瀏覽代碼

Optimised QRView.kt

flutter-beta
Julian Steenbakker 5 年之前
父節點
當前提交
56eef31917
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 16E437C7A3D94250
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. +4
    -5
      android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt

+ 4
- 5
android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt 查看文件

@@ -16,7 +16,6 @@ import com.journeyapps.barcodescanner.BarcodeView
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.platform.PlatformView
class QRView(messenger: BinaryMessenger, id: Int, private val context: Context) :
PlatformView, MethodChannel.MethodCallHandler {
@@ -82,12 +81,12 @@ class QRView(messenger: BinaryMessenger, id: Int, private val context: Context)
}
}

fun flipCamera() {
private fun flipCamera() {
barcodeView?.pause()
var settings = barcodeView?.cameraSettings
val settings = barcodeView?.cameraSettings

if(settings?.requestedCameraId == CameraInfo.CAMERA_FACING_FRONT)
settings?.requestedCameraId = CameraInfo.CAMERA_FACING_BACK
settings.requestedCameraId = CameraInfo.CAMERA_FACING_BACK
else
settings?.requestedCameraId = CameraInfo.CAMERA_FACING_FRONT

@@ -133,7 +132,7 @@ class QRView(messenger: BinaryMessenger, id: Int, private val context: Context)
return barcodeView
}

private fun createBarCodeView(): BarcodeView? {
private fun createBarCodeView(): BarcodeView {
val barcode = BarcodeView(Shared.activity)
barcode.decodeContinuous(
object : BarcodeCallback {


Loading…
取消
儲存