Skip to content

Commit a241027

Browse files
committed
disable sos or strobo if the other one is enabled
1 parent 2cdf4a5 commit a241027

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ class MainActivity : SimpleActivity() {
248248
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
249249
mIsFlashlightOn = true
250250

251+
sos_btn.setTextColor(getContrastColor())
252+
251253
changeIconColor(getContrastColor(), stroboscope_btn)
252254
stroboscope_bar.beInvisible()
253255
}

app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ class MyCameraImpl(val context: Context) {
5757
}
5858

5959
fun toggleStroboscope(): Boolean {
60+
if (isSOSRunning) {
61+
stopSOS()
62+
return false
63+
}
64+
6065
isStroboSOS = false
6166
if (!isStroboscopeRunning) {
6267
disableFlashlight()
@@ -81,6 +86,11 @@ class MyCameraImpl(val context: Context) {
8186
}
8287

8388
fun toggleSOS(): Boolean {
89+
if (isStroboscopeRunning) {
90+
stopStroboscope()
91+
return false
92+
}
93+
8494
isStroboSOS = true
8595
if (isStroboscopeRunning) {
8696
stopStroboscope()

0 commit comments

Comments
 (0)