cleanup flash implementation

- fix issues with brightness control
- add separate classes for Android 5 and Android 6+ for simplicity
- properly cleanup camera in onDestory and also when stroboscope/flashlight mode are disabled
This commit is contained in:
darthpaul
2022-11-14 19:17:00 +00:00
parent 87b678e4bb
commit 98c0f0578e
5 changed files with 120 additions and 163 deletions

View File

@ -0,0 +1,12 @@
package com.simplemobiletools.flashlight.helpers
interface CameraFlash {
fun initialize()
fun toggleFlashlight(enable: Boolean)
fun changeTorchBrightness(level: Int) {}
fun getMaximumBrightnessLevel(): Int = DEFAULT_BRIGHTNESS_LEVEL
fun supportsBrightnessControl(): Boolean = false
fun getCurrentBrightnessLevel(): Int = DEFAULT_BRIGHTNESS_LEVEL
fun unregisterListeners(){}
fun release(){}
}