11package com.simplemobiletools.flashlight.dialogs
22
33import androidx.annotation.StringRes
4+ import androidx.compose.foundation.clickable
45import androidx.compose.foundation.layout.*
56import androidx.compose.foundation.text.KeyboardOptions
67import androidx.compose.material3.*
@@ -13,6 +14,7 @@ import androidx.compose.ui.unit.dp
1314import com.simplemobiletools.commons.R
1415import com.simplemobiletools.commons.compose.alert_dialog.AlertDialogState
1516import com.simplemobiletools.commons.compose.alert_dialog.DialogSurface
17+ import com.simplemobiletools.commons.compose.alert_dialog.dialogTextColor
1618import com.simplemobiletools.commons.compose.alert_dialog.rememberAlertDialogState
1719import com.simplemobiletools.commons.compose.extensions.MyDevices
1820import com.simplemobiletools.commons.compose.theme.AppThemeSurface
@@ -58,31 +60,43 @@ fun SleepTimerCustomAlertDialog(
5860 top = SimpleTheme .dimens.padding.extraLarge
5961 )
6062 ) {
61- TextField (
62- modifier = Modifier .padding(
63- bottom = SimpleTheme .dimens.padding.large
64- ),
63+ OutlinedTextField (
64+ modifier = Modifier
65+ .fillMaxWidth()
66+ .padding(
67+ bottom = SimpleTheme .dimens.padding.large
68+ ),
6569 value = value,
6670 onValueChange = {
6771 value = it.filter { it.isDigit() }
6872 },
6973 label = {
7074 Text (stringResource(id = R .string.value))
7175 },
76+ colors = OutlinedTextFieldDefaults .colors(
77+ disabledTextColor = dialogTextColor,
78+ disabledBorderColor = SimpleTheme .colorScheme.primary,
79+ disabledLabelColor = SimpleTheme .colorScheme.primary,
80+ ),
7281 keyboardOptions = KeyboardOptions (
7382 keyboardType = KeyboardType .Number
7483 )
7584 )
7685
7786 items.forEachIndexed { index, item ->
7887 Row (
88+ modifier = Modifier
89+ .clickable {
90+ selectedItem = index
91+ }
92+ .padding(vertical = SimpleTheme .dimens.padding.large)
93+ .fillMaxWidth(),
7994 verticalAlignment = Alignment .CenterVertically
8095 ) {
8196 RadioButton (
97+ modifier = Modifier .padding(horizontal = SimpleTheme .dimens.padding.small),
8298 selected = index == selectedItem,
83- onClick = {
84- selectedItem = index
85- }
99+ onClick = null
86100 )
87101 Text (
88102 text = stringResource(id = item.stringResId)
0 commit comments