Tidy wording in comments and changelog (#367)
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- **Scroll back to earlier days in the agenda.** Scroll up past today to see the events of the days before, a month at a time. Past days follow the past-events setting: dimmed with Dim, and not shown at all with Hide ([#367]).
|
||||
- **Scroll back to earlier days in the agenda.** Scroll up past today to see earlier days' events, loaded a month at a time. Past days follow the past-events setting: Dim fades them, and with Hide the agenda still starts at today ([#367]).
|
||||
|
||||
### Fixed
|
||||
- **The agenda always starts today.** Coming from the month or day view, the agenda used to start at the day you had open there, so "Next 30 days" could show the 1st to the 30th of the month. It now opens on today with your chosen range. Backing out of a day you opened from the agenda still returns you to where you were ([#367]).
|
||||
|
||||
@@ -146,8 +146,8 @@ fun CalendarHost(
|
||||
mutableStateOf(listOf(defaultView))
|
||||
}
|
||||
var navigationVersion by remember { mutableIntStateOf(0) }
|
||||
// Whether the view on show was reached by backing out of a day drilled into
|
||||
// from it, so the agenda returns to where it was instead of today (#367).
|
||||
// True after backing out of a day opened from the view now shown, so the
|
||||
// agenda returns to where it was instead of today (#367).
|
||||
var returnedFromDay by remember { mutableStateOf(false) }
|
||||
val view = viewStack.last()
|
||||
// The date every view opens on and carries along (#184); tapping a day
|
||||
|
||||
@@ -93,9 +93,9 @@ fun AgendaScreen(
|
||||
restorePosition: Boolean = false,
|
||||
viewModel: AgendaViewModel = hiltViewModel(),
|
||||
) {
|
||||
// Opens on today rather than the day another view was on (#367), unless
|
||||
// backing out of a day opened from here or recreated, which land on the day
|
||||
// last at the top. Still hands the top day back to the shared focus.
|
||||
// Opens on today, not on the day another view was on (#367). Backing out of
|
||||
// a day opened from here, or a recreated screen, returns to the day last at
|
||||
// the top. The top day still goes back to the shared focus.
|
||||
val focus = LocalViewFocus.current
|
||||
val opened = rememberSaveable { mutableStateOf(false) }
|
||||
val restoreTop = remember(viewModel) {
|
||||
@@ -126,8 +126,8 @@ fun AgendaScreen(
|
||||
// list scroll, not an anchor change — "today" has to bring the list back to
|
||||
// the top as well, and stay offered while it is scrolled away (#305).
|
||||
val listState = rememberLazyListState()
|
||||
// Past days load above the anchor (#367), so "at the start" is the anchor's
|
||||
// row rather than the top of the list.
|
||||
// Past days load above the anchor (#367), so the anchor's row counts as the
|
||||
// start of the list.
|
||||
val anchorIndex = remember { mutableIntStateOf(0) }
|
||||
val scrolledAway by remember {
|
||||
derivedStateOf {
|
||||
@@ -350,7 +350,7 @@ internal fun AgendaContent(
|
||||
today = state.today,
|
||||
enabled = showToday && state.anchor == state.today,
|
||||
)
|
||||
// Loaded past days alone aren't anything coming up.
|
||||
// Past days alone don't count as anything coming up.
|
||||
if (days.none { it.date >= state.anchor }) {
|
||||
// Nothing to scroll: drop the position a previous list left, so
|
||||
// the today FAB doesn't linger over an empty screen.
|
||||
@@ -400,8 +400,8 @@ private fun AgendaList(
|
||||
val itemDates = agendaItemDates(days)
|
||||
val anchorRow = itemDates.indexOfFirst { it >= anchor }.coerceAtLeast(0)
|
||||
SideEffect { anchorIndex.intValue = anchorRow }
|
||||
// A new anchor opens the list on its row, past days above it, from the first
|
||||
// frame. Keyed on the anchor the days arrived with, not the one just
|
||||
// A new anchor opens the list on its row from the first frame, with past
|
||||
// days above. Keyed on the anchor the days arrived with, not the one just
|
||||
// requested: scrolling before the new rows compose leaves the list keyed to
|
||||
// a row that reappears further down, and it follows it there. The first run
|
||||
// may restore a remembered day instead.
|
||||
@@ -415,7 +415,7 @@ private fun AgendaList(
|
||||
listState.requestScrollToItem(index)
|
||||
onDispose {}
|
||||
}
|
||||
// Scrolling up near the first loaded day reaches further back.
|
||||
// Scrolling up near the first loaded day loads earlier days.
|
||||
val currentLoadEarlier by rememberUpdatedState(onLoadEarlier)
|
||||
val loadOnScrollUp = remember(listState) {
|
||||
object : NestedScrollConnection {
|
||||
|
||||
@@ -2868,7 +2868,7 @@ private fun MonthBar(
|
||||
) {
|
||||
val title = event.title.ifBlank { stringResource(R.string.event_untitled) }
|
||||
val dimCutoff = LocalDimCutoff.current
|
||||
// A bar is one piece, so it dims once the last day it covers is behind.
|
||||
// A bar is one piece, so it dims once the last day it covers has passed.
|
||||
val dimmed = dimCutoff != null &&
|
||||
(event.hasEnded(dimCutoff) || days?.let { event.isPastOn(it.last(), dimCutoff) } == true)
|
||||
val paint = eventPaint(event, dark)
|
||||
|
||||
@@ -1119,7 +1119,7 @@ private fun AllDayBar(
|
||||
) {
|
||||
val title = event.title.ifBlank { stringResource(R.string.event_untitled) }
|
||||
val dimCutoff = LocalDimCutoff.current
|
||||
// A bar is one piece, so it dims once the last day it covers here is behind.
|
||||
// A bar is one piece, so it dims once the last day it covers here has passed.
|
||||
val dimmed = dimCutoff != null && event.isPastOn(lastDay, dimCutoff)
|
||||
val paint = eventPaint(event, dark)
|
||||
Box(
|
||||
|
||||
Reference in New Issue
Block a user