-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add an extended day setting (#596)
Co-authored-by: gBL17 <[email protected]>
- Loading branch information
Showing
7 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/src/main/kotlin/br/com/colman/petals/settings/view/listitem/ExtendDayListItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package br.com.colman.petals.settings.view.listitem | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import br.com.colman.petals.R.string.extend_day | ||
import br.com.colman.petals.R.string.extend_day_a_few_hours | ||
import br.com.colman.petals.R.string.wait_until_3am_to_show_a_new_day | ||
import br.com.colman.petals.settings.view.dialog.SelectFromListDialog | ||
import compose.icons.TablerIcons | ||
import compose.icons.tablericons.CalendarTime | ||
|
||
@Preview | ||
@Composable | ||
fun ExtendDayListItem( | ||
extendedDay: String = "", | ||
extendedDayOptions: List<String> = listOf(), | ||
setExtendDayOption: (String) -> Unit = {} | ||
) { | ||
DialogListItem( | ||
icon = TablerIcons.CalendarTime, | ||
textId = extend_day_a_few_hours, | ||
descriptionId = wait_until_3am_to_show_a_new_day, | ||
dialog = { hideDialog: () -> Unit -> | ||
ExtendDayDialog( | ||
extendedDay, | ||
extendedDayOptions, | ||
setExtendDayOption, | ||
hideDialog | ||
) | ||
} | ||
) | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun ExtendDayDialog( | ||
initialExtendDay: String = "", | ||
extendDayList: List<String> = listOf(), | ||
setExtendedDay: (String) -> Unit = {}, | ||
onDismiss: () -> Unit = {}, | ||
) { | ||
SelectFromListDialog( | ||
initialValue = initialExtendDay, | ||
possibleValues = extendDayList, | ||
setValue = setExtendedDay, | ||
onDismiss = onDismiss, | ||
label = extend_day | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters