@@ -17,6 +17,8 @@ import android.view.OrientationEventListener
1717import android.view.Surface
1818import android.widget.FrameLayout
1919import android.widget.LinearLayout
20+ import androidx.camera.core.AspectRatio
21+ import androidx.camera.view.PreviewView.ScaleType
2022import androidx.core.app.ActivityCompat
2123import androidx.core.content.ContextCompat
2224import java.io.IOException
@@ -29,13 +31,9 @@ import org.nativescript.widgets.GridLayout
2931
3032abstract class CameraBase @JvmOverloads constructor(
3133 context : Context , attrs : AttributeSet ? = null , defStyleAttr : Int = 0
32- ) : GridLayout(context) {
33- // ) : GridLayout(context, attrs, defStyleAttr) {
34+ // ) : GridLayout(context) {
35+ ) : GridLayout(context, attrs, defStyleAttr) {
3436 var enableAudio: Boolean = true
35- abstract var retrieveLatestImage: Boolean
36- internal var latestImage: Bitmap ? = null
37- var processEveryNthFrame: Int = 0
38- internal var currentFrame: Int = 0
3937 abstract var pause: Boolean
4038 abstract var whiteBalance: WhiteBalance
4139 abstract var position: CameraPosition
@@ -55,8 +53,8 @@ abstract class CameraBase @JvmOverloads constructor(
5553 abstract val amplitudeEMA: Double
5654 abstract var isAudioLevelsEnabled: Boolean
5755 abstract val numberOfCameras: Int
58- var overridePhotoWidth: Int = - 1
59- var overridePhotoHeight: Int = - 1
56+ // var overridePhotoWidth: Int = -1
57+ // var overridePhotoHeight: Int = -1
6058 abstract fun stop ()
6159 abstract fun release ()
6260 abstract fun startPreview ()
@@ -70,31 +68,33 @@ abstract class CameraBase @JvmOverloads constructor(
7068// abstract fun getSupportedRatios(): Array<String>
7169 abstract fun getAvailablePictureSizes (ratio : String ): Array <Size >
7270 abstract fun getAllAvailablePictureSizes (): Array <Size >
73- abstract var displayRatio: String
71+ abstract var displayRatio: String?
72+ abstract var aspectRatio: String?
7473 abstract var pictureSize: String?
7574 abstract var enablePinchZoom: Boolean
75+ abstract var scaleType: ScaleType
7676 abstract var zoom: Float
7777 protected var displayId: Int = - 1
7878
7979 protected val displayManager by lazy {
8080 context.getSystemService(Context .DISPLAY_SERVICE ) as DisplayManager
8181 }
8282
83- internal fun resetCurrentFrame () {
84- if (isProcessingEveryNthFrame()) {
85- currentFrame = 0
86- }
87- }
83+ // internal fun resetCurrentFrame() {
84+ // if (isProcessingEveryNthFrame()) {
85+ // currentFrame = 0
86+ // }
87+ // }
8888
89- internal fun isProcessingEveryNthFrame (): Boolean {
90- return processEveryNthFrame > 0
91- }
89+ // internal fun isProcessingEveryNthFrame(): Boolean {
90+ // return processEveryNthFrame > 0
91+ // }
9292
93- internal fun incrementCurrentFrame () {
94- if (isProcessingEveryNthFrame()) {
95- currentFrame++
96- }
97- }
93+ // internal fun incrementCurrentFrame() {
94+ // if (isProcessingEveryNthFrame()) {
95+ // currentFrame++
96+ // }
97+ // }
9898
9999 internal fun stringSizeToSize (value : String? ): Size ? {
100100 if (value == null ) {
0 commit comments