Ver código fonte

fix black screen when manual focus

flutter-beta
Leon 7 anos atrás
committed by GitHub
pai
commit
d18e2dffae
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados ID da chave GPG: 4AEE18F83AFDEB23
1 arquivos alterados com 9 adições e 1 exclusões
  1. +9
    -1
      android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt

+ 9
- 1
android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt Ver arquivo

@@ -42,6 +42,15 @@ class QRView(context: Context, private val registrar: PluginRegistry.Registrar,
override fun possibleResultPoints(resultPoints: List<ResultPoint>) {}
}
)
barcodeView.addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener {
override fun onViewDetachedFromWindow(p0: View?) {
barcodeView.pause()
}

override fun onViewAttachedToWindow(p0: View?) {
barcodeView.resume()
}
})
}


@@ -54,7 +63,6 @@ class QRView(context: Context, private val registrar: PluginRegistry.Registrar,
}

override fun getView(): View {
barcodeView.pause()
return barcodeView.apply {
init()
}


Carregando…
Cancelar
Salvar