disable sos or strobo if the other one is enabled
This commit is contained in:
parent
2cdf4a55a1
commit
a2410274eb
|
@ -248,6 +248,8 @@ class MainActivity : SimpleActivity() {
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
mIsFlashlightOn = true
|
mIsFlashlightOn = true
|
||||||
|
|
||||||
|
sos_btn.setTextColor(getContrastColor())
|
||||||
|
|
||||||
changeIconColor(getContrastColor(), stroboscope_btn)
|
changeIconColor(getContrastColor(), stroboscope_btn)
|
||||||
stroboscope_bar.beInvisible()
|
stroboscope_bar.beInvisible()
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,11 @@ class MyCameraImpl(val context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toggleStroboscope(): Boolean {
|
fun toggleStroboscope(): Boolean {
|
||||||
|
if (isSOSRunning) {
|
||||||
|
stopSOS()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
isStroboSOS = false
|
isStroboSOS = false
|
||||||
if (!isStroboscopeRunning) {
|
if (!isStroboscopeRunning) {
|
||||||
disableFlashlight()
|
disableFlashlight()
|
||||||
|
@ -81,6 +86,11 @@ class MyCameraImpl(val context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toggleSOS(): Boolean {
|
fun toggleSOS(): Boolean {
|
||||||
|
if (isStroboscopeRunning) {
|
||||||
|
stopStroboscope()
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
isStroboSOS = true
|
isStroboSOS = true
|
||||||
if (isStroboscopeRunning) {
|
if (isStroboscopeRunning) {
|
||||||
stopStroboscope()
|
stopStroboscope()
|
||||||
|
|
Loading…
Reference in New Issue