Skip to content

Commit b3b0bc8

Browse files
committed
Clean up SleepTimerCustomAlertDialog
1 parent b57e782 commit b3b0bc8

File tree

2 files changed

+21
-62
lines changed

2 files changed

+21
-62
lines changed

app/src/main/kotlin/com/simplemobiletools/flashlight/dialogs/SleepTimerCustomAlertDialog.kt

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.simplemobiletools.flashlight.dialogs
22

33
import androidx.annotation.StringRes
4+
import androidx.compose.foundation.clickable
45
import androidx.compose.foundation.layout.*
56
import androidx.compose.foundation.text.KeyboardOptions
67
import androidx.compose.material3.*
@@ -13,6 +14,7 @@ import androidx.compose.ui.unit.dp
1314
import com.simplemobiletools.commons.R
1415
import com.simplemobiletools.commons.compose.alert_dialog.AlertDialogState
1516
import com.simplemobiletools.commons.compose.alert_dialog.DialogSurface
17+
import com.simplemobiletools.commons.compose.alert_dialog.dialogTextColor
1618
import com.simplemobiletools.commons.compose.alert_dialog.rememberAlertDialogState
1719
import com.simplemobiletools.commons.compose.extensions.MyDevices
1820
import 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)

app/src/main/res/layout/dialog_custom_sleep_timer_picker.xml

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)