Skip to content

Commit

Permalink
setup device orientation listener
Browse files Browse the repository at this point in the history
  • Loading branch information
navaronbracke committed Jan 20, 2025
1 parent 6b08a6d commit 2c6c592
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class MobileScanner(
private val textureRegistry: TextureRegistry,
private val mobileScannerCallback: MobileScannerCallback,
private val mobileScannerErrorCallback: MobileScannerErrorCallback,
private val barcodeScannerFactory: (options: BarcodeScannerOptions?) -> BarcodeScanner = ::defaultBarcodeScannerFactory,
private val deviceOrientationListener: DeviceOrientationListener,
private val barcodeScannerFactory: (options: BarcodeScannerOptions?) -> BarcodeScanner = ::defaultBarcodeScannerFactory,
) {

/// Internal variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class MobileScannerHandler(
"dev.steenbakker.mobile_scanner/scanner/method")
methodChannel!!.setMethodCallHandler(this)

val deviceOrientationListener = DeviceOrientationListener(activity)

deviceOrientationChannel = EventChannel(binaryMessenger,
"dev.steenbakker.mobile_scanner/scanner/deviceOrientation")
deviceOrientationChannel!!.setStreamHandler(deviceOrientationListener)
Expand Down

0 comments on commit 2c6c592

Please sign in to comment.