From 17ac263c5d379e6d8c209fb0eb0e4c0b4a80342b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 5 Oct 2023 12:44:38 +0200 Subject: [PATCH] Use `DialogSurface` for `SleepTimerCustomAlertDialog` --- .../dialogs/SleepTimerCustomAlertDialog.kt | 16 +++------------- gradle/libs.versions.toml | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/dialogs/SleepTimerCustomAlertDialog.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/dialogs/SleepTimerCustomAlertDialog.kt index e393094..239d52d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/dialogs/SleepTimerCustomAlertDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/dialogs/SleepTimerCustomAlertDialog.kt @@ -6,7 +6,6 @@ import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType @@ -15,10 +14,7 @@ import com.simplemobiletools.commons.compose.alert_dialog.AlertDialogState import com.simplemobiletools.commons.compose.alert_dialog.rememberAlertDialogState import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import com.simplemobiletools.commons.dialogs.dialogBorder -import com.simplemobiletools.commons.dialogs.dialogContainerColor -import com.simplemobiletools.commons.dialogs.dialogElevation -import com.simplemobiletools.commons.dialogs.dialogShape +import com.simplemobiletools.commons.dialogs.DialogSurface private val items = listOf( R.string.minutes_raw, @@ -32,20 +28,14 @@ fun SleepTimerCustomAlertDialog( onConfirmClick: (seconds: Int) -> Unit, onCancelClick: () -> Unit = {} ) { - val context = LocalContext.current var selectedItem by remember { mutableIntStateOf(0) } var value by remember { mutableStateOf("") } AlertDialog( - modifier = modifier - .dialogBorder, onDismissRequest = alertDialogState::hide ) { - Surface( - modifier = modifier, - shape = dialogShape, - color = dialogContainerColor, - tonalElevation = dialogElevation, + DialogSurface( + modifier = modifier ) { Column( modifier = Modifier.padding(all = dimensionResource(id = R.dimen.big_margin)) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f7d2911..1c0c9a9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ androidx-customView = "1.2.0-alpha02" androidx-customViewPooling = "1.0.0" androidx-lifecycle = "2.7.0-alpha02" #Simple tools -simple-commons = "ffe7d33846" +simple-commons = "b72ded2a75" #Compose composeActivity = "1.8.0-rc01" compose = "1.6.0-alpha06"