Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2023-10-24 12:38:46 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1b1adddd00693b595b828cb33998ad8c2135b756
1b1adddd
1 parent
b6c1bcda
add mssing main looper switches for Android
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
View file @
1b1addd
...
...
@@ -2,6 +2,8 @@ package dev.steenbakker.mobile_scanner
import android.app.Activity
import android.net.Uri
import android.os.Handler
import android.os.Looper
import android.util.Size
import androidx.camera.core.CameraSelector
import androidx.camera.core.ExperimentalGetImage
...
...
@@ -30,11 +32,12 @@ class MobileScannerHandler(
"name" to "barcode",
"data" to barcodes
))
analyzerResult?.success(true)
} else {
analyzerResult?.success(false)
}
analyzerResult = null
Handler(Looper.getMainLooper()).post {
analyzerResult?.success(barcodes != null)
analyzerResult = null
}
}
private var analyzerResult: MethodChannel.Result? = null
...
...
@@ -92,7 +95,6 @@ class MobileScannerHandler(
if(listener != null) {
activityPluginBinding.removeRequestPermissionsResultListener(listener)
}
}
@ExperimentalGetImage
...
...
@@ -173,11 +175,13 @@ class MobileScannerHandler(
torchStateCallback,
zoomScaleStateCallback,
mobileScannerStartedCallback = {
result.success(mapOf(
"textureId" to it.id,
"size" to mapOf("width" to it.width, "height" to it.height),
"torchable" to it.hasFlashUnit
))
Handler(Looper.getMainLooper()).post {
result.success(mapOf(
"textureId" to it.id,
"size" to mapOf("width" to it.width, "height" to it.height),
"torchable" to it.hasFlashUnit
))
}
},
timeout.toLong(),
cameraResolution,
...
...
Please
register
or
login
to post a comment