Fix stroboscope stored progress

This commit is contained in:
Ensar Sarajčić 2023-10-02 12:45:38 +02:00
parent 87e92df993
commit 3414295887

View File

@ -336,7 +336,7 @@ class MainActivity : SimpleActivity() {
camera.enableFlashlight() camera.enableFlashlight()
} }
_stroboscopeBarValue.value = preferences.stroboscopeProgress.toFloat() / 100 _stroboscopeBarValue.value = preferences.stroboscopeProgress.toFloat() / MAX_STROBO_DELAY
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
@ -373,7 +373,7 @@ class MainActivity : SimpleActivity() {
val newLevel = MathUtils.lerp(min.toFloat(), max.toFloat(), 1 - newValue) val newLevel = MathUtils.lerp(min.toFloat(), max.toFloat(), 1 - newValue)
camera.stroboFrequency = newLevel.toLong() camera.stroboFrequency = newLevel.toLong()
preferences.stroboscopeFrequency = newLevel.toLong() preferences.stroboscopeFrequency = newLevel.toLong()
preferences.stroboscopeProgress = ((1 - newLevel) * 100).toInt() preferences.stroboscopeProgress = ((1 - newLevel) * MAX_STROBO_DELAY).toInt()
} }
fun onResume() { fun onResume() {