mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-06-05 21:59:19 +02: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:
@ -49,7 +49,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
|||||||
|
|
||||||
fun toggleStroboscope(): Boolean {
|
fun toggleStroboscope(): Boolean {
|
||||||
handleCameraSetup()
|
handleCameraSetup()
|
||||||
cameraFlash!!.unregisterListeners()
|
|
||||||
|
|
||||||
if (isSOSRunning) {
|
if (isSOSRunning) {
|
||||||
stopSOS()
|
stopSOS()
|
||||||
@ -62,6 +61,8 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
|||||||
disableFlashlight()
|
disableFlashlight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cameraFlash!!.unregisterListeners()
|
||||||
|
|
||||||
if (!tryInitCamera()) {
|
if (!tryInitCamera()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -82,7 +83,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
|||||||
|
|
||||||
fun toggleSOS(): Boolean {
|
fun toggleSOS(): Boolean {
|
||||||
handleCameraSetup()
|
handleCameraSetup()
|
||||||
cameraFlash!!.unregisterListeners()
|
|
||||||
|
|
||||||
if (isStroboscopeRunning) {
|
if (isStroboscopeRunning) {
|
||||||
stopStroboscope()
|
stopStroboscope()
|
||||||
@ -103,6 +103,8 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
|
|||||||
disableFlashlight()
|
disableFlashlight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cameraFlash!!.unregisterListeners()
|
||||||
|
|
||||||
return if (isSOSRunning) {
|
return if (isSOSRunning) {
|
||||||
stopSOS()
|
stopSOS()
|
||||||
false
|
false
|
||||||
|
Reference in New Issue
Block a user