Skip to content

Commit d322fca

Browse files
author
FerranAD
committed
feat(add-note): add date pickers
1 parent e01b42d commit d322fca

File tree

1 file changed

+18
-2
lines changed
  • app/src/main/java/com/eps/todoturtle/note/ui

1 file changed

+18
-2
lines changed

app/src/main/java/com/eps/todoturtle/note/ui/AddNote.kt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ fun CompleteAddNoteForm(
261261
}
262262
}
263263

264+
@OptIn(ExperimentalMaterial3Api::class)
264265
@Composable
265266
fun QuickAddNoteForm(
266267
modifier: Modifier = Modifier,
@@ -270,6 +271,21 @@ fun QuickAddNoteForm(
270271
onAddDeadlineClick: () -> Unit,
271272
) {
272273
var titleText by rememberSaveable { mutableStateOf("") }
274+
var choosingNotification by remember { mutableStateOf(false) }
275+
var choosingDeadline by remember { mutableStateOf(false) }
276+
277+
if (choosingNotification || choosingDeadline) {
278+
DatePickerDialog(
279+
onDismissRequest = {
280+
choosingNotification = false
281+
choosingDeadline = false
282+
},
283+
confirmButton = {},
284+
) {
285+
DatePicker(state = rememberDatePickerState())
286+
}
287+
}
288+
273289
Column(
274290
modifier = modifier
275291
.padding(horizontal = 16.dp, vertical = 16.dp)
@@ -280,13 +296,13 @@ fun QuickAddNoteForm(
280296
modifier = Modifier.weight(0.5f),
281297
horizontalArrangement = Arrangement.Start,
282298
) {
283-
IconButton(onClick = { }) {
299+
IconButton(onClick = { choosingNotification = true }) {
284300
ResourceIcon(
285301
contentDescriptionId = R.string.add_notification_icon_desc,
286302
imageId = R.drawable.add_notification_filled,
287303
)
288304
}
289-
IconButton(onClick = { }) {
305+
IconButton(onClick = { choosingDeadline = true }) {
290306
ResourceIcon(
291307
contentDescriptionId = R.string.add_deadline_icon_desc,
292308
imageId = R.drawable.add_deadline_filled,

0 commit comments

Comments
 (0)