mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-02-01 19:06:46 +01:00
clear listeners after disabling flash for SOS and stroboscope
- this prevents the two sliders for brightness and stroboscope from showing up at the same time
This commit is contained in:
parent
98c0f0578e
commit
c975ab1e82
@ -49,7 +49,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
||||
|
||||
fun toggleStroboscope(): Boolean {
|
||||
handleCameraSetup()
|
||||
cameraFlash!!.unregisterListeners()
|
||||
|
||||
if (isSOSRunning) {
|
||||
stopSOS()
|
||||
@ -62,6 +61,8 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
||||
disableFlashlight()
|
||||
}
|
||||
|
||||
cameraFlash!!.unregisterListeners()
|
||||
|
||||
if (!tryInitCamera()) {
|
||||
return false
|
||||
}
|
||||
@ -82,7 +83,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
||||
|
||||
fun toggleSOS(): Boolean {
|
||||
handleCameraSetup()
|
||||
cameraFlash!!.unregisterListeners()
|
||||
|
||||
if (isStroboscopeRunning) {
|
||||
stopStroboscope()
|
||||
@ -103,6 +103,8 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
||||
disableFlashlight()
|
||||
}
|
||||
|
||||
cameraFlash!!.unregisterListeners()
|
||||
|
||||
return if (isSOSRunning) {
|
||||
stopSOS()
|
||||
false
|
||||
|
Loading…
x
Reference in New Issue
Block a user