mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-02-04 04:07:32 +01:00
Remove getCameraPermissionLauncher
This commit is contained in:
parent
f21cd4ff49
commit
cef9f6e62b
@ -64,8 +64,14 @@ class MainActivity : ComponentActivity() {
|
|||||||
setContent {
|
setContent {
|
||||||
AppThemeSurface {
|
AppThemeSurface {
|
||||||
val showMoreApps = onEventValue { !resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations) }
|
val showMoreApps = onEventValue { !resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations) }
|
||||||
val sosPermissionLauncher = getCameraPermissionLauncher(onResult = getPermissionResultHandler(true))
|
val sosPermissionLauncher = rememberLauncherForActivityResult(
|
||||||
val stroboscopePermissionLauncher = getCameraPermissionLauncher(onResult = getPermissionResultHandler(false))
|
contract = ActivityResultContracts.RequestPermission(),
|
||||||
|
onResult = getPermissionResultHandler(true)
|
||||||
|
)
|
||||||
|
val stroboscopePermissionLauncher = rememberLauncherForActivityResult(
|
||||||
|
contract = ActivityResultContracts.RequestPermission(),
|
||||||
|
onResult = getPermissionResultHandler(false)
|
||||||
|
)
|
||||||
|
|
||||||
val sleepTimerCustomDialogState = getSleepTimerCustomDialogState()
|
val sleepTimerCustomDialogState = getSleepTimerCustomDialogState()
|
||||||
val sleepTimerDialogState = getSleepTimerDialogState(showCustomSleepTimerDialog = sleepTimerCustomDialogState::show)
|
val sleepTimerDialogState = getSleepTimerDialogState(showCustomSleepTimerDialog = sleepTimerCustomDialogState::show)
|
||||||
@ -235,14 +241,6 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun getCameraPermissionLauncher(
|
|
||||||
onResult: (Boolean) -> Unit
|
|
||||||
) = rememberLauncherForActivityResult(
|
|
||||||
contract = ActivityResultContracts.RequestPermission(),
|
|
||||||
onResult = onResult
|
|
||||||
)
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun getSleepTimerCustomDialogState() = rememberAlertDialogState().apply {
|
private fun getSleepTimerCustomDialogState() = rememberAlertDialogState().apply {
|
||||||
DialogMember {
|
DialogMember {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user