Remove `getCameraPermissionLauncher`
This commit is contained in:
parent
f21cd4ff49
commit
cef9f6e62b
|
@ -64,8 +64,14 @@ class MainActivity : ComponentActivity() {
|
|||
setContent {
|
||||
AppThemeSurface {
|
||||
val showMoreApps = onEventValue { !resources.getBoolean(com.simplemobiletools.commons.R.bool.hide_google_relations) }
|
||||
val sosPermissionLauncher = getCameraPermissionLauncher(onResult = getPermissionResultHandler(true))
|
||||
val stroboscopePermissionLauncher = getCameraPermissionLauncher(onResult = getPermissionResultHandler(false))
|
||||
val sosPermissionLauncher = rememberLauncherForActivityResult(
|
||||
contract = ActivityResultContracts.RequestPermission(),
|
||||
onResult = getPermissionResultHandler(true)
|
||||
)
|
||||
val stroboscopePermissionLauncher = rememberLauncherForActivityResult(
|
||||
contract = ActivityResultContracts.RequestPermission(),
|
||||
onResult = getPermissionResultHandler(false)
|
||||
)
|
||||
|
||||
val sleepTimerCustomDialogState = getSleepTimerCustomDialogState()
|
||||
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
|
||||
private fun getSleepTimerCustomDialogState() = rememberAlertDialogState().apply {
|
||||
DialogMember {
|
||||
|
|
Loading…
Reference in New Issue