|
@@ -20,7 +20,9 @@ import androidx.compose.runtime.*
|
|
|
import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.platform.LocalContext
|
|
|
-import androidx.compose.ui.tooling.preview.Preview
|
|
|
+import androidx.compose.ui.unit.ExperimentalUnitApi
|
|
|
+import androidx.compose.ui.unit.TextUnit
|
|
|
+import androidx.compose.ui.unit.TextUnitType
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.navigation.NavController
|
|
|
import androidx.navigation.compose.NavHost
|
|
@@ -297,33 +299,30 @@ fun Settings() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-@Composable
|
|
|
-fun Greeting(name: String) {
|
|
|
- Text(text = "Hello $name!")
|
|
|
-}
|
|
|
-
|
|
|
-@Preview(showBackground = true)
|
|
|
-@Composable
|
|
|
-fun DefaultPreview() {
|
|
|
- AlarmClockConfiguratorTheme {
|
|
|
- Greeting("Helmut")
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+@OptIn(ExperimentalUnitApi::class)
|
|
|
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
|
|
|
@Composable
|
|
|
fun WeekDayElement(weekDay: DayOfWeek, cache: WakeupTimeCache<DayOfWeek>) {
|
|
|
Column {
|
|
|
Row {
|
|
|
+ Column(Modifier.fillMaxWidth(0.35F)) {
|
|
|
+ Text(
|
|
|
+ text = weekDay.getDisplayName(TextStyle.FULL, Locale.ENGLISH) + ":",
|
|
|
+ fontSize = TextUnit(
|
|
|
+ 25F, TextUnitType.Sp
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ Column() {
|
|
|
+ WakeupTimeTextField(weekDay, cache)
|
|
|
+ }
|
|
|
|
|
|
- Text(text = weekDay.getDisplayName(TextStyle.FULL, Locale.ENGLISH))
|
|
|
- WakeupTimeTextField(weekDay, cache)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
|
|
|
-@OptIn(ExperimentalFoundationApi::class)
|
|
|
+@OptIn(ExperimentalFoundationApi::class, ExperimentalUnitApi::class)
|
|
|
@Composable
|
|
|
fun WakeupTimeTextField(dayOfWeek: DayOfWeek, cache: WakeupTimeCache<DayOfWeek>) {
|
|
|
val viewModel = remember {
|
|
@@ -347,7 +346,8 @@ fun WakeupTimeTextField(dayOfWeek: DayOfWeek, cache: WakeupTimeCache<DayOfWeek>)
|
|
|
onLongClick = {
|
|
|
dropDownExpanded = true
|
|
|
})
|
|
|
- .background(backGroundColor)
|
|
|
+ .background(backGroundColor),
|
|
|
+ fontSize = TextUnit(25F, TextUnitType.Sp)
|
|
|
)
|
|
|
|
|
|
if (showTimePickerDialog) {
|
|
@@ -420,7 +420,7 @@ fun NavigationBar(navController: NavController) {
|
|
|
var expanded by remember {
|
|
|
mutableStateOf(false)
|
|
|
}
|
|
|
- TopAppBar(title = { Text(text = "Hello") }, navigationIcon = {
|
|
|
+ TopAppBar(title = { }, navigationIcon = {
|
|
|
IconButton(onClick = {
|
|
|
expanded = true
|
|
|
}) {
|