fix(#459): review round 3 - the pointer turns the summary on and closes through onDismiss
This commit is contained in:
1 parent
c4926145f3
commit
47e737f8ec
3 files changed
+14
-10
No files matched your search
@@ -132,7 +132,8 @@ fun FixedTimeReminderEditor(
|
||||
* Picker for a fixed-time default (#459), full-screen: off, or a reminder at a
|
||||
* set time edited in place — and, on a per-calendar picker ([inheritedLabel]
|
||||
* non-null), deferring to the global default, [inherited], which also seeds the
|
||||
* editor. Applies live; the user leaves via back. [footer] follows the options.
|
||||
* editor. Applies live; the user leaves via back. [footer] follows the options
|
||||
* and gets [onDismiss] to close the picker.
|
||||
*/
|
||||
@Composable
|
||||
fun FixedTimeReminderPicker(
|
||||
@@ -142,7 +143,7 @@ fun FixedTimeReminderPicker(
|
||||
onDismiss: () -> Unit,
|
||||
inheritedLabel: String? = null,
|
||||
inherited: FixedTimeReminder? = null,
|
||||
footer: @Composable ColumnScope.() -> Unit = {},
|
||||
footer: @Composable ColumnScope.(dismiss: () -> Unit) -> Unit = {},
|
||||
) {
|
||||
var current by rememberSaveable(stateSaver = FixedTimeOverrideSaver) { mutableStateOf(selected) }
|
||||
var editing by rememberSaveable { mutableStateOf(false) }
|
||||
@@ -194,7 +195,7 @@ fun FixedTimeReminderPicker(
|
||||
},
|
||||
)
|
||||
}
|
||||
footer()
|
||||
footer(onDismiss)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ internal fun NotificationsScreen(
|
||||
|
||||
Spacer(Modifier.height(24.dp))
|
||||
DailyDigestRows(
|
||||
modifier = Modifier.bringIntoViewRequester(digestRequester),
|
||||
switchRequester = digestRequester,
|
||||
digest = state.dailyDigest,
|
||||
blocked = channelStatus.appBlocked || digestBlocked,
|
||||
onEnable = toggleDigest,
|
||||
@@ -261,16 +261,17 @@ internal fun NotificationsScreen(
|
||||
selected = state.defaultFixedTimeReminder?.let { FixedTimeOverride.At(it) } ?: FixedTimeOverride.Off,
|
||||
onSelect = { viewModel.setDefaultFixedTimeReminder((it as? FixedTimeOverride.At)?.reminder) },
|
||||
onDismiss = { showFixedDefault = false },
|
||||
footer = {
|
||||
// A pointer for those after one list of the day's events (#459).
|
||||
footer = { dismiss ->
|
||||
// For those after one list of the day's events (#459).
|
||||
if (!state.dailyDigest.enabled) {
|
||||
Spacer(Modifier.height(24.dp))
|
||||
GroupedRow(
|
||||
title = stringResource(R.string.settings_digest),
|
||||
title = stringResource(R.string.settings_digest_turn_on),
|
||||
summary = stringResource(R.string.settings_digest_hint),
|
||||
position = Position.Alone,
|
||||
onClick = {
|
||||
showFixedDefault = false
|
||||
toggleDigest(true)
|
||||
dismiss()
|
||||
scope.launch { digestRequester.bringIntoView() }
|
||||
},
|
||||
)
|
||||
@@ -357,10 +358,11 @@ private fun DailyDigestRows(
|
||||
onPickDay: () -> Unit,
|
||||
onPickTime: () -> Unit,
|
||||
onOpenSound: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) = Column(modifier) {
|
||||
switchRequester: BringIntoViewRequester,
|
||||
) {
|
||||
GroupedSwitchRow(
|
||||
title = stringResource(R.string.settings_digest),
|
||||
modifier = Modifier.bringIntoViewRequester(switchRequester),
|
||||
checked = digest.enabled,
|
||||
onCheckedChange = onEnable,
|
||||
summary = if (digest.enabled) {
|
||||
|
||||
@@ -808,6 +808,7 @@
|
||||
<string name="settings_fixed_reminder_hint">Added to new timed events, e.g. the evening before. It follows the event when you move it to another time.</string>
|
||||
<!-- Daily summary notification (#459) -->
|
||||
<string name="settings_digest">Daily summary</string>
|
||||
<string name="settings_digest_turn_on">Turn on daily summary</string>
|
||||
<string name="settings_digest_hint">One notification listing a day\'s events</string>
|
||||
<!-- %1$s is settings_digest_day_today/tomorrow, %2$s a clock time. -->
|
||||
<string name="settings_digest_summary">%1$s at %2$s</string>
|
||||
|
||||
Reference in new issue
Block a user