fix(#143): quote the view name and share the title

This commit is contained in:
makiolaj committed 2026-11-25 12:07:50 +01:00
1 parent 81c38b424d
commit 2eeabb40c8
3 files changed
+10 -6

No files matched your search

@@ -38,7 +38,6 @@ import de.jeanlucmakiola.calendula.ui.common.CalendarAccountGroup
import de.jeanlucmakiola.calendula.ui.common.CalendarColorChip
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.accountGroupTitle
import de.jeanlucmakiola.calendula.ui.common.label
import de.jeanlucmakiola.calendula.ui.common.orUnnamed
import de.jeanlucmakiola.floret.components.GroupedListInset
import de.jeanlucmakiola.floret.components.GroupedRow
@@ -71,7 +70,7 @@ fun CalendarFilterList(
hidden = s.hidden,
hiddenInView = hiddenInView,
hiddenOnlyHere = hiddenInView.size,
viewName = currentView.label(),
hideInViewTitle = currentView.hideInViewTitle(),
onHideInView = onHideInView,
onToggleCalendar = viewModel::toggleCalendar,
onToggleGroup = viewModel::toggleGroup,
@@ -92,7 +91,7 @@ private fun FilterList(
hidden: Set<Long>,
hiddenInView: Set<Long>,
hiddenOnlyHere: Int,
viewName: String,
hideInViewTitle: String,
onHideInView: () -> Unit,
onToggleCalendar: (Long) -> Unit,
onToggleGroup: (List<Long>) -> Unit,
@@ -127,7 +126,7 @@ private fun FilterList(
// The per-view hide (#517): the drawer filter above hides everywhere, this only here.
Spacer(Modifier.height(8.dp))
GroupedRow(
title = stringResource(R.string.view_calendars_title, viewName),
title = hideInViewTitle,
summary = if (hiddenOnlyHere > 0) {
pluralStringResource(R.plurals.drawer_hidden_in_view_count, hiddenOnlyHere, hiddenOnlyHere)
} else {
@@ -19,6 +19,10 @@ import de.jeanlucmakiola.floret.components.GroupedHint
import de.jeanlucmakiola.floret.components.GroupedSectionHeader
import de.jeanlucmakiola.floret.components.MultiOptionRows
/** "Hide in “Month” view": the per-view hide's entry and picker title (#143). */
@Composable
internal fun CalendarView.hideInViewTitle(): String = stringResource(R.string.view_calendars_title, label())
/**
* The calendars hidden in [view] (#517), opened from the drawer while on it: the
* per-view setting from Settings → Calendars (#270), seen from the view's side.
@@ -32,7 +36,7 @@ fun ViewCalendarsPicker(
onDismiss: () -> Unit,
) {
FullScreenPicker(
title = stringResource(R.string.view_calendars_title, view.label()),
title = view.hideInViewTitle(),
onDismiss = onDismiss,
predictiveBack = true,
) {
+2 -1
View File
@@ -968,7 +968,8 @@
<string name="calendars_hide_in_views_none">Shown in every view</string>
<string name="calendars_hidden_in">Hidden in %1$s</string>
<string name="filter_hidden_in_view">Hidden in this view</string>
<string name="view_calendars_title">Hide in %1$s view</string>
<!-- %1$s is the view's name as the view switcher shows it, e.g. "Month" or "3 days". -->
<string name="view_calendars_title">Hide in “%1$s” view</string>
<plurals name="drawer_hidden_in_view_count">
<item quantity="one">%d calendar hidden in this view</item>
<item quantity="other">%d calendars hidden in this view</item>