Compare commits

..
Author SHA1 Message Date
makiolaj cd3fb7378f Fix widget review findings for 2.24
Week strip lost its weekend to Glance's 10-child row limit, widget taps
shared PendingIntents across kinds, Month + day kept a stale selection,
all-day events ended at UTC midnight, countdown missed edited and split
occurrences, Today never redrew when its last event ended, and redraw
receivers could crash on removed widgets. Plus redraw scoping, caching
and locale cleanups.
2026-10-28 18:03:22 +01:00
makiolaj 14c10c6d0b 2.24.0-beta.2
Beta — Codeberg pre-release / detect (push) Successful in 5s
Beta — Codeberg pre-release / beta (push) Successful in 10m9s
2026-10-28 15:35:38 +01:00
Jean-Luc Makiolaandmakiolaj f5e28eae8d Widget fixes and tweaks from the 2.24 beta feedback (#449)
Beta — Codeberg pre-release / detect (push) Successful in 5s
Beta — Codeberg pre-release / beta (push) Skipped
Feedback on 2.24.0-beta.1 from #90, #376 and #71. floret-kit is pinned to its main after floret-kit#24, which carries the shared parts.

- Transparent background: switching to or from it now shows right away on Date, Countdown, Week strip, Quick add, Upcoming and Today (and the Month and day grid). Their backings always set a fill, so a reapplied rendering can't keep the old one.
- App language: changing it in Settings redraws every widget, which now render in the app language. Below Android 13 the choice is mirrored for the widget process, since AppCompat only applies it inside an activity.
- Picker previews: Countdown and Week strip previews inflate on Android 14 and below (they used View/Space, which RemoteViews refuses).
- Month widget: days outside the month take a 40% lighter shade, in the widget and its XML preview.
- Add button: the filled header action is 44dp instead of 36dp wide (floret-kit).
- Tinted background: the tonal header and weekday pills had the same tone as the fill and disappeared; they now use inversePrimary there (floret-kit). Not in the issues, found while testing.
- Dimmed past events (Month and day, Today, Agenda): the fill fades to 30% and the text to 65% instead of both to 40%, so the title stays readable.
- Widget picker: names drop the Calendula prefix, and each widget gets its own description instead of repeating its name (#71).

The config screen stalling until touched (#90, item 2) is not addressed: it didn't reproduce on an Android 12 emulator.

Closes #376
Closes #71

Co-authored-by: Jean-Luc Makiola <business@jeanlucmakiola.de>
Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/449
2026-10-28 15:34:16 +01:00
makiolaj b6cec2f95e 2.24.0-beta.1
Beta — Codeberg pre-release / detect (push) Successful in 5s
Beta — Codeberg pre-release / beta (push) Successful in 8m50s
2026-10-26 20:32:16 +01:00
makiolaj d012948de6 Pin floret-kit to main after #22 2026-10-26 20:28:37 +01:00
makiolaj 8ff8a2de1f Merge the widget refactor and new widgets into 2.24.0 2026-10-26 20:16:34 +01:00
makiolaj 3f81bb9ea5 Widget picker: generated previews on Android 15+, XML mock-ups redrawn to match the widgets 2026-10-26 20:08:18 +01:00
makiolaj a08ad15c4a Month and day widget: clear the fill of previously tapped days (#441) 2026-10-26 20:08:11 +01:00
makiolaj c9cc40ff60 Month and day widget: compact month grid beside the selected day's events (#441) 2026-10-23 18:51:49 +02:00
makiolaj 343a8904ea Countdown widget: next timed event or a chosen event/series, redrawn when its label changes (#439) 2026-10-23 18:51:49 +02:00
makiolaj 075940d29e Today list widget: today's events, then tomorrow's first ones once the day is done (#438) 2026-10-23 18:51:49 +02:00
makiolaj 670cdb226a Upcoming widget: today's date over the next events, rows fitted to the height (#437) 2026-10-23 18:51:49 +02:00
makiolaj a8da8bc7a3 Week strip widget: this week's days with event-colour dots, today filled (#436) 2026-10-23 18:51:49 +02:00
makiolaj cfcba283f1 Date widget: 1×1 weekday and day number on a cookie shape, opens today (#376) 2026-10-23 18:51:49 +02:00
makiolaj 85d4dc535c Quick add widget: 1×1 shaped + opening the editor on today (#435) 2026-10-23 18:51:49 +02:00
makiolaj edf80fe8b8 Widgets: one kind registry and receiver base, per-widget calendar choice (#292) 2026-10-23 18:51:49 +02:00
makiolaj 0ecd6de27b Merge #71 widget redesign and #372 month grid into the widget refactor 2026-10-23 17:59:34 +02:00
makiolaj 610409012f Month widget: day cells and weekday pills, shaded outside days, new-event button (#71) 2026-10-23 17:59:34 +02:00
makiolaj 7e45656479 Pin floret-kit past its lint fix 2026-10-23 15:48:44 +02:00
makiolaj 94b04c1365 Month widget grid: palette-following colours, day ripples, bold today, strike via span, lane cap (#372) 2026-10-23 15:45:54 +02:00
makiolaj d1557825c6 Month widget: draw the weeks as plain RemoteViews, lanes from the widget's height (#372)
Glance's 499 view ids forced busy months down to one or two lanes. The week rows are now one embedded RemoteViews tree, so every event that fits the height gets its bar and only the rest folds into +N. The on-device test now checks the payload instead of the view count.
2026-10-23 15:16:28 +02:00
makiolaj d43a741c93 Agenda widget: format the month label outside the composable (#71) 2026-10-23 15:16:28 +02:00
makiolaj 6da0648b77 Widget redesign: agenda date pills and tinted day cards, month labels, pill headers, true-size config preview (#71, #90)
Drops the agenda refresh button (redraws are automatic since #420). Caps the config preview at Glance's 10-row Column limit, which made it fail with busy agendas (#292).
2026-10-23 14:51:29 +02:00
makiolaj 3b48987ab7 Merge #292 widget config into the widget refactor 2026-10-23 11:12:24 +02:00
makiolaj 04a677dc10 Per-widget config screen: background, theme and agenda options (#292) 2026-10-23 11:12:18 +02:00
makiolaj 46ca2db63a Month widget: count Glance's real view ids per Android version, test the budget on device (#372) 2026-10-21 18:44:14 +02:00
makiolaj a87ebc33b6 Month widget: tap a day anywhere opens it, fit busy months into Glance's view limit (#386, #372) 2026-10-21 18:18:01 +02:00
makiolaj 3471447ab6 Pin floret-kit to main (glance refresh helpers, #18) 2026-10-21 17:57:04 +02:00
makiolaj b206e0e6a5 Bump floret-kit onto current main 2026-10-21 17:48:24 +02:00
makiolaj 35f5dc1666 Fix widget onUpdate crash, skip provider echoes, per-widget redraws (#420, #229) 2026-10-21 17:36:30 +02:00
makiolaj 225901ceee Share widget loads across sizes, redraw on own changes only (#420, #229) 2026-10-21 17:02:43 +02:00
makiolaj 77e103c66c Move widgets onto floret-kit glance, reload on every redraw (#420, #229) 2026-10-21 15:26:05 +02:00
232 changed files with 1013 additions and 6739 deletions

No files matched your search

+1 -4
View File
@@ -318,16 +318,13 @@ jobs:
# not provide node inside custom job containers, so JavaScript actions
# (checkout, download-artifact) can't run there. The Renovate job gets away
# with a container because its only step is a shell command. Ruby is installed
# the same way sshpass, jq and fdroidserver are in the job above, from trixie:
# fastlane >= 2.241 needs Ruby 3.2+, and bookworm's apt only has 3.1.
# the same way sshpass, jq and fdroidserver are in the job above.
play:
needs: [detect, release]
# workflow_dispatch is the F-Droid re-sign recovery path — it must never
# touch Play, so gate on a real release only.
if: needs.detect.outputs.is_release == 'true'
runs-on: docker
container:
image: node:22-trixie
env:
VERSION: ${{ needs.detect.outputs.version }}
VERSION_CODE: ${{ needs.detect.outputs.version_code }}
+1 -1
View File
@@ -33,7 +33,7 @@ jobs:
# directly drops the docker-in-docker requirement entirely.
# Full tag pinned; Renovate's github-actions manager keeps it bumped.
container:
image: ghcr.io/renovatebot/renovate:44.237.3
image: ghcr.io/renovatebot/renovate:43.232.0
steps:
- name: Run Renovate
run: renovate
-73
View File
@@ -7,49 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.24.3] — 2026-11-20
### Added
- **Galician**, a new community translation through [Calendula's Weblate](https://weblate.dev.jeanlucmakiola.de/projects/calendula/), complete from the start. Pick it under Settings → Language. Thanks to Jani Buni.
### Changed
- Arabic, Italian and Spanish are now fully translated, with further updates to Belarusian, German and Slovak. Thanks to everyone translating on Weblate.
## [2.24.2] — 2026-11-13
### Fixed
- **Quick moves no longer get lost.** Dropping an event while an earlier move was still saving used to snap it back without a word. Drops now wait in line and are saved in order, and a moved event stays where you dropped it until the calendar shows it there. If an event changed before a drop could be saved, or the line is full, a message says so instead ([#494]).
- **Undo after a run of moves** keeps the first move's Undo, and each failed move gets its own message rather than replacing the last one ([#494]).
### Changed
- **The day view's title names the month**, like the week and 3-day views. Weekday and date already sit in the column header below it ([#501]).
- Library updates (kotlinx-datetime, AppCompat).
## [2.24.1] — 2026-11-12
### Added
- **A classic style for the agenda widget.** Its settings now have a Style option: Cards keeps the new look, Classic brings back the 2.23 layout with a line per day and a colour stripe beside each event, under the current header. Dates in another year show the year. Classic has an Invert text colour switch, so its text stays readable on light and dark wallpapers ([#489]).
- **Widget opacity.** Every widget with a Solid or Tinted background has an Opacity slider from 20 to 100%. Below 50%, the card-style widgets back their content like a Transparent widget so it stays readable ([#489]).
### Fixed
- **Week numbers match your region.** With weeks starting on Sunday, the month and week views showed every week number one too low. Rows are now numbered by your region's rules, so ISO regions such as Germany are unchanged ([#493]).
- **The month widget shows events at every height.** At some sizes a week row had room for a little more than the date but not a full line of events, and drew none. It now fits a slimmer line there, and a row with a single line shows "+N" on days with more events than fit ([#491]).
- **Dimmed past events in dark widgets are readable again.** They used to turn pastel with white text on top ([#475]).
- **A widget set to Light or Dark matches the system colours.** With Material You, the + button and today's date could look different from a widget that follows the app ([#475]).
### Changed
- **Fewer permissions.** Calendula no longer asks for network state, wake lock or foreground service access, which a library added without the app needing them ([#448]).
- Translation updates from [Calendula's Weblate](https://weblate.dev.jeanlucmakiola.de/projects/calendula/).
## [2.24.0] — 2026-11-06
### Added
- **Six new home-screen widgets.** Quick add (1×1) opens a new event on today with the same defaults as the app's + button ([#435]). Date (1×1) shows today's weekday and day number on a rounded shape and opens today ([#376]). Week strip (4×1) shows this week's days with a dot in each event's colour and today filled ([#436]). Upcoming (2×2) shows today's date over your next events, as many as fit ([#437]). Today lists today's events; once they're over it says "Nothing left today" and shows tomorrow's first one or two ([#438]). Countdown counts down to your next timed event, or to an event or series you pick, like a holiday in 12 days ([#439]).
- **A month and day widget.** A compact month grid sits beside the events of one day. Tap a day in the grid to see its events, and tap the list to open that day in the app ([#441]).
- **Each widget has its own settings.** Placing a widget, or long-pressing it and choosing Edit, opens a settings screen with a live preview. Pick a solid, tinted or transparent background, a light or dark theme or the app's, and which calendars it shows. Widgets that list events also have their time range, text size and how past events look. Settings → Widgets lists the widgets on your home screen so you can change them from there. These options used to be shared by all widgets; widgets you already placed keep what you had set ([#292]).
- **Turn off start times in the month view.** Settings → Views → Month → Start times hides the time in front of event titles, so narrow fonts keep more of the title. With it on, the time now only shows when the whole title, or at least its first 12 characters, still fits beside it ([#476]).
- **Drag all-day events.** In the day, 3-day and week views, long-press an event in the all-day strip and move it sideways to another day, or down into the grid to turn it into a timed event ([#296]).
- **Traditional Chinese**, started as a community translation through [Calendula's Weblate](https://weblate.dev.jeanlucmakiola.de/projects/calendula/). It covers only a few screens so far, so the rest still shows in English until it fills out. Pick it under Settings → Language. Thanks to AventineC.
### Changed
- **The agenda and month widgets have a new look.** The agenda puts each day in its own card, with a round date pill beside the first event and today's pill filled. The month widget has rounded day cells, weekday pills, shaded days outside the month and a + for a new event. The agenda's refresh button is gone, since widgets now update on their own ([#71], [#90]).
@@ -57,29 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **The widget picker shows what each widget looks like.** On Android 15 and later the previews are the real widgets with sample events, in your language and colours; on older versions they are redrawn to match.
- **Widgets are listed by their name alone,** without "Calendula" in front, and each has a short description in the picker ([#71]).
- **Past events in widgets stay readable when dimmed.** Their background fades further and their text less ([#90]).
- **Events from midnight to midnight show as all-day events.** A timed event that starts and ends at midnight now sits in the all-day strip, shows as "All day" in the agenda and widgets, and its reminder names the day instead of 00:00 – 00:00. The event itself stays as it was saved ([#296]).
- **Cancelled and tentative events are marked.** Cancelled events are struck through and listed last, like declined invites, and tentative ones get the outline used for unanswered invites. Cancelled one-off events and series no longer disappear ([#388]).
- **One notification per event.** An event with several reminders now keeps a single notification, which each later reminder updates in place ([#463]).
- **Go further back and forward in time.** Every view and the date picker now reach from 1600 to 2399 ([#457]).
- **The split month agenda only lists days with events.** In other months it no longer starts with an empty 1st, and a month with nothing in it says so in one row ([#142]).
### Fixed
- **Widgets show your changes straight away.** After you added, edited or deleted an event, a widget could keep showing the old events until something else redrew it ([#420], [#229]).
- **Widgets follow the app's language.** After you picked a language in Settings, widgets kept the old one until something redrew them ([#90]).
- **The month widget handles busy months.** It could show "Can't show content", or only one or two events per day. Each day now shows as many events as its height fits, and the rest fold into +N ([#372]).
- **Short events late in the day are fully visible.** An event like 23:58–23:59 used to be cut down to a sliver at the bottom of the day, week and 3-day views. It now keeps its usual minimum height and sits flush against midnight ([#483]).
- **The month view no longer crashes after going before 1900** in the day or week view ([#457]).
- **Month pages keep updating.** After a small swipe that snapped back, a month page could stop showing new or edited events, and opening an event from the split view could show its old times ([#440], [#454]).
- **Smoother expand and collapse in the split month view.** The day cells morph cleanly between the two layouts, and week numbers now animate along with them ([#473]).
- **Back clears the selected day in the split month view.** With a day picked, the back gesture used to close the app; it now goes back to the whole month's agenda first ([#142]).
## [2.23.1] — 2026-10-28
### Changed
- **The split month view fits more events.** With a day selected, its date is no longer shown twice: the filter chip now stands in for the day's header. Tapping the chip opens the day, and its ✕ clears the filter. The day headers in the month agenda below the grid take less room too ([#142]).
### Fixed
- **Event dots in the split month grid stay in place on busy days.** A day with a "+N" next to its dots used to push them further down the cell ([#142]).
## [2.23.0] — 2026-10-21
@@ -1913,7 +1856,6 @@ automatically, with zero telemetry and no internet permission.
[#146]: https://codeberg.org/jlmakiola/calendula/issues/146
[#267]: https://codeberg.org/jlmakiola/calendula/issues/267
[#239]: https://codeberg.org/jlmakiola/calendula/issues/239
[#296]: https://codeberg.org/jlmakiola/calendula/issues/296
[#297]: https://codeberg.org/jlmakiola/calendula/issues/297
[#298]: https://codeberg.org/jlmakiola/calendula/issues/298
[#309]: https://codeberg.org/jlmakiola/calendula/issues/309
@@ -1963,7 +1905,6 @@ automatically, with zero telemetry and no internet permission.
[#306]: https://codeberg.org/jlmakiola/calendula/issues/306
[#178]: https://codeberg.org/jlmakiola/calendula/issues/178
[#116]: https://codeberg.org/jlmakiola/calendula/issues/116
[#388]: https://codeberg.org/jlmakiola/calendula/issues/388
[#413]: https://codeberg.org/jlmakiola/calendula/issues/413
[#71]: https://codeberg.org/jlmakiola/calendula/issues/71
[#90]: https://codeberg.org/jlmakiola/calendula/issues/90
@@ -1978,18 +1919,4 @@ automatically, with zero telemetry and no internet permission.
[#437]: https://codeberg.org/jlmakiola/calendula/issues/437
[#438]: https://codeberg.org/jlmakiola/calendula/issues/438
[#439]: https://codeberg.org/jlmakiola/calendula/issues/439
[#440]: https://codeberg.org/jlmakiola/calendula/issues/440
[#441]: https://codeberg.org/jlmakiola/calendula/issues/441
[#454]: https://codeberg.org/jlmakiola/calendula/issues/454
[#457]: https://codeberg.org/jlmakiola/calendula/issues/457
[#463]: https://codeberg.org/jlmakiola/calendula/issues/463
[#473]: https://codeberg.org/jlmakiola/calendula/issues/473
[#476]: https://codeberg.org/jlmakiola/calendula/issues/476
[#483]: https://codeberg.org/jlmakiola/calendula/issues/483
[#448]: https://codeberg.org/jlmakiola/calendula/issues/448
[#475]: https://codeberg.org/jlmakiola/calendula/issues/475
[#489]: https://codeberg.org/jlmakiola/calendula/issues/489
[#491]: https://codeberg.org/jlmakiola/calendula/issues/491
[#493]: https://codeberg.org/jlmakiola/calendula/issues/493
[#494]: https://codeberg.org/jlmakiola/calendula/issues/494
[#501]: https://codeberg.org/jlmakiola/calendula/issues/501
+1 -1
View File
@@ -7,4 +7,4 @@ source "https://rubygems.org"
# Pinned exactly; Renovate's bundler manager keeps it bumped. No Gemfile.lock is
# committed on purpose: this resolves an uploader's transitive deps, not the
# app's, and none of it affects the reproducible release build.
gem "fastlane", "2.241.1"
gem "fastlane", "2.237.0"
+2 -2
View File
@@ -32,8 +32,8 @@ android {
// (up to 2.22.3: 2.22.3 -> 22203; from 2.22.4: 2.23.0-beta.1 -> 2230001,
// 2.22.4 -> 2220499), and CI fails if the committed one doesn't match.
// See docs/RELEASING.md.
versionCode = 2240399
versionName = "2.24.3"
versionCode = 2240002
versionName = "2.24.0-beta.2"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
-5
View File
@@ -41,11 +41,6 @@
-->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- WorkManager declares these for network constraints and foreground workers, neither of which the app uses (#448). -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove" />
<uses-permission android:name="android.permission.WAKE_LOCK" tools:node="remove" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" tools:node="remove" />
<!-- Package visibility (Android 11+): without this, getLaunchIntentForPackage
returns null and the calendar manager's per-account "manage" button can't
open the source sync app (DAVx5, ICSx5, Google Calendar, …). The LAUNCHER
@@ -567,31 +567,8 @@ class AndroidCalendarDataSource @Inject constructor(
}
}
override fun instances(beginMillis: Long, endMillis: Long): List<EventInstance> {
val listed = queryInstances(beginMillis, endMillis, null, null)
// A provider that does expand cancelled events already listed them.
val shown = listed.mapTo(HashSet()) { it.eventId }
val cancelled = queryCancelledOneOffs(beginMillis, endMillis).filter { it.eventId !in shown }
return if (cancelled.isEmpty()) listed else (listed + cancelled).sortedBy { it.start }
}
/** Cancelled one-off events overlapping the window, which AOSP leaves out of Instances (#388). */
private fun queryCancelledOneOffs(beginMillis: Long, endMillis: Long): List<EventInstance> {
val selection = "${CalendarContract.Events.STATUS} = ${CalendarContract.Events.STATUS_CANCELED} AND " +
"${CalendarContract.Events.DELETED} = 0 AND " +
"${CalendarContract.Events.RRULE} IS NULL AND ${CalendarContract.Events.RDATE} IS NULL AND " +
"${CalendarContract.Events.ORIGINAL_ID} IS NULL AND " +
"${CalendarContract.Events.ORIGINAL_SYNC_ID} IS NULL AND " +
"${CalendarContract.Events.DTSTART} < ? AND " +
"COALESCE(${CalendarContract.Events.DTEND}, ${CalendarContract.Events.DTSTART}) >= ?"
return resolver.query(
CalendarContract.Events.CONTENT_URI,
CancelledEventProjection.COLUMNS,
selection,
arrayOf(endMillis.toString(), beginMillis.toString()),
null,
)?.use { c -> c.mapRowsNotNull { toCancelledOneOff() } } ?: emptyList()
}
override fun instances(beginMillis: Long, endMillis: Long): List<EventInstance> =
queryInstances(beginMillis, endMillis, null, null)
override fun eventInstances(eventId: Long, beginMillis: Long, endMillis: Long): List<EventInstance> =
// The series' own rows plus its exceptions, so an occurrence edited on
@@ -610,12 +587,14 @@ class AndroidCalendarDataSource @Inject constructor(
args: Array<String>?,
): List<EventInstance> {
ensureObserversRegistered()
// Hide deleted occurrences (cancelled exceptions, #47) but keep a cancelled
// event of its own (#388); NULL status is a normal event. DELETED: #364.
// Hide cancelled occurrences: "delete only this event" writes a
// cancelled exception for the one instance (#47). A NULL status is a
// normal, un-cancelled event, so it must survive the filter — a bare
// `!= CANCELED` would drop it (NULL != 2 is NULL, not true).
// DELETED = 0: a provider that soft-deletes may keep the row's
// instances until a purge (#364).
val visible = "(${CalendarContract.Instances.STATUS} IS NULL OR " +
"${CalendarContract.Instances.STATUS} != ${CalendarContract.Events.STATUS_CANCELED} OR " +
"(${CalendarContract.Instances.ORIGINAL_ID} IS NULL AND " +
"${CalendarContract.Instances.ORIGINAL_SYNC_ID} IS NULL)) AND " +
"${CalendarContract.Instances.STATUS} != ${CalendarContract.Events.STATUS_CANCELED}) AND " +
"${CalendarContract.Events.DELETED} = 0"
return resolver.query(
instancesUri(beginMillis, endMillis),
@@ -645,8 +624,7 @@ class AndroidCalendarDataSource @Inject constructor(
.toTypedArray()
val selection = "($match) AND " +
"${CalendarContract.Events.DELETED} = 0 AND " +
"${CalendarContract.Events.ORIGINAL_ID} IS NULL AND " +
"${CalendarContract.Events.ORIGINAL_SYNC_ID} IS NULL"
"${CalendarContract.Events.ORIGINAL_ID} IS NULL"
return resolver.query(
CalendarContract.Events.CONTENT_URI,
SearchProjection.COLUMNS,
@@ -9,7 +9,6 @@ import de.jeanlucmakiola.calendula.domain.EventColorOption
import de.jeanlucmakiola.calendula.domain.EventForm
import de.jeanlucmakiola.calendula.domain.FormTime
import de.jeanlucmakiola.calendula.domain.EventStatus
import de.jeanlucmakiola.calendula.domain.forNewEvent
import de.jeanlucmakiola.calendula.domain.ics.ParsedIcsEvent
import de.jeanlucmakiola.calendula.domain.nearestTo
import kotlinx.datetime.toJavaLocalDate
@@ -133,8 +132,6 @@ internal fun buildEventInsertValues(
put(CalendarContract.Events.EVENT_TIMEZONE, times.timezone)
put(CalendarContract.Events.AVAILABILITY, form.availability.toProviderValue())
put(CalendarContract.Events.ACCESS_LEVEL, form.accessLevel.toProviderValue())
form.status.forNewEvent().takeIf { it != EventStatus.Confirmed }
?.let { put(CalendarContract.Events.STATUS, it.toProviderStatus()) }
form.location.trim().takeIf { it.isNotEmpty() }
?.let { put(CalendarContract.Events.EVENT_LOCATION, it) }
form.description.trim().takeIf { it.isNotEmpty() }
@@ -182,9 +179,6 @@ internal fun buildEventUpdateValues(
if (updated.accessLevel != original.accessLevel) {
put(CalendarContract.Events.ACCESS_LEVEL, updated.accessLevel.toProviderValue())
}
if (updated.status != original.status) {
put(CalendarContract.Events.STATUS, updated.status.toProviderStatus())
}
if (updated.colorKey != original.colorKey || updated.color != original.color) {
putAll(eventColorColumns(updated.colorKey, updated.color))
}
@@ -285,7 +279,6 @@ internal fun buildOccurrenceExceptionValues(
put(CalendarContract.Events.EVENT_TIMEZONE, times.timezone)
put(CalendarContract.Events.AVAILABILITY, form.availability.toProviderValue())
put(CalendarContract.Events.ACCESS_LEVEL, form.accessLevel.toProviderValue())
put(CalendarContract.Events.STATUS, form.status.forNewEvent().toProviderStatus())
put(CalendarContract.Events.EVENT_LOCATION, form.location.trim().ifEmpty { null })
put(CalendarContract.Events.DESCRIPTION, form.description.trim().ifEmpty { null })
if (form.colorKey == null) putAll(eventColorColumns(null, form.color))
@@ -361,8 +354,7 @@ internal fun buildMovedMasterValues(
}
put(CalendarContract.Events.AVAILABILITY, snapshot.availability)
put(CalendarContract.Events.ACCESS_LEVEL, snapshot.accessLevel)
snapshot.status?.takeIf { it != CalendarContract.Events.STATUS_CANCELED }
?.let { put(CalendarContract.Events.STATUS, it) }
snapshot.status?.let { put(CalendarContract.Events.STATUS, it) }
put(CalendarContract.Events.EVENT_LOCATION, snapshot.location?.ifEmpty { null })
put(CalendarContract.Events.DESCRIPTION, snapshot.description?.ifEmpty { null })
}
@@ -866,7 +858,7 @@ internal fun buildImportedEventValues(
// timed rows keep the event's own zone.
put(CalendarContract.Events.EVENT_TIMEZONE, if (event.isAllDay) "UTC" else event.zoneId)
put(CalendarContract.Events.AVAILABILITY, event.availability.toProviderValue())
put(CalendarContract.Events.STATUS, event.status.forNewEvent().toProviderStatus())
put(CalendarContract.Events.STATUS, event.status.toProviderStatus())
event.location?.trim()?.takeIf { it.isNotEmpty() }
?.let { put(CalendarContract.Events.EVENT_LOCATION, it) }
event.description?.trim()?.takeIf { it.isNotEmpty() }
@@ -38,17 +38,9 @@ internal fun ColumnReader.toEventInstance(): EventInstance? {
color = color,
location = getString(InstanceProjection.IDX_LOCATION),
response = mapEventResponse(getInt(InstanceProjection.IDX_SELF_ATTENDEE_STATUS)),
status = eventStatus(InstanceProjection.IDX_STATUS),
)
}
/**
* A [CancelledEventProjection] row as an instance. Its id is the negated event
* id, so it can't collide with a provider instance id.
*/
internal fun ColumnReader.toCancelledOneOff(): EventInstance? =
toEventInstance()?.let { it.copy(instanceId = -it.eventId) }
/**
* `SELF_ATTENDEE_STATUS` as the calendar surfaces read it: a tentative "maybe"
* counts as going, and everything that is not an open or refused invitation —
@@ -62,7 +62,6 @@ internal object InstanceProjection {
CalendarContract.Instances.CALENDAR_COLOR,
CalendarContract.Instances.EVENT_LOCATION,
CalendarContract.Instances.SELF_ATTENDEE_STATUS,
CalendarContract.Instances.STATUS,
)
const val IDX_INSTANCE_ID = 0
@@ -76,29 +75,6 @@ internal object InstanceProjection {
const val IDX_CALENDAR_COLOR = 8
const val IDX_LOCATION = 9
const val IDX_SELF_ATTENDEE_STATUS = 10
const val IDX_STATUS = 11
}
/**
* A cancelled one-off straight from the Events table, laid out on
* [InstanceProjection]'s indices so [toCancelledOneOff] reuses its mapper. AOSP
* writes no Instances rows for a cancelled event (#388).
*/
internal object CancelledEventProjection {
val COLUMNS: Array<String> = arrayOf(
CalendarContract.Events._ID,
CalendarContract.Events._ID,
CalendarContract.Events.CALENDAR_ID,
CalendarContract.Events.TITLE,
CalendarContract.Events.DTSTART,
CalendarContract.Events.DTEND,
CalendarContract.Events.ALL_DAY,
CalendarContract.Events.EVENT_COLOR,
CalendarContract.Events.CALENDAR_COLOR,
CalendarContract.Events.EVENT_LOCATION,
CalendarContract.Events.SELF_ATTENDEE_STATUS,
CalendarContract.Events.STATUS,
)
}
internal object EventDetailProjection {
@@ -222,7 +198,6 @@ internal object SearchProjection {
// Excerpted, not just filtered on: a hit has to show what it matched.
CalendarContract.Events.DESCRIPTION,
CalendarContract.Events.SELF_ATTENDEE_STATUS,
CalendarContract.Events.STATUS,
)
const val IDX_ID = 0
@@ -239,7 +214,6 @@ internal object SearchProjection {
const val IDX_RDATE = 11
const val IDX_DESCRIPTION = 12
const val IDX_SELF_ATTENDEE_STATUS = 13
const val IDX_STATUS = 14
}
/**
@@ -35,6 +35,5 @@ internal fun ColumnReader.toSearchResult(): EventInstance? {
isRecurring = !getString(SearchProjection.IDX_RRULE).isNullOrEmpty() ||
!getString(SearchProjection.IDX_RDATE).isNullOrEmpty(),
response = mapEventResponse(getInt(SearchProjection.IDX_SELF_ATTENDEE_STATUS)),
status = eventStatus(SearchProjection.IDX_STATUS),
)
}
@@ -146,7 +146,6 @@ class SettingsPrefs @Inject constructor(
val pastEventDisplay: Flow<PastEventDisplay> = prefs.flow(SettingsKeys.pastEventDisplay)
val dimCompletedEvents: Flow<Boolean> = prefs.flow(SettingsKeys.dimCompletedEvents)
val showWeekNumbers: Flow<Boolean> = prefs.flow(SettingsKeys.showWeekNumbers)
val monthShowStartTimes: Flow<Boolean> = prefs.flow(SettingsKeys.monthShowStartTimes)
val monthViewStyle: Flow<MonthViewStyle> = prefs.flow(SettingsKeys.monthViewStyle)
val timelineScale: Flow<TimelineScale> = prefs.flow(SettingsKeys.timelineScale)
val multiDayCount: Flow<Int> = prefs.flow(SettingsKeys.multiDayCount)
@@ -213,7 +212,6 @@ class SettingsPrefs @Inject constructor(
suspend fun setPastEventDisplay(mode: PastEventDisplay) = prefs.set(SettingsKeys.pastEventDisplay, mode)
suspend fun setDimCompletedEvents(enabled: Boolean) = prefs.set(SettingsKeys.dimCompletedEvents, enabled)
suspend fun setShowWeekNumbers(enabled: Boolean) = prefs.set(SettingsKeys.showWeekNumbers, enabled)
suspend fun setMonthShowStartTimes(enabled: Boolean) = prefs.set(SettingsKeys.monthShowStartTimes, enabled)
suspend fun setMonthViewStyle(style: MonthViewStyle) = prefs.set(SettingsKeys.monthViewStyle, style)
suspend fun setTimelineScale(scale: TimelineScale) = prefs.set(SettingsKeys.timelineScale, scale)
suspend fun setMultiDayCount(count: Int) = prefs.set(SettingsKeys.multiDayCount, count)
@@ -447,9 +445,6 @@ object SettingsKeys {
*/
val showWeekNumbers: Pref<Boolean> = booleanPref("show_week_numbers", false)
/** Whether Month chips may show the start time before the title when wide enough (#219, #476). */
val monthShowStartTimes: Pref<Boolean> = booleanPref("month_show_start_times", true)
/** How the Month view lays itself out (#38, #53). */
val monthViewStyle: Pref<MonthViewStyle> = enumPref("month_view_style", MonthViewStyle.Paged)
@@ -38,8 +38,6 @@ class ReminderActionReceiver : BroadcastReceiver() {
ACTION_DISMISS -> notifier.cancel(alert)
ACTION_SNOOZE -> {
// Tapped on a stale view: the reminder that replaced it stays put.
if (notifier.isSuperseded(alert)) return
// Cancel now so the notification doesn't linger until the alarm;
// the snooze delay read is the only async work.
notifier.cancel(alert)
@@ -52,8 +50,6 @@ class ReminderActionReceiver : BroadcastReceiver() {
ACTION_SHOW -> {
goAsync {
// A later reminder posted while this one was snoozed has taken its place.
if (notifier.isSuperseded(alert)) return@goAsync
if (settingsPrefs.remindersEnabled.first() && notifier.canPost()) {
notifier.post(alert)
}
@@ -86,14 +82,12 @@ class ReminderActionReceiver : BroadcastReceiver() {
/**
* An explicit intent to this receiver carrying [alert] as extras. The
* data URI duplicates no information but is what keeps two reminders'
* `PendingIntent`s apart — `filterEquals` never compares extras. The
* snooze alarm is the exception: one per occurrence, so a later snooze
* replaces an earlier one and a newer reminder can cancel it.
* `PendingIntent`s apart — `filterEquals` never compares extras.
*/
fun intent(context: Context, action: String, alert: ReminderAlert): Intent =
Intent(context, ReminderActionReceiver::class.java).apply {
this.action = action
data = "calendula://reminder/${identity(alert, action)}".toUri()
data = "calendula://reminder/${alert.key}".toUri()
putExtra(EXTRA_ALERT_KEY, alert.key)
putExtra(EXTRA_EVENT_ID, alert.eventId)
putExtra(EXTRA_CALENDAR_ID, alert.calendarId)
@@ -107,7 +101,7 @@ class ReminderActionReceiver : BroadcastReceiver() {
/**
* A stable request code per (alert, action), so one notification's
* PendingIntents stay distinct. The shift keeps the action slot intact;
* the top bits it drops are separated by [intent]'s URI.
* the top bits it drops are separated by [intent]'s per-reminder URI.
*/
fun requestCode(alert: ReminderAlert, action: String): Int {
val actionOffset = when (action) {
@@ -117,12 +111,9 @@ class ReminderActionReceiver : BroadcastReceiver() {
ACTION_OPEN -> 4
else -> 0
}
return (identity(alert, action).toInt() shl 3) + actionOffset
return (alert.key.toInt() shl 3) + actionOffset
}
private fun identity(alert: ReminderAlert, action: String): Long =
if (action == ACTION_SHOW) alert.occurrenceKey else alert.key
private fun alertFrom(intent: Intent): ReminderAlert? {
if (!intent.hasExtra(EXTRA_ALERT_KEY)) return null
return ReminderAlert(
@@ -1,7 +1,6 @@
package de.jeanlucmakiola.calendula.data.reminders
import de.jeanlucmakiola.calendula.domain.reminders.PlannedReminder
import de.jeanlucmakiola.calendula.domain.reminders.occurrenceKey
/**
* One reminder as the notification layer needs it: what to show, and the stable
@@ -21,13 +20,6 @@ data class ReminderAlert(
val isAllDay: Boolean,
)
/**
* The occurrence [ReminderAlert] belongs to. Keys the notification and the
* snooze alarm, so a later reminder for the same occurrence replaces the earlier
* one instead of stacking beside it (#463).
*/
val ReminderAlert.occurrenceKey: Long get() = occurrenceKey(eventId, beginMillis)
fun PlannedReminder.toAlert(): ReminderAlert = ReminderAlert(
key = key,
eventId = instance.eventId,
@@ -6,7 +6,6 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.os.Build
import android.os.Bundle
import android.util.Log
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
@@ -29,13 +28,13 @@ import javax.inject.Inject
import javax.inject.Singleton
/**
* Posts one notification per occurrence on a dedicated channel. Tapping opens
* Posts one notification per due reminder on a dedicated channel. Tapping opens
* the event's detail screen.
*
* The tag is the [occurrenceKey], so each reminder for an occurrence replaces
* the one before it in place (#463). A different reminder alerts afresh; the
* same one posted again — a catch-up pass overlapping the alarm that already
* fired — replaces its notification silently.
* The tag is the reminder's stable key, so a scan that posts the same reminder
* again — a catch-up pass overlapping the alarm that already fired — replaces
* its notification silently ([NotificationCompat.Builder.setOnlyAlertOnce])
* instead of stacking a second one.
*/
@Singleton
class ReminderNotifier @Inject constructor(
@@ -66,7 +65,7 @@ class ReminderNotifier @Inject constructor(
suspend fun post(alert: ReminderAlert) {
if (isSilenced(alert.calendarId)) return
ensureChannel()
val title = displayTitle(alert)
val title = alert.title.ifBlank { context.getString(R.string.event_untitled) }
val is24Hour = settingsPrefs.timeFormat.first()
.is24Hour(android.text.format.DateFormat.is24HourFormat(context))
val zone = ZoneId.systemDefault()
@@ -97,8 +96,7 @@ class ReminderNotifier @Inject constructor(
.setCategory(NotificationCompat.CATEGORY_EVENT)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setAutoCancel(true)
.setOnlyAlertOnce(shownKey(alert) == alert.key)
.addExtras(Bundle().apply { putLong(EXTRA_REMINDER_KEY, alert.key) })
.setOnlyAlertOnce(true)
.setContentIntent(detailIntent(alert))
.addAction(
R.drawable.ic_notification_snooze,
@@ -111,58 +109,20 @@ class ReminderNotifier @Inject constructor(
actionIntent(alert, ReminderActionReceiver.ACTION_DISMISS),
)
.build()
val manager = NotificationManagerCompat.from(context)
cancelLegacy(alert)
try {
manager.notify(alert.occurrenceKey.toString(), NOTIFICATION_ID, notification)
NotificationManagerCompat.from(context)
.notify(alert.key.toString(), NOTIFICATION_ID, notification)
} catch (e: SecurityException) {
// POST_NOTIFICATIONS was revoked between canPost() and here.
Log.w(TAG, "Could not post reminder for event ${alert.eventId}", e)
}
}
/**
* Remove [alert]'s notification (snooze re-shows it later; dismiss is final),
* unless a later reminder has replaced it — an action tapped on a stale view
* mustn't take the newer one with it.
*/
/** Remove a posted reminder (snooze re-shows it later; dismiss is final). */
fun cancel(alert: ReminderAlert) {
val manager = NotificationManagerCompat.from(context)
if (shownKey(alert) == alert.key) manager.cancel(alert.occurrenceKey.toString(), NOTIFICATION_ID)
// Posted before reminders shared a notification, under the reminder's own key.
manager.cancel(alert.key.toString(), NOTIFICATION_ID)
NotificationManagerCompat.from(context).cancel(alert.key.toString(), NOTIFICATION_ID)
}
/** Whether a different reminder for [alert]'s occurrence is on screen now. */
fun isSuperseded(alert: ReminderAlert): Boolean = shownKey(alert).let { it != null && it != alert.key }
/** The key of the reminder showing for [alert]'s occurrence, if any. */
private fun shownKey(alert: ReminderAlert): Long? {
val tag = alert.occurrenceKey.toString()
return NotificationManagerCompat.from(context).activeNotifications
.firstOrNull { it.tag == tag && it.id == NOTIFICATION_ID }
?.notification?.extras
?.takeIf { it.containsKey(EXTRA_REMINDER_KEY) }
?.getLong(EXTRA_REMINDER_KEY)
}
/**
* Remove a reminder for the same occurrence posted before reminders shared a
* notification. It carries no reminder key; its time and title identify it.
*/
private fun cancelLegacy(alert: ReminderAlert) {
val manager = NotificationManagerCompat.from(context)
manager.activeNotifications
.filter { it.id == NOTIFICATION_ID && it.notification.channelId == CHANNEL_ID }
.filter { !it.notification.extras.containsKey(EXTRA_REMINDER_KEY) }
.filter { it.notification.`when` == alert.beginMillis }
.filter { it.notification.extras.getCharSequence(NotificationCompat.EXTRA_TITLE)?.toString() == displayTitle(alert) }
.forEach { manager.cancel(it.tag, it.id) }
}
private fun displayTitle(alert: ReminderAlert): String =
alert.title.ifBlank { context.getString(R.string.event_untitled) }
private fun actionIntent(alert: ReminderAlert, action: String): PendingIntent =
PendingIntent.getBroadcast(
context,
@@ -197,10 +157,8 @@ class ReminderNotifier @Inject constructor(
const val TAG = "ReminderNotifier"
const val CHANNEL_ID = "reminders"
// One id, distinct tags: the tag (occurrence) already keys the
// One id, distinct tags: the tag (alert id) already keys the
// notification, so a fixed id keeps cancellation/replacement simple.
const val NOTIFICATION_ID = 1
const val EXTRA_REMINDER_KEY = "de.jeanlucmakiola.calendula.reminder_key"
}
}
@@ -43,7 +43,6 @@ class ReminderScanner @Inject constructor(
private val source: ReminderInstanceSource,
private val calendarDataSource: CalendarDataSource,
private val notifier: ReminderNotifier,
private val snoozes: ReminderSnoozeScheduler,
private val alarms: ReminderAlarmScheduler,
private val state: ReminderStatePrefs,
private val settingsPrefs: SettingsPrefs,
@@ -105,11 +104,7 @@ class ReminderScanner @Inject constructor(
)
if (notifier.canPost()) {
schedule.due.forEach {
val alert = it.toAlert()
snoozes.cancel(alert)
notifier.post(alert)
}
schedule.due.forEach { notifier.post(it.toAlert()) }
}
// Advance even when nothing could be posted, so muting notifications
// doesn't build a backlog.
@@ -33,16 +33,4 @@ class ReminderSnoozeScheduler @Inject constructor(
)
alarmManager.setWakeup(triggerAtMillis, pendingIntent)
}
/** Drop a snooze still pending for [alert]'s occurrence, so it can't re-show over a newer reminder. */
fun cancel(alert: ReminderAlert) {
val pendingIntent = PendingIntent.getBroadcast(
context,
ReminderActionReceiver.requestCode(alert, ReminderActionReceiver.ACTION_SHOW),
ReminderActionReceiver.intent(context, ReminderActionReceiver.ACTION_SHOW, alert),
PendingIntent.FLAG_NO_CREATE or PendingIntent.FLAG_IMMUTABLE,
) ?: return
context.getSystemService<AlarmManager>()?.cancel(pendingIntent)
pendingIntent.cancel()
}
}
@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.data.reminders
import de.jeanlucmakiola.calendula.domain.runsMidnightToMidnight
import de.jeanlucmakiola.calendula.ui.common.timeOfDayFormatter
import java.time.DayOfWeek
import java.time.Instant
@@ -12,8 +11,6 @@ import java.time.format.FormatStyle
import java.time.format.TextStyle
import java.time.temporal.ChronoUnit
import java.util.Locale
import kotlinx.datetime.toKotlinTimeZone
import kotlin.time.Instant as KInstant
/**
* The one line of time context in a reminder notification. Pure so it can be
@@ -35,8 +32,7 @@ import kotlin.time.Instant as KInstant
* - all-day, multi-day: "Tomorrow – 12 Jun 2026" (relative start, explicit end)
*
* All-day instances store UTC midnights with an exclusive end, so they are read
* in UTC and the end day is the last *covered* day (issue #308). A timed event
* from local midnight to local midnight reads like one too, in [zone] (#296).
* in UTC and the end day is the last *covered* day (issue #308).
*/
fun reminderTimeText(
beginMillis: Long,
@@ -51,17 +47,11 @@ fun reminderTimeText(
tomorrowLabel: String,
yesterdayLabel: String,
): String {
val wholeDays = !isAllDay && runsMidnightToMidnight(
KInstant.fromEpochMilliseconds(beginMillis),
KInstant.fromEpochMilliseconds(endMillis),
zone.toKotlinTimeZone(),
)
if (isAllDay || wholeDays) {
val dayZone = if (isAllDay) ZoneOffset.UTC else zone
if (isAllDay) {
val dateFormat = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).withLocale(locale)
// (atZone().toLocalDate() instead of LocalDate.ofInstant — API 34+)
val firstDay = Instant.ofEpochMilli(beginMillis).atZone(dayZone).toLocalDate()
val lastDay = Instant.ofEpochMilli(endMillis).atZone(dayZone).toLocalDate()
val firstDay = Instant.ofEpochMilli(beginMillis).atZone(ZoneOffset.UTC).toLocalDate()
val lastDay = Instant.ofEpochMilli(endMillis).atZone(ZoneOffset.UTC).toLocalDate()
.minusDays(1)
.coerceAtLeast(firstDay)
val start = relativeDayPrefix(
@@ -1,35 +1,18 @@
package de.jeanlucmakiola.calendula.domain
import kotlinx.datetime.TimeZone
import kotlinx.datetime.atStartOfDayIn
import kotlin.time.Instant
/** Lower values appear first in lists and get the upper visible lanes in grids. */
fun EventInstance.displayPriority(zone: TimeZone): Int = when {
isCrossedOut -> 3
isDeclined -> 3
spansMultipleDays(zone) -> 0
coversWholeDays(zone) -> 1
isAllDay -> 1
else -> 2
}
/**
* Shared order for agenda and split day lists. Grid bars add their lane geometry.
* Each event's priority is worked out once, not on every comparison.
*/
fun List<EventInstance>.sortedForDisplay(zone: TimeZone): List<EventInstance> =
map { Triple(it, it.displayPriority(zone), it.displayStart(zone)) }
.sortedWith(
compareBy<Triple<EventInstance, Int, Instant>> { it.second }
.thenBy { it.third }
.thenBy { it.first.title }
.thenBy { it.first.instanceId },
)
.map { it.first }
/**
* Where an event starts for ordering: a whole-day event at local midnight of its
* first day, since an all-day one is stored at UTC midnight and would otherwise
* sort around timed events by the device's offset (#296).
*/
internal fun EventInstance.displayStart(zone: TimeZone): Instant =
if (coversWholeDays(zone)) spanFirstDay(zone).atStartOfDayIn(zone) else start
/** Shared order for agenda and split day lists. Grid bars add their lane geometry. */
fun eventDisplayComparator(zone: TimeZone): Comparator<EventInstance> =
compareBy<EventInstance> { it.displayPriority(zone) }
.thenBy { it.start }
.thenBy { it.title }
.thenBy { it.instanceId }
@@ -42,8 +42,6 @@ data class EventForm(
val reminders: List<Int> = emptyList(),
val availability: Availability = Availability.Busy,
val accessLevel: AccessLevel = AccessLevel.Default,
/** Confirmed / Tentative / Cancelled (#388). */
val status: EventStatus = EventStatus.Confirmed,
/**
* Bare RRULE value (`Events.RRULE` convention, no "RRULE:" prefix); null
* means a one-off event. May hold rules the simple picker can't express —
@@ -115,7 +113,6 @@ enum class EventFormField {
Reminders,
Recurrence,
Availability,
Status,
Visibility,
Color,
Attendees,
@@ -181,7 +178,6 @@ fun EventDetail.toEditForm(beginMillis: Long, endMillis: Long, zone: TimeZone):
reminders = reminders.map { it.minutes }.distinct().sorted(),
availability = availability,
accessLevel = accessLevel,
status = status,
rrule = rrule.normalizedRrule(),
// The provider fills EVENT_COLOR from the key, so [color] is the
// swatch either way; a null colour means the event inherits its
@@ -217,7 +213,7 @@ fun EventDetail.toEditForm(beginMillis: Long, endMillis: Long, zone: TimeZone):
* re-deriving with the same occurrence would mask an externally moved
* event. Guests are covered (the form writes editable attendees), so an
* external attendee change now also trips the conflict check. Still not
* covered: the user's own response, reminder methods, the
* covered: status, the user's own response, reminder methods, the
* organizer/resource rows, and a recurring event's duration.
*/
data class EditSnapshot(
@@ -247,22 +243,6 @@ internal fun allDayFormTimes(start: LocalDate, endExclusive: LocalDate?): Pair<F
/** The bare RRULE value the form edits; blank means none. */
internal fun String?.normalizedRrule(): String? = this?.removePrefix("RRULE:")?.takeIf { it.isNotBlank() }
/**
* Whether this form may be saved apart from its series, as one modified
* occurrence or as a split-off "this & following" tail. A cancelled exception
* row is how Android records a deleted occurrence, and Google reads an inserted
* cancelled event as deleted, so either would vanish rather than show struck
* through (#388).
*/
fun EventForm.canSaveApartFromSeries(): Boolean = status != EventStatus.Cancelled
/**
* The status a newly inserted row may carry. Google reads an inserted cancelled
* event as deleted, so every new row (a copy, an import, a calendar move or an
* exception) starts confirmed instead (#388).
*/
fun EventStatus.forNewEvent(): EventStatus = if (this == EventStatus.Cancelled) EventStatus.Confirmed else this
/**
* Whether this form's times mean something else in [target] — a timed event
* pinned to another zone. False when there's nothing to disambiguate: an
@@ -289,7 +269,6 @@ fun EventForm.populatedFields(): Set<EventFormField> = buildSet {
if (reminders.isNotEmpty()) add(EventFormField.Reminders)
if (rrule != null) add(EventFormField.Recurrence)
if (availability != Availability.Busy) add(EventFormField.Availability)
if (status != EventStatus.Confirmed) add(EventFormField.Status)
if (accessLevel != AccessLevel.Default) add(EventFormField.Visibility)
if (colorKey != null || color != null) add(EventFormField.Color)
if (attendees.isNotEmpty()) add(EventFormField.Attendees)
@@ -332,5 +311,4 @@ fun EventDetail.toDuplicateForm(canModify: Boolean, zone: TimeZone): EventForm =
).copy(
rrule = null,
calendarId = instance.calendarId.takeIf { canModify },
status = status.forNewEvent(),
)
@@ -173,11 +173,8 @@ fun EventForm.shiftedByDays(days: Int, deviceZone: TimeZone): EventForm {
return copy(start = movedStart, end = (startAt + span).toFormTime(zone))
}
/**
* The form with new start and end, each in the form's own zone — a resize. An
* all-day event becomes timed: one dragged out of the all-day strip.
*/
/** The form with new start and end, each in the form's own zone — a resize. All-day is untouched. */
fun EventForm.resizedTo(newStart: Instant, newEnd: Instant, deviceZone: TimeZone): EventForm {
val timed = copy(isAllDay = false)
return timed.withTimes(newStart, newEnd, timed.resolvedZone(deviceZone))
if (isAllDay) return this
return withTimes(newStart, newEnd, resolvedZone(deviceZone))
}
@@ -73,8 +73,6 @@ data class EventInstance(
* (#180, #230).
*/
val response: EventResponse = EventResponse.Going,
/** The event's own Confirmed / Tentative / Cancelled (`Events.STATUS`, #388). */
val status: EventStatus = EventStatus.Confirmed,
)
/**
@@ -97,19 +95,8 @@ enum class EventResponse {
Declined,
}
/**
* Struck through on every surface and sorted last: an invitation you declined
* (#180), or an event its organizer cancelled (#388). Neither plans reminders.
*/
val EventInstance.isCrossedOut: Boolean
get() = response == EventResponse.Declined || status == EventStatus.Cancelled
/**
* Drawn as an outline, still undecided: an invitation you have not answered
* (#230), or a tentative event (#388).
*/
val EventInstance.isOutlined: Boolean
get() = !isCrossedOut && (response == EventResponse.Invited || status == EventStatus.Tentative)
/** Shorthand for the declined case, which most surfaces test on its own (#180). */
val EventInstance.isDeclined: Boolean get() = response == EventResponse.Declined
/**
* Whether this event has finished relative to [now] — its end is at or before
@@ -150,20 +137,6 @@ fun EventInstance.spanLastDay(zone: TimeZone): LocalDate {
fun EventInstance.spansMultipleDays(zone: TimeZone): Boolean =
spanFirstDay(zone) != spanLastDay(zone)
/**
* Whether this event fills whole days in [zone], so the grids and lists lay it
* out with the all-day events: an all-day event, or a timed one running from
* local midnight to local midnight (#296). The event itself stays timed.
*/
fun EventInstance.coversWholeDays(zone: TimeZone): Boolean = isAllDay || runsMidnightToMidnight(start, end, zone)
/** Whether a timed span from [start] to [end] runs from local midnight to local midnight in [zone] (#296). */
fun runsMidnightToMidnight(start: Instant, end: Instant, zone: TimeZone): Boolean =
end > start && start.isStartOfDay(zone) && end.isStartOfDay(zone)
private fun Instant.isStartOfDay(zone: TimeZone): Boolean =
this == toLocalDateTime(zone).date.atStartOfDayIn(zone)
data class EventDetail(
val instance: EventInstance,
val description: String?,
@@ -2,7 +2,6 @@ package de.jeanlucmakiola.calendula.domain.ics
import de.jeanlucmakiola.calendula.domain.EventForm
import de.jeanlucmakiola.calendula.domain.allDayFormTimes
import de.jeanlucmakiola.calendula.domain.forNewEvent
import de.jeanlucmakiola.calendula.domain.normalizedRrule
import de.jeanlucmakiola.calendula.domain.toFormTime
import kotlinx.datetime.TimeZone
@@ -36,7 +35,6 @@ fun ParsedIcsEvent.toEventForm(zone: TimeZone): EventForm {
description = description.orEmpty(),
reminders = semanticReminderMinutes(),
availability = availability,
status = status.forNewEvent(),
rrule = recurrenceRule.normalizedRrule(),
)
}
@@ -32,26 +32,19 @@ data class PlannedReminder(
val minutes: Int,
val alarmMillis: Long,
) {
/** The occurrence this reminder belongs to; it shares one notification with its siblings (#463). */
val occurrenceKey: Long = occurrenceKey(instance.eventId, instance.beginMillis)
/**
* Stable identity of this one reminder, keying the snooze/dismiss
* Stable identity, keying the notification tag and the snooze/dismiss
* `PendingIntent`s. Survives reboot, re-scan and reinstall.
*/
val key: Long = mix64(occurrenceKey + minutes)
}
val key: Long = key(instance.eventId, instance.beginMillis, minutes)
/** Stable identity of one occurrence, shared by every reminder on it. */
fun occurrenceKey(eventId: Long, beginMillis: Long): Long =
mix64(mix64(eventId) + beginMillis)
/** SplitMix64's finaliser: spreads close inputs across all 64 bits. */
private fun mix64(value: Long): Long {
var z = value + -0x61c8864680b583ebL
z = (z xor (z ushr 30)) * -0x40a7b892e31b1a47L
z = (z xor (z ushr 27)) * -0x6b2fb644ecceee15L
return z xor (z ushr 31)
private companion object {
fun key(eventId: Long, beginMillis: Long, minutes: Int): Long {
var h = eventId * 1_000_003L
h = (h xor beginMillis) * 31L
return h + minutes
}
}
}
/** What one scan concluded: post these now, and wake up again at [nextAlarmMillis]. */
@@ -153,8 +146,7 @@ private fun allDayAlarmMillis(
*
* Due means the fire instant falls in `(lastFiredMillis, nowMillis]`, so a scan
* running twice cannot post twice while a late one still catches up. Reminders
* whose event has ended are dropped ([isStillRelevant]), and of several due on
* one occurrence only the latest is kept — they'd replace each other anyway (#463). [nextAlarmMillis] is
* whose event has ended are dropped ([isStillRelevant]). [nextAlarmMillis] is
* capped at [horizonMillis] so the lookahead window keeps rolling forward.
*/
fun scheduleReminders(
@@ -166,8 +158,7 @@ fun scheduleReminders(
val due = planned
.filter { it.alarmMillis in (lastFiredMillis + 1)..nowMillis }
.filter { it.instance.isStillRelevant(nowMillis) }
.groupBy { it.occurrenceKey }
.values.map { siblings -> siblings.maxBy { it.alarmMillis } }
.distinctBy { it.key }
.sortedWith(compareBy({ it.instance.beginMillis }, { it.key }))
val nextPending = planned
.filter { it.alarmMillis > nowMillis }
@@ -485,8 +485,9 @@ fun CalendarHost(
movableCalendarIds = movableCalendarIds,
dragEnabled = dragToReschedule,
move = { reschedule.move(it) },
drops = reschedule.drops,
inFlight = reschedule.inFlight,
undoStarted = reschedule.undoStarted,
abandoned = reschedule.abandoned,
edit = onEditEvent,
)
}
@@ -32,7 +32,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isDeclined
import de.jeanlucmakiola.calendula.ui.common.EventDimAlpha
import de.jeanlucmakiola.calendula.ui.common.ViewMorphKey
import de.jeanlucmakiola.calendula.ui.common.declinedTitle
@@ -59,16 +59,11 @@ import java.util.Locale
// split style can list a day with exactly the same visual language instead of
// growing a parallel set of event rows.
/**
* A day's header; tapping it opens the Day view. [compact] trims the padding for
* the month view's split pane, where vertical space is short (#142).
*/
@Composable
internal fun AgendaDayHeader(
date: LocalDate,
today: LocalDate,
onOpenDay: (LocalDate) -> Unit,
compact: Boolean = false,
) {
Surface(
color = MaterialTheme.colorScheme.surface,
@@ -84,12 +79,7 @@ internal fun AgendaDayHeader(
} else {
MaterialTheme.colorScheme.onSurfaceVariant
},
modifier = Modifier.padding(
start = 28.dp,
end = 28.dp,
top = if (compact) 8.dp else 16.dp,
bottom = if (compact) 4.dp else 8.dp,
),
modifier = Modifier.padding(start = 28.dp, end = 28.dp, top = 16.dp, bottom = 8.dp),
)
}
}
@@ -148,7 +138,7 @@ internal fun AgendaEventRow(
val title = event.title.ifBlank { stringResource(R.string.event_untitled) }
GroupedRow(
modifier = if (dimmed) modifier.alpha(EventDimAlpha) else modifier,
title = declinedTitle(title, event.isCrossedOut),
title = declinedTitle(title, event.isDeclined),
summary = AnnotatedString(agendaTimeSummary(event, day, zone)),
position = position,
minHeight = 64.dp,
@@ -230,11 +220,10 @@ internal fun LazyListScope.agendaDays(
dimmed: (EventInstance, LocalDate) -> Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
compact: Boolean = false,
) {
days.forEach { day ->
stickyHeader(key = "header-${day.date}") {
AgendaDayHeader(date = day.date, today = today, onOpenDay = onOpenDay, compact = compact)
AgendaDayHeader(date = day.date, today = today, onOpenDay = onOpenDay)
}
if (day.events.isEmpty()) {
item(key = "placeholder-${day.date}") {
@@ -262,6 +251,6 @@ internal fun LazyListScope.agendaDays(
)
}
}
item(key = "gap-${day.date}") { Spacer(Modifier.height(if (compact) 4.dp else 8.dp)) }
item(key = "gap-${day.date}") { Spacer(Modifier.height(8.dp)) }
}
}
@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.ui.agenda
import de.jeanlucmakiola.calendula.ui.common.FabClearance
import de.jeanlucmakiola.calendula.ui.common.PublishChrome
import de.jeanlucmakiola.calendula.ui.common.ScreenActions
import de.jeanlucmakiola.calendula.ui.common.ScreenBody
@@ -433,7 +432,7 @@ private fun AgendaList(
modifier = modifier.nestedScroll(loadOnScrollUp),
state = listState,
// Bottom inset clears the FAB stack so the last row stays tappable.
contentPadding = PaddingValues(top = 8.dp, bottom = FabClearance),
contentPadding = PaddingValues(top = 8.dp, bottom = 96.dp),
) {
agendaDays(
days = days,
@@ -1,8 +1,7 @@
package de.jeanlucmakiola.calendula.ui.agenda
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.domain.sortedForDisplay
import de.jeanlucmakiola.calendula.domain.eventDisplayComparator
import de.jeanlucmakiola.calendula.domain.FailureReason
import de.jeanlucmakiola.calendula.domain.spanFirstDay
import de.jeanlucmakiola.calendula.domain.spanLastDay
@@ -19,7 +18,7 @@ import kotlin.time.Instant
* surface only formats the instants into its own locale/24h string.
*/
sealed interface AgendaTimeLabel {
/** An event filling whole days (#296), or a whole in-between day of a multi-day span. */
/** An all-day event, or a whole in-between day of a multi-day span. */
data object AllDay : AgendaTimeLabel
/** The first day of a multi-day timed event: when it begins. */
data class Starts(val start: Instant) : AgendaTimeLabel
@@ -31,7 +30,7 @@ sealed interface AgendaTimeLabel {
/** The [AgendaTimeLabel] for [event] as it appears on [day], resolved in [zone]. */
fun agendaTimeLabel(event: EventInstance, day: LocalDate, zone: TimeZone): AgendaTimeLabel {
if (event.coversWholeDays(zone)) return AgendaTimeLabel.AllDay
if (event.isAllDay) return AgendaTimeLabel.AllDay
val firstDay = event.spanFirstDay(zone)
val lastDay = event.spanLastDay(zone)
return when {
@@ -88,7 +87,7 @@ fun groupAgendaDays(
return byDay.map { (date, dayEvents) ->
AgendaDay(
date = date,
events = dayEvents.sortedForDisplay(zone),
events = dayEvents.sortedWith(eventDisplayComparator(zone)),
)
}
}
@@ -30,9 +30,7 @@ fun CalendarDatePickerDialog(
onDismiss: () -> Unit,
) {
val state = rememberDatePickerState(
initialSelectedDateMillis = initial.coerceIn(CalendarSpan.FIRST_DAY, CalendarSpan.LAST_DAY)
.toEpochDays() * MILLIS_PER_DAY,
yearRange = CalendarSpan.years,
initialSelectedDateMillis = initial.toEpochDays() * MILLIS_PER_DAY,
)
DatePickerDialog(
onDismissRequest = onDismiss,
@@ -38,9 +38,6 @@ import de.jeanlucmakiola.calendula.R
/** The standard FAB's size, shared by the selection bar that unrolls from it (#141). */
val FabSize = 56.dp
/** Bottom inset that lets a scrolling view's last row or hour scroll clear of the FAB. */
val FabClearance = 96.dp
/** What the FAB is while an event is selected (#141): the toggle for its action bar. */
@Stable
class FabSelection(
@@ -1,14 +0,0 @@
package de.jeanlucmakiola.calendula.ui.common
import kotlinx.datetime.LocalDate
/**
* The dates every view can show and every date picker offers. One span for all
* of them, so no view can hand another a date it has no page for (#457).
*/
object CalendarSpan {
val FIRST_DAY: LocalDate = LocalDate(1600, 1, 1)
val LAST_DAY: LocalDate = LocalDate(2399, 12, 31)
val years: IntRange get() = FIRST_DAY.year..LAST_DAY.year
}
@@ -8,9 +8,9 @@ import java.util.Locale
* out in [locale]'s own order, with the year shown only when [date] falls outside
* [currentYear].
*
* Pass [skeleton] *without* a year field, e.g. "LLLL" for a month. A skeleton
* is a field list, so wanting the year is just asking for one more field; the
* locale still decides where it lands ("July 2026" vs "2026年7月").
* Pass [skeleton] *without* a year field — "LLLL" for a month, "EEEdMMM" for a
* day. A skeleton is a field list, so wanting the year is just asking for one
* more field; the locale still decides where it lands ("July 2026" vs "2026年7月").
*
* Dropping the year in the current year is the one bit of policy here: the title
* sits directly above a grid that already says which year it is, and the year's
@@ -11,7 +11,6 @@ import androidx.compose.material.icons.filled.People
import androidx.compose.material.icons.filled.Place
import androidx.compose.material.icons.filled.Public
import androidx.compose.material.icons.filled.Repeat
import androidx.compose.material.icons.filled.TaskAlt
import androidx.compose.ui.graphics.vector.ImageVector
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventFormField
@@ -30,7 +29,6 @@ fun eventFormFieldLabel(field: EventFormField): Int = when (field) {
EventFormField.Reminders -> R.string.event_detail_reminders
EventFormField.Recurrence -> R.string.event_detail_recurrence
EventFormField.Availability -> R.string.event_edit_availability
EventFormField.Status -> R.string.event_edit_status
EventFormField.Visibility -> R.string.event_edit_visibility
EventFormField.Color -> R.string.event_edit_color
EventFormField.Attendees -> R.string.event_edit_attendees
@@ -43,7 +41,6 @@ fun eventFormFieldIcon(field: EventFormField): ImageVector = when (field) {
EventFormField.Reminders -> Icons.Default.Notifications
EventFormField.Recurrence -> Icons.Default.Repeat
EventFormField.Availability -> Icons.Default.EventAvailable
EventFormField.Status -> Icons.Default.TaskAlt
EventFormField.Visibility -> Icons.Default.Lock
EventFormField.Color -> Icons.Default.Palette
EventFormField.Attendees -> Icons.Default.People
@@ -90,11 +90,7 @@ fun EventMoveHost(
MoveOutcome.Undone -> stringResource(R.string.event_move_undone)
MoveOutcome.WriteDenied -> stringResource(R.string.event_move_write_denied)
MoveOutcome.Gone -> stringResource(R.string.event_move_gone)
MoveOutcome.Stale -> stringResource(R.string.event_move_stale)
MoveOutcome.Skipped -> stringResource(R.string.event_move_skipped)
MoveOutcome.QueueFull -> stringResource(R.string.event_move_queue_full)
MoveOutcome.BlockedSeriesEnd -> stringResource(R.string.event_move_blocked_series_end)
MoveOutcome.BlockedCancelledSeries -> stringResource(R.string.event_move_blocked_cancelled_series)
MoveOutcome.Failed -> stringResource(R.string.event_move_failed)
}
@@ -1,15 +1,12 @@
package de.jeanlucmakiola.calendula.ui.common
import androidx.compose.animation.core.animateFloatAsState
import kotlinx.coroutines.delay
import androidx.compose.animation.core.tween
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.res.stringResource
@@ -19,7 +16,6 @@ import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import java.util.concurrent.atomic.AtomicLong
/**
* Drag-to-reschedule wiring (#68), provided once at `CalendarHost` and read by
@@ -41,18 +37,24 @@ class EventMoveScope(
val dragEnabled: Boolean,
/**
* Hand a drop to the writer. Returns nothing on purpose: a drop is answered
* before its write resolves, so [drops] — not a return value — is what tells
* a held copy whether anything landed.
* before its write resolves, so [abandoned] — not a return value — is what
* tells a held copy that nothing landed.
*/
val move: (MoveRequest) -> Unit,
/**
* Each drop's progress by its token — see `RescheduleViewModel.drops`. A flow
* rather than a value so this scope stays the same object across a move —
* every visible block reads it as a composition local.
* True while a dropped event is being written, including the time its scope
* dialog is up. A flow rather than a value so this scope stays the same
* object across a move — every visible block reads it as a composition local.
*/
val drops: StateFlow<DropStates>,
/** The undo write that just began — see `RescheduleViewModel.undoStarted`. */
val undoStarted: StateFlow<UndoStart?>,
val inFlight: StateFlow<Boolean>,
/** Ticks when an undo write begins — see `RescheduleViewModel.undoStarted`. */
val undoStarted: StateFlow<Int>,
/**
* Ticks when a drop ends with nothing landing — see
* `RescheduleViewModel.abandoned`. [move] answers before the write is
* resolved, so this is what tells a held copy to stop waiting.
*/
val abandoned: StateFlow<Int>,
/** Open an event in the edit form — the pointer-free route to the same change. */
val edit: (EventInstance) -> Unit,
) {
@@ -61,42 +63,30 @@ class EventMoveScope(
val LocalEventMove = compositionLocalOf<EventMoveScope?> { null }
private val moveTokens = AtomicLong()
private val NEVER_IN_FLIGHT = MutableStateFlow(false)
/** A fresh identity for one drop or undo, unique for the process. */
fun nextMoveToken(): Long = moveTokens.incrementAndGet()
private val NEVER_UNDONE = MutableStateFlow(0)
/** How many abandoned drops [DropStates] remembers — far more than can be on screen at once. */
private const val ABANDONED_KEPT = 32
/** Per-drop progress, by token — see `RescheduleViewModel.drops`. */
@Immutable
data class DropStates(
val pending: Set<Long> = emptySet(),
val abandoned: Set<Long> = emptySet(),
) {
fun started(token: Long): DropStates = copy(pending = pending + token)
fun ended(token: Long, landed: Boolean): DropStates = copy(
pending = pending - token,
// Insertion-ordered, so the oldest go first.
abandoned = if (landed) abandoned else (abandoned + token).let { kept ->
if (kept.size > ABANDONED_KEPT) kept.drop(kept.size - ABANDONED_KEPT).toSet() else kept
},
)
}
private val NO_DROPS = MutableStateFlow(DropStates())
private val NEVER_UNDONE = MutableStateFlow<UndoStart?>(null)
private val NEVER_ABANDONED = MutableStateFlow(0)
/**
* Every drop's progress — empty wherever moving is off. A drag overlay keeps
* the token of its own drop and holds its copy while that token is pending.
* Whether a dropped event is still being written — false wherever moving is off.
* The drag overlays hold a landed block on its target for this window.
*/
@Composable
fun dropStates(): DropStates {
val flow = LocalEventMove.current?.drops ?: NO_DROPS
fun moveInFlight(): Boolean {
val flow = LocalEventMove.current?.inFlight ?: NEVER_IN_FLIGHT
return flow.collectAsStateWithLifecycle().value
}
/**
* How many drops have ended with nothing landing. Read as a plain count so a
* drag overlay can capture it at the moment of the drop and tell, later, whether
* *its own* drop was one of them.
*/
@Composable
fun abandonedMoves(): Int {
val flow = LocalEventMove.current?.abandoned ?: NEVER_ABANDONED
return flow.collectAsStateWithLifecycle().value
}
@@ -105,53 +95,17 @@ fun dropStates(): DropStates {
* this composable came on screen.
*/
@Composable
fun OnUndoStarted(onUndo: (UndoStart) -> Unit) {
fun OnUndoStarted(onUndo: () -> Unit) {
val flow = LocalEventMove.current?.undoStarted ?: NEVER_UNDONE
val start by flow.collectAsStateWithLifecycle()
var seen by remember { mutableStateOf(start) }
LaunchedEffect(start) {
val started = start
if (started == null || started == seen) return@LaunchedEffect
seen = started
onUndo(started)
val tick by flow.collectAsStateWithLifecycle()
var seen by remember { mutableIntStateOf(tick) }
LaunchedEffect(tick) {
if (tick == seen) return@LaunchedEffect
seen = tick
onUndo()
}
}
/**
* The life of a drop parked by a newer pickup (#494): held while its [token]
* is pending, then a beat after the grid [seated] it — or [timeoutMillis] if it
* never does — handed over and faded, then released. Returns the copy's alpha.
* An abandoned drop skips the wait; nothing is coming to seat it.
*/
@Composable
fun rememberHeldSettle(
token: Long,
seated: Boolean,
timeoutMillis: Long,
onHandOver: () -> Unit,
onRelease: () -> Unit,
): Float {
val drops = dropStates()
val pending = token in drops.pending
val abandoned = token in drops.abandoned
val handOver by rememberUpdatedState(onHandOver)
val release by rememberUpdatedState(onRelease)
var fading by remember(token) { mutableStateOf(false) }
LaunchedEffect(token, pending, abandoned, seated) {
if (pending) return@LaunchedEffect
if (!abandoned) delay(if (seated) SETTLE_GRACE_MILLIS else timeoutMillis)
fading = true
handOver()
delay(SETTLE_FADE_MILLIS.toLong())
release()
}
return animateFloatAsState(
targetValue = if (fading) 0f else 1f,
animationSpec = tween(SETTLE_FADE_MILLIS),
label = "held-settle",
).value
}
/** Opacity the source block keeps while its floating copy travels. */
const val GHOST_ALPHA: Float = 0.3f
@@ -21,8 +21,8 @@ import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isOutlined
import de.jeanlucmakiola.calendula.domain.EventResponse
import de.jeanlucmakiola.calendula.domain.isDeclined
/** Stroke an invitation you have not answered is outlined with. */
val EVENT_OUTLINE_WIDTH = 1.dp
@@ -60,13 +60,13 @@ fun timedBlockCuts(continuesBefore: Boolean, continuesAfter: Boolean): ChipCuts
/**
* How one event's chip or block is painted, which turns on your answer to its
* invitation (#180, #230) and on the event's own status (#388).
* invitation (#180, #230).
*
* An invitation you have not answered, or a tentative event, is drawn as an
* outline: its calendar's colour on the border and on the title, over the
* surface the chip sits on. So it holds a chip's shape and a chip's weight
* without claiming the filled container an event you are going to gets. A
* declined or cancelled one keeps the fill and its strike-through.
* An invitation you have not answered is drawn as an outline: its calendar's
* colour on the border and on the title, over the surface the chip sits on. So
* it holds a chip's shape and a chip's weight without claiming the filled
* container an event you are going to gets. A declined one keeps the fill and
* its strike-through.
*/
@Immutable
data class EventPaint(
@@ -87,7 +87,7 @@ data class EventPaint(
@Composable
fun eventPaint(event: EventInstance, dark: Boolean): EventPaint {
val soften = LocalSoftenColors.current
if (event.isOutlined) {
if (event.response == EventResponse.Invited) {
// Harmonised even when the setting is off. Raw mode exists so a filled
// container matches what the sync source paints, and an outlined chip
// has no container — what it has is coloured *text*, which needs the
@@ -117,7 +117,7 @@ fun eventPaint(event: EventInstance, dark: Boolean): EventPaint {
outline = null,
titleInk = eventInk(fill, alpha = TITLE_INK_ALPHA),
secondaryInk = eventInk(fill, alpha = SECONDARY_INK_ALPHA),
decoration = declinedDecoration(event.isCrossedOut),
decoration = declinedDecoration(event.isDeclined),
titleWeight = null,
)
}
@@ -3,12 +3,15 @@ package de.jeanlucmakiola.calendula.ui.common
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.sp
import de.jeanlucmakiola.floret.locale.currentLocale
@@ -42,17 +45,33 @@ fun inlineTimeLabel(time: String?, title: String, timeInk: Color): AnnotatedStri
append(title)
}
/**
* The characters of title that have to survive a time prefix for it to be worth
* its place — lowercase Latin of average advance, priced at the surface's own
* text style rather than guessed in dp.
*/
private const val TITLE_SAMPLE = "notepad"
/** The widest wall-clock time in either convention: two-digit hour, and a meridiem in 12-hour. */
private const val SAMPLE_HOUR = 12
private const val SAMPLE_MINUTE = 45
/**
* The widest time the current convention writes, for pricing a time prefix by
* measurement: it follows the 12/24-hour setting and the locale's own format.
* The narrowest run of [style] text that may carry a time in front of a title:
* wide enough for the widest time in the current convention plus [TITLE_SAMPLE].
*
* Measured rather than a device breakpoint, so it follows the font scale, the
* 12/24-hour setting, the locale's own time format and whatever else has
* already been taken off the width.
*/
@Composable
fun rememberWidestTimeSample(): String {
fun rememberInlineTimeWidth(style: TextStyle): Dp {
val measurer = rememberTextMeasurer()
val density = LocalDensity.current
val locale = currentLocale()
val is24Hour = LocalUse24HourFormat.current
return remember(is24Hour, locale) { formatTimeOfDay(SAMPLE_HOUR, SAMPLE_MINUTE, is24Hour, locale) }
val sample = formatTimeOfDay(SAMPLE_HOUR, SAMPLE_MINUTE, LocalUse24HourFormat.current, locale)
return remember(sample, style, density, measurer) {
val label = inlineTimeLabel(sample, TITLE_SAMPLE, Color.Unspecified)
with(density) { measurer.measure(label, style).size.width.toDp() }
}
}
@@ -56,8 +56,7 @@ private const val DIMMED_HOUR_ALPHA = 0.3f
* The timeline's hour gutter. Scrolls in sync with the day columns through the
* shared [scrollState], and while [dragController] holds a lifted block it dims
* the hour labels and floats a badge with the drag's current start time at the
* row the block would land on. Its content ends in the same [FabClearance]
* the day columns do, or the two drift apart at the bottom of the scroll.
* row the block would land on.
*/
@Composable
fun HourGutter(
@@ -87,8 +86,7 @@ fun HourGutter(
.width(GUTTER_WIDTH)
.padding(start = GUTTER_CONTENT_START_INSET)
.fillMaxHeight()
.verticalScroll(scrollState)
.padding(bottom = FabClearance),
.verticalScroll(scrollState),
) {
Column {
(0 until 24).forEach { h ->
@@ -70,24 +70,27 @@ data class OutOfViewEvents(val above: TimedBlock?, val below: TimedBlock?) {
/** Which edge of the viewport a hidden event sits past. */
enum class ViewportEdge { Top, Bottom }
/** Where [block]'s rendered bottom lands, in minutes — short blocks keep a floor. */
internal fun renderedEndMin(block: TimedBlock): Float =
maxOf(block.endMin.toFloat(), block.startMin + MIN_EVENT_FRACTION * 60f)
/**
* The blocks of one column lying out of a viewport spanning [topMin]..[bottomMin]
* (minutes of the day), nearest first. A block leaves this set as soon as any
* part of its [renderedSpan] enters the viewport.
* part of its rendered height enters the viewport.
*/
fun outOfViewEvents(
blocks: List<TimedBlock>,
topMin: Float,
bottomMin: Float,
): OutOfViewEvents {
val spans = blocks.map { it to it.renderedSpan() }
val above = spans
.filter { (_, span) -> span.bottomMin <= topMin }
.maxWithOrNull(compareBy({ it.second.bottomMin }, { it.first.startMin }))
val below = spans
.filter { (_, span) -> span.topMin >= bottomMin }
.minWithOrNull(compareBy({ it.second.topMin }, { -it.second.bottomMin }))
return OutOfViewEvents(above?.first, below?.first)
val above = blocks
.filter { renderedEndMin(it) <= topMin }
.maxWithOrNull(compareBy<TimedBlock>({ renderedEndMin(it) }, { it.startMin }))
val below = blocks
.filter { it.startMin >= bottomMin }
.minWithOrNull(compareBy<TimedBlock>({ it.startMin }, { -renderedEndMin(it) }))
return OutOfViewEvents(above, below)
}
/**
@@ -104,9 +107,8 @@ fun revealScrollTarget(
marginPx: Float,
maxScroll: Int,
): Int {
val span = block.renderedSpan()
val startPx = span.topMin / 60f * hourPx
val endPx = span.bottomMin / 60f * hourPx
val startPx = block.startMin / 60f * hourPx
val endPx = renderedEndMin(block) / 60f * hourPx
val target = when (edge) {
ViewportEdge.Top -> startPx - marginPx
ViewportEdge.Bottom -> minOf(endPx + marginPx - viewportPx, startPx - marginPx)
@@ -291,7 +293,6 @@ private fun EdgeBar(
modifier: Modifier = Modifier,
) {
block ?: return
val span = remember(block) { block.renderedSpan() }
val color = eventFill(block.event.color, dark, LocalSoftenColors.current)
val label = stringResource(
if (edge == ViewportEdge.Top) R.string.timeline_earlier_events else R.string.timeline_later_events,
@@ -302,8 +303,8 @@ private fun EdgeBar(
.height(EDGE_TOUCH_HEIGHT)
.graphicsLayer {
val gapPx = when (edge) {
ViewportEdge.Top -> scrollState.value - span.bottomMin / 60f * hourPx
ViewportEdge.Bottom -> span.topMin / 60f * hourPx -
ViewportEdge.Top -> scrollState.value - renderedEndMin(block) / 60f * hourPx
ViewportEdge.Bottom -> block.startMin / 60f * hourPx -
(scrollState.value + scrollState.viewportSize)
}
alpha = edgeBarAlpha(gapPx, fadeLeadPx)
@@ -1,26 +1,22 @@
package de.jeanlucmakiola.calendula.ui.common
import de.jeanlucmakiola.floret.android.stateWhileSubscribed
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalForInheritanceCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.plus
/**
* One shared state per pager page — a week, a day, a month — so a page and the
* screen's anchor read the same query, and the pages either side stay loaded
* across a swipe.
*
* An entry queries only while something collects it, stopping [STOP_TIMEOUT_MILLIS]
* after the last collector leaves, and starts again when one comes back. Letting
* an entry go only forgets it: a page still holding it keeps a working state
* however far the pager composes or prefetches, and however long the screen sat
* stopped (#440, #454). A forgotten entry nobody collects holds no coroutine, so
* paging through a year doesn't keep a year of queries around. Main thread only.
* Every entry shares on its own job, cancelled when [keep] lets it go: a
* `stateIn` on the ViewModel's scope would stay running, holding its last state,
* until the ViewModel itself was cleared. Main thread only.
*
* @param keep whether a cached key is still worth holding once [get] asks for another.
*/
@@ -30,54 +26,28 @@ class PageStateCache<K, S>(
private val keep: (cached: K, requested: K) -> Boolean,
private val load: (K) -> Flow<S>,
) {
private val entries = HashMap<K, Entry>()
private class Entry<S>(val state: StateFlow<S>, val job: Job)
private val entries = HashMap<K, Entry<S>>()
/** The number of entries held, for tests. */
internal val size: Int get() = entries.size
fun get(key: K): StateFlow<S> {
// One still collected stays, so the anchor asking for it again shares its query.
entries.entries.removeAll { (cached, entry) ->
cached != key && !keep(cached, key) && !entry.isCollected
}
return entries.getOrPut(key) { Entry(key) }
}
@OptIn(ExperimentalForInheritanceCoroutinesApi::class)
private inner class Entry(private val key: K) : StateFlow<S> {
private val state = MutableStateFlow(initial)
private var collectors = 0
private var loading: Job? = null
private var stopping: Job? = null
val isCollected: Boolean get() = collectors > 0
override val value: S get() = state.value
override val replayCache: List<S> get() = state.replayCache
override suspend fun collect(collector: FlowCollector<S>): Nothing {
collectors++
stopping?.cancel()
stopping = null
if (loading?.isActive != true) {
loading = scope.launch { load(key).collect { state.value = it } }
}
try {
state.collect(collector)
} finally {
if (--collectors == 0) {
stopping = scope.launch {
delay(STOP_TIMEOUT_MILLIS)
loading?.cancel()
loading = null
}
}
val iterator = entries.iterator()
while (iterator.hasNext()) {
val (cached, entry) = iterator.next()
if (cached != key && !keep(cached, key)) {
entry.job.cancel()
iterator.remove()
}
}
}
private companion object {
/** Long enough to ride out a configuration change, as `stateWhileSubscribed` does. */
const val STOP_TIMEOUT_MILLIS = 5_000L
return entries.getOrPut(key) {
val job = SupervisorJob(scope.coroutineContext[Job])
Entry(
state = load(key).stateWhileSubscribed(scope + job, initial),
job = job,
)
}.state
}
}
@@ -41,19 +41,19 @@ const val EventDimAlpha = 0.4f
* is still something the organiser expects you at. Null for everything else, so
* it drops straight into a `Text`'s `textDecoration`.
*/
fun declinedDecoration(isCrossedOut: Boolean): TextDecoration? =
if (isCrossedOut) TextDecoration.LineThrough else null
fun declinedDecoration(isDeclined: Boolean): TextDecoration? =
if (isDeclined) TextDecoration.LineThrough else null
/** [declinedDecoration] for the rows that take styled text rather than a `String`. */
fun declinedTitle(title: String, isCrossedOut: Boolean): AnnotatedString = if (isCrossedOut) {
fun declinedTitle(title: String, isDeclined: Boolean): AnnotatedString = if (isDeclined) {
AnnotatedString(title, SpanStyle(textDecoration = TextDecoration.LineThrough))
} else {
AnnotatedString(title)
}
/** [declinedTitle] over already-styled text, e.g. a search hit's marked runs. */
fun declinedTitle(title: AnnotatedString, isCrossedOut: Boolean): AnnotatedString =
if (!isCrossedOut) {
fun declinedTitle(title: AnnotatedString, isDeclined: Boolean): AnnotatedString =
if (!isDeclined) {
title
} else {
buildAnnotatedString {
@@ -6,7 +6,6 @@ import dagger.hilt.android.lifecycle.HiltViewModel
import de.jeanlucmakiola.calendula.data.time.ZoneSource
import de.jeanlucmakiola.calendula.data.calendar.CalendarRepository
import de.jeanlucmakiola.calendula.data.calendar.NoSuchEventException
import de.jeanlucmakiola.calendula.domain.canSaveApartFromSeries
import de.jeanlucmakiola.calendula.domain.EventDetail
import de.jeanlucmakiola.calendula.domain.EventForm
import de.jeanlucmakiola.calendula.domain.EventFormProblem
@@ -32,7 +31,6 @@ import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.LocalDate
@@ -41,21 +39,12 @@ import kotlinx.datetime.atStartOfDayIn
import kotlinx.datetime.plus
import kotlinx.datetime.toLocalDateTime
import kotlin.coroutines.cancellation.CancellationException
import kotlin.time.Duration.Companion.seconds
import kotlin.time.Instant
import kotlin.time.TimeMark
import kotlin.time.TimeSource
import javax.inject.Inject
private const val MILLIS_PER_MINUTE = 60_000
private const val MINUTES_PER_DAY = 24 * 60
/** How many drops may wait behind the one in flight before more are refused. */
private const val MAX_QUEUED = 8
/** How long after a write its event's drawn times may still be the old ones. */
private val RECENT_WRITE = 3.seconds
/** Where a dragged event should land. */
sealed interface MoveTarget {
/** A new start instant — a timeline drag, which moves time and day at once. */
@@ -68,10 +57,7 @@ sealed interface MoveTarget {
*/
data class ByDays(val days: Int) : MoveTarget
/**
* New start and end instants — a timeline resize, which changes the length,
* or an all-day event dragged into the time grid, which becomes timed.
*/
/** New start and end instants — a timeline resize, which changes the length. */
data class Span(val start: Instant, val end: Instant) : MoveTarget
}
@@ -84,10 +70,6 @@ data class MoveRequest(
val beginMillis: Long,
val endMillis: Long,
val target: MoveTarget,
/** Whether the dragged occurrence is all-day, which decides the zone its day is read in. */
val isAllDay: Boolean,
/** The drop's own identity, from [nextMoveToken], which the view holding its copy waits on. */
val token: Long,
)
/**
@@ -106,13 +88,8 @@ data class MoveUndo(
val moved: EventForm,
/** The form as it stood before the move. */
val restored: EventForm,
/** The token of the drop this undoes, so the view that drew it carries the right chip back. */
val dropToken: Long,
)
/** An undo write that just began: its own [token], and the [dropToken] of the drop it undoes. */
data class UndoStart(val token: Long, val dropToken: Long)
sealed interface MoveOutcome {
/**
* Written. [startMillis] is where the dragged occurrence now begins, for the
@@ -134,28 +111,9 @@ sealed interface MoveOutcome {
/** The event vanished (sync, another device) between the read and the write. */
data object Gone : MoveOutcome
/** Drops that waited behind a scope dialog, cancelled rather than run after it (#494). */
data object Skipped : MoveOutcome
/** More drops waiting than the queue holds; this one was not taken. */
data object QueueFull : MoveOutcome
/**
* The drop's recurring occurrence may no longer be where it was picked up —
* its series was just written — and can't be followed there, so it is not
* written (#494).
*/
data object Stale : MoveOutcome
/** The drop would push the series past its own `UNTIL`, generating nothing. */
data object BlockedSeriesEnd : MoveOutcome
/**
* A cancelled series only moves as a whole, and this drop would change which
* days it falls on (#388).
*/
data object BlockedCancelledSeries : MoveOutcome
data object Failed : MoveOutcome
}
@@ -184,32 +142,36 @@ class RescheduleViewModel @Inject constructor(
private val _inFlight = MutableStateFlow(false)
/** True while any drop or undo runs or waits — what the confirmation chip holds for. */
/**
* True from the moment a drop is accepted until its write settles — the
* window the dropped block holds its landing position for.
*/
val inFlight: StateFlow<Boolean> = _inFlight.asStateFlow()
private val _drops = MutableStateFlow(DropStates())
private val _abandoned = MutableStateFlow(0)
/**
* Each drop's own state, by its [MoveRequest.token]: pending from the moment
* it is accepted until its write settles, and abandoned once it ends with
* nothing on the target day — refused, failed, or its scope dialog dismissed.
* Per drop, so a queued drop's held copy waits on its own write and is never
* let go by another drop's failure (#253, #494).
* Ticks when a drop ends with nothing on the target day: refused outright,
* refused before the write, written and failed, or its scope dialog
* dismissed. [move] answers before any of that is known, so without this
* signal the view that drew the drop held its copy out for the full settle
* timeout waiting for a grid that was never going to draw it (#253).
*/
val drops: StateFlow<DropStates> = _drops.asStateFlow()
val abandoned: StateFlow<Int> = _abandoned.asStateFlow()
private val _undoStarted = MutableStateFlow<UndoStart?>(null)
private val _undoStarted = MutableStateFlow(0)
/**
* An undo write the moment it begins, before the provider has anything to
* Ticks the moment an undo write begins, before the provider has anything to
* re-read, so the view that drew the drop can carry its chip back rather than
* let it reappear on the old day. Its fate then reads off [drops].
* let it reappear on the old day.
*/
val undoStarted: StateFlow<UndoStart?> = _undoStarted.asStateFlow()
val undoStarted: StateFlow<Int> = _undoStarted.asStateFlow()
/**
* Set while a drop is being prepared, waits on its scope dialog, or is
* written. Drops arriving in that window wait in [queue] and run in order.
* Set from the moment a drop is accepted until its write settles. Two drops
* of the same recurring event inside that window would compute their shift
* from the same pre-move occurrence, and the shifts would compound.
*/
private var busy = false
set(value) {
@@ -217,22 +179,6 @@ class RescheduleViewModel @Inject constructor(
_inFlight.value = value
}
/** Whether a move has been announced since the pipeline was last idle — see [report]. */
private var movedThisRun = false
/** Outcomes waiting for the chip, shown one after another as each is consumed. */
private val notices = ArrayDeque<MoveOutcome>()
/**
* When each event's series (by id) or single occurrence (by id and begin)
* was last written. The grid draws the old times until it re-reads, so a
* drop on a recurring event written moments ago may carry stale times (#494).
*/
private val written = mutableMapOf<Pair<Long, Long?>, TimeMark>()
/** Drops that arrived while another was in flight, oldest first (#494). */
private val queue = ArrayDeque<MoveRequest>()
/**
* The calendars whose events may be dragged. Nothing below the UI guards
* this, so a block outside this set registers no drag gesture at all.
@@ -257,63 +203,43 @@ class RescheduleViewModel @Inject constructor(
val canRealign: Boolean,
/** The series row's DTSTART date after the move — what its `UNTIL` must clear. */
val newAnchorDate: LocalDate,
) {
/** A timed event's new length, rather than an all-day one dragged into the grid. */
val isResize: Boolean get() = request.target is MoveTarget.Span && !original.isAllDay
}
)
/**
* Take a drop: run it now, or queue it behind the ones in flight. False means
* nothing will be written — the queue is full — and the drop is marked
* abandoned in [drops], so its held copy is let go by the one signal rather
* than by every caller remembering to.
* Take a drop, unless one is already being written. False means nothing will
* be written; [abandoned] ticks for that refusal too, so a held copy is let
* go by the one signal rather than by every caller remembering to.
*
* The Boolean is diagnostic — the tests read it, [EventMoveScope] does not
* hand it on. It answers before the write is resolved anyway.
* hand it on. A caller that gated on it would be back to releasing its copy
* from two places, and it answers before the write is resolved anyway.
*/
fun move(request: MoveRequest): Boolean {
if (queue.size >= MAX_QUEUED) {
_drops.update { it.ended(request.token, landed = false) }
report(MoveOutcome.QueueFull)
if (busy || _scopePrompt.value != null) {
_abandoned.value += 1
return false
}
if (_scopePrompt.value != null) {
_drops.update { it.ended(request.token, landed = false) }
report(MoveOutcome.Skipped)
return false
}
_drops.update { it.started(request.token) }
if (busy) queue.addLast(request) else run(request)
return true
}
private fun run(request: MoveRequest) {
busy = true
viewModelScope.launch {
val prepared = prepare(request)
if (prepared == null) {
settle(request.token, landed = false)
_abandoned.value += 1
busy = false
return@launch
}
// A cancelled series only moves as a whole (#388).
val seriesOnly = !prepared.original.canSaveApartFromSeries()
if (!prepared.isRecurring || (seriesOnly && prepared.canRealign)) {
settle(request.token, write(prepared, RecurringWriteScope.AllEvents))
} else if (seriesOnly) {
report(MoveOutcome.BlockedCancelledSeries)
settle(request.token, landed = false)
if (!prepared.isRecurring) {
write(prepared, RecurringWriteScope.AllEvents)
busy = false
} else {
// Still busy: the scope dialog is now the thing in flight. Drops
// waiting behind it are cancelled, not held behind a question
// about another event.
skipQueued()
// Still busy: the scope dialog is now the thing in flight.
pending = prepared
_scopePrompt.value = MoveScopePrompt(
occurrenceOnly = !prepared.canRealign,
resize = prepared.isResize,
resize = request.target is MoveTarget.Span,
)
}
}
return true
}
/** Answer the scope dialog. */
@@ -324,92 +250,35 @@ class RescheduleViewModel @Inject constructor(
pending = null
_scopePrompt.value = null
viewModelScope.launch {
settle(prepared.request.token, write(prepared, scope))
write(prepared, scope)
busy = false
}
}
/** Dismiss the scope dialog without writing. */
fun cancelScope() {
val prepared = pending ?: return
pending = null
busy = false
_scopePrompt.value = null
settle(prepared.request.token, landed = false)
}
/** End the drop [token], then run the next queued one, if any. */
private fun settle(token: Long, landed: Boolean) {
_drops.update { it.ended(token, landed) }
// Straight on to the next, so busy never reads false between two drops.
val next = queue.removeFirstOrNull()
if (next != null) {
run(next)
} else {
busy = false
movedThisRun = false
}
}
private fun skipQueued() {
if (queue.isEmpty()) return
val skipped = queue.map { it.token }
queue.clear()
_drops.update { states -> skipped.fold(states) { acc, token -> acc.ended(token, landed = false) } }
report(MoveOutcome.Skipped)
}
/**
* Queue [outcome] for the chip. While drops run back to back only the first
* move is announced, so its Undo stays on offer; every failure gets its own
* turn after it, since the grid shows what moved but only the chip says what
* didn't. A later write to the announced move's event takes that Undo away,
* as putting the event back would undo the later move too.
*/
private fun report(outcome: MoveOutcome, eventId: Long? = null) {
if (outcome is MoveOutcome.Moved) {
if (movedThisRun) {
dropUndoFor(eventId)
return
}
movedThisRun = true
} else if (outcome == (notices.lastOrNull() ?: _outcome.value)) {
return
}
if (_outcome.value == null) _outcome.value = outcome else notices.addLast(outcome)
}
private fun dropUndoFor(eventId: Long?) {
fun MoveOutcome.withoutUndo(): MoveOutcome =
if (this is MoveOutcome.Moved && undo?.eventId == eventId) copy(undo = null) else this
_outcome.value = _outcome.value?.withoutUndo()
val rest = notices.map { it.withoutUndo() }
notices.clear()
notices.addAll(rest)
}
private fun markWritten(eventId: Long, beginMillis: Long?) {
written[eventId to beginMillis] = TimeSource.Monotonic.markNow()
}
private fun writtenRecently(eventId: Long, beginMillis: Long): Boolean {
written.entries.removeAll { it.value.elapsedNow() > RECENT_WRITE }
return (eventId to null) in written || (eventId to beginMillis) in written
_abandoned.value += 1
}
/**
* Put a completed move back where it came from. The outcome stands until the
* inverse write reports back, so the one chip changes what it says rather
* than closing and reopening. False when another write is already running —
* the chip hides its action for that window, so this is the backstop. An
* undo is a journey of its own: [undoStarted] names its token, and [drops]
* reports whether it landed.
* the chip hides its action for that window, so this is the backstop.
*
* [abandoned] ticks once an inverse that *started* fails to land: [undoStarted]
* has sent the chip back on its journey by then and nothing else will seat it.
* A refusal ticks nothing — it launched no journey of its own, and the counter
* is global, so a tick here would release some other drop's held copy before
* the grid has drawn it.
*/
fun undo(undo: MoveUndo): Boolean {
if (busy) return false
val token = nextMoveToken()
_drops.update { it.started(token) }
busy = true
_undoStarted.value = UndoStart(token, undo.dropToken)
markWritten(undo.eventId, null)
_undoStarted.value += 1
viewModelScope.launch {
_outcome.value = try {
repository.updateEvent(undo.eventId, undo.moved, undo.restored)
@@ -423,40 +292,33 @@ class RescheduleViewModel @Inject constructor(
} catch (e: Exception) {
MoveOutcome.Failed
}
settle(token, landed = _outcome.value is MoveOutcome.Undone)
// Read off the outcome, the way [write] does — no second copy of the
// same fact to drift from it.
if (_outcome.value !is MoveOutcome.Undone) _abandoned.value += 1
busy = false
}
return true
}
/** Clear the outcome once the screen has shown it, bringing on the next one waiting. */
/** Clear the outcome once the screen has shown it. */
fun consumeOutcome() {
_outcome.value = notices.removeFirstOrNull()
_outcome.value = null
}
private suspend fun prepare(dropped: MoveRequest): PreparedMove? {
val zone = zoneSource.current()
private suspend fun prepare(request: MoveRequest): PreparedMove? {
val detail = try {
repository.eventDetail(dropped.eventId)
repository.eventDetail(request.eventId)
} catch (e: CancellationException) {
throw e
} catch (e: NoSuchEventException) {
report(MoveOutcome.Gone)
_outcome.value = MoveOutcome.Gone
return null
} catch (e: Exception) {
report(MoveOutcome.Failed)
_outcome.value = MoveOutcome.Failed
return null
}
// The drop carries the times the grid drew, which an earlier write may
// have moved on since (#494).
val request = if (detail.rrule == null || detail.isException) {
followed(dropped, detail, zone)
} else if (writtenRecently(dropped.eventId, dropped.beginMillis)) {
report(MoveOutcome.Stale)
return null
} else {
dropped
}
val zone = zoneSource.current()
val original = detail.toEditForm(request.beginMillis, request.endMillis, zone)
val shifted = when (val target = request.target) {
is MoveTarget.Start -> original.shiftedTo(target.instant, zone)
@@ -469,7 +331,7 @@ class RescheduleViewModel @Inject constructor(
// The UNTIL check is deferred to the write, which knows how far the move
// reaches and so which date has to clear it.
if ((shifted.problems(zone) - EventFormProblem.RecurrenceEndsBeforeStart).isNotEmpty()) {
report(MoveOutcome.Failed)
_outcome.value = MoveOutcome.Failed
return null
}
@@ -514,14 +376,14 @@ class RescheduleViewModel @Inject constructor(
)
}
/** Write [prepared] in [scope]; true when it landed. */
private suspend fun write(prepared: PreparedMove, scope: RecurringWriteScope): Boolean {
private suspend fun write(prepared: PreparedMove, scope: RecurringWriteScope) {
val request = prepared.request
if (endsBeforeItStarts(prepared, scope)) {
report(MoveOutcome.BlockedSeriesEnd)
return false
_outcome.value = MoveOutcome.BlockedSeriesEnd
_abandoned.value += 1
return
}
val outcome = try {
_outcome.value = try {
when {
!prepared.isRecurring || scope == RecurringWriteScope.AllEvents ->
repository.updateEvent(request.eventId, prepared.original, prepared.updated)
@@ -556,37 +418,9 @@ class RescheduleViewModel @Inject constructor(
} catch (e: Exception) {
MoveOutcome.Failed
}
if (outcome is MoveOutcome.Moved) {
markWritten(request.eventId, request.beginMillis.takeIf { scope == RecurringWriteScope.ThisEvent && prepared.isRecurring })
}
report(outcome, request.eventId)
return outcome is MoveOutcome.Moved
}
/**
* A one-off [dropped] rebased onto where its event now is, so the last drop
* wins: absolute targets stand as they are, and a whole-day shift is re-aimed
* at the day it was dropped on. Unchanged when the event hasn't moved.
*/
private fun followed(dropped: MoveRequest, detail: EventDetail, zone: TimeZone): MoveRequest {
val now = detail.instance
val target = when (val target = dropped.target) {
is MoveTarget.ByDays -> {
// Each day read the way its own kind anchors it: all-day at UTC.
val aimed = Instant.fromEpochMilliseconds(dropped.beginMillis)
.toLocalDateTime(if (dropped.isAllDay) TimeZone.UTC else zone).date
.plus(target.days, DateTimeUnit.DAY)
val from = now.start.toLocalDateTime(if (now.isAllDay) TimeZone.UTC else zone).date
MoveTarget.ByDays((aimed.toEpochDays() - from.toEpochDays()).toInt())
}
else -> target
}
return dropped.copy(
beginMillis = now.start.toEpochMilliseconds(),
endMillis = now.end.toEpochMilliseconds(),
target = target,
isAllDay = now.isAllDay,
)
// Nothing landed, so the copy the view is holding has nothing to fade
// into — let it go now rather than at the end of the settle timeout.
if (_outcome.value !is MoveOutcome.Moved) _abandoned.value += 1
}
/**
@@ -625,9 +459,9 @@ class RescheduleViewModel @Inject constructor(
val anchorZone = if (original.isAllDay) TimeZone.UTC else original.resolvedZone(zone)
val anchorMinute = detail.instance.start.toLocalDateTime(anchorZone)
.time.toMillisecondOfDay() / MILLIS_PER_MINUTE
// An all-day form's time is a placeholder; its anchor sits at midnight.
val fromMillis = if (original.isAllDay) 0 else original.start.time.toMillisecondOfDay()
val delta = (shifted.start.time.toMillisecondOfDay() - fromMillis) / MILLIS_PER_MINUTE
val delta = (
shifted.start.time.toMillisecondOfDay() - original.start.time.toMillisecondOfDay()
) / MILLIS_PER_MINUTE
return anchorMinute + delta in 0 until MINUTES_PER_DAY
}
@@ -653,7 +487,6 @@ class RescheduleViewModel @Inject constructor(
eventId = prepared.request.eventId,
moved = prepared.updated,
restored = prepared.original,
dropToken = prepared.request.token,
)
} else {
null
@@ -661,7 +494,7 @@ class RescheduleViewModel @Inject constructor(
/** Where a resized occurrence now ends; null for a move, which keeps its length. */
private fun resizedEndMillis(prepared: PreparedMove): Long? {
if (!prepared.isResize) return null
if (prepared.request.target !is MoveTarget.Span) return null
val form = prepared.updated
return form.endInstant(form.resolvedZone(zoneSource.current())).toEpochMilliseconds()
}
@@ -20,7 +20,6 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.Stable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
@@ -61,6 +60,7 @@ import de.jeanlucmakiola.floret.identity.LocalFloretDarkTheme
import de.jeanlucmakiola.floret.identity.rememberReduceMotion
import de.jeanlucmakiola.floret.locale.currentLocale
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.StateFlow
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.LocalDate
import kotlinx.datetime.atStartOfDayIn
@@ -78,9 +78,6 @@ import kotlin.time.Instant
/** Start granularity a dragged block snaps to, matching the big calendar apps. */
const val DRAG_SNAP_MINUTES: Int = 15
/** How far below a strip drag's timed block top the finger holds it, in minutes. */
private const val STRIP_GRAB_MINUTES = 15
/** How close to a timeline edge the finger must get before the view scrolls. */
private val AUTO_SCROLL_EDGE = 64.dp
@@ -129,29 +126,6 @@ data class TimelineDrag(
val slot: Triple<LocalDate, Int, Int> get() = Triple(date, startMin, eventSpanMin)
}
/**
* An event lifted off the all-day strip: held over the strip it moves [dayShift]
* days and stays whole-day, held over the time grid it becomes a timed block.
*/
data class StripDrag(val event: EventInstance, val dayShift: Int = 0, val overGrid: Boolean = false)
/** Where a strip drag asks its event to go. */
sealed interface StripDrop {
val event: EventInstance
/** The drop's identity, which its held copy waits on. */
val token: Long
data class Days(override val event: EventInstance, val days: Int, override val token: Long) : StripDrop
data class Timed(
override val event: EventInstance,
val start: Instant,
val end: Instant,
override val token: Long,
) : StripDrop
}
/** The event a long press left selected (#141). */
data class TimelineSelection(
val event: EventInstance,
@@ -275,10 +249,9 @@ internal fun dragPieceBounds(
): DragPieceBounds {
val top = if (slice.continuesBefore) 0f else insetPx
val bottom = if (slice.continuesAfter) 0f else insetPx
val span = renderedSpan(slice.startMin, slice.startMin + slice.spanMin, slice.continuesAfter)
val full = (span.bottomMin - span.topMin) / 60f * hourPx
val full = maxOf(slice.spanMin / 60f * hourPx, MIN_EVENT_FRACTION * hourPx)
return DragPieceBounds(
top = span.topMin / 60f * hourPx + top,
top = slice.startMin / 60f * hourPx + top,
height = (full - top - bottom).coerceAtLeast(0f),
)
}
@@ -305,9 +278,7 @@ data class TimelineDrop(
val date: LocalDate,
val startMin: Int,
/** Minutes from the event's start to the dragged block's top edge. */
val clipOffsetMin: Int,
/** The drop's identity, which its held copy waits on. */
val token: Long,
val clipOffsetMin: Int = 0,
)
/** The id a drafted block's stand-in event carries, which no provider row has (#153). */
@@ -338,49 +309,19 @@ internal fun draftStartMin(minutes: Float): Int =
internal fun draftBlock(draft: EventInstance, date: LocalDate, zone: TimeZone): TimedBlock? {
// Clipped to the day the way the grid lays out events, so it's drawn the same across a DST change (#387).
// The end is exclusive, so a draft ending at midnight belongs to the day before.
val dayEnd = date.plus(1, DateTimeUnit.DAY).atStartOfDayIn(zone)
val start = maxOf(draft.start, date.atStartOfDayIn(zone))
val end = minOf(draft.end, dayEnd)
val end = minOf(draft.end, date.plus(1, DateTimeUnit.DAY).atStartOfDayIn(zone))
if (end <= start) return null
val startMin = wallClockMinutes(start, date, zone)
val endMin = wallClockEndMinutes(startMin, start, end, date, zone).coerceAtMost(MINUTES_PER_DAY)
return TimedBlock(draft, startMin, endMin, lane = 0, laneCount = 1, continuesAfter = draft.end > dayEnd)
return TimedBlock(draft, startMin, endMin, lane = 0, laneCount = 1)
}
/** Which end of an event a resize handle moves (#141). */
enum class ResizeEdge { Top, Bottom }
/** A drop parked by a newer pickup while its write still runs — see [TimelineDragController.held]. */
data class HeldDrop(
val copy: TimelineDrag,
val token: Long,
val instanceId: Long,
/** The event row and start the drop came from, as [TimelineDragController.ghosts] matches them. */
val origin: Pair<Long, Instant>,
/** A resize's new end, which has to have landed too before the drop counts as seated. */
val end: Instant?,
/** Whether the grid now draws the drop at its landing slot. */
val seated: Boolean = false,
val handedOver: Boolean = false,
) {
fun ghosts(block: TimedBlock): Boolean = block.event.instanceId == instanceId ||
(block.event.eventId == origin.first && block.event.start == origin.second)
}
/** A strip drop parked by a newer one while its write still runs — see [TimelineDragController.heldStrips]. */
data class HeldStrip(val drag: StripDrag, val token: Long, val seated: Boolean = false)
/** An event's new start and end, as a resize leaves them. */
data class ResizedSpan(val start: Instant, val end: Instant)
/** Where a finished resize asks its event to begin and end. */
data class TimelineResizeDrop(
val event: EventInstance,
val start: Instant,
val end: Instant,
/** The drop's identity, which its held copy waits on. */
val token: Long,
)
data class TimelineResizeDrop(val event: EventInstance, val start: Instant, val end: Instant)
/**
* [event] resized by its [edge] to the span [startMin]..+[spanMin] from [date]'s
@@ -391,16 +332,17 @@ data class TimelineResizeDrop(
* it was drawn (see [repicked]). An end takes a pass the grid draws at the drop
* point, so the block settles under the finger.
*/
internal fun resizedSpan(
internal fun resizedDrop(
event: EventInstance,
edge: ResizeEdge?,
date: LocalDate,
startMin: Int,
spanMin: Int,
zone: TimeZone,
): ResizedSpan {
): TimelineResizeDrop {
val drawn = wallClockSpan(event, zone)
return ResizedSpan(
return TimelineResizeDrop(
event = event,
start = if (edge == ResizeEdge.Top) {
event.start.toFormTime(zone).repicked(
wallClockTime(date, startMin),
@@ -551,14 +493,6 @@ class TimelineDragController {
*/
private var settledOrigin: Pair<Long, Instant>? by mutableStateOf(null)
/**
* Earlier drops still being written when another block was picked up. They
* keep their copy and their ghost until their own token settles, rather than
* vanishing and flashing back at the old slot (#494).
*/
var held: List<HeldDrop> by mutableStateOf(emptyList())
private set
/** How long a block drafted on an empty slot starts out, in minutes (#153). */
var draftMinutes: Int = SettingsPrefs.DEFAULT_EVENT_DURATION
@@ -657,8 +591,14 @@ class TimelineDragController {
var settlingSelected: Boolean = false
private set
/** The token of the drop [settling] waits on. */
var settledToken: Long = 0L
/**
* The abandoned-move counter, read at the drop so the mark can't be a
* composition behind the tick it is compared against.
*/
var abandonedTicks: StateFlow<Int>? = null
/** What [abandonedTicks] stood at when the settling drop was let go. */
var settledAbandonedMark: Int = 0
private set
private var source: TimedBlock? = null
@@ -689,32 +629,6 @@ class TimelineDragController {
/** The resize in progress, or null for a plain drag (#141). */
private var resize: ResizeSession? = null
/** The strip drag in progress; over the grid it drives [drag] through a timed stand-in. */
var stripDrag: StripDrag? by mutableStateOf(null)
private set
/** A strip drop held at its new days until the strip redraws the event there. */
var stripSettling: StripDrag? by mutableStateOf(null)
private set
/** Whether the strip now draws [stripSettling] at its new days itself. */
var stripSeated: Boolean by mutableStateOf(false)
private set
/** Strip drops parked by a newer strip drop while their writes still run (#494). */
var heldStrips: List<HeldStrip> by mutableStateOf(emptyList())
private set
/** The token of the drop [stripSettling] waits on. */
var stripToken: Long = 0L
private set
/** The shown day the finger picked the strip bar up on. */
private var stripGrabIndex = 0
/** Whether a strip drag over the grid has cleared its top edge, and may now scroll up. */
private var stripScrollArmed = false
fun begin(
block: TimedBlock,
clipOffsetMin: Int,
@@ -731,7 +645,7 @@ class TimelineDragController {
dragDuration = (block.event.end - block.event.start).coerceAtLeast(Duration.ZERO)
dragKept = zone.repeatedHourOffsetAt(block.event.start)
this.titleLines = titleLines
parkSettling()
settling = null
isDragging = true
liftedInstanceId = block.event.instanceId
grab = pointerInRoot - blockInRoot
@@ -753,86 +667,6 @@ class TimelineDragController {
begin(block, clipOffsetMin = 0, zone, titleLines = 1, pointerInRoot = pointerInRoot, blockInRoot = blockInRoot)
}
/**
* Lift [event] off the all-day strip. Over the time grid it is dragged as a
* block [draftMinutes] long, whose top sits a little above the finger.
*/
fun beginStrip(event: EventInstance, zone: TimeZone, pointerInRoot: Offset) {
val grid = geometry.grid?.takeIf { it.isAttached } ?: return
if (geometry.columnWidthPx <= 0f || geometry.days.isEmpty()) return
deselect()
if (stripSettling?.event?.instanceId == event.instanceId) releaseStrip()
stripScrollArmed = false
val timed = event.copy(isAllDay = false, end = event.start + draftMinutes.minutes)
source = TimedBlock(timed, 0, draftMinutes, lane = 0, laneCount = 1)
clipOffsetMin = 0
dragZone = zone
dragDuration = draftMinutes.minutes
dragKept = null
titleLines = 1
parkSettling()
isDragging = true
liftedInstanceId = event.instanceId
grab = Offset(0f, geometry.hourPx * STRIP_GRAB_MINUTES / 60f)
pointer = pointerInRoot
pickupPointer = pointerInRoot
pointerMoved = false
originSlot = null
stripGrabIndex = dayIndexAt(pointerInRoot.x, grid.positionInRoot().x)
stripDrag = StripDrag(event)
}
/** The shown day under [x], clamped to the days on screen. */
private fun dayIndexAt(x: Float, originX: Float): Int =
column(((x - originX) / geometry.columnWidthPx).toInt().coerceIn(0, geometry.days.lastIndex))
/** End a strip drag, handing back where it landed — null when it went nowhere. */
fun finishStrip(): StripDrop? {
val held = stripDrag ?: return null
val landed = drag
val zone = dragZone
cancel()
if (held.overGrid && landed != null && zone != null && !landed.edgeOnly) {
val token = settle(landed)
val start = dropStartInstant(landed.event, landed.date, landed.startMin, clipOffsetMin = 0, zone)
return StripDrop.Timed(held.event, start, start + draftMinutes.minutes, token)
}
if (held.overGrid || held.dayShift == 0) return null
// One still settling keeps its place on the strip until its own write lands (#494).
stripSettling?.let { heldStrips = heldStrips + HeldStrip(it, stripToken, stripSeated) }
stripSettling = held
stripSeated = false
stripToken = nextMoveToken()
drops++
return StripDrop.Days(held.event, held.dayShift, stripToken)
}
/** Let the held strip drop go, once the strip shows the event at its new days or the move failed. */
fun releaseStrip() {
stripSettling = null
stripSeated = false
}
/** Note that the strip draws the settling drop at its new days. */
fun seatStrip() {
if (stripSettling != null) stripSeated = true
}
/** Note that the strip draws the parked strip drop [token] at its new days. */
fun seatHeldStrip(token: Long) {
if (heldStrips.any { it.token == token && !it.seated }) {
heldStrips = heldStrips.map { if (it.token == token) it.copy(seated = true) else it }
}
}
/** Let the parked strip drop [token] go. */
fun releaseHeldStrip(token: Long) {
heldStrips = heldStrips.filterNot { it.token == token }
}
/** Every strip drop still shown at its new days: the parked ones, then the latest. */
fun stripPreviews(): List<StripDrag> = heldStrips.map { it.drag } + listOfNotNull(stripDrag ?: stripSettling)
fun move(pointerInRoot: Offset) {
pointer = pointerInRoot
if (!pointerMoved && (pointerInRoot - pickupPointer).getDistance() > slopPx) pointerMoved = true
@@ -841,7 +675,6 @@ class TimelineDragController {
fun cancel() {
resize = null
stripDrag = null
source = null
clipOffsetMin = 0
dragZone = null
@@ -867,36 +700,12 @@ class TimelineDragController {
* an event that crosses midnight (#253).
*/
fun ghosts(block: TimedBlock): Boolean {
if (held.any { !it.handedOver && it.ghosts(block) }) return true
if (liftedInstanceId == null) return false
if (block.event.instanceId == liftedInstanceId) return true
val (eventId, start) = settledOrigin ?: return false
return block.event.eventId == eventId && block.event.start == start
}
/** Move a still-settling drop to [held] before a new pickup takes the slot. */
private fun parkSettling() {
val landed = settling
val origin = settledOrigin
if (landed != null && origin != null && !landed.event.isDraft) {
held = held + HeldDrop(landed, settledToken, landed.event.instanceId, origin, settledEnd, settledOnGrid)
}
settling = null
settledOnGrid = false
settledOrigin = null
settledEnd = null
}
/** Stop ghosting the held drop [token]'s source while its copy fades. */
fun handOverHeld(token: Long) {
held = held.map { if (it.token == token) it.copy(handedOver = true) else it }
}
/** Drop the held copy [token] once it has faded. */
fun releaseHeld(token: Long) {
held = held.filterNot { it.token == token }
}
/**
* What a day column now holds, so a settled drop can tell when the grid has
* caught up with it. Matched on the landing slot plus either the event row
@@ -904,23 +713,16 @@ class TimelineDragController {
* blank title matches nothing: every untitled event has one (#253).
*/
fun noteGrid(date: LocalDate, blocks: List<TimedBlock>) {
if (held.any { !it.seated && drawsDrop(it.copy, it.end, date, blocks) }) {
held = held.map { if (!it.seated && drawsDrop(it.copy, it.end, date, blocks)) it.copy(seated = true) else it }
}
val landed = settling ?: return
if (settledOnGrid) return
settledOnGrid = drawsDrop(landed, settledEnd, date, blocks)
}
/** Whether [blocks], [date]'s column, draws the drop [landed] where it landed. */
private fun drawsDrop(landed: TimelineDrag, end: Instant?, date: LocalDate, blocks: List<TimedBlock>): Boolean {
// Where this day would draw it, which for a drop clipped at midnight is
// the day's own start rather than the edge the finger held (#253) — and
// which for a tail dragged clear of its day is the day before it.
val offset = (date.toEpochDays() - landed.date.toEpochDays()).toInt()
val slice = dragSlices(landed.eventStartMin, landed.eventSpanMin, offset..offset)
.firstOrNull() ?: return false
return blocks.any { block ->
.firstOrNull() ?: return
val end = settledEnd
settledOnGrid = blocks.any { block ->
block.startMin == slice.startMin &&
// A resize may keep its start, so its end has to have landed too.
(end == null || block.event.end == end) &&
@@ -947,31 +749,23 @@ class TimelineDragController {
if (landed == null || landed.slot == origin) return null
// A draft dropped on a day off screen would vanish, so it stays where it was (#153).
if (landed.edgeOnly && landed.event.isDraft) return null
val token = settle(landed)
return TimelineDrop(landed.event, landed.date, landed.startMin, clipOffset, token)
settle(landed)
return TimelineDrop(landed.event, landed.date, landed.startMin, clipOffset)
}
/**
* Keep [landed]'s copy on the target as [settling] until [release]; [end] is a
* resize's. Returns the drop's fresh token.
*/
private fun settle(landed: TimelineDrag, end: Instant? = null): Long {
// Landed on midnight to midnight, the event moves to the all-day strip (#296).
val leavesGrid = !landed.event.isDraft && landed.eventSpanMin > 0 &&
landed.eventStartMin.mod(MINUTES_PER_DAY) == 0 &&
landed.eventSpanMin % MINUTES_PER_DAY == 0
/** Keep [landed]'s copy on the target as [settling] until [release]; [end] is a resize's. */
private fun settle(landed: TimelineDrag, end: Instant? = null) {
settlingSelected = selection?.event?.instanceId == landed.event.instanceId
// An edge piece is a hint for the finger, not a preview of the landing
// slot: the event belongs to a day this timeline has no column for, so
// [noteGrid] can never seat it and it would sit at the top of today for
// the whole settle timeout, long after the event moved off-screen.
settling = if (landed.edgeOnly || leavesGrid) landed.copy(pieces = emptyList()) else landed
settling = if (landed.edgeOnly) landed.copy(pieces = emptyList()) else landed
liftedInstanceId = landed.event.instanceId
settledOrigin = landed.event.eventId to landed.event.start
settledToken = nextMoveToken()
settledAbandonedMark = abandonedTicks?.value ?: 0
settledEnd = end
drops++
return settledToken
}
/**
@@ -991,7 +785,7 @@ class TimelineDragController {
resize = session
clipOffsetMin = 0
this.titleLines = titleLines
parkSettling()
settling = null
isDragging = true
pointerMoved = true
liftedInstanceId = block.event.instanceId
@@ -1001,9 +795,7 @@ class TimelineDragController {
val edgeIndex = geometry.days.indexOf(span.day.plus(edgeDay, DateTimeUnit.DAY))
session.column = edgeIndex.takeIf { it >= 0 }
?.let { column(it) }
// The top handle sits on the drawn top, which a short block near midnight lifts (#483).
val lift = if (edge == ResizeEdge.Top) block.startMin - block.renderedSpan().topMin else 0f
session.grabMin = (pointerResizeMinutes(session) ?: 0f) + lift -
session.grabMin = (pointerResizeMinutes(session) ?: 0f) -
if (edge == ResizeEdge.Top) session.startMin else session.endMin
originSlot = null
recompute()
@@ -1022,10 +814,10 @@ class TimelineDragController {
val event = source?.event ?: return null
val edge = resize?.edge
if (edge != null) {
val drop = resizedSpan(event, edge, date, startMin, spanMin, zone)
val drop = resizedDrop(event, edge, date, startMin, spanMin, zone)
return event.copy(start = drop.start, end = drop.end)
}
val start = dropStartInstant(event, date, startMin, clipOffsetMin, zone)
val start = TimelineDrop(event, date, startMin, clipOffsetMin).startInstant(zone)
return event.copy(start = start, end = start + dragDuration)
}
@@ -1039,8 +831,9 @@ class TimelineDragController {
val edge = resize?.edge
cancel()
if (landed == null || landed.slot == origin) return null
val span = resizedSpan(landed.event, edge, landed.date, landed.eventStartMin, landed.eventSpanMin, zone)
return TimelineResizeDrop(landed.event, span.start, span.end, settle(landed, end = span.end))
val drop = resizedDrop(landed.event, edge, landed.date, landed.eventStartMin, landed.eventSpanMin, zone)
settle(landed, end = drop.end)
return drop
}
/**
@@ -1062,9 +855,7 @@ class TimelineDragController {
session.column = held
val dayOffset = (days[column(held)].toEpochDays() - session.day.toEpochDays()).toInt()
session.edgeDay = dayOffset
// Held to its column's midnight: the clearance under it is not the next day.
val minutes = ((pointer.y - origin.y) / hourPx * 60f).coerceAtMost(MINUTES_PER_DAY.toFloat())
return dayOffset * MINUTES_PER_DAY + minutes
return dayOffset * MINUTES_PER_DAY + (pointer.y - origin.y) / hourPx * 60f
}
private fun recomputeResize(session: ResizeSession) {
@@ -1137,29 +928,6 @@ class TimelineDragController {
recomputeResize(it)
return
}
stripDrag?.let {
recomputeStrip(it)
return
}
recomputeDrag()
}
/** Over the strip the bar moves by whole days; past its bottom edge it is a timed block. */
private fun recomputeStrip(held: StripDrag) {
val grid = geometry.grid?.takeIf { it.isAttached } ?: return
val viewport = geometry.viewport?.takeIf { it.isAttached } ?: return
if (geometry.columnWidthPx <= 0f || geometry.days.isEmpty()) return
if (pointer.y >= viewport.boundsInRoot().top) {
stripDrag = held.copy(overGrid = true)
recomputeDrag()
} else {
drag = null
val shift = dayIndexAt(pointer.x, grid.positionInRoot().x) - stripGrabIndex
stripDrag = held.copy(dayShift = shift, overGrid = false)
}
}
private fun recomputeDrag() {
val block = source ?: return
val grid = geometry.grid?.takeIf { it.isAttached } ?: return
val hourPx = geometry.hourPx
@@ -1245,18 +1013,11 @@ class TimelineDragController {
}
private fun edgeStep(): Float {
val strip = stripDrag
if (strip?.overGrid == false) return 0f
val viewport = geometry.viewport?.takeIf { it.isAttached } ?: return 0f
val edge = geometry.edgePx
if (edge <= 0f) return 0f
val bounds = viewport.boundsInRoot()
val fromTop = pointer.y - bounds.top
// Coming down out of the strip the finger starts inside the top edge.
if (strip != null && !stripScrollArmed) {
if (fromTop < edge) return 0f
stripScrollArmed = true
}
val fromBottom = bounds.bottom - pointer.y
return when {
fromTop < edge -> -(edge - fromTop) / edge * geometry.stepPx
@@ -1294,6 +1055,7 @@ fun rememberTimelineDragController(): TimelineDragController {
controller.geometry.edgePx = with(density) { AUTO_SCROLL_EDGE.toPx() }
controller.geometry.stepPx = with(density) { AUTO_SCROLL_STEP.toPx() }
controller.slopPx = LocalViewConfiguration.current.touchSlop
controller.abandonedTicks = LocalEventMove.current?.abandoned
return controller
}
@@ -1315,6 +1077,10 @@ fun TimedBlock.clipOffsetMinutes(day: LocalDate, zone: TimeZone): Int {
fun TimedBlock.continuesBefore(day: LocalDate, zone: TimeZone): Boolean =
event.start < day.atStartOfDayIn(zone)
/** True when the event runs past [day]'s midnight, so this block is cut there. */
fun TimedBlock.continuesAfter(day: LocalDate, zone: TimeZone): Boolean =
event.end > day.plus(1, DateTimeUnit.DAY).atStartOfDayIn(zone)
/**
* The instant a drop asks for — the *event's* new start, so the tail of an
* overnight event drops back onto the day its own start belongs to. Read in the
@@ -1323,16 +1089,7 @@ fun TimedBlock.continuesBefore(day: LocalDate, zone: TimeZone): Boolean =
* visibly settles there.
*/
fun TimelineDrop.startInstant(zone: TimeZone): Instant =
dropStartInstant(event, date, startMin, clipOffsetMin, zone)
/** Where [event] starts when its block's top edge lands [startMin] past [date]'s midnight — see [TimelineDrop]. */
internal fun dropStartInstant(
event: EventInstance,
date: LocalDate,
startMin: Int,
clipOffsetMin: Int,
zone: TimeZone,
): Instant = wallClockInstant(date, startMin - clipOffsetMin, zone, kept = zone.repeatedHourOffsetAt(event.start))
wallClockInstant(date, startMin - clipOffsetMin, zone, kept = zone.repeatedHourOffsetAt(event.start))
/**
* The wall-clock minutes an event lasting [duration] covers when it starts
@@ -1404,7 +1161,6 @@ private const val SETTLE_TIMEOUT_MILLIS = 900L
*/
const val SETTLE_FADE_MILLIS: Int = 250
/**
* The floating block, drawn over the whole calendar so it is free of the day
* column's clip and of the scroll viewport's rounded corners.
@@ -1412,14 +1168,16 @@ const val SETTLE_FADE_MILLIS: Int = 250
@Composable
fun TimelineDragOverlay(controller: TimelineDragController, modifier: Modifier = Modifier) {
var origin by remember { mutableStateOf(Offset.Zero) }
val density = LocalDensity.current
val dark = LocalFloretDarkTheme.current
val use24Hour = LocalUse24HourFormat.current
val locale = currentLocale()
val reduceMotion = rememberReduceMotion()
val drops = dropStates()
val moveInFlight = controller.settledToken in drops.pending
val stripInFlight = controller.stripToken in drops.pending
val moveInFlight = moveInFlight()
// Both live here rather than beside the controller: they read [drag], which
// changes every frame, and this composable is the one that is meant to.
DragSnapHaptics(controller.drag?.slot ?: controller.stripDrag?.dayShift, controller.drops)
DragSnapHaptics(controller.drag?.slot, controller.drops)
// Only once the finger has moved: a long press held near an edge must not
// scroll the drop target out from under a finger that only means to select.
LaunchedEffect(controller.isDragging && controller.pointerMoved) {
@@ -1429,11 +1187,12 @@ fun TimelineDragOverlay(controller: TimelineDragController, modifier: Modifier =
// recurring drop's scope dialog is up — and then until the grid draws the
// drop itself.
var handingOver by remember(controller.settling) { mutableStateOf(false) }
val abandoned = controller.settledToken in drops.abandoned
val abandoned = abandonedMoves()
LaunchedEffect(controller.settling, moveInFlight, controller.settledOnGrid, abandoned) {
if (controller.settling == null || moveInFlight) return@LaunchedEffect
// An abandoned drop: nothing will land and there is nothing to wait for.
if (!abandoned) {
// Past the mark this drop was let go on, it was abandoned: nothing will
// land and there is nothing to wait for.
if (abandoned == controller.settledAbandonedMark) {
delay(if (controller.settledOnGrid) SETTLE_GRACE_MILLIS else SETTLE_TIMEOUT_MILLIS)
}
handingOver = true
@@ -1442,16 +1201,6 @@ fun TimelineDragOverlay(controller: TimelineDragController, modifier: Modifier =
controller.release()
}
// The same hold for a bar moved along the all-day strip.
val stripAbandoned = controller.stripToken in drops.abandoned
LaunchedEffect(controller.stripSettling, stripInFlight, controller.stripSeated, stripAbandoned) {
if (controller.stripSettling == null || stripInFlight) return@LaunchedEffect
if (!stripAbandoned) {
delay(if (controller.stripSeated) SETTLE_GRACE_MILLIS else SETTLE_TIMEOUT_MILLIS)
}
controller.releaseStrip()
}
Box(
modifier = modifier
.fillMaxSize()
@@ -1460,12 +1209,6 @@ fun TimelineDragOverlay(controller: TimelineDragController, modifier: Modifier =
.clearAndSetSemantics { }
.onGloballyPositioned { origin = it.positionInRoot() },
) {
controller.held.forEach { parked ->
key(parked.token) { HeldTimelineCopy(controller, parked, origin) }
}
controller.heldStrips.forEach { parked ->
key(parked.token) { HeldStripSettle(controller, parked) }
}
val drag = controller.drag ?: controller.settling ?: return@Box
// Landed: the copy sinks back to the grid's own plane while the write runs.
val landed = controller.drag == null
@@ -1479,58 +1222,6 @@ fun TimelineDragOverlay(controller: TimelineDragController, modifier: Modifier =
animationSpec = tween(SETTLE_FADE_MILLIS),
label = "drag-handover",
)
TimelineCopy(drag, controller.geometry, origin, lift, copyAlpha)
}
}
/**
* [TimelineDragController.ghosts] for [block], derived so the block recomposes
* only when its own answer changes rather than on every lift, park and release.
*/
@Composable
fun TimelineDragController.ghostsDerived(block: TimedBlock): Boolean {
val ghosted by remember(this, block) { derivedStateOf { ghosts(block) } }
return ghosted
}
/** A drop parked by a newer pickup: held at its landing slot until its own write settles. */
@Composable
private fun HeldTimelineCopy(controller: TimelineDragController, parked: HeldDrop, origin: Offset) {
val alpha = rememberHeldSettle(
token = parked.token,
seated = parked.seated,
timeoutMillis = SETTLE_TIMEOUT_MILLIS,
onHandOver = { controller.handOverHeld(parked.token) },
onRelease = { controller.releaseHeld(parked.token) },
)
TimelineCopy(parked.copy, controller.geometry, origin, lift = 0f, copyAlpha = alpha)
}
/** A strip drop parked by a newer one: shown at its new days until its own write settles. */
@Composable
private fun HeldStripSettle(controller: TimelineDragController, parked: HeldStrip) {
rememberHeldSettle(
token = parked.token,
seated = parked.seated,
timeoutMillis = SETTLE_TIMEOUT_MILLIS,
onHandOver = {},
onRelease = { controller.releaseHeldStrip(parked.token) },
)
}
/** [drag]'s pieces drawn over the calendar, clipped to the timeline's viewport. */
@Composable
private fun TimelineCopy(
drag: TimelineDrag,
geometry: TimelineGeometry,
origin: Offset,
lift: Float,
copyAlpha: Float,
) {
val density = LocalDensity.current
val dark = LocalFloretDarkTheme.current
val use24Hour = LocalUse24HourFormat.current
val locale = currentLocale()
val paint = eventPaint(drag.event, dark)
val title = drag.event.title.ifBlank { stringResource(R.string.event_untitled) }
// Read off the event rather than the held block, so grabbing either half
@@ -1546,7 +1237,7 @@ private fun TimelineCopy(
// so no column clip or rounded corner cuts it, but it still belongs to
// the timeline: a piece a whole day tall reaches far past both ends of
// the viewport, and unclipped it paints over the headers above (#267).
val port = geometry.viewport?.takeIf { it.isAttached }?.boundsInRoot()
val port = controller.geometry.viewport?.takeIf { it.isAttached }?.boundsInRoot()
// How much of each piece the viewport actually shows. A multi-day event
// has a piece per day, and the widest one is a full 24 hours — taller
// than the screen, its top at a midnight scrolled out of sight. Picking
@@ -1598,6 +1289,7 @@ private fun TimelineCopy(
)
}
}
}
}
/** One piece of a dragged block, floating over the calendar. */
@@ -43,21 +43,14 @@ data class TimelineHours(
/**
* The scroll offset that puts [startHour] at the top of a timeline laid out
* with [maxValue] scroll range over a [viewportPx] viewport, [clearancePx] of
* which is the empty inset under midnight, or null while that
* with [maxValue] scroll range over a [viewportPx] viewport, or null while that
* layout is not yet at [hourPx] per hour — the scale changes a frame before the
* content grows to match it, and scrolling against the old layout would land on
* the wrong hour.
*/
internal fun startHourScroll(
maxValue: Int,
viewportPx: Int,
startHour: Int,
hourPx: Float,
clearancePx: Int = 0,
): Int? {
internal fun startHourScroll(maxValue: Int, viewportPx: Int, startHour: Int, hourPx: Float): Int? {
if (viewportPx <= 0 || maxValue < 0 || maxValue == Int.MAX_VALUE) return null
val laidOutHourPx = (maxValue + viewportPx - clearancePx) / 24f
val laidOutHourPx = (maxValue + viewportPx) / 24f
if (abs(laidOutHourPx - hourPx) > 1f) return null
return (startHour * laidOutHourPx).roundToInt().coerceIn(0, maxValue)
}
@@ -4,8 +4,6 @@ import androidx.annotation.StringRes
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.ui.week.MINUTES_PER_DAY
import de.jeanlucmakiola.calendula.ui.week.TimedBlock
/**
* How tall one hour is drawn in the week and day timelines (#56).
@@ -61,9 +59,8 @@ sealed interface TimelineScale {
}
/**
* Hour height for this scale. [viewportHeight] is the height the day is fitted
* to, the scrolling timeline's [dayFitHeight], and is not consulted by the
* fixed presets.
* Hour height for this scale. [viewportHeight] is the visible height of the
* scrolling timeline and is only consulted by [TimelineScale.FitDay].
*
* The fit-day result is clamped: below [FIT_DAY_MIN] the 24 gutter labels stop
* being legible, and above [FIT_DAY_MAX] a short landscape day would stretch its
@@ -88,13 +85,6 @@ fun TimelineScale.hourHeight(viewportHeight: Dp): Dp = when (this) {
.coerceAtLeast(fillHourHeight(viewportHeight))
}
/**
* The part of a [viewportHeight]-tall timeline the day is fitted to: the
* [FabClearance] under midnight, which lets the last hour scroll clear of the
* FAB (#483), is left out. Pass this, not the raw viewport, to [hourHeight].
*/
fun dayFitHeight(viewportHeight: Dp): Dp = (viewportHeight - FabClearance).coerceAtLeast(0.dp)
/**
* The minute of the day a tap [offsetY] px down a timeline column means, snapped
* to the hour it landed in.
@@ -115,28 +105,6 @@ fun tappedMinuteOfDay(offsetY: Float, hourPx: Float): Int =
*/
const val MIN_EVENT_FRACTION = 26f / 60f
/** Where a timed block is drawn down its day, in minutes from midnight. */
data class RenderedSpan(val topMin: Float, val bottomMin: Float)
/**
* Where a block of [startMin]..[endMin] is drawn, at least [MIN_EVENT_FRACTION]
* of an hour tall. A short block near midnight rises until that floor ends at
* midnight instead of running off the day, unless it [continuesAfter] into the
* next one (#483).
*/
fun renderedSpan(startMin: Int, endMin: Int, continuesAfter: Boolean): RenderedSpan {
val floor = MIN_EVENT_FRACTION * 60f
val bottom = maxOf(endMin.toFloat(), startMin + floor)
return if (continuesAfter || bottom <= MINUTES_PER_DAY) {
RenderedSpan(startMin.toFloat(), bottom)
} else {
RenderedSpan(MINUTES_PER_DAY - floor, MINUTES_PER_DAY.toFloat())
}
}
/** This block's [renderedSpan]. */
fun TimedBlock.renderedSpan(): RenderedSpan = renderedSpan(startMin, endMin, continuesAfter)
/** Smallest hour height [TimelineScale.FitDay] will resolve to. */
val FIT_DAY_MIN = 24.dp
@@ -32,21 +32,16 @@ val LocalTimelineScroll = staticCompositionLocalOf<TimelineScrollMemory?> { null
/** A timeline's scroll, and where it opens before it can scroll there. */
@Stable
class TimelineScroll(
val state: ScrollState,
noonPending: Boolean,
private val openingHour: Int?,
private val clearancePx: Float = 0f,
) {
class TimelineScroll(val state: ScrollState, noonPending: Boolean, private val openingHour: Int?) {
/** Whether it is still to be put on noon, which it only can be once laid out. */
var noonPending by mutableStateOf(noonPending)
internal set
/** The top of what it shows, or will once open, over [content] pixels of day in a [viewport] pixels high. */
/** The top of what it shows, or will once open, over [content] pixels in a [viewport] pixels high. */
fun top(viewport: Float, content: Float): Float =
if (noonPending) {
(openingHour?.let { it * content / 24f } ?: (content - viewport) / 2f)
.coerceIn(0f, (content + clearancePx - viewport).coerceAtLeast(0f))
.coerceIn(0f, (content - viewport).coerceAtLeast(0f))
} else state.value.toFloat()
}
@@ -63,7 +58,6 @@ fun rememberTimelineScrollState(timelineTop: Dp): TimelineScroll {
val density = LocalDensity.current
val zoom = LocalTimelineZoom.current
val topPx = with(density) { timelineTop.toPx() }
val clearancePx = with(density) { FabClearance.roundToPx() }
val remembered = memory?.midnightY
val scrollState = rememberScrollState(
initial = remembered?.let { (topPx - it).roundToInt().coerceAtLeast(0) } ?: 0,
@@ -73,7 +67,6 @@ fun rememberTimelineScrollState(timelineTop: Dp): TimelineScroll {
scrollState,
noonPending = remembered == null,
openingHour = zoom.hours.takeIf { it.enabled }?.startHour,
clearancePx = clearancePx.toFloat(),
)
}
val currentTop by rememberUpdatedState(topPx)
@@ -87,20 +80,20 @@ fun rememberTimelineScrollState(timelineTop: Dp): TimelineScroll {
val startHour = zoom.open()
if (startHour == null) {
snapshotFlow { scrollState.maxValue }.first { it > 0 }
scrollState.scrollTo(((scrollState.maxValue - clearancePx) / 2).coerceAtLeast(0))
scrollState.scrollTo(scrollState.maxValue / 2)
} else {
// Fitted to the scroll viewport itself: the layout resolves scales
// against the viewport plus the all-day strip, which would push the
// end hour below the screen.
val viewport = snapshotFlow { scrollState.viewportSize }.first { it > 0 }
val hourHeight = zoom.scale.hourHeight(dayFitHeight(with(density) { viewport.toDp() }))
val hourHeight = zoom.scale.hourHeight(with(density) { viewport.toDp() })
zoom.holdFit(hourHeight)
val hourPx = with(density) { hourHeight.toPx() }
val target = withTimeoutOrNull(FIT_LAYOUT_TIMEOUT_MILLIS) {
snapshotFlow {
startHourScroll(scrollState.maxValue, scrollState.viewportSize, startHour, hourPx, clearancePx)
startHourScroll(scrollState.maxValue, scrollState.viewportSize, startHour, hourPx)
}.filterNotNull().first()
} ?: (startHour * (scrollState.maxValue + scrollState.viewportSize - clearancePx) / 24)
} ?: (startHour * (scrollState.maxValue + scrollState.viewportSize) / 24)
.coerceIn(0, scrollState.maxValue.coerceAtLeast(0))
scrollState.scrollTo(target)
}
@@ -1,21 +0,0 @@
package de.jeanlucmakiola.calendula.ui.common
import android.content.res.Resources
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import de.jeanlucmakiola.floret.time.rowWeekNumber
import kotlinx.datetime.LocalDate
import kotlinx.datetime.toJavaLocalDate
import java.time.temporal.WeekFields
/**
* The week number of the grid row starting on [rowStart], numbered by the
* device region's rules (#493). The region, not the app language: an English
* UI in the Netherlands still numbers weeks the ISO way. Shared by the Month
* gutter and the Week badge so the two always agree.
*/
@Composable
internal fun rememberRowWeekNumber(rowStart: LocalDate): Int {
val fields = remember { WeekFields.of(Resources.getSystem().configuration.locales[0]) }
return remember(rowStart, fields) { rowStart.toJavaLocalDate().rowWeekNumber(fields) }
}
@@ -37,7 +37,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
import de.jeanlucmakiola.calendula.ui.common.orUnnamed
import de.jeanlucmakiola.floret.components.IconInfoCard
import de.jeanlucmakiola.floret.components.SegmentedChoiceCard
import de.jeanlucmakiola.floret.identity.LocalFloretDarkTheme
import kotlinx.coroutines.launch
import de.jeanlucmakiola.calendula.ui.common.sendEventShare
@@ -120,7 +119,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.AccessLevel
import de.jeanlucmakiola.calendula.domain.Availability
import de.jeanlucmakiola.calendula.domain.EventStatus
import de.jeanlucmakiola.calendula.domain.CalendarSource
import de.jeanlucmakiola.calendula.domain.EventAttendee
import de.jeanlucmakiola.calendula.domain.EventColorOption
@@ -894,15 +892,6 @@ private fun EventEditContent(
AvailabilityCard(availability = form.availability, onSelect = viewModel::setAvailability)
}
OptionalFormSection(visible = EventFormField.Status in state.visibleFields) {
Spacer(Modifier.height(gap))
StatusCard(
status = form.status,
offerCancelled = state.offerCancelled,
onSelect = viewModel::setStatus,
)
}
OptionalFormSection(visible = EventFormField.Visibility in state.visibleFields) {
Spacer(Modifier.height(gap))
IconInfoCard(
@@ -1325,33 +1314,33 @@ private fun RecurrenceCard(state: EventEditUiState, locale: Locale, onClick: (()
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun AvailabilityCard(availability: Availability, onSelect: (Availability) -> Unit) {
SegmentedChoiceCard(
IconInfoCard(
icon = Icons.Default.EventAvailable,
title = stringResource(R.string.event_edit_availability),
options = listOf(
Availability.Busy to stringResource(R.string.event_availability_busy),
Availability.Free to stringResource(R.string.event_availability_free),
),
selected = availability,
onSelect = onSelect,
)
}
@Composable
private fun StatusCard(status: EventStatus, offerCancelled: Boolean, onSelect: (EventStatus) -> Unit) {
SegmentedChoiceCard(
icon = eventFormFieldIcon(EventFormField.Status),
title = stringResource(R.string.event_edit_status),
options = listOfNotNull(
EventStatus.Confirmed to stringResource(R.string.event_status_confirmed),
EventStatus.Tentative to stringResource(R.string.event_status_tentative),
(EventStatus.Cancelled to stringResource(R.string.event_status_cancelled)).takeIf { offerCancelled },
),
selected = status,
onSelect = onSelect,
)
iconContentDescription = null,
header = {
Text(
text = stringResource(R.string.event_edit_availability),
style = MaterialTheme.typography.titleMedium,
)
},
) {
Spacer(Modifier.height(8.dp))
SingleChoiceSegmentedButtonRow(modifier = Modifier.fillMaxWidth()) {
SegmentedButton(
selected = availability == Availability.Busy,
onClick = { onSelect(Availability.Busy) },
shape = SegmentedButtonDefaults.itemShape(index = 0, count = 2),
) { Text(stringResource(R.string.event_availability_busy)) }
SegmentedButton(
selected = availability == Availability.Free,
onClick = { onSelect(Availability.Free) },
shape = SegmentedButtonDefaults.itemShape(index = 1, count = 2),
) { Text(stringResource(R.string.event_availability_free)) }
}
}
}
/**
@@ -48,12 +48,6 @@ data class EventEditUiState(
* then drops "only this event" (an exception row can't carry a rule).
*/
val recurrenceChanged: Boolean = false,
/**
* Whether the Status field offers Cancelled: only for an event that already
* is. Google reads a cancelled event as deleted, so picking it is no safe
* way to strike an event through (#388).
*/
val offerCancelled: Boolean = false,
/**
* The event-colour palette the resolved target calendar publishes; empty
* when it exposes none. Non-empty → the colour picker offers these swatches
@@ -14,10 +14,8 @@ import de.jeanlucmakiola.calendula.data.time.ZoneSource
import de.jeanlucmakiola.calendula.data.prefs.firstDayOfWeek
import de.jeanlucmakiola.calendula.data.prefs.resolveDefaultEventDuration
import de.jeanlucmakiola.calendula.data.prefs.resolveDefaultReminder
import de.jeanlucmakiola.calendula.domain.canSaveApartFromSeries
import de.jeanlucmakiola.calendula.domain.AccessLevel
import de.jeanlucmakiola.calendula.domain.Availability
import de.jeanlucmakiola.calendula.domain.EventStatus
import de.jeanlucmakiola.calendula.domain.CalendarSource
import de.jeanlucmakiola.calendula.domain.EditSnapshot
import de.jeanlucmakiola.calendula.domain.EventAttendee
@@ -337,7 +335,6 @@ class EventEditViewModel @Inject constructor(
// the scope dialog drops "only this event" after a rule change.
recurrenceChanged = local.editTarget != null &&
resolved.rrule != local.editTarget.original.rrule,
offerCancelled = local.editTarget?.original?.status == EventStatus.Cancelled,
colorPalette = palette,
allowColorOnUnsupportedCalendars = external.allowColorOnUnsupported,
)
@@ -674,7 +671,6 @@ class EventEditViewModel @Inject constructor(
applyDefaultDuration(id)
}
fun setAvailability(value: Availability) = edit { it.copy(availability = value) }
fun setStatus(value: EventStatus) = edit { it.copy(status = value) }
fun setAccessLevel(value: AccessLevel) = edit { it.copy(accessLevel = value) }
/** Pick a palette colour (round-trips via its key); [argb] is its swatch. */
@@ -770,10 +766,7 @@ class EventEditViewModel @Inject constructor(
// Managed events are a yearly series whose editable fields (reminders,
// notes, location) live on the series row — never offer the scope dialog,
// which would split the series into an exception the sync then reverts.
// A cancelled one only saves as the whole series (#388).
if (target != null && target.original.rrule != null && !current.isManaged && !movingCalendar &&
form.canSaveApartFromSeries()
) {
if (target != null && target.original.rrule != null && !current.isManaged && !movingCalendar) {
_saveState.value = SaveUiState.AwaitingScope
return
}
@@ -2,28 +2,17 @@ package de.jeanlucmakiola.calendula.ui.month
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.TextMeasurer
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.ui.common.formatTimeOfDay
import de.jeanlucmakiola.calendula.ui.common.inlineTimeLabel
import de.jeanlucmakiola.calendula.ui.common.rememberWidestTimeSample
import de.jeanlucmakiola.calendula.ui.common.trimmedLines
import de.jeanlucmakiola.calendula.ui.common.rememberInlineTimeWidth
import kotlinx.datetime.TimeZone
import java.util.Locale
/**
* The start time a chip shows before its title (#219), or null when it has none
* to show: a chip filling whole days never carries a time (#296), and neither
* does a bar carried in from an earlier week, whose start is not in this segment.
* to show: an all-day chip never carries a time, and neither does a bar carried
* in from an earlier week, whose start is not in this segment.
*/
internal fun monthChipTime(
event: EventInstance,
@@ -32,75 +21,11 @@ internal fun monthChipTime(
is24Hour: Boolean,
locale: Locale,
): String? {
if (event.coversWholeDays(zone) || continuesLeft) return null
if (event.isAllDay || continuesLeft) return null
return formatTimeOfDay(event.start, zone, is24Hour, locale)
}
/** How many characters of a longer title a chip must keep beside its start time (#476). */
internal const val MONTH_TITLE_MIN_CHARS = 12
/**
* The part of [title] that has to stay readable beside a start time: all of it,
* or its first [MONTH_TITLE_MIN_CHARS] characters, counted in code points so an
* emoji is never cut in half.
*/
internal fun monthTitleToKeep(title: String): String {
if (title.codePointCount(0, title.length) <= MONTH_TITLE_MIN_CHARS) return title
return title.substring(0, title.offsetByCodePoints(0, MONTH_TITLE_MIN_CHARS))
}
/**
* Whether a chip shows its start time (#219, #476): only with the setting
* [enabled], and only when [availableWidth] (the chip less its chrome) holds
* [labelWidth], the widest time followed by [monthTitleToKeep] of the title.
*/
internal fun monthChipShowsTime(
enabled: Boolean,
availableWidth: Float,
labelWidth: Float,
): Boolean = enabled && labelWidth <= availableWidth
/**
* Prices month chips' time labels for [monthChipShowsTime] in the chips' own
* text style. One per grid; each title is measured once for its lifetime.
*/
@Stable
internal class MonthChipTimeFit(
private val measurer: TextMeasurer,
private val style: TextStyle,
private val density: Density,
private val timeSample: String,
) {
private val chromePx = with(density) { MONTH_CHIP_CHROME.toPx() }
private val labelWidths = HashMap<String, Int>()
fun showsTime(chipWidth: Dp, title: String): Boolean {
if (labelWidths.size >= MAX_CACHED_TITLES) labelWidths.clear()
val labelWidth = labelWidths.getOrPut(title) {
val label = inlineTimeLabel(timeSample, monthTitleToKeep(title), Color.Unspecified)
measurer.measure(label, style, softWrap = false, maxLines = 1).size.width
}
return monthChipShowsTime(
enabled = true,
availableWidth = with(density) { chipWidth.toPx() } - chromePx,
labelWidth = labelWidth.toFloat(),
)
}
private companion object {
const val MAX_CACHED_TITLES = 1000
}
}
/** The grid's [MonthChipTimeFit], or null when start times are switched off (#476). */
/** The narrowest chip that may show a time — the text it needs, plus its chrome. */
@Composable
internal fun rememberMonthChipTimeFit(showStartTimes: Boolean): MonthChipTimeFit? {
if (!showStartTimes) return null
val measurer = rememberTextMeasurer(cacheSize = 0)
val style = MaterialTheme.typography.labelSmall.trimmedLines()
val density = LocalDensity.current
val timeSample = rememberWidestTimeSample()
return remember(measurer, style, density, timeSample) {
MonthChipTimeFit(measurer, style, density, timeSample)
}
}
internal fun rememberMonthTimeChipWidth(): Dp =
rememberInlineTimeWidth(MaterialTheme.typography.labelSmall) + MONTH_CHIP_CHROME
@@ -14,7 +14,8 @@ import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.unit.IntSize
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.ui.common.nextMoveToken
import de.jeanlucmakiola.calendula.ui.common.LocalEventMove
import kotlinx.coroutines.flow.StateFlow
import kotlinx.datetime.LocalDate
import kotlin.math.abs
@@ -106,22 +107,11 @@ data class MonthChipDrag(
val time: String? = null,
)
/** A drop parked by a newer pickup while its write still runs — see [MonthDragController.held]. */
data class HeldChip(
val copy: MonthChipDrag,
val token: Long,
val handedOver: Boolean = false,
/** Where the grid now draws the drop, in root coordinates, once a row seats it. */
val seat: Offset? = null,
)
/** Where a finished chip drag asks its event to go, as a whole-day shift. */
data class MonthChipDrop(
val event: EventInstance,
val grabDate: LocalDate,
val targetDate: LocalDate,
/** The drop's identity, which its held copy waits on — see [MonthDragController.settledToken]. */
val token: Long,
)
/**
@@ -177,22 +167,19 @@ class MonthDragController {
private set
/**
* This controller's recent drops by token, kept past [release] for
* [beginUndo] — the confirmation chip carries Undo long after the copy is
* gone, and it may be any of them the chip offers to undo.
* The last drop this controller made, kept past [release] for [beginUndo] —
* the confirmation chip carries Undo long after the copy is gone.
*/
private val undoable = LinkedHashMap<Long, MonthChipDrag>()
private var undoable: MonthChipDrag? = null
/**
* Earlier drops still being written when another chip was picked up. They
* keep their copy and their ghost until their own token settles, rather than
* vanishing and flashing back on the old day (#494).
* The abandoned-move counter, read at the drop so the mark can't be a
* composition behind the tick it is compared against.
*/
var held: List<HeldChip> by mutableStateOf(emptyList())
private set
var abandonedTicks: StateFlow<Int>? = null
/** The token of the drop (or undo) [settling] is waiting on. */
var settledToken: Long = 0L
/** What [abandonedTicks] stood at when the settling chip was let go. */
var settledAbandonedMark: Int = 0
private set
private var event: EventInstance? = null
@@ -221,7 +208,7 @@ class MonthDragController {
this.event = event
this.grabDate = grabDate
this.time = time
parkSettling()
settling = null
isDragging = true
liftedInstanceId = event.instanceId
grab = pointerInRoot - chipInRoot
@@ -247,39 +234,6 @@ class MonthDragController {
settledGhost = false
}
/**
* Whether [event]'s chip belongs to a held drop and must stay a ghost: its
* source, or once a row seats it, the chip the grid draws on its target day.
*/
fun isHeldChip(event: EventInstance, days: List<LocalDate>?): Boolean = held.any { parked ->
!parked.handedOver && (
parked.copy.event.instanceId == event.instanceId ||
(
parked.seat != null && days != null && parked.copy.targetDate in days &&
isSameEvent(event, parked.copy.event)
)
)
}
/** Move a still-settling drop to [held] before a new pickup takes the slot. */
private fun parkSettling() {
val landed = settling
if (landed != null) held = held + HeldChip(landed, settledToken)
settling = null
settledInRoot = null
settledGhost = false
}
/** Stop ghosting the held drop [token]'s source while its copy fades. */
fun handOverHeld(token: Long) {
held = held.map { if (it.token == token) it.copy(handedOver = true) else it }
}
/** Drop the held copy [token] once it has faded. */
fun releaseHeld(token: Long) {
held = held.filterNot { it.token == token }
}
/**
* Whether [days] holds the chip the grid has drawn for the settled drop —
* the seat the copy is on its way to, which must ghost until it gets there.
@@ -296,13 +250,6 @@ class MonthDragController {
* nearest where the chip was let go is the one the finger was over.
*/
fun noteSettled(token: Any) {
val row = rows[token]
if (row != null && held.any { it.seat == null }) {
held = held.map { parked ->
val target = parked.copy.targetDate
if (parked.seat != null || target == null) parked else parked.copy(seat = row.seatOf(parked.copy.event, target))
}
}
val landed = settling ?: return
val target = landed.targetDate ?: return
val at = rows[token]?.seatOf(landed.event, target) ?: return
@@ -318,16 +265,16 @@ class MonthDragController {
* there is no drop of this controller's left to undo, or the grid doesn't
* seat the moved event where the chip would have to start from.
*/
fun beginUndo(token: Long, dropToken: Long): Boolean {
val last = undoable.remove(dropToken) ?: return false
parkSettling()
fun beginUndo(): Boolean {
val last = undoable ?: return false
undoable = null
val from = last.targetDate ?: return false
val at = rows.values.firstNotNullOfOrNull { it.seatOf(last.event, from) } ?: return false
settling = last.copy(grabDate = from, targetDate = last.grabDate, topLeftInRoot = at)
liftedInstanceId = last.event.instanceId
settledGhost = true
settledInRoot = null
settledToken = token
settledAbandonedMark = abandonedTicks?.value ?: 0
return true
}
@@ -347,11 +294,10 @@ class MonthDragController {
)
liftedInstanceId = landed.event.instanceId
settledGhost = true
settledToken = nextMoveToken()
undoable[settledToken] = requireNotNull(settling)
if (undoable.size > UNDOABLE_KEPT) undoable.remove(undoable.keys.first())
undoable = settling
settledAbandonedMark = abandonedTicks?.value ?: 0
drops++
return MonthChipDrop(landed.event, landed.grabDate, target, settledToken)
return MonthChipDrop(landed.event, landed.grabDate, target)
}
/**
@@ -409,10 +355,9 @@ class MonthDragController {
@Composable
fun rememberMonthDragController(): MonthDragController {
return remember { MonthDragController() }
val controller = remember { MonthDragController() }
controller.abandonedTicks = LocalEventMove.current?.abandoned
return controller
}
val LocalMonthDrag = compositionLocalOf<MonthDragController?> { null }
/** How many recent drops a month controller keeps for an undo to carry back. */
private const val UNDOABLE_KEPT = 8
@@ -34,10 +34,6 @@ internal sealed interface MonthMorphKey {
data class DayNumber(val date: LocalDate) : MonthMorphKey
data class WeekNumber(val weekStart: LocalDate) : MonthMorphKey
data class CellRipple(val date: LocalDate) : MonthMorphKey
/**
* One event *on one day*. Keyed by date as well as instance because a
* multi-day event has a dot on every day it covers but only one bar, drawn
@@ -115,8 +111,8 @@ internal fun morphInFlight(): Boolean {
*
* Rendering in place puts everything back in one z-order and one clip, which is
* what makes the grid read as a single surface changing shape rather than a
* stack of pieces sliding past each other. Event marks are the exception: they
* render in the overlay so the expanding day backgrounds cannot cover them.
* stack of pieces sliding past each other. Nothing here needs to escape its
* ancestors: the cells, marks and markers all travel within the grid.
*/
@OptIn(ExperimentalSharedTransitionApi::class)
@Composable
@@ -145,7 +141,6 @@ internal fun Modifier.morphElement(key: MonthMorphKey): Modifier {
@Composable
internal fun Modifier.morphBounds(key: MonthMorphKey): Modifier {
val morph = LocalMonthMorph.current ?: return this
val isEvent = key is MonthMorphKey.Event
return with(morph.shared) {
this@morphBounds.sharedBounds(
sharedContentState = rememberSharedContentState(key),
@@ -153,8 +148,7 @@ internal fun Modifier.morphBounds(key: MonthMorphKey): Modifier {
enter = fadeIn(),
exit = fadeOut(),
resizeMode = SharedTransitionScope.ResizeMode.RemeasureToBounds,
renderInOverlayDuringTransition = isEvent,
zIndexInOverlay = if (isEvent) 1f else 0f,
renderInOverlayDuringTransition = false,
)
}
}
@@ -2,12 +2,7 @@ package de.jeanlucmakiola.calendula.ui.month
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedContent
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.indication
import androidx.compose.foundation.LocalIndication
import androidx.compose.animation.EnterExitState
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.foundation.gestures.detectVerticalDragGestures
import androidx.compose.foundation.gestures.detectHorizontalDragGestures
import androidx.compose.foundation.pager.HorizontalPager
@@ -16,8 +11,8 @@ import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.runtime.setValue
import androidx.compose.runtime.rememberUpdatedState
import de.jeanlucmakiola.calendula.ui.agenda.AgendaDay
import de.jeanlucmakiola.calendula.ui.agenda.agendaDays
import de.jeanlucmakiola.calendula.ui.common.FabClearance
import de.jeanlucmakiola.calendula.ui.common.PublishChrome
import de.jeanlucmakiola.calendula.ui.common.ScreenActions
import de.jeanlucmakiola.calendula.ui.common.ScreenBody
@@ -68,7 +63,6 @@ import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.itemsIndexed
@@ -125,11 +119,11 @@ import de.jeanlucmakiola.calendula.ui.common.eventTitleOverflow
import de.jeanlucmakiola.calendula.ui.common.MoveTarget
import de.jeanlucmakiola.calendula.ui.common.MoveRequest
import de.jeanlucmakiola.calendula.ui.common.LocalEventMove
import de.jeanlucmakiola.calendula.ui.common.dropStates
import de.jeanlucmakiola.calendula.ui.common.moveInFlight
import de.jeanlucmakiola.calendula.ui.common.abandonedMoves
import de.jeanlucmakiola.calendula.ui.common.OnUndoStarted
import de.jeanlucmakiola.calendula.ui.common.ghostAlpha
import de.jeanlucmakiola.calendula.ui.common.DragSnapHaptics
import de.jeanlucmakiola.calendula.ui.common.rememberHeldSettle
import de.jeanlucmakiola.calendula.ui.common.SETTLE_FADE_MILLIS
import de.jeanlucmakiola.calendula.ui.common.SETTLE_GRACE_MILLIS
import de.jeanlucmakiola.calendula.ui.common.EventMoveScope
@@ -163,9 +157,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.hasEnded
import de.jeanlucmakiola.calendula.ui.agenda.agendaDayLabel
import de.jeanlucmakiola.calendula.ui.agenda.AgendaDayHeader
import de.jeanlucmakiola.calendula.ui.agenda.AgendaEmptyDayRow
import de.jeanlucmakiola.calendula.ui.agenda.AgendaEventRow
import de.jeanlucmakiola.calendula.ui.agenda.agendaDayLabel
import de.jeanlucmakiola.calendula.ui.common.formatCalendarTitle
import de.jeanlucmakiola.calendula.ui.common.AppBarSpacing
import de.jeanlucmakiola.calendula.ui.common.CalendarFailure
@@ -187,6 +182,7 @@ import de.jeanlucmakiola.floret.identity.itemEnter
import de.jeanlucmakiola.floret.identity.rememberReduceMotion
import de.jeanlucmakiola.floret.locale.currentLocale
import de.jeanlucmakiola.calendula.ui.common.next
import de.jeanlucmakiola.floret.time.isoWeekNumber
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filterNotNull
@@ -204,7 +200,6 @@ import java.time.format.TextStyle as JavaTextStyle
import java.util.Locale
import kotlinx.datetime.toJavaMonth
import kotlinx.datetime.yearMonth
import de.jeanlucmakiola.calendula.ui.common.rememberRowWeekNumber
private val LocalTodayPulse = staticCompositionLocalOf { 0 }
@@ -283,8 +278,6 @@ fun MonthScreen(
val selectedDate by viewModel.selectedDate.collectAsStateWithLifecycle()
val dimCompleted by viewModel.dimCompletedEvents.collectAsStateWithLifecycle()
val showWeekNumbers by viewModel.showWeekNumbers.collectAsStateWithLifecycle()
val showToday by viewModel.showToday.collectAsStateWithLifecycle()
val showStartTimes by viewModel.showStartTimes.collectAsStateWithLifecycle()
// The instant before which an event counts as completed, or null when dimming
// is off. derivedStateOf keeps the per-minute "now" from recomposing the
// screen while the setting is off (it stays null regardless of the tick).
@@ -370,7 +363,7 @@ fun MonthScreen(
if (!scrolling) return@LaunchedEffect
snapshotFlow {
// Empty before the first layout pass — and reporting a default of 0
// for it would claim the span's first month is on screen and drag the whole
// for it would claim January 1900 is on screen and drag the whole
// window back there.
val visible = listState.layoutInfo.visibleItemsInfo
when {
@@ -455,8 +448,7 @@ fun MonthScreen(
}
}
// Drawer jump-to-date.
val jumpToDate: (LocalDate) -> Unit = { date ->
val target = coerceToMonthRange(date)
val jumpToDate: (LocalDate) -> Unit = { target ->
if (scrolling) {
val targetMonth = target.yearMonth
pendingScrollMonth = targetMonth
@@ -515,7 +507,7 @@ fun MonthScreen(
val chipDrag = rememberMonthDragController()
// Undo moves the event back, so the chip travels back too. The
// signal comes from the write, not from the chip that offers it.
OnUndoStarted { start -> chipDrag.beginUndo(start.token, start.dropToken) }
OnUndoStarted { chipDrag.beginUndo() }
Box(
modifier = Modifier
.padding(innerPadding)
@@ -532,20 +524,17 @@ fun MonthScreen(
) {
if (scrolling) {
ContinuousMonthContent(
// Held on the skeleton until the start-time setting has
// loaded, so chips don't redraw without their times.
state = if (showStartTimes == null) ContinuousMonthUiState.Loading else continuousState,
state = continuousState,
listState = listState,
dense = dense,
showWeekNumbers = showWeekNumbers,
showStartTimes = showStartTimes == true,
onRetry = jumpToToday,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
} else {
SplitMonthContent(
state = if (showStartTimes == null) MonthUiState.Loading else state,
state = state,
selected = selectedDate,
initiallyExpanded = viewStyle == MonthViewStyle.Paged,
expanded = splitExpanded,
@@ -554,8 +543,6 @@ fun MonthScreen(
weekStart = weekStart,
monthState = viewModel::month,
showWeekNumbers = showWeekNumbers,
showStartTimes = showStartTimes == true,
showToday = showToday,
onPaneSwipeNext = { viewModel.stepSplitPane(1) },
onPaneSwipePrev = { viewModel.stepSplitPane(-1) },
onClearSelection = viewModel::clearSelection,
@@ -564,10 +551,8 @@ fun MonthScreen(
// month, pager and all — straight away, or a swipe
// still settling would land and take the tap back.
onSelectDay = { date ->
if (isInMonthRange(date)) {
viewModel.selectDate(date)
jumpToMonth(date.yearMonth)
}
viewModel.selectDate(date)
jumpToMonth(date.yearMonth)
},
onOpenDay = onOpenDay,
onEventClick = onEventClick,
@@ -576,7 +561,7 @@ fun MonthScreen(
}
}
}
MonthDragOverlay(chipDrag, showStartTimes = showStartTimes == true)
MonthDragOverlay(chipDrag)
}
}
}
@@ -589,13 +574,13 @@ private const val MONTH_SETTLE_TIMEOUT_MILLIS = 450L
/** The chip in flight, drawn over the grid and following the finger. */
@Composable
private fun MonthDragOverlay(controller: MonthDragController, showStartTimes: Boolean) {
private fun MonthDragOverlay(controller: MonthDragController) {
var origin by remember { mutableStateOf(Offset.Zero) }
val timeFit = rememberMonthChipTimeFit(showStartTimes)
val dark = LocalFloretDarkTheme.current
val density = LocalDensity.current
val timeChipWidth = rememberMonthTimeChipWidth()
val reduceMotion = rememberReduceMotion()
val drops = dropStates()
val moveInFlight = controller.settledToken in drops.pending
val abandoned = controller.settledToken in drops.abandoned
val moveInFlight = moveInFlight()
// Here rather than beside the controller: this reads [drag], which changes
// every frame, and this composable is the one that is meant to.
DragSnapHaptics(controller.drag?.targetDate, controller.drops)
@@ -608,12 +593,14 @@ private fun MonthDragOverlay(controller: MonthDragController, showStartTimes: Bo
val glide = remember { Animatable(Offset.Zero, Offset.VectorConverter) }
val glideSpec = MaterialTheme.motionScheme.fastSpatialSpec<Offset>()
val seat = controller.settledInRoot
val abandoned = abandonedMoves()
LaunchedEffect(controller.settling, moveInFlight, seat, abandoned) {
val landed = controller.settling
if (landed == null || moveInFlight) return@LaunchedEffect
if (seat == null) {
// An abandoned drop has no seat coming.
if (!abandoned) delay(MONTH_SETTLE_TIMEOUT_MILLIS)
// Past the mark this drop was let go on, it was abandoned and no
// seat is ever coming.
if (abandoned == controller.settledAbandonedMark) delay(MONTH_SETTLE_TIMEOUT_MILLIS)
} else {
if (!gliding) glide.snapTo(landed.topLeftInRoot)
gliding = true
@@ -633,9 +620,6 @@ private fun MonthDragOverlay(controller: MonthDragController, showStartTimes: Bo
.clearAndSetSemantics { }
.onGloballyPositioned { origin = it.positionInRoot() },
) {
controller.held.forEach { parked ->
key(parked.token) { HeldMonthChip(controller, parked, origin, timeFit) }
}
val drag = controller.drag ?: controller.settling ?: return@Box
// Landed: the copy sinks back to the grid's own plane while the write runs.
val lift by animateFloatAsState(
@@ -647,93 +631,41 @@ private fun MonthDragOverlay(controller: MonthDragController, showStartTimes: Bo
animationSpec = tween(SETTLE_FADE_MILLIS),
label = "chip-handover",
)
MonthChipCopy(
drag = drag,
// Read at layout, so the glide doesn't recompose every frame.
at = { if (gliding) glide.value else drag.topLeftInRoot },
origin = origin,
lift = lift,
alpha = copyAlpha,
timeFit = timeFit,
MonthBar(
event = drag.event,
dark = dark,
continuesLeft = false,
continuesRight = false,
// The time the source chip carried, drawn only if this one-column
// cut-out of it has the room — which a slice of a multi-day bar has
// not, however wide the bar was.
time = drag.time,
showTime = with(density) { drag.sizePx.width.toDp() } >= timeChipWidth,
modifier = Modifier
// Absolute: these are root coordinates, and the direction-aware
// offset would mirror them across the screen in an RTL layout.
.absoluteOffset {
val at = if (gliding) glide.value else drag.topLeftInRoot
IntOffset(
(at.x - origin.x).roundToInt(),
(at.y - origin.y).roundToInt(),
)
}
.width(with(density) { drag.sizePx.width.toDp() })
.height(with(density) { drag.sizePx.height.toDp() })
.padding(horizontal = MONTH_CHIP_INSET, vertical = 1.dp)
.graphicsLayer {
scaleX = 1f + 0.04f * lift
scaleY = 1f + 0.04f * lift
shadowElevation = 8.dp.toPx() * lift
alpha = copyAlpha
shape = EventChipShape
clip = false
},
)
}
}
/** A drop parked by a newer pickup: held on its landing day until its own write settles. */
@Composable
private fun HeldMonthChip(
controller: MonthDragController,
parked: HeldChip,
origin: Offset,
timeFit: MonthChipTimeFit?,
) {
val reduceMotion = rememberReduceMotion()
val glide = remember { Animatable(parked.copy.topLeftInRoot, Offset.VectorConverter) }
val glideSpec = MaterialTheme.motionScheme.fastSpatialSpec<Offset>()
val seat = parked.seat
val landed = parked.token !in dropStates().pending
// Carried onto its seat once the write is in, as the settling chip is.
LaunchedEffect(seat, landed) {
if (seat == null || !landed) return@LaunchedEffect
if (reduceMotion) glide.snapTo(seat) else glide.animateTo(seat, glideSpec)
}
val alpha = rememberHeldSettle(
token = parked.token,
seated = seat != null,
timeoutMillis = MONTH_SETTLE_TIMEOUT_MILLIS,
onHandOver = { controller.handOverHeld(parked.token) },
onRelease = { controller.releaseHeld(parked.token) },
)
MonthChipCopy(parked.copy, { glide.value }, origin, lift = 0f, alpha = alpha, timeFit = timeFit)
}
/** [drag]'s chip floating over the grid with its top left at [at], in root coordinates. */
@Composable
private fun MonthChipCopy(
drag: MonthChipDrag,
at: () -> Offset,
origin: Offset,
lift: Float,
alpha: Float,
timeFit: MonthChipTimeFit?,
) {
val density = LocalDensity.current
val dark = LocalFloretDarkTheme.current
MonthBar(
event = drag.event,
dark = dark,
continuesLeft = false,
continuesRight = false,
// The time the source chip carried, drawn only if this one-column
// cut-out of it has the room — which a slice of a multi-day bar has
// not, however wide the bar was.
time = drag.time,
timeFit = timeFit,
chipWidth = with(density) { drag.sizePx.width.toDp() },
modifier = Modifier
// Absolute: these are root coordinates, and the direction-aware
// offset would mirror them across the screen in an RTL layout.
.absoluteOffset {
val topLeft = at()
IntOffset(
(topLeft.x - origin.x).roundToInt(),
(topLeft.y - origin.y).roundToInt(),
)
}
.width(with(density) { drag.sizePx.width.toDp() })
.height(with(density) { drag.sizePx.height.toDp() })
.padding(horizontal = MONTH_CHIP_INSET, vertical = 1.dp)
.graphicsLayer {
scaleX = 1f + 0.04f * lift
scaleY = 1f + 0.04f * lift
shadowElevation = 8.dp.toPx() * lift
this.alpha = alpha
shape = EventChipShape
clip = false
},
)
}
/**
* Content for both scrolling styles. No swipe detector and no [AnimatedContent]:
* vertical scrolling owns the gesture, and the list never swaps wholesale — it
@@ -745,7 +677,6 @@ private fun ContinuousMonthContent(
listState: LazyListState,
dense: Boolean,
showWeekNumbers: Boolean,
showStartTimes: Boolean,
onRetry: () -> Unit,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
@@ -762,7 +693,6 @@ private fun ContinuousMonthContent(
state = state,
listState = listState,
showWeekNumbers = showWeekNumbers,
showStartTimes = showStartTimes,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
@@ -771,7 +701,6 @@ private fun ContinuousMonthContent(
state = state,
listState = listState,
showWeekNumbers = showWeekNumbers,
showStartTimes = showStartTimes,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
@@ -944,7 +873,6 @@ private val DENSE_HEADER_GAP = 4.dp
internal fun MonthGrid(
state: MonthUiState.Success,
showWeekNumbers: Boolean,
showStartTimes: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
/** See [MonthWeekRow]'s `selected`: an anchor for the morph, never a mark. */
@@ -969,13 +897,13 @@ internal fun MonthGrid(
val month = state.month
// Once per grid: the value depends on the typography, the density, the
// locale and the 24-hour setting, none of which vary by row (#219).
val timeFit = rememberMonthChipTimeFit(showStartTimes)
val timeChipWidth = rememberMonthTimeChipWidth()
state.weeks.forEach { week ->
MonthWeekRow(
week = week,
today = state.today,
zone = state.zone,
timeFit = timeFit,
timeChipWidth = timeChipWidth,
rowHeight = rowHeight,
inMonth = { it.month == month.month && it.year == month.year },
showWeekNumbers = showWeekNumbers,
@@ -1011,19 +939,18 @@ internal fun ContinuousMonthGrid(
state: ContinuousMonthUiState.Success,
listState: LazyListState,
showWeekNumbers: Boolean,
showStartTimes: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
modifier: Modifier = Modifier,
) {
val monthCount = remember { continuousMonthCount() }
val todayMonth = remember(state.today) { state.today.yearMonth }
val timeFit = rememberMonthChipTimeFit(showStartTimes)
val timeChipWidth = rememberMonthTimeChipWidth()
LazyColumn(
state = listState,
modifier = modifier.fillMaxSize(),
// Bottom inset clears the FAB stack so the last row stays tappable.
contentPadding = PaddingValues(bottom = FabClearance),
contentPadding = PaddingValues(bottom = 96.dp),
) {
repeat(monthCount) { index ->
val month = yearMonthForIndex(index)
@@ -1041,7 +968,7 @@ internal fun ContinuousMonthGrid(
weekStart = state.weekStart,
today = state.today,
zone = state.zone,
timeFit = timeFit,
timeChipWidth = timeChipWidth,
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
@@ -1063,7 +990,7 @@ private fun ContinuousMonthBlock(
weekStart: DayOfWeek,
today: LocalDate,
zone: TimeZone,
timeFit: MonthChipTimeFit?,
timeChipWidth: Dp,
showWeekNumbers: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
@@ -1084,7 +1011,7 @@ private fun ContinuousMonthBlock(
week = week,
today = today,
zone = zone,
timeFit = timeFit,
timeChipWidth = timeChipWidth,
rowHeight = CONTINUOUS_ROW_HEIGHT,
inMonth = { it.month == month.month && it.year == month.year },
// The block owns its month alone: a day from either
@@ -1150,13 +1077,12 @@ internal fun DenseMonthGrid(
state: ContinuousMonthUiState.Success,
listState: LazyListState,
showWeekNumbers: Boolean,
showStartTimes: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
modifier: Modifier = Modifier,
) {
val weekCount = remember(state.weekStart) { continuousWeekCount(state.weekStart) }
val timeFit = rememberMonthChipTimeFit(showStartTimes)
val timeChipWidth = rememberMonthTimeChipWidth()
LazyColumn(
state = listState,
modifier = modifier
@@ -1169,7 +1095,7 @@ internal fun DenseMonthGrid(
.padding(top = DENSE_HEADER_GAP),
verticalArrangement = Arrangement.spacedBy(2.dp),
// Bottom inset clears the FAB stack so the last row stays tappable.
contentPadding = PaddingValues(bottom = FabClearance),
contentPadding = PaddingValues(bottom = 96.dp),
) {
items(count = weekCount, key = { it }) { index ->
val week = state.weeksByIndex[index]
@@ -1180,7 +1106,7 @@ internal fun DenseMonthGrid(
week = week,
today = state.today,
zone = state.zone,
timeFit = timeFit,
timeChipWidth = timeChipWidth,
rowHeight = CONTINUOUS_ROW_HEIGHT,
// Every day in the stream belongs to a month equally — there
// is no "other month" to recede here.
@@ -1272,8 +1198,6 @@ private fun SplitMonthContent(
weekStart: DayOfWeek,
monthState: (YearMonth, DayOfWeek) -> StateFlow<MonthUiState>,
showWeekNumbers: Boolean,
showStartTimes: Boolean,
showToday: Boolean,
onPaneSwipeNext: () -> Unit,
onPaneSwipePrev: () -> Unit,
onClearSelection: () -> Unit,
@@ -1283,12 +1207,9 @@ private fun SplitMonthContent(
onEventClick: (EventInstance) -> Unit,
onCreateEvent: (LocalDate) -> Unit,
) {
val fadeSpec = rememberCalendarFadeSpec()
val reduceMotion = rememberReduceMotion()
val haptics = LocalHapticFeedback.current
// Registered first so the expand handler below wins while the grid is open.
BackHandler(enabled = selected != null && !expanded) {
onClearSelection()
}
BackHandler(enabled = expanded != initiallyExpanded) {
onExpandedChange(initiallyExpanded)
}
@@ -1357,9 +1278,8 @@ private fun SplitMonthContent(
modifier = Modifier.fillMaxSize(),
// Both faces fill the same page — the grid grows into exactly the
// room the pane gives up — so there is no size change to contain.
// Fading the faces made the shared cell backgrounds briefly
// disappear beneath their incoming counterparts.
transitionSpec = { EnterTransition.None togetherWith ExitTransition.None },
// The travel between them is the shared elements' job.
transitionSpec = { fadeIn(fadeSpec) togetherWith fadeOut(fadeSpec) },
label = "split-expand",
) { isExpanded ->
// The view switch's morph stays off a face until it has fully
@@ -1390,7 +1310,6 @@ private fun SplitMonthContent(
state = page,
selected = pageSelected,
showWeekNumbers = showWeekNumbers,
showStartTimes = showStartTimes,
expandDrag = expandDrag,
onPickDay = onPickDay,
// A tapped chip is asking for that event, not for its
@@ -1416,11 +1335,7 @@ private fun SplitMonthContent(
state = page,
paneReady = paneReady,
selected = pageSelected,
selectionIndicatorVisible = reduceMotion ||
(transition.currentState == EnterExitState.Visible &&
transition.targetState == EnterExitState.Visible),
showWeekNumbers = showWeekNumbers,
showToday = showToday,
expandDrag = expandDrag,
onSelectDay = onSelectDay,
onPaneSwipeNext = {
@@ -1462,9 +1377,7 @@ private fun SplitMonthCollapsed(
state: MonthUiState.Success,
paneReady: Boolean,
selected: LocalDate?,
selectionIndicatorVisible: Boolean,
showWeekNumbers: Boolean,
showToday: Boolean,
expandDrag: Modifier,
onSelectDay: (LocalDate) -> Unit,
onPaneSwipeNext: () -> Unit,
@@ -1484,7 +1397,6 @@ private fun SplitMonthCollapsed(
SplitMonthGrid(
state = state,
selected = selected,
selectionIndicatorVisible = selectionIndicatorVisible,
showWeekNumbers = showWeekNumbers,
onSelectDay = onSelectDay,
modifier = Modifier.height(splitGridHeight(state.weeks.size)),
@@ -1498,7 +1410,6 @@ private fun SplitMonthCollapsed(
Box(Modifier.weight(1f).fillMaxWidth().then(paneModifier)) {
SplitMonthAgendaPane(
state = state,
showToday = showToday,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
onCreateEvent = onCreateEvent,
@@ -1512,13 +1423,24 @@ private fun SplitMonthCollapsed(
.then(paneModifier)
.then(rememberSplitPaneSwipe(onPaneSwipeNext, onPaneSwipePrev)),
) {
InputChip(
selected = true,
onClick = onClearSelection,
label = { Text(agendaDayLabel(selected, state.today)) },
trailingIcon = {
Icon(
Icons.Default.Close,
contentDescription = stringResource(R.string.month_split_clear_filter),
)
},
modifier = Modifier.padding(start = 16.dp),
)
SplitDayPane(
date = selected,
today = state.today,
events = state.instancesByDay[selected],
zone = state.zone,
onOpenDay = onOpenDay,
onClearSelection = onClearSelection,
onEventClick = onEventClick,
onCreateEvent = onCreateEvent,
modifier = Modifier.weight(1f).fillMaxWidth(),
@@ -1565,7 +1487,6 @@ private fun SplitMonthExpanded(
/** Marked nowhere here; it only anchors the outline's morph. */
selected: LocalDate?,
showWeekNumbers: Boolean,
showStartTimes: Boolean,
expandDrag: Modifier,
onPickDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
@@ -1578,7 +1499,6 @@ private fun SplitMonthExpanded(
MonthGrid(
state = state,
showWeekNumbers = showWeekNumbers,
showStartTimes = showStartTimes,
onOpenDay = onPickDay,
onEventClick = onEventClick,
selected = selected,
@@ -1692,7 +1612,6 @@ private val SPLIT_PANE_EASING = CubicBezierEasing(0.05f, 0.7f, 0.1f, 1f)
internal fun SplitMonthGrid(
state: MonthUiState.Success,
selected: LocalDate?,
selectionIndicatorVisible: Boolean = true,
showWeekNumbers: Boolean,
onSelectDay: (LocalDate) -> Unit,
modifier: Modifier = Modifier,
@@ -1738,7 +1657,6 @@ internal fun SplitMonthGrid(
// removes that without timing anything against the
// page transition.
isSelected = day == selected && inMonth,
selectionIndicatorVisible = selectionIndicatorVisible,
inMonth = inMonth,
relativeToToday = todayCol?.let { col - it },
rippleProgress = { ripple.value },
@@ -1767,7 +1685,6 @@ private fun SplitDayCell(
hidden: List<EventInstance>,
isToday: Boolean,
isSelected: Boolean,
selectionIndicatorVisible: Boolean,
inMonth: Boolean,
relativeToToday: Int?,
rippleProgress: () -> Float,
@@ -1797,7 +1714,7 @@ private fun SplitDayCell(
// pace it lingered after the thing it marks had already moved.
val outlineSpec = MaterialTheme.motionScheme.fastEffectsSpec<Float>()
val selection = animateFloatAsState(
targetValue = if (isSelected && selectionIndicatorVisible) 1f else 0f,
targetValue = if (isSelected) 1f else 0f,
animationSpec = if (reduceMotion) snap() else outlineSpec,
label = "split-day-selection",
)
@@ -1809,19 +1726,12 @@ private fun SplitDayCell(
// built — and so the pill can be tagged for the morph on its own. Tagged as
// one piece with its contents inside, the dots would be nested shared
// elements within a shared element and travel twice.
// The cell keeps the click and selection semantics, so TalkBack reads the
// day number with them; the topmost layer only draws the ripple.
val interaction = remember { MutableInteractionSource() }
Box(
modifier = modifier
.padding(horizontal = CELL_GAP, vertical = 1.dp)
.todayRipple(relativeToToday, rippleProgress)
.selectable(
selected = isSelected,
interactionSource = interaction,
indication = null,
onClick = onClick,
),
.clip(CELL_SHAPE)
.selectable(selected = isSelected, onClick = onClick),
contentAlignment = Alignment.TopCenter,
) {
Box(
@@ -1883,13 +1793,6 @@ private fun SplitDayCell(
Spacer(Modifier.height(2.dp))
SplitDots(date = date, events = events, hidden = hidden, dark = dark)
}
Box(
Modifier
.fillMaxSize()
.morphElement(MonthMorphKey.CellRipple(date))
.clip(CELL_SHAPE)
.indication(interaction, LocalIndication.current),
)
}
}
@@ -1911,10 +1814,7 @@ private fun SplitDots(
if (events.isEmpty()) return
val soften = LocalSoftenColors.current
val dimCutoff = LocalDimCutoff.current
// Held to the dots' height so a "+N" doesn't grow the row and push the dots
// down; the label overflows it evenly instead (#142).
Row(
modifier = Modifier.height(SPLIT_DOT_SIZE),
horizontalArrangement = Arrangement.spacedBy(2.dp),
verticalAlignment = Alignment.CenterVertically,
) {
@@ -1949,7 +1849,6 @@ private fun SplitDots(
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier
.wrapContentHeight(unbounded = true)
.morphBounds(MonthMorphKey.Overflow(date))
.alpha(if (allEnded(hidden, date, dimCutoff)) EventDimAlpha else 1f),
)
@@ -1960,33 +1859,22 @@ private fun SplitDots(
@Composable
private fun SplitMonthAgendaPane(
state: MonthUiState.Success,
showToday: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
onCreateEvent: (LocalDate) -> Unit,
) {
val days = remember(state.month, state.today, state.instancesByDay, showToday) {
splitAgendaDays(state.month, state.today, state.instancesByDay, showToday)
}
val start = agendaStartForMonth(state.month, state.today)
val days = state.instancesByDay.keys
.filter { it >= start && it.year == state.month.year && it.month == state.month.month }
.filter { state.instancesByDay[it].orEmpty().isNotEmpty() }
.toMutableList()
.apply { if (start !in this) add(start) }
.sorted()
val dimCutoff = LocalDimCutoff.current
val listState = key(state.month) { rememberLazyListState() }
LazyColumn(state = listState, contentPadding = PaddingValues(bottom = FabClearance)) {
// A fixed first item, so a day added above the first listed one shows
// up rather than landing above a list that holds its scroll position.
item(key = "top") { Spacer(Modifier.height(4.dp)) }
if (days.isEmpty()) {
val start = agendaStartForMonth(state.month, state.today)
item(key = "empty") {
AgendaEmptyDayRow(
text = stringResource(
if (start == state.today) R.string.month_split_no_more_events else R.string.month_split_no_events_month,
),
onClick = { onCreateEvent(start) },
)
}
}
LazyColumn(state = listState, contentPadding = PaddingValues(top = 8.dp, bottom = 96.dp)) {
agendaDays(
days = days,
days = days.map { AgendaDay(it, state.instancesByDay[it].orEmpty()) },
today = state.today,
zone = state.zone,
emptyText = R.string.month_split_no_events,
@@ -1994,7 +1882,6 @@ private fun SplitMonthAgendaPane(
dimmed = { event, day -> dimCutoff != null && event.isPastOn(day, dimCutoff) },
onOpenDay = onOpenDay,
onEventClick = onEventClick,
compact = true,
)
}
}
@@ -2002,8 +1889,7 @@ private fun SplitMonthAgendaPane(
/**
* The selected day's events, in the agenda's own row vocabulary so the two
* surfaces read as one app. The date header opens the full Day view, matching
* the Week and Agenda headers (#37). It is shown as the filter chip itself,
* whose ✕ clears the day filter back to the whole month (#142).
* the Week and Agenda headers (#37).
*/
@Composable
internal fun SplitDayPane(
@@ -2013,7 +1899,6 @@ internal fun SplitDayPane(
events: List<EventInstance>?,
zone: TimeZone,
onOpenDay: (LocalDate) -> Unit,
onClearSelection: () -> Unit,
onEventClick: (EventInstance) -> Unit,
onCreateEvent: (LocalDate) -> Unit,
modifier: Modifier = Modifier,
@@ -2025,23 +1910,7 @@ internal fun SplitDayPane(
val enter = itemEnter()
val fadeSpec = rememberCalendarFadeSpec()
Column(modifier = modifier) {
InputChip(
selected = true,
onClick = { onOpenDay(date) },
label = {
Text(agendaDayLabel(date, today), style = MaterialTheme.typography.titleSmall)
},
trailingIcon = {
Icon(
Icons.Default.Close,
contentDescription = stringResource(R.string.month_split_clear_filter),
modifier = Modifier
.clip(CircleShape)
.clickable(onClick = onClearSelection),
)
},
modifier = Modifier.padding(start = 16.dp),
)
AgendaDayHeader(date = date, today = today, onOpenDay = onOpenDay)
AnimatedContent(
targetState = date to events,
modifier = Modifier.weight(1f).fillMaxWidth(),
@@ -2064,7 +1933,7 @@ internal fun SplitDayPane(
else -> LazyColumn(
// Bottom inset clears the FAB stack so the last row stays
// tappable.
contentPadding = PaddingValues(bottom = FabClearance),
contentPadding = PaddingValues(bottom = 96.dp),
) {
itemsIndexed(
items = dayEvents,
@@ -2220,8 +2089,8 @@ private fun MonthWeekRow(
today: LocalDate,
/** The zone the grid was laid out in — never re-read here (see [MonthUiState.Success.zone]). */
zone: TimeZone,
/** Prices chips' start times, once per grid; null when they are switched off (#219, #476). */
timeFit: MonthChipTimeFit?,
/** The narrowest chip that may carry a start time, measured once per grid (#219). */
timeChipWidth: Dp,
/** The height this row was given, which decides its lanes — see [laneCapFor]. */
rowHeight: Dp,
inMonth: (LocalDate) -> Boolean,
@@ -2310,7 +2179,7 @@ private fun MonthWeekRow(
// Once the grid holds the settled chip, tell the controller where this row
// has seated it, so the copy in flight can glide onto it. Keyed on the week,
// which is what changes when the re-read lands.
LaunchedEffect(week, dragController?.settling, dragController?.held) {
LaunchedEffect(week, dragController?.settling) {
dragController?.noteSettled(rowToken)
}
@@ -2347,8 +2216,8 @@ private fun MonthWeekRow(
),
),
) {
// What a chip has to spend, against what [timeFit] says its start
// time costs it (#219).
// What a chip has to spend, against the [timeChipWidth] a start time
// costs it (#219).
val colW = maxWidth / 7
// Held here rather than read at the offset: the dots are placed
// inside a plain lambda, which is no longer in this scope. The box
@@ -2438,8 +2307,7 @@ private fun MonthWeekRow(
continuesRight = span.continuesRight,
days = week.days.subList(span.startCol, span.endCol + 1),
time = chipTimes[span.event.instanceId],
timeFit = timeFit,
chipWidth = colW * cols,
showTime = colW * cols >= timeChipWidth,
modifier = Modifier
.offset(
x = colW * span.startCol,
@@ -2516,8 +2384,7 @@ private fun MonthWeekRow(
continuesRight = false,
days = listOf(d),
time = chipTimes[ev.instanceId],
timeFit = timeFit,
chipWidth = colW,
showTime = colW >= timeChipWidth,
modifier = Modifier
.offset(
x = colW * col,
@@ -2615,7 +2482,6 @@ private fun MonthWeekRow(
}
}
.padding(horizontal = CELL_GAP, vertical = 1.dp)
.morphElement(MonthMorphKey.CellRipple(d))
.clip(CELL_SHAPE)
.clickable {
// Cleared on read: a click with no fresh down
@@ -2743,8 +2609,6 @@ private fun monthChipDragModifier(
beginMillis = drop.event.start.toEpochMilliseconds(),
endMillis = drop.event.end.toEpochMilliseconds(),
target = MoveTarget.ByDays(delta),
isAllDay = drop.event.isAllDay,
token = drop.token,
),
)
}
@@ -2755,20 +2619,19 @@ private fun monthChipDragModifier(
/**
* Left-gutter calendar-week cell (#25): a full-height tonal pill mirroring the
* day cells' geometry, set apart by the secondaryContainer tint (matching the
* Week view's badge), with the week number centred like a day number. It is
* numbered by the device region from the row's mid-week day, as in the Week
* view, so it is right for any first weekday (#493).
* Week view's badge), with the ISO week number centred like a day number. The
* week is computed on the row's first day — the same basis as the Week view — so
* the two agree.
*/
@Composable
private fun WeekNumberGutter(weekStart: LocalDate, modifier: Modifier = Modifier) {
val weekNumber = rememberRowWeekNumber(weekStart)
val weekNumber = remember(weekStart) { weekStart.toJavaLocalDate().isoWeekNumber() }
val label = stringResource(R.string.week_number_label)
val openLabel = stringResource(R.string.month_open_week, weekNumber)
val onOpenWeek = LocalOpenWeek.current
Box(
modifier = modifier
.padding(horizontal = CELL_GAP, vertical = 1.dp)
.morphElement(MonthMorphKey.WeekNumber(weekStart))
.clip(CELL_SHAPE)
.background(MaterialTheme.colorScheme.secondaryContainer)
.then(if (onOpenWeek != null) Modifier.clickable(onClickLabel = openLabel) {
@@ -2847,7 +2710,7 @@ private fun shortMonthName(date: LocalDate): String {
/**
* A filled event pill/bar — softened (or raw) fill, title clipped to one line,
* with the start time before it where the chip is wide enough ([timeFit], #219, #476).
* with the start time before it where the chip is wide enough ([showTime], #219).
*/
@Composable
private fun MonthBar(
@@ -2864,13 +2727,10 @@ private fun MonthBar(
days: List<LocalDate>? = null,
/** The chip's start time, or null where it has none — see `monthChipTime` (#219). */
time: String? = null,
/** Decides whether [time] is drawn at [chipWidth]; null draws none. A screen reader gets it either way. */
timeFit: MonthChipTimeFit? = null,
/** The chip's full width, chrome included. */
chipWidth: Dp = 0.dp,
/** Whether this chip has the width to draw [time]; a screen reader gets it either way. */
showTime: Boolean = false,
) {
val title = event.title.ifBlank { stringResource(R.string.event_untitled) }
val showTime = time != null && timeFit != null && timeFit.showsTime(chipWidth, title)
val dimCutoff = LocalDimCutoff.current
// A bar is one piece, so it dims once the last day it covers has passed.
val dimmed = dimCutoff != null &&
@@ -2890,17 +2750,8 @@ private fun MonthBar(
val moveAction = eventMoveAction(event)
// The source stays put as a ghost while its floating copy travels.
val monthDrag = LocalMonthDrag.current
// Derived, so a chip recomposes only when its own answer changes rather than
// on every lift, park and release anywhere in the grid.
val lifted by remember(monthDrag, event, days) {
derivedStateOf {
monthDrag != null && (
monthDrag.liftedInstanceId == event.instanceId ||
monthDrag.isSettledChip(event, days) ||
monthDrag.isHeldChip(event, days)
)
}
}
val lifted = monthDrag?.liftedInstanceId == event.instanceId ||
monthDrag?.isSettledChip(event, days) == true
val ghost = ghostAlpha(lifted)
val shape = monthBarShape(continuesLeft, continuesRight)
Box(
@@ -31,7 +31,6 @@ import kotlinx.datetime.yearMonth
internal fun MonthStylePreview(
style: MonthViewStyle,
weekStart: DayOfWeek,
showStartTimes: Boolean,
height: Dp,
modifier: Modifier = Modifier,
) {
@@ -45,7 +44,6 @@ internal fun MonthStylePreview(
MonthViewStyle.Paged -> MonthGrid(
state = sample.month,
showWeekNumbers = false,
showStartTimes = showStartTimes,
onOpenDay = {},
onEventClick = {},
)
@@ -57,7 +55,6 @@ internal fun MonthStylePreview(
),
),
showWeekNumbers = false,
showStartTimes = showStartTimes,
onOpenDay = {},
onEventClick = {},
)
@@ -70,7 +67,6 @@ internal fun MonthStylePreview(
initialFirstVisibleItemIndex = weekIndexOf(today, weekStart) - 1,
),
showWeekNumbers = false,
showStartTimes = showStartTimes,
onOpenDay = {},
onEventClick = {},
)
@@ -87,7 +83,6 @@ internal fun MonthStylePreview(
events = sample.month.instancesByDay[today].orEmpty(),
zone = zone,
onOpenDay = {},
onClearSelection = {},
onEventClick = {},
onCreateEvent = {},
modifier = Modifier.fillMaxWidth().height(SPLIT_PANE_HEIGHT),
@@ -13,15 +13,11 @@ import de.jeanlucmakiola.calendula.data.time.currentDate
import de.jeanlucmakiola.calendula.data.time.stateFollowingDays
import de.jeanlucmakiola.calendula.domain.CalendarSource
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.domain.FailureReason
import de.jeanlucmakiola.calendula.domain.calendarListFailure
import de.jeanlucmakiola.calendula.ui.agenda.AgendaDay
import de.jeanlucmakiola.calendula.ui.agenda.anchorTodayIfMissing
import de.jeanlucmakiola.calendula.ui.common.CalendarSpan
import de.jeanlucmakiola.calendula.ui.common.PageStateCache
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.sortedForDisplay
import de.jeanlucmakiola.calendula.domain.isDeclined
import de.jeanlucmakiola.calendula.domain.eventDisplayComparator
import de.jeanlucmakiola.calendula.ui.week.coversDay
import de.jeanlucmakiola.calendula.ui.week.layoutAllDay
import de.jeanlucmakiola.calendula.ui.week.spansMultipleDays
@@ -85,23 +81,6 @@ class MonthViewModel @Inject constructor(
initialValue = false,
)
/** Whether the split agenda keeps a free today, as the Agenda view does (#35). */
val showToday: StateFlow<Boolean> = settingsPrefs.agendaShowToday
.stateWhileSubscribed(
scope = viewModelScope,
initialValue = true,
)
/**
* Whether chips may show their start time before the title (#476; display
* only). Null until the setting has loaded, so the grid can wait for it.
*/
val showStartTimes: StateFlow<Boolean?> = settingsPrefs.monthShowStartTimes
.stateWhileSubscribed(
scope = viewModelScope,
initialValue = null,
)
/** How the grid is laid out and navigated (#38, #53). */
val viewStyle: StateFlow<MonthViewStyle> = settingsPrefs.monthViewStyle
.stateWhileSubscribed(
@@ -116,7 +95,7 @@ class MonthViewModel @Inject constructor(
val today: StateFlow<LocalDate> =
todaySource.today.stateFollowingDays(viewModelScope, todayDate, ::followToday)
private val _month = MutableStateFlow(yearMonthForIndex(monthIndexOf(todayDate.yearMonth)))
private val _month = MutableStateFlow(todayDate.yearMonth)
val month: StateFlow<YearMonth> = _month
/**
@@ -170,7 +149,7 @@ class MonthViewModel @Inject constructor(
/** The pager came to rest on [page]; follow it unless it is already the anchor's. */
fun onPageSettled(page: Int) {
if (monthIndexOf(_month.value) == page) return
setMonth(yearMonthForIndex(page))
_month.value = yearMonthForIndex(page)
// Moving the grid to another month restores its full agenda.
_selectedDate.value = null
}
@@ -319,11 +298,9 @@ class MonthViewModel @Inject constructor(
* silently list a date the grid isn't pointing at.
*/
fun selectDate(date: LocalDate) {
// A greyed-out day past either end of the grid has no month to follow to.
if (!isInMonthRange(date)) return
val target = date.yearMonth
_selectedDate.value = if (target == _month.value && _selectedDate.value == date) null else date
if (target != _month.value) setMonth(target)
if (target != _month.value) _month.value = target
}
fun clearSelection() { _selectedDate.value = null }
@@ -332,16 +309,16 @@ class MonthViewModel @Inject constructor(
fun stepSplitPane(days: Int) {
val selected = _selectedDate.value
if (selected == null) {
setMonth(yearMonthForIndex(monthIndexOf(_month.value) + days))
_month.value = yearMonthForIndex(monthIndexOf(_month.value) + days)
} else {
val next = coerceToMonthRange(selected.plus(days, DateTimeUnit.DAY))
val next = selected.plus(days, DateTimeUnit.DAY)
_selectedDate.value = next
setMonth(next.yearMonth)
_month.value = next.yearMonth
}
}
fun goToToday() {
setMonth(todayDate.yearMonth)
_month.value = todayDate.yearMonth
_selectedDate.value = null
}
@@ -353,7 +330,7 @@ class MonthViewModel @Inject constructor(
private fun followToday(old: LocalDate, new: LocalDate) {
if (viewStyle.value.isScrolling) return
if (_month.value != old.yearMonth) return
setMonth(new.yearMonth)
_month.value = new.yearMonth
_selectedDate.value = null
}
@@ -367,24 +344,14 @@ class MonthViewModel @Inject constructor(
*/
fun syncScrollMonth(ym: YearMonth) {
if (_month.value == ym) return
setMonth(ym)
_month.value = ym
_selectedDate.value = null
}
/**
* Jump to the month containing [date] (drawer jump-to-date, or the focus
* handed over by another view). The focus itself keeps a date outside the
* grid's span, so the day and week views return to it unchanged.
*/
/** Jump to the month containing [date] (drawer jump-to-date). */
fun goToDate(date: LocalDate) {
val target = coerceToMonthRange(date)
setMonth(target.yearMonth)
_selectedDate.value = target
}
/** Every write to [_month] goes through here, so it can't leave the grid's span (#457). */
private fun setMonth(ym: YearMonth) {
_month.value = yearMonthForIndex(monthIndexOf(ym))
_month.value = date.yearMonth
_selectedDate.value = date
}
private fun buildState(
@@ -502,7 +469,7 @@ internal fun layoutCalendarWeek(
// crossing midnight into the next week row covers a single day in each, and
// counting per row drew it as two unrelated pills (#253).
val (bars, singles) = weekEvents.partition { ev ->
ev.coversWholeDays(zone) || ev.spansMultipleDays(zone)
ev.isAllDay || ev.spansMultipleDays(zone)
}
val spans = layoutAllDay(bars, days, zone).map { s ->
MonthSpan(
@@ -521,7 +488,7 @@ internal fun layoutCalendarWeek(
// Declined last, so a day that overflows drops the events you said
// no to before the ones you are actually going to (#230).
singles.filter { it.coversDay(d, zone) }
.sortedWith(compareBy<EventInstance> { it.isCrossedOut }.thenBy { it.start })
.sortedWith(compareBy<EventInstance> { it.isDeclined }.thenBy { it.start })
},
countByDay = days.associateWith { d -> weekEvents.count { it.coversDay(d, zone) } },
)
@@ -542,7 +509,7 @@ internal fun instancesByDay(
days.associateWith { day ->
instances
.filter { it.coversDay(day, zone) }
.sortedForDisplay(zone)
.sortedWith(eventDisplayComparator(zone))
}
/**
@@ -589,25 +556,6 @@ internal fun agendaStartForMonth(month: YearMonth, today: LocalDate): LocalDate
LocalDate(month.year, month.month, 1)
}
/**
* The days the split agenda lists for [month]: those from [agendaStartForMonth]
* on that have events, plus a free today when [showToday] is set, as in the
* Agenda view (#142).
*/
internal fun splitAgendaDays(
month: YearMonth,
today: LocalDate,
instancesByDay: Map<LocalDate, List<EventInstance>>,
showToday: Boolean,
): List<AgendaDay> {
val start = agendaStartForMonth(month, today)
val days = instancesByDay.keys
.filter { it >= start && it.yearMonth == month && instancesByDay.getValue(it).isNotEmpty() }
.sorted()
.map { AgendaDay(it, instancesByDay.getValue(it)) }
return anchorTodayIfMissing(days, today, enabled = showToday && start == today)
}
/**
* The window to load for a visible range, or null to keep the current one.
*
@@ -630,39 +578,24 @@ internal fun nextLoadWindow(
/**
* The continuous grid addresses months by an absolute index, so the list has one
* stable, gap-free coordinate space to scroll through and key its items by.
* Index 0 is the first month of [CalendarSpan]; the list runs to [continuousMonthCount].
* Index 0 is January 1900; the list runs to [continuousMonthCount].
*
* Unlike the week indexing this replaced, the coordinate space doesn't depend on
* the week-start preference — changing it reflows the rows *inside* a month
* block but never moves the block, so a scroll position stays put.
*/
private val MONTH_INDEX_EPOCH_YEAR = CalendarSpan.FIRST_DAY.year
private val MONTH_INDEX_END_YEAR = CalendarSpan.LAST_DAY.year
/** The first and last day the month and Dense grids can show. */
private val GRID_FIRST_DAY = LocalDate(MONTH_INDEX_EPOCH_YEAR, 1, 1)
private val GRID_LAST_DAY = LocalDate(MONTH_INDEX_END_YEAR, 12, 31)
private const val MONTH_INDEX_EPOCH_YEAR = 1900
private const val MONTH_INDEX_END_YEAR = 2100
internal fun monthIndexOf(ym: YearMonth): Int =
(ym.year - MONTH_INDEX_EPOCH_YEAR) * 12 + ym.month.ordinal
/** The month at [index], held to the grid's span, so a stray index can't throw (#457). */
internal fun yearMonthForIndex(index: Int): YearMonth {
val held = clampMonthIndex(index)
return YearMonth(MONTH_INDEX_EPOCH_YEAR + held / 12, Month.entries[held % 12])
}
internal fun yearMonthForIndex(index: Int): YearMonth = YearMonth(
MONTH_INDEX_EPOCH_YEAR + index / 12,
Month.entries[index % 12],
)
internal fun clampMonthIndex(index: Int): Int = index.coerceIn(0, continuousMonthCount() - 1)
/**
* Hold [date] inside the span the month grid can show. Every view shares
* [CalendarSpan], but another app can open Calendula on any date (#457).
*/
internal fun coerceToMonthRange(date: LocalDate): LocalDate = date.coerceIn(GRID_FIRST_DAY, GRID_LAST_DAY)
internal fun isInMonthRange(date: LocalDate): Boolean = date in GRID_FIRST_DAY..GRID_LAST_DAY
/** Total months the continuous grid scrolls through. */
/** Total months the continuous grid scrolls through (1900 → 2100). */
internal fun continuousMonthCount(): Int =
(MONTH_INDEX_END_YEAR - MONTH_INDEX_EPOCH_YEAR + 1) * 12
@@ -678,23 +611,25 @@ internal fun monthIndexForItem(itemIndex: Int): Int = itemIndex / 2
/**
* Hold a load window inside the months that actually exist. The pad
* [nextLoadWindow] adds can otherwise push an index past either end of the
* span, and [yearMonthForIndex] has no month to hand back for one.
* 1900–2100 span, and [yearMonthForIndex] has no month to hand back for one.
*/
internal fun clampMonthWindow(window: IntRange): IntRange =
clampMonthIndex(window.first)..clampMonthIndex(window.last)
internal fun clampMonthWindow(window: IntRange): IntRange {
val last = continuousMonthCount() - 1
return window.first.coerceIn(0, last)..window.last.coerceIn(0, last)
}
/**
* The Dense style addresses *weeks* by absolute index instead: it has no month
* blocks to key by, and a row's identity has to survive the months around it
* scrolling past. Index 0 is the span's first week under the active week-start,
* scrolling past. Index 0 is the first week of 1900 under the active week-start,
* so — like the month space — every index is non-negative and the LazyColumn's
* item indices and week indices are the same number.
*
* Unlike month indices these *do* shift with the week-start preference, which is
* why the list state is keyed on it.
*/
private val WEEK_INDEX_EPOCH = GRID_FIRST_DAY
private val WEEK_INDEX_END = GRID_LAST_DAY
private val WEEK_INDEX_EPOCH = LocalDate(1900, 1, 1)
private val WEEK_INDEX_END = LocalDate(2100, 12, 31)
internal fun weekIndexOf(date: LocalDate, weekStart: DayOfWeek): Int {
val base = WEEK_INDEX_EPOCH.startOfWeek(weekStart)
@@ -704,7 +639,7 @@ internal fun weekIndexOf(date: LocalDate, weekStart: DayOfWeek): Int {
internal fun weekStartForIndex(index: Int, weekStart: DayOfWeek): LocalDate =
WEEK_INDEX_EPOCH.startOfWeek(weekStart).plus(index * 7, DateTimeUnit.DAY)
/** Total weeks the Dense grid scrolls through. */
/** Total weeks the Dense grid scrolls through (1900 → 2100). */
internal fun continuousWeekCount(weekStart: DayOfWeek): Int =
weekIndexOf(WEEK_INDEX_END, weekStart) + 1
@@ -220,7 +220,6 @@ class OnboardingViewModel @Inject constructor(
prefs.defaultView,
prefs.monthViewStyle,
prefs.weekStart,
prefs.monthShowStartTimes,
::ViewChoice,
).stateWhileSubscribed(
scope = viewModelScope,
@@ -465,7 +464,6 @@ data class ViewChoice(
val defaultView: CalendarView,
val monthViewStyle: MonthViewStyle,
val weekStart: WeekStartPref,
val monthShowStartTimes: Boolean,
)
/**
@@ -63,7 +63,6 @@ internal fun ViewStep(
CalendarView.Month -> MonthStylePreview(
style = choice.monthViewStyle,
weekStart = weekStart,
showStartTimes = choice.monthShowStartTimes,
height = PREVIEW_HEIGHT,
)
CalendarView.Week -> WeekViewPreview(weekStart = weekStart, height = PREVIEW_HEIGHT)
@@ -119,12 +118,7 @@ internal fun MonthStyleStep(
navigationIcon = navigationIcon,
) {
StepPreview(selected = choice.monthViewStyle) { style ->
MonthStylePreview(
style = style,
weekStart = weekStart,
showStartTimes = choice.monthShowStartTimes,
height = PREVIEW_HEIGHT,
)
MonthStylePreview(style = style, weekStart = weekStart, height = PREVIEW_HEIGHT)
}
GroupedHint(stringResource(choice.monthViewStyle.descriptionRes), verticalPadding = 8.dp)
options.forEachIndexed { index, style ->
@@ -75,7 +75,7 @@ import de.jeanlucmakiola.calendula.domain.MatchSpan
import de.jeanlucmakiola.calendula.domain.RecurringWriteScope
import de.jeanlucmakiola.calendula.domain.SearchHit
import de.jeanlucmakiola.calendula.domain.SearchMonth
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isDeclined
import de.jeanlucmakiola.floret.identity.LocalFloretDarkTheme
import de.jeanlucmakiola.floret.identity.animateItemMotion
import de.jeanlucmakiola.floret.identity.fadeThrough
@@ -94,7 +94,6 @@ import de.jeanlucmakiola.calendula.ui.common.EventDimAlpha
import de.jeanlucmakiola.calendula.ui.common.LocalSoftenColors
import de.jeanlucmakiola.calendula.ui.common.RecurringScopeDialog
import de.jeanlucmakiola.calendula.ui.common.eventAccent
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.domain.spanFirstDay
import de.jeanlucmakiola.calendula.ui.common.LocalUse24HourFormat
import de.jeanlucmakiola.calendula.ui.common.timeOfDayFormatter
@@ -500,7 +499,7 @@ private fun SearchResultRow(
// Faded like a past event anywhere else in the app — search reaches back
// through the whole history.
modifier = if (hit.isPast) modifier.alpha(EventDimAlpha) else modifier,
title = declinedTitle(marked(title, hit.titleSpans, highlight), event.isCrossedOut),
title = declinedTitle(marked(title, hit.titleSpans, highlight), event.isDeclined),
summary = searchSummary(hit, highlight),
position = position,
minHeight = 64.dp,
@@ -610,7 +609,7 @@ private fun searchSummary(hit: SearchHit, highlight: SpanStyle): AnnotatedString
.format(event.spanFirstDay(TimeZone.currentSystemDefault()).toJavaLocalDate())
}
val use24Hour = LocalUse24HourFormat.current
val timeText = if (event.coversWholeDays(TimeZone.currentSystemDefault())) {
val timeText = if (event.isAllDay) {
stringResource(R.string.event_detail_all_day)
} else {
remember(locale, use24Hour) { timeOfDayFormatter(use24Hour, locale) }.format(start)
@@ -33,7 +33,6 @@ import kotlinx.datetime.DayOfWeek
internal fun MonthViewStylePicker(
selected: MonthViewStyle,
weekStart: DayOfWeek,
showStartTimes: Boolean,
onSelect: (MonthViewStyle) -> Unit,
onDismiss: () -> Unit,
) {
@@ -51,7 +50,6 @@ internal fun MonthViewStylePicker(
MonthStylePreview(
style = shown,
weekStart = weekStart,
showStartTimes = showStartTimes,
height = PREVIEW_HEIGHT,
)
}
@@ -42,8 +42,6 @@ data class SettingsUiState(
val dimCompletedEvents: Boolean = false,
/** Whether the Month grid shows calendar-week numbers in a left gutter (#25). */
val showWeekNumbers: Boolean = false,
/** Whether Month chips may show start times before their titles (#476). */
val monthShowStartTimes: Boolean = true,
/** Whether the jump-to-today control sits in the top bar instead of the FAB (#60). */
val todayButtonInToolbar: Boolean = false,
/** Whether events can be dragged to another slot to reschedule them (#68, #173). */
@@ -101,7 +101,6 @@ class SettingsViewModel @Inject constructor(
pastEventDisplay = this[SettingsKeys.pastEventDisplay],
dimCompletedEvents = this[SettingsKeys.dimCompletedEvents],
showWeekNumbers = this[SettingsKeys.showWeekNumbers],
monthShowStartTimes = this[SettingsKeys.monthShowStartTimes],
todayButtonInToolbar = this[SettingsKeys.todayButtonInToolbar],
dragToReschedule = this[SettingsKeys.dragToReschedule],
tapOpensEditor = this[SettingsKeys.tapOpensEditor],
@@ -293,8 +292,6 @@ class SettingsViewModel @Inject constructor(
fun setShowWeekNumbers(enabled: Boolean) = save { setShowWeekNumbers(enabled) }
fun setMonthShowStartTimes(enabled: Boolean) = save { setMonthShowStartTimes(enabled) }
fun setTodayButtonInToolbar(enabled: Boolean) = save { setTodayButtonInToolbar(enabled) }
fun setDragToReschedule(enabled: Boolean) = save { setDragToReschedule(enabled) }
@@ -160,13 +160,6 @@ internal fun ViewsScreen(
checked = state.showWeekNumbers,
onCheckedChange = viewModel::setShowWeekNumbers,
summary = stringResource(R.string.settings_week_numbers_summary),
position = Position.Middle,
)
GroupedSwitchRow(
title = stringResource(R.string.settings_month_start_times),
checked = state.monthShowStartTimes,
onCheckedChange = viewModel::setMonthShowStartTimes,
summary = stringResource(R.string.settings_month_start_times_summary),
position = Position.Bottom,
)
@@ -303,7 +296,6 @@ internal fun ViewsScreen(
selected = state.monthViewStyle,
// The preview is a real grid, so it uses the real week start too.
weekStart = state.weekStart.resolveFirstDay(currentLocale()),
showStartTimes = state.monthShowStartTimes,
onSelect = viewModel::setMonthViewStyle,
onDismiss = { showMonthStyle = false },
)
@@ -332,7 +324,6 @@ internal fun ViewsScreen(
selected = state.weekStart,
// The preview is a real grid, so it uses the user's own month style.
monthStyle = state.monthViewStyle,
showStartTimes = state.monthShowStartTimes,
options = WEEK_START_OPTIONS,
onSelect = viewModel::setWeekStart,
onDismiss = { showWeekStart = false },
@@ -27,7 +27,6 @@ import de.jeanlucmakiola.floret.locale.currentLocale
internal fun WeekStartPicker(
selected: WeekStartPref,
monthStyle: MonthViewStyle,
showStartTimes: Boolean,
options: List<WeekStartPref>,
onSelect: (WeekStartPref) -> Unit,
onDismiss: () -> Unit,
@@ -47,7 +46,6 @@ internal fun WeekStartPicker(
MonthStylePreview(
style = monthStyle,
weekStart = day,
showStartTimes = showStartTimes,
height = PREVIEW_HEIGHT,
)
}
@@ -6,7 +6,6 @@ import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.ui.common.StripDrop
import de.jeanlucmakiola.calendula.ui.common.TimelineDragController
import de.jeanlucmakiola.calendula.ui.common.TimelineDrop
import de.jeanlucmakiola.calendula.ui.common.TimelineResizeDrop
@@ -26,7 +25,6 @@ internal class TimelineActions(
val onCreateAt: (LocalDate, Int) -> Unit,
val onDrop: (TimelineDrop) -> Unit,
val onResize: (TimelineResizeDrop) -> Unit,
val onStripDrop: (StripDrop) -> Unit,
)
/** The callbacks are read through their latest values, so the holder outlives them. */
@@ -39,14 +37,12 @@ internal fun rememberTimelineActions(
onCreateAt: (LocalDate, Int) -> Unit,
onDrop: (TimelineDrop) -> Unit,
onResize: (TimelineResizeDrop) -> Unit,
onStripDrop: (StripDrop) -> Unit,
): TimelineActions {
val eventClick = rememberUpdatedState(onEventClick)
val openDay = rememberUpdatedState(onOpenDay)
val createAt = rememberUpdatedState(onCreateAt)
val drop = rememberUpdatedState(onDrop)
val resize = rememberUpdatedState(onResize)
val stripDrop = rememberUpdatedState(onStripDrop)
return remember(scrollState, dragController) {
TimelineActions(
scrollState = scrollState,
@@ -56,7 +52,6 @@ internal fun rememberTimelineActions(
onCreateAt = { date, minutes -> createAt.value(date, minutes) },
onDrop = { drop.value(it) },
onResize = { resize.value(it) },
onStripDrop = { stripDrop.value(it) },
)
}
}
@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.ui.week
import de.jeanlucmakiola.calendula.ui.common.CalendarSpan
import de.jeanlucmakiola.calendula.ui.common.startOfWeek
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.DayOfWeek
@@ -8,7 +7,16 @@ import kotlinx.datetime.LocalDate
import kotlinx.datetime.daysUntil
import kotlinx.datetime.plus
/** A fixed day every grid's pages are counted from. */
/** Pages the week pager spans — a little under four centuries. */
internal const val WEEK_PAGE_COUNT: Int = 20_000
/** Pages the multi-day pager spans — over three centuries at the widest page. */
internal const val DAYS_PAGE_COUNT: Int = 40_000
/** Pages the day pager spans — a little under four centuries. */
internal const val DAY_PAGE_COUNT: Int = 140_000
/** A fixed day every grid's pages are counted from, at its middle page. */
private val DAYS_EPOCH = LocalDate(2000, 1, 1)
/** The week the week pager's middle page shows; any date works, it only has to stay fixed. */
@@ -16,19 +24,13 @@ private val WEEK_EPOCH = LocalDate(2000, 1, 3)
/**
* How a timeline pager cuts the calendar: runs of [dayCount] days, offset
* [phase] days from a fixed epoch, over as many pages as cover [CalendarSpan].
* The multi-day view's phase (#193) stays put while paging and only changes when
* a jump moves another date to the first column.
* [phase] days from a fixed epoch, over [pageCount] pages centred on it. The
* multi-day view's phase (#193) stays put while paging and only changes when a
* jump moves another date to the first column.
*/
data class DaysGrid(val dayCount: Int, val phase: Int) {
data class DaysGrid(val dayCount: Int, val phase: Int, val pageCount: Int = DAYS_PAGE_COUNT) {
/** The page showing the epoch; page 0 is the one holding [CalendarSpan.FIRST_DAY]. */
private val epochPage: Int get() = -pagesFromEpoch(CalendarSpan.FIRST_DAY)
val pageCount: Int get() = epochPage + pagesFromEpoch(CalendarSpan.LAST_DAY) + 1
private fun pagesFromEpoch(date: LocalDate): Int =
Math.floorDiv(DAYS_EPOCH.daysUntil(date) - phase, dayCount)
private val epochPage: Int get() = pageCount / 2
/** First day shown on pager [page]. */
fun startForPage(page: Int): LocalDate =
@@ -36,16 +38,18 @@ data class DaysGrid(val dayCount: Int, val phase: Int) {
/** The pager page showing [date]. */
fun pageFor(date: LocalDate): Int =
(epochPage + pagesFromEpoch(date)).coerceIn(0, pageCount - 1)
(epochPage + Math.floorDiv(DAYS_EPOCH.daysUntil(date) - phase, dayCount))
.coerceIn(0, pageCount - 1)
companion object {
/** Single days: every date starts a page of its own. */
val days: DaysGrid = DaysGrid(dayCount = 1, phase = 0)
val days: DaysGrid = DaysGrid(dayCount = 1, phase = 0, pageCount = DAY_PAGE_COUNT)
/** Whole weeks, starting on [firstDay]. */
fun weeks(firstDay: DayOfWeek): DaysGrid = DaysGrid(
dayCount = 7,
phase = DAYS_EPOCH.daysUntil(WEEK_EPOCH.startOfWeek(firstDay)),
pageCount = WEEK_PAGE_COUNT,
)
/** The grid of [dayCount]-day pages on which [date] is a page's first day. */
@@ -106,16 +106,9 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.animation.core.FiniteAnimationSpec
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.snap
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.runtime.State
import androidx.compose.ui.layout.ParentDataModifier
import androidx.compose.ui.unit.Density
import androidx.compose.ui.layout.layout
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
@@ -132,9 +125,6 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.dateZone
import de.jeanlucmakiola.calendula.domain.spanFirstDay
import de.jeanlucmakiola.calendula.domain.spanLastDay
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.ui.common.LocalChipGround
import de.jeanlucmakiola.calendula.ui.common.eventPaint
@@ -157,12 +147,10 @@ import de.jeanlucmakiola.calendula.ui.common.LocalEventMove
import de.jeanlucmakiola.calendula.ui.common.MoveRequest
import de.jeanlucmakiola.calendula.ui.common.MoveTarget
import de.jeanlucmakiola.calendula.ui.common.TimelineDragController
import de.jeanlucmakiola.calendula.ui.common.ghostsDerived
import de.jeanlucmakiola.calendula.ui.common.StripDrag
import de.jeanlucmakiola.calendula.ui.common.StripDrop
import de.jeanlucmakiola.calendula.ui.common.TimelineDragOverlay
import de.jeanlucmakiola.calendula.ui.common.TimelineDrop
import de.jeanlucmakiola.calendula.ui.common.clipOffsetMinutes
import de.jeanlucmakiola.calendula.ui.common.continuesAfter
import de.jeanlucmakiola.calendula.ui.common.continuesBefore
import de.jeanlucmakiola.calendula.ui.common.ChipCuts
import de.jeanlucmakiola.calendula.ui.common.timedBlockCuts
@@ -197,10 +185,8 @@ import de.jeanlucmakiola.floret.locale.currentLocale
import de.jeanlucmakiola.calendula.ui.common.LocalUse24HourFormat
import de.jeanlucmakiola.calendula.ui.common.LocalShowHourGrid
import de.jeanlucmakiola.calendula.ui.common.LocalTimelineZoom
import de.jeanlucmakiola.calendula.ui.common.renderedSpan
import de.jeanlucmakiola.calendula.ui.common.MIN_EVENT_FRACTION
import de.jeanlucmakiola.calendula.ui.common.hourHeight
import de.jeanlucmakiola.calendula.ui.common.dayFitHeight
import de.jeanlucmakiola.calendula.ui.common.FabClearance
import de.jeanlucmakiola.calendula.ui.common.rememberTimelinePinchZoom
import de.jeanlucmakiola.calendula.ui.common.formatMinuteOfDay
import de.jeanlucmakiola.calendula.ui.common.GUTTER_CONTENT_START_INSET
@@ -210,8 +196,8 @@ import de.jeanlucmakiola.calendula.ui.common.TIMELINE_CONTENT_END_INSET
import de.jeanlucmakiola.calendula.ui.common.hourCellBlockInset
import de.jeanlucmakiola.calendula.ui.common.hourGridCells
import de.jeanlucmakiola.calendula.ui.common.tappedMinuteOfDay
import de.jeanlucmakiola.floret.time.isoWeekNumber
import kotlinx.coroutines.launch
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.LocalDate
import kotlinx.datetime.TimeZone
import kotlinx.datetime.plus
@@ -221,7 +207,6 @@ import kotlinx.datetime.toLocalDateTime
import java.time.format.TextStyle as JavaTextStyle
import java.util.Locale
import kotlinx.datetime.yearMonth
import de.jeanlucmakiola.calendula.ui.common.rememberRowWeekNumber
/** One lane of the all-day strip, sized to a trimmed bar line (#190). */
private val ALL_DAY_ROW_HEIGHT = 20.dp
@@ -311,6 +296,14 @@ internal enum class TimelineKind(
// A run of days often straddles two weeks, so no single number fits it.
MultiDay(showWeekNumber = false, todayText = R.string.week_today_action, headerBias = 0f),
Day(showWeekNumber = false, todayText = R.string.day_today_action, headerBias = -1f),
;
fun title(start: LocalDate, end: LocalDate, locale: Locale, currentYear: Int, abbreviated: Boolean): String =
if (this == Day) {
formatDayTitle(start, locale, currentYear, abbreviated)
} else {
formatWeekTitle(start, end, locale, currentYear, abbreviated)
}
}
internal val CalendarView.timelineKind: TimelineKind
@@ -485,10 +478,9 @@ private fun PagedTimelineScreen(
val jumpToToday = { jumpToDate(today) }
val locale = currentLocale()
// The day view names the month too: its header already shows weekday and date (#501).
val (title, shortTitle) = remember(weekStart, weekEnd, locale, today.year) {
formatTimelineTitle(weekStart, weekEnd, locale, today.year, abbreviated = false) to
formatTimelineTitle(weekStart, weekEnd, locale, today.year, abbreviated = true)
val (title, shortTitle) = remember(titleKind, weekStart, weekEnd, locale, today.year) {
titleKind.title(weekStart, weekEnd, locale, today.year, abbreviated = false) to
titleKind.title(weekStart, weekEnd, locale, today.year, abbreviated = true)
}
PublishChrome(
ScreenChrome(
@@ -585,9 +577,7 @@ private fun WeekContent(
eventId = drop.event.eventId,
beginMillis = drop.event.start.toEpochMilliseconds(),
endMillis = drop.event.end.toEpochMilliseconds(),
isAllDay = drop.event.isAllDay,
target = MoveTarget.Start(start),
token = drop.token,
),
)
}
@@ -606,26 +596,7 @@ private fun WeekContent(
eventId = drop.event.eventId,
beginMillis = drop.event.start.toEpochMilliseconds(),
endMillis = drop.event.end.toEpochMilliseconds(),
isAllDay = drop.event.isAllDay,
target = MoveTarget.Span(drop.start, drop.end),
token = drop.token,
),
)
}
// Off the all-day strip: sideways moves days, into the grid makes it timed.
val onStripDrop: (StripDrop) -> Unit = { drop ->
move?.move(
MoveRequest(
eventId = drop.event.eventId,
beginMillis = drop.event.start.toEpochMilliseconds(),
endMillis = drop.event.end.toEpochMilliseconds(),
isAllDay = drop.event.isAllDay,
target = when (drop) {
is StripDrop.Days -> MoveTarget.ByDays(drop.days)
is StripDrop.Timed -> MoveTarget.Span(drop.start, drop.end)
},
token = drop.token,
),
)
}
@@ -690,7 +661,6 @@ private fun WeekContent(
onCreateAt = onCreateAt,
onDrop = onDrop,
onResize = onResize,
onStripDrop = onStripDrop,
)
Box(modifier = modifier) {
@@ -766,11 +736,7 @@ private fun WeekPager(
val loaded = pageState as? WeekUiState.Success
// Until its days arrive a page shows their frame without events.
val empty = remember(pageSpan, today) { emptySpan(pageSpan, today) }
// A bar held over other days in the strip makes room there before it is dropped.
val held = dragController.stripPreviews().takeIf { page == pagerState.currentPage }.orEmpty()
val zone = LocalTimelineZone.current
val shown = remember(loaded, held, zone) { loaded?.withStripPreview(held, zone) }
val stripHeight = shown?.allDayStripHeight()
val stripHeight = loaded?.allDayStripHeight()
DisposableEffect(page, stripHeight) {
if (stripHeight != null) stripHeights[page] = stripHeight
onDispose { stripHeights.remove(page) }
@@ -778,8 +744,8 @@ private fun WeekPager(
ViewMorphPage(active = morphPageActive(page, pagerState.settledPage)) {
WeekPage(
// A cached page may predate midnight; today comes off the clock (#373).
state = remember(shown, empty, today) {
shown?.takeIf { it.today != today }?.copy(today = today) ?: shown ?: empty
state = remember(loaded, empty, today) {
loaded?.takeIf { it.today != today }?.copy(today = today) ?: loaded ?: empty
},
headerBias = kind.headerBias,
allDayHeight = allDayHeight,
@@ -791,43 +757,6 @@ private fun WeekPager(
}
}
/**
* [this] with the strip bars [held] sideways laid out at the days they are over,
* so the bars there move aside live. Each bar keeps its own event, and with it
* its key and the gesture on it; one moved off the page keeps a lane it is not
* seen in.
*/
internal fun WeekUiState.Success.withStripPreview(held: List<StripDrag>, zone: TimeZone): WeekUiState.Success {
val shifts = held.filter { !it.overGrid && it.dayShift != 0 }.associate { it.event.instanceId to it.dayShift }
if (shifts.isEmpty()) return this
val originals = allDaySpans.filter { it.event.instanceId in shifts }.associateBy { it.event.instanceId }
if (originals.isEmpty()) return this
val events = allDaySpans.map { span ->
shifts[span.event.instanceId]?.let { span.event.shiftedDays(it, zone) } ?: span.event
}
val spans = layoutAllDay(events, days, zone).map { span ->
originals[span.event.instanceId]?.let { span.copy(event = it.event) } ?: span
}
val laidOut = spans.mapTo(HashSet()) { it.event.instanceId }
return copy(allDaySpans = spans + originals.values.filter { it.event.instanceId !in laidOut }.map { it.copy(lane = 0) })
}
private fun EventInstance.shiftedDays(days: Int, zone: TimeZone): EventInstance {
val dates = dateZone(zone)
return copy(start = start.plus(days, DateTimeUnit.DAY, dates), end = end.plus(days, DateTimeUnit.DAY, dates))
}
/** Whether these bars draw the strip drop [drop] at the days it was dropped on. */
private fun List<PlacedBar>.drawStripDrop(drop: StripDrag, zone: TimeZone): Boolean {
val target = drop.event.spanFirstDay(zone).plus(drop.dayShift, DateTimeUnit.DAY)
return any { bar ->
bar.event.instanceId != drop.event.instanceId &&
(bar.event.eventId == drop.event.eventId ||
(drop.event.title.isNotBlank() && bar.event.title == drop.event.title)) &&
bar.event.spanFirstDay(zone) == target
}
}
/** A page with no events yet, for one whose days are still loading. */
private fun emptySpan(span: DaySpan, today: LocalDate): WeekUiState.Success {
val days = (0 until span.count).map { span.start.plus(it, kotlinx.datetime.DateTimeUnit.DAY) }
@@ -963,9 +892,8 @@ private fun WeekFrame(
),
) {
val zoom = LocalTimelineZoom.current
val fitHeight = dayFitHeight(
if (animatedAllDayHeight == null) maxHeight + allDayHeight else maxHeight,
)
val fitHeight = if (animatedAllDayHeight == null) maxHeight + allDayHeight
else maxHeight
val hourHeight = zoom.scale.hourHeight(fitHeight)
HourGutter(
scrollState = actions.scrollState,
@@ -1064,7 +992,7 @@ private fun TimelinePageContent(
LocalChipGround provides MaterialTheme.colorScheme.surface,
) {
AllDayStrip(geometry = geometry, bars = bars, height = allDayHeight,
animatedHeight = animatedAllDayHeight, actions = actions, active = active)
animatedHeight = animatedAllDayHeight, onEventClick = actions.onEventClick)
}
}
Spacer(Modifier.height(TIMELINE_TOP_GAP))
@@ -1154,7 +1082,7 @@ private fun WeekDayHeader(
*/
@Composable
private fun WeekNumberCell(weekStart: LocalDate, showBadge: Boolean, modifier: Modifier = Modifier) {
val weekNumber = rememberRowWeekNumber(weekStart)
val weekNumber = remember(weekStart) { weekStart.toJavaLocalDate().isoWeekNumber() }
Column(
modifier = modifier
.fillMaxWidth()
@@ -1199,23 +1127,9 @@ private fun AllDayStrip(
bars: List<PlacedBar>,
height: Dp,
animatedHeight: (() -> Dp)? = null,
actions: TimelineActions,
active: Boolean,
onEventClick: (EventInstance) -> Unit,
) {
val dark = LocalFloretDarkTheme.current
val zone = LocalTimelineZone.current
val dragController = actions.dragController
// Only the page the finger is on draws the drag; the controller is shared.
val held = (dragController.stripDrag ?: dragController.stripSettling)?.takeIf { active }
val sideways = held?.takeIf { !it.overGrid }
val lifted = dragController.liftedInstanceId?.takeIf { active && dragController.stripDrag?.overGrid != false }
val settling = dragController.stripSettling?.takeIf { active }
val heldStrips = dragController.heldStrips.takeIf { active }.orEmpty()
// Seated once the re-read draws the event at the days it was dropped on.
LaunchedEffect(settling, heldStrips, bars) {
if (settling != null && bars.drawStripDrop(settling, zone)) dragController.seatStrip()
heldStrips.forEach { if (!it.seated && bars.drawStripDrop(it.drag, zone)) dragController.seatHeldStrip(it.token) }
}
Row(
modifier = Modifier
@@ -1236,20 +1150,12 @@ private fun AllDayStrip(
content = {
bars.forEach { bar ->
key(bar.event.eventId, bar.event.start) {
val moving = sideways?.event?.instanceId == bar.event.instanceId
val lane = animatedStripLane(bar.toLane)
AllDayBar(
event = bar.event,
lastDay = bar.toRange.endInclusive,
dark = dark,
dragController = dragController,
lifted = moving,
ghosted = lifted == bar.event.instanceId,
onClick = { actions.onEventClick(bar.event) },
onDrop = actions.onStripDrop,
onClick = { onEventClick(bar.event) },
modifier = Modifier
.then(if (moving) Modifier.zIndex(1f) else Modifier)
.then(StripLane(lane))
.morphEvent(ViewMorphKey.event(bar.event, bar.keyDate))
.padding(horizontal = 1.dp, vertical = 1.dp),
)
@@ -1266,19 +1172,10 @@ private fun AllDayStrip(
val progress = geometry.progress()
val placed = measurables.mapIndexed { i, measurable ->
val bar = bars[i]
val shift = sideways?.takeIf { it.event.instanceId == bar.event.instanceId }?.dayShift ?: 0
val extent = if (shift == 0) {
geometry.extent(bar.fromRange, bar.toRange, width, 0f)
} else {
// The whole event, not the part this page shows: it may come in from off screen.
val moved = bar.event.spanFirstDay(zone)..bar.event.spanLastDay(zone)
geometry.extent(moved.shiftedBy(shift), moved.shiftedBy(shift), width, 0f)
}
val extent = geometry.extent(bar.fromRange, bar.toRange, width, 0f)
val left = extent.left.roundToInt()
val barWidth = (extent.right.roundToInt() - left).coerceAtLeast(0)
// Standing still a bar tweens to a new lane, as bars make room for a dragged one.
val lane = (measurable.parentData as? StripLane)?.lane?.takeIf { bar.fromLane == bar.toLane }
val y = ((lane?.value ?: lerp(bar.fromLane.toFloat(), bar.toLane.toFloat(), progress)) * rowPx).roundToInt()
val y = (lerp(bar.fromLane.toFloat(), bar.toLane.toFloat(), progress) * rowPx).roundToInt()
Triple(measurable.measure(Constraints.fixed(barWidth, rowPx.roundToInt())), left, y)
}
layout(constraints.maxWidth, constraints.maxHeight) {
@@ -1288,31 +1185,12 @@ private fun AllDayStrip(
}
}
private data class StripLane(val lane: State<Float>) : ParentDataModifier {
override fun Density.modifyParentData(parentData: Any?): Any = this@StripLane
}
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
private fun animatedStripLane(lane: Int): State<Float> {
val spec: FiniteAnimationSpec<Float> =
if (rememberReduceMotion()) snap() else MaterialTheme.motionScheme.fastSpatialSpec()
return animateFloatAsState(lane.toFloat(), spec, label = "strip-lane")
}
private fun ClosedRange<LocalDate>.shiftedBy(days: Int): ClosedRange<LocalDate> =
start.plus(days, DateTimeUnit.DAY)..endInclusive.plus(days, DateTimeUnit.DAY)
@Composable
private fun AllDayBar(
event: EventInstance,
lastDay: LocalDate,
dark: Boolean,
dragController: TimelineDragController,
lifted: Boolean,
ghosted: Boolean,
onClick: () -> Unit,
onDrop: (StripDrop) -> Unit,
modifier: Modifier = Modifier,
) {
val title = event.title.ifBlank { stringResource(R.string.event_untitled) }
@@ -1320,29 +1198,8 @@ private fun AllDayBar(
// 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)
val zone = LocalTimelineZone.current
val draggable = eventDragAllowed(event)
// Long press lifts the bar: sideways moves its days, down into the grid makes it timed.
val dragModifier = rememberEventDragSource(
enabled = draggable,
key = event.instanceId,
onPickUp = { pointer, _, _ ->
dragController.beginStrip(event, zone, pointer)
if (dragController.stripDrag != null) PickUp.Drag else PickUp.None
},
onMove = dragController::move,
onDrop = { dragController.finishStrip()?.let(onDrop) },
onCancel = dragController::cancel,
onRelease = dragController::cancel,
)
// Ghosted while it hangs over the grid as a timed block, and until that drop lands.
val ghost = ghostAlpha(ghosted)
val raise = selectionLift(lifted)
Box(
modifier = (if (dimmed) modifier.alpha(EventDimAlpha) else modifier)
.alpha(ghost)
.selectionLift(raise, EventChipShape)
.then(dragModifier)
.eventSurface(paint, EventChipShape)
.clickable(onClick = onClick)
.padding(horizontal = 6.dp, vertical = 2.dp)
@@ -1397,9 +1254,7 @@ private fun Timeline(
else Modifier.stableMorphViewport(animatedAllDayHeight, fullViewportHeight),
),
) {
val fitHeight = dayFitHeight(
if (animatedAllDayHeight == null) maxHeight + allDayHeight else maxHeight,
)
val fitHeight = if (animatedAllDayHeight == null) maxHeight + allDayHeight else maxHeight
val hourHeight = zoom.scale.hourHeight(fitHeight)
val totalHeight = hourHeight * 24
// The pinch sits above the scroll viewport: it has to outrank the
@@ -1432,11 +1287,9 @@ private fun Timeline(
.fillMaxSize()
.then(pinch)
.padding(end = TIMELINE_CONTENT_END_INSET)
.clip(RoundedCornerShape(TIMELINE_CORNER))
.clip(RoundedCornerShape(16.dp))
.verticalScroll(scrollState)
.onGloballyPositioned { if (active) dragController.geometry.viewport = it }
// Past midnight, outside the columns: nothing there takes a tap or a drop.
.padding(bottom = FabClearance),
.onGloballyPositioned { if (active) dragController.geometry.viewport = it },
) {
TimelineColumns(
geometry = geometry,
@@ -1472,7 +1325,6 @@ private fun Timeline(
visibleTop = visibleTop,
viewportHeight = visibleViewport,
actions = actions,
shape = columnShape(day == geometry.dates.first(), day == geometry.dates.last()),
modifier = Modifier.fillMaxHeight(),
)
}
@@ -1480,19 +1332,6 @@ private fun Timeline(
}
}
/**
* The outer columns round their bottom corner at midnight: the room left below
* for the buttons means the rounded window no longer does it there.
*/
private fun columnShape(first: Boolean, last: Boolean): Shape =
if (!first && !last) RectangleShape
else RoundedCornerShape(
bottomStart = if (first) TIMELINE_CORNER else 0.dp,
bottomEnd = if (last) TIMELINE_CORNER else 0.dp,
)
private val TIMELINE_CORNER = 16.dp
@Composable
private fun DayColumnCard(
blocks: List<TimedBlock>,
@@ -1504,7 +1343,6 @@ private fun DayColumnCard(
visibleTop: () -> Float,
viewportHeight: () -> Float,
actions: TimelineActions,
shape: Shape = RectangleShape,
modifier: Modifier = Modifier,
) {
val scrollState = actions.scrollState
@@ -1535,8 +1373,8 @@ private fun DayColumnCard(
val draftSurface = rememberDraftSurface(date, edges, hourPx, dragController, actions.onDrop)
Card(
// Plain rectangular columns — the soft corners come from the outer
// rounded scroll viewport, apart from the outer ones' bottoms ([columnShape]).
shape = shape,
// rounded scroll viewport, so inner rounding would look odd at the edges.
shape = RectangleShape,
colors = CardDefaults.cardColors(
// With the grid on, the container colour moves onto the hour cells
// and the column behind them recedes to surface, so the gap between
@@ -1576,6 +1414,7 @@ private fun DayColumnCard(
// block or handle on top can claim the press first.
.then(draftSurface),
) {
val minEventHeight = hourHeight * MIN_EVENT_FRACTION
// Keyed by event, so a block that changes time or lane is the *same*
// composable afterwards and tweens there. The ordinal disambiguates
// a column holding two occurrences of one series.
@@ -1583,24 +1422,24 @@ private fun DayColumnCard(
shown.forEach { block ->
val ordinal = ordinals.merge(block.event.eventId, 1, Int::plus)!! - 1
key(block.event.eventId, ordinal) {
// Where this block is cut at midnight, which decides both
// its shape and the half-gap it gives up to the hour cells.
val cuts = remember(block, date, zone) {
timedBlockCuts(
block.continuesBefore(date, zone),
block.continuesAfter,
)
}
val span = remember(block) { block.renderedSpan() }
val top = hourHeight * (span.topMin / 60f)
val height = hourHeight * ((span.bottomMin - span.topMin) / 60f)
val top = hourHeight * (block.startMin / 60f)
val rawHeight = hourHeight * ((block.endMin - block.startMin) / 60f)
val height = if (rawHeight < minEventHeight) minEventHeight else rawHeight
val place = animatedBlockPlacement(
xFraction = block.lane.toFloat() / block.laneCount,
widthFraction = 1f / block.laneCount,
y = top,
height = height,
landing = dragController.ghostsDerived(block),
landing = dragController.ghosts(block),
)
// Where this block is cut at midnight, which decides both
// its shape and the half-gap it gives up to the hour cells.
val cuts = remember(block, date, zone) {
timedBlockCuts(
block.continuesBefore(date, zone),
block.continuesAfter(date, zone),
)
}
val topInset = hourCellBlockInset(showHourGrid, cuts.top)
val bottomInset = hourCellBlockInset(showHourGrid, cuts.bottom)
val blockHeight = (place.height - topInset - bottomInset)
@@ -1767,7 +1606,7 @@ private fun EventBlock(
onCancel = dragController::cancel,
onRelease = { dragController.select(block.event, fromLift = draggable) },
)
val lifted = draggable && dragController.ghostsDerived(block)
val lifted = draggable && dragController.ghosts(block)
// Released in place, the block takes over the copy's lift without a dip.
val takesOverLift = selected && dragController.selection?.fromLift == true
val ghostFade = ghostAlpha(lifted)
@@ -1936,7 +1775,7 @@ private fun rememberDraftSurface(
block = block,
zone = zone,
pointerInRoot = pointer,
blockInRoot = node + Offset(0f, block.renderedSpan().topMin / 60f * hour),
blockInRoot = node + Offset(0f, startMin / 60f * hour),
)
true
},
@@ -1984,10 +1823,8 @@ private fun WeekLoading(dayCount: Int) {
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
// Same scale resolution as the loaded timeline, so the skeleton's
// columns don't resize the moment the real week arrives.
val fitHeight = dayFitHeight(
maxHeight + SKELETON_HEADER_HEIGHT + SKELETON_HEADER_PADDING * 2 -
headerHeight - TIMELINE_TOP_GAP,
)
val fitHeight = maxHeight + SKELETON_HEADER_HEIGHT + SKELETON_HEADER_PADDING * 2 -
headerHeight - TIMELINE_TOP_GAP
val hourHeight = scale.hourHeight(fitHeight)
val totalHeight = hourHeight * 24
// The skeleton wears the loaded columns' own ground, so the arrival
@@ -2000,8 +1837,7 @@ private fun WeekLoading(dayCount: Int) {
modifier = Modifier
.fillMaxSize()
.padding(end = TIMELINE_CONTENT_END_INSET)
.verticalScroll(scrollState)
.padding(bottom = FabClearance),
.verticalScroll(scrollState),
) {
Spacer(Modifier.width(GUTTER_WIDTH))
repeat(dayCount) {
@@ -2027,7 +1863,7 @@ private fun minToHm(min: Int, is24Hour: Boolean, locale: java.util.Locale): Stri
formatMinuteOfDay(min, is24Hour, locale)
/**
* Every timeline's title, the day view's included: just the month [weekStart] falls in.
* The week's title: just the month [weekStart] falls in.
*
* The day numbers are already in the column headers directly below, so spelling
* out "13.–19. Jul" restates them in the widest string in the bar. Naming the
@@ -2042,7 +1878,7 @@ private fun minToHm(min: Int, is24Hour: Boolean, locale: java.util.Locale): Stri
* "December" with no year would be actively misleading while the reader is
* looking straight at January dates.
*/
private fun formatTimelineTitle(
private fun formatWeekTitle(
weekStart: LocalDate,
weekEnd: LocalDate,
locale: Locale,
@@ -2057,3 +1893,17 @@ private fun formatTimelineTitle(
forceYear = weekEnd.year != weekStart.year,
)
}
/** The day's title: its weekday and date, abbreviated to the date alone when short of room. */
private fun formatDayTitle(
date: LocalDate,
locale: Locale,
currentYear: Int,
abbreviated: Boolean = false,
): String =
formatCalendarTitle(
date = date.toJavaLocalDate(),
locale = locale,
currentYear = currentYear,
skeleton = if (abbreviated) "dMMM" else "EEEdMMM",
)
@@ -15,8 +15,6 @@ import kotlinx.datetime.LocalDate
* minimum tap-target height)
* @param lane 0-based column within [laneCount]
* @param laneCount number of columns the event's overlap-cluster needs
* @param continuesAfter whether the event runs past this day's midnight, so the
* block is cut there
*/
data class TimedBlock(
val event: EventInstance,
@@ -24,7 +22,6 @@ data class TimedBlock(
val endMin: Int,
val lane: Int,
val laneCount: Int,
val continuesAfter: Boolean = false,
)
/**
@@ -1,7 +1,6 @@
package de.jeanlucmakiola.calendula.ui.week
import de.jeanlucmakiola.calendula.ui.common.dayRange
import de.jeanlucmakiola.calendula.ui.common.renderedSpan
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
@@ -14,9 +13,7 @@ import de.jeanlucmakiola.calendula.data.time.currentDate
import de.jeanlucmakiola.calendula.data.time.stateFollowingDays
import de.jeanlucmakiola.calendula.domain.CalendarSource
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.domain.displayPriority
import de.jeanlucmakiola.calendula.domain.displayStart
import de.jeanlucmakiola.calendula.domain.FailureReason
import de.jeanlucmakiola.calendula.domain.calendarListFailure
import de.jeanlucmakiola.calendula.ui.common.PageStateCache
@@ -209,7 +206,8 @@ abstract class PagedTimelineViewModel(
): WeekUiState {
calendarListFailure(calendars)?.let { return WeekUiState.Failure(it) }
val days = (0 until span.count).map { span.start.plus(it, DateTimeUnit.DAY) }
val (allDay, timed) = instances.splitWholeDays(zone)
val allDay = instances.filter { it.isAllDay }
val timed = instances.filterNot { it.isAllDay }
return WeekUiState.Success(
weekStart = span.start,
today = today,
@@ -294,21 +292,20 @@ internal fun layoutAllDay(
days: List<LocalDate>,
zone: TimeZone,
): List<AllDaySpan> {
data class Raw(val event: EventInstance, val startCol: Int, val endCol: Int, val priority: Int)
data class Raw(val event: EventInstance, val startCol: Int, val endCol: Int)
val raw = events
.mapNotNull { ev ->
val covered = days.indices.filter { ev.coversDay(days[it], zone) }
if (covered.isEmpty()) null else Raw(ev, covered.first(), covered.last(), ev.displayPriority(zone))
if (covered.isEmpty()) null else Raw(ev, covered.first(), covered.last())
}
// Declined bars are packed after every other one, so on any day they
// cover they land in a lane below it (#230).
.sortedWith(
compareBy<Raw> { it.priority }
compareBy<Raw> { it.event.displayPriority(zone) }
.thenBy { it.startCol }
.thenBy { it.endCol }
.thenBy { it.event.displayStart(zone) }
.thenBy { it.event.title }
.thenBy { it.event.start }
.thenBy { it.event.instanceId },
)
@@ -429,21 +426,12 @@ internal fun EventInstance.spansMultipleDays(zone: TimeZone): Boolean {
return coversDay(secondDay, zone)
}
/**
* Split events into those for the all-day strip and those for the time grid:
* all-day events and timed ones from midnight to midnight go to the strip (#296).
*/
internal fun List<EventInstance>.splitWholeDays(zone: TimeZone): Pair<List<EventInstance>, List<EventInstance>> =
partition { it.coversWholeDays(zone) }
/**
* Clip [events] to a single [day] and assign lanes so overlapping events render
* side-by-side. Lane count is computed per overlap-cluster (a maximal run of
* chained-overlapping events), matching the common phone week-view behaviour.
* Overlap is judged on each block's [renderedSpan], so a short block's floor
* (lifted off midnight, #483) never hides another block.
*
* Takes the timed half of [splitWholeDays]; the rest lives in the all-day strip.
* All-day events are ignored here — they live in the all-day strip.
*/
internal fun layoutDay(
events: List<EventInstance>,
@@ -453,53 +441,55 @@ internal fun layoutDay(
val dayStart = day.atStartOfDayIn(zone)
val dayEnd = day.plus(1, DateTimeUnit.DAY).atStartOfDayIn(zone)
data class Raw(val event: EventInstance, val startMin: Int, val endMin: Int)
val raw = events.asSequence()
.filterNot { it.isAllDay }
.mapNotNull { ev ->
if (ev.start == ev.end) {
// Instant event: keep only if the point falls inside this day.
if (ev.start < dayStart || ev.start >= dayEnd) return@mapNotNull null
val m = wallClockMinutes(ev.start, day, zone)
TimedBlock(ev, m, m, lane = 0, laneCount = 1)
Raw(ev, m, m)
} else {
val s = maxOf(ev.start, dayStart)
val e = minOf(ev.end, dayEnd)
if (e <= s) return@mapNotNull null
val startMin = wallClockMinutes(s, day, zone)
val endMin = wallClockEndMinutes(startMin, s, e, day, zone).coerceAtMost(MINUTES_PER_DAY)
TimedBlock(ev, startMin, endMin, lane = 0, laneCount = 1, continuesAfter = ev.end > dayEnd)
Raw(ev, startMin, endMin)
}
}
.map { it to it.renderedSpan() }
.sortedWith(compareBy({ it.second.topMin }, { it.second.bottomMin }))
.sortedWith(compareBy({ it.startMin }, { it.endMin }))
.toList()
val result = ArrayList<TimedBlock>(raw.size)
var i = 0
while (i < raw.size) {
// Grow a cluster of chained-overlapping events.
var clusterEnd = raw[i].second.bottomMin
var clusterEnd = raw[i].endMin
var j = i + 1
while (j < raw.size && raw[j].second.topMin < clusterEnd) {
clusterEnd = maxOf(clusterEnd, raw[j].second.bottomMin)
while (j < raw.size && raw[j].startMin < clusterEnd) {
clusterEnd = maxOf(clusterEnd, raw[j].endMin)
j++
}
val cluster = raw.subList(i, j)
// Greedy first-fit column assignment (= max overlap depth in the cluster).
val laneEnd = ArrayList<Float>()
val laneEnd = ArrayList<Int>()
val lanes = IntArray(cluster.size)
cluster.forEachIndexed { k, (_, span) ->
var placed = laneEnd.indexOfFirst { it <= span.topMin }
cluster.forEachIndexed { k, r ->
var placed = laneEnd.indexOfFirst { it <= r.startMin }
if (placed == -1) {
laneEnd.add(span.bottomMin)
laneEnd.add(r.endMin)
placed = laneEnd.size - 1
} else {
laneEnd[placed] = span.bottomMin
laneEnd[placed] = r.endMin
}
lanes[k] = placed
}
val laneCount = laneEnd.size
cluster.forEachIndexed { k, (block, _) ->
result.add(block.copy(lane = lanes[k], laneCount = laneCount))
cluster.forEachIndexed { k, r ->
result.add(TimedBlock(r.event, r.startMin, r.endMin, lanes[k], laneCount))
}
i = j
}
@@ -61,7 +61,6 @@ internal fun WeekViewPreview(
onCreateAt = { _, _ -> },
onDrop = {},
onResize = {},
onStripDrop = {},
),
)
}
@@ -76,12 +75,12 @@ private fun sampleWeekState(
): WeekUiState.Success {
val start = if (dayCount == 7) today.startOfWeek(weekStart) else today
val days = (0 until dayCount).map { start.plus(it, DateTimeUnit.DAY) }
val (allDay, timed) = sampleTimelineEvents(days, today, zone).splitWholeDays(zone)
val events = sampleTimelineEvents(days, today, zone)
return WeekUiState.Success(
weekStart = start,
today = today,
days = days,
allDaySpans = layoutAllDay(allDay, days, zone),
timedByDay = days.associateWith { layoutDay(timed, it, zone) },
allDaySpans = layoutAllDay(events.filter { it.isAllDay }, days, zone),
timedByDay = days.associateWith { layoutDay(events, it, zone) },
)
}
@@ -4,7 +4,6 @@ import android.content.Context
import androidx.datastore.preferences.core.MutablePreferences
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.floatPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.core.stringSetPreferencesKey
import androidx.glance.GlanceId
@@ -27,22 +26,14 @@ enum class WidgetTheme { FOLLOW_APP, LIGHT, DARK }
data class WidgetAppearance(
val background: WidgetBackground = WidgetBackground.TINTED,
val theme: WidgetTheme = WidgetTheme.FOLLOW_APP,
/** How opaque a Solid or Tinted fill is (#489). */
val opacity: Float = 1f,
)
/** The agenda widget's look: the 2.24 day cards, or v2.23's plain day headers and stripes (#489). */
enum class AgendaWidgetStyle { CARDS, CLASSIC }
/** What the agenda widget lists, per placed widget. */
data class AgendaWidgetOptions(
val range: AgendaRange,
val textSize: WidgetSize,
val showToday: Boolean,
val pastDisplay: PastEventDisplay,
val style: AgendaWidgetStyle = AgendaWidgetStyle.CARDS,
/** Classic style only: draw the text in the opposite theme's colours, for a faded fill over the wallpaper. */
val invertText: Boolean = false,
)
internal fun WidgetTheme.resolve(app: ThemeMode): WidgetThemeMode = when (this) {
@@ -57,9 +48,6 @@ internal fun WidgetTheme.resolve(app: ThemeMode): WidgetThemeMode = when (this)
private val BackgroundKey = stringPreferencesKey("cfg_background")
private val ThemeKey = stringPreferencesKey("cfg_theme")
private val OpacityKey = floatPreferencesKey("cfg_opacity")
private val AgendaStyleKey = stringPreferencesKey("cfg_agenda_style")
private val InvertTextKey = booleanPreferencesKey("cfg_invert_text")
private val AgendaRangeKey = stringPreferencesKey("cfg_agenda_range")
private val TextSizeKey = stringPreferencesKey("cfg_text_size")
private val ShowTodayKey = booleanPreferencesKey("cfg_show_today")
@@ -70,7 +58,6 @@ internal val Preferences.widgetAppearance: WidgetAppearance
get() = WidgetAppearance(
background = this[BackgroundKey].toEnum(WidgetBackground.TINTED),
theme = this[ThemeKey].toEnum(WidgetTheme.FOLLOW_APP),
opacity = this[OpacityKey] ?: 1f,
)
/**
@@ -83,8 +70,6 @@ internal fun Preferences.agendaWidgetOptions(defaults: AgendaWidgetOptions) = Ag
textSize = this[TextSizeKey].toEnum(defaults.textSize),
showToday = this[ShowTodayKey] ?: defaults.showToday,
pastDisplay = this[PastDisplayKey].toEnum(defaults.pastDisplay),
style = this[AgendaStyleKey].toEnum(defaults.style),
invertText = this[InvertTextKey] ?: defaults.invertText,
)
/** Whether this widget has agenda options of its own, rather than following the app's. */
@@ -93,7 +78,6 @@ internal val Preferences.hasAgendaOptions: Boolean get() = this[AgendaRangeKey]
internal fun MutablePreferences.putAppearance(appearance: WidgetAppearance) {
this[BackgroundKey] = appearance.background.name
this[ThemeKey] = appearance.theme.name
this[OpacityKey] = appearance.opacity
}
internal fun MutablePreferences.putAgendaOptions(options: AgendaWidgetOptions) {
@@ -101,8 +85,6 @@ internal fun MutablePreferences.putAgendaOptions(options: AgendaWidgetOptions) {
this[TextSizeKey] = options.textSize.name
this[ShowTodayKey] = options.showToday
this[PastDisplayKey] = options.pastDisplay.name
this[AgendaStyleKey] = options.style.name
this[InvertTextKey] = options.invertText
}
/**
@@ -126,8 +126,6 @@ sealed interface AgendaWidgetData {
/** "Always show today" (#35): anchor today at the top even with no events left. */
val showToday: Boolean,
val textSize: WidgetSize,
val style: AgendaWidgetStyle = AgendaWidgetStyle.CARDS,
val invertText: Boolean = false,
/** Snapshot instant the data was read at, for "has this event ended?" tests. */
val now: Instant,
) : AgendaWidgetData
@@ -186,8 +184,6 @@ internal suspend fun Context.loadAgendaWidgetData(
pastDisplay = options.pastDisplay,
showToday = options.showToday,
textSize = options.textSize,
style = options.style,
invertText = options.invertText,
now = Clock.System.now(),
)
}
@@ -2,7 +2,6 @@ package de.jeanlucmakiola.calendula.widget
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
@@ -19,40 +18,28 @@ import androidx.glance.layout.padding
import androidx.glance.text.FontWeight
import androidx.glance.text.Text
import androidx.glance.text.TextStyle
import de.jeanlucmakiola.calendula.MainActivity
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isDeclined
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.SECONDARY_INK_ALPHA
import de.jeanlucmakiola.calendula.ui.common.eventFill
import de.jeanlucmakiola.calendula.ui.common.eventInk
import de.jeanlucmakiola.calendula.ui.theme.CalendulaDarkFallback
import de.jeanlucmakiola.calendula.widget.agenda.metricsFor
import de.jeanlucmakiola.floret.components.Position
import de.jeanlucmakiola.floret.glance.WidgetGroupedRow
import de.jeanlucmakiola.floret.glance.themedColor
/** How much of a past event's tone stays in its dimmed fill (#90). */
private const val WidgetDimFillAlpha = 0.3f
/** A past event's fill when dimmed: fainter than the app's whole-row dim, so its text can stay readable (#90). */
internal const val WidgetDimFillAlpha = 0.3f
/** A dimmed event's ink, held above its fill. */
private const val WidgetDimInkAlpha = 0.65f
/**
* An event's fill in the light or [dark] theme. A dimmed one is its tone faded
* into that theme's surface, kept opaque: a translucent tint lands on the row
* shape's white, not on the widget, and its ink would be picked for the wrong tone (#475).
*/
internal fun widgetEventFill(rawArgb: Int, dark: Boolean, soften: Boolean, dimmed: Boolean): Color {
val tone = eventFill(rawArgb, dark, soften)
if (!dimmed) return tone
val surface = if (dark) CalendulaDarkFallback.surface else Color.White
return tone.copy(alpha = WidgetDimFillAlpha).compositeOver(surface)
}
/** Ink for an event on [fill], faded when the row is [dimmed]. */
internal fun widgetEventInk(fill: Color, alpha: Float, dimmed: Boolean): Color =
eventInk(fill, if (dimmed) alpha * WidgetDimInkAlpha else alpha)
/** Ink for an event on [fill], picked against the opaque tone and faded when the fill is dimmed. */
internal fun widgetEventInk(fill: Color, alpha: Float): Color =
eventInk(fill.copy(alpha = 1f), if (fill.alpha < 1f) alpha * WidgetDimInkAlpha else alpha)
/** Text and row sizes of a compact event list, from a widget's [WidgetSize]. */
internal data class EventRowMetrics(val title: TextUnit, val time: TextUnit, val rowHeight: Dp, val message: TextUnit)
@@ -85,8 +72,9 @@ internal fun WidgetEventRow(
quiet: Boolean = false,
) {
val context = LocalContext.current
val day = widgetEventFill(event.color, dark = false, soften, dimmed)
val night = widgetEventFill(event.color, dark = true, soften, dimmed)
fun tone(dark: Boolean): Color = eventFill(event.color, dark, soften).let { if (dimmed) it.copy(alpha = WidgetDimFillAlpha) else it }
val day = tone(dark = false)
val night = tone(dark = true)
val card = widgetCardColor()
WidgetGroupedRow(position = position, color = if (quiet) card else themedColor(day = day, night = night)) {
Column(
@@ -96,7 +84,13 @@ internal fun WidgetEventRow(
.padding(horizontal = 12.dp)
.clickable(
actionStartActivity(
event.openIntent(context, source),
MainActivity.openEventIntent(
context = context,
eventId = event.eventId,
beginMillis = event.start.toEpochMilliseconds(),
endMillis = event.end.toEpochMilliseconds(),
source = source,
),
),
),
verticalAlignment = Alignment.CenterVertically,
@@ -104,12 +98,12 @@ internal fun WidgetEventRow(
val titleInk = if (quiet) {
GlanceTheme.colors.onSurface
} else {
themedColor(day = widgetEventInk(day, 1f, dimmed), night = widgetEventInk(night, 1f, dimmed))
themedColor(day = widgetEventInk(day, 1f), night = widgetEventInk(night, 1f))
}
val timeInk = if (quiet) {
GlanceTheme.colors.onSurfaceVariant
} else {
themedColor(day = widgetEventInk(day, SECONDARY_INK_ALPHA, dimmed), night = widgetEventInk(night, SECONDARY_INK_ALPHA, dimmed))
themedColor(day = widgetEventInk(day, SECONDARY_INK_ALPHA), night = widgetEventInk(night, SECONDARY_INK_ALPHA))
}
Text(
text = event.title.ifBlank { context.getString(R.string.event_untitled) },
@@ -118,7 +112,7 @@ internal fun WidgetEventRow(
color = titleInk,
fontSize = metrics.title,
fontWeight = FontWeight.Medium,
textDecoration = glanceDeclinedDecoration(event.isCrossedOut),
textDecoration = glanceDeclinedDecoration(event.isDeclined),
),
)
Text(text = secondary, maxLines = 1, style = TextStyle(color = timeInk, fontSize = metrics.time))
@@ -26,7 +26,7 @@ import de.jeanlucmakiola.calendula.widget.split.MonthDayWidget
import de.jeanlucmakiola.calendula.widget.split.MonthDayWidgetReceiver
/** A content option a widget's config screen offers, besides background and theme. */
enum class WidgetOption { STYLE, RANGE, TEXT_SIZE, PAST_DISPLAY, SHOW_TODAY, CALENDARS }
enum class WidgetOption { RANGE, TEXT_SIZE, PAST_DISPLAY, SHOW_TODAY, CALENDARS }
/**
* Every widget the app ships, told apart by their receiver: what redraws,
@@ -42,14 +42,7 @@ enum class WidgetKind(
AGENDA(
AgendaWidgetReceiver::class.java,
R.string.widget_agenda_label,
setOf(
WidgetOption.STYLE,
WidgetOption.RANGE,
WidgetOption.TEXT_SIZE,
WidgetOption.PAST_DISPLAY,
WidgetOption.SHOW_TODAY,
WidgetOption.CALENDARS,
),
setOf(WidgetOption.RANGE, WidgetOption.TEXT_SIZE, WidgetOption.PAST_DISPLAY, WidgetOption.SHOW_TODAY, WidgetOption.CALENDARS),
DpSize(260.dp, 280.dp),
),
MONTH(
@@ -19,9 +19,6 @@ import kotlinx.datetime.toJavaDayOfWeek
import kotlinx.datetime.toJavaLocalDate
import kotlinx.datetime.toLocalDateTime
import kotlin.time.Instant
import de.jeanlucmakiola.calendula.MainActivity
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import androidx.glance.appwidget.action.actionStartActivity
/** Cards sit one tone off the root fill, and stay opaque over a wallpaper (#292). */
@Composable
@@ -30,19 +27,6 @@ internal fun widgetCardColor(): ColorProvider = when (LocalWidgetBackground.curr
WidgetBackground.TINTED, WidgetBackground.TRANSPARENT -> GlanceTheme.colors.widgetBackground
}
/** Opens this occurrence in the app, backing out to [source]. */
internal fun EventInstance.openIntent(context: Context, source: CalendarView) = MainActivity.openEventIntent(
context = context,
eventId = eventId,
beginMillis = start.toEpochMilliseconds(),
endMillis = end.toEpochMilliseconds(),
source = source,
)
/** Opens [date] in the app's agenda. */
internal fun openDayAction(context: Context, date: LocalDate) =
actionStartActivity(MainActivity.openDateIntent(context, date, CalendarView.Agenda))
/** An event's time on [day]: "All day", "Starts 14:00", "Ends 9:00" or "14:00 – 15:30". */
internal fun widgetTimeLabel(context: Context, event: EventInstance, day: LocalDate, is24Hour: Boolean): String =
when (val label = agendaTimeLabel(event, day, systemZone())) {
@@ -34,7 +34,7 @@ fun CalendulaGlanceTheme(mode: WidgetThemeMode, content: @Composable () -> Unit)
@Composable
internal fun CalendulaWidgetRoot(appearance: WidgetAppearance, appTheme: ThemeMode, content: @Composable () -> Unit) {
CalendulaGlanceTheme(appearance.theme.resolve(appTheme)) {
WidgetSurface(background = appearance.background, opacity = appearance.opacity, content = content)
WidgetSurface(background = appearance.background, content = content)
}
}
@@ -42,8 +42,8 @@ internal fun CalendulaWidgetRoot(appearance: WidgetAppearance, appTheme: ThemeMo
* Glance's counterpart to the app's `declinedDecoration`: a declined invitation
* reads the same on the home screen as it does inside the app (#180).
*/
fun glanceDeclinedDecoration(isCrossedOut: Boolean): TextDecoration =
if (isCrossedOut) TextDecoration.LineThrough else TextDecoration.None
fun glanceDeclinedDecoration(isDeclined: Boolean): TextDecoration =
if (isDeclined) TextDecoration.LineThrough else TextDecoration.None
/** Static, so a language change recomposes the whole widget rather than letting unchanged parts skip. */
private val LocalWidgetLanguage = staticCompositionLocalOf<String?> { null }
@@ -12,15 +12,6 @@ internal val ROW_H_PAD = 12.dp
/** Space between the date-pill gutter and a day's card. */
internal val GUTTER_GAP = 6.dp
/** The classic style's row inset, colour stripe and the gap after it (#489). */
internal val CLASSIC_ROW_H_PAD = 4.dp
internal val STRIPE_WIDTH = 5.dp
internal val STRIPE_GAP = 10.dp
/** The stripe and its gap, and where the classic style's event text starts, so its placeholder lines up with the titles. */
internal val STRIPE_INSET = STRIPE_WIDTH + STRIPE_GAP
internal val TEXT_INDENT = CLASSIC_ROW_H_PAD + STRIPE_INSET
/**
* Every size the agenda widget varies by [WidgetSize]. Values that genuinely
* shouldn't grow (the horizontal row constants above, corner radii) stay
@@ -38,8 +29,6 @@ internal data class AgendaMetrics(
val rowVPad: Dp, // event row vertical padding
val dayGap: Dp, // space between two days' cards
val monthLabel: TextUnit, // month name above a new month's first day
val dayHeader: TextUnit, // classic style's day label ("Today · …")
val dayHeaderTopPad: Dp, // classic style's space above a day label
) {
/** One event row's height, shared by the date pill beside it and the placeholder row. */
val rowHeight: Dp get() = contentH + rowVPad * 2
@@ -72,8 +61,6 @@ private val SMALL_METRICS = AgendaMetrics(
rowVPad = 4.dp,
dayGap = 8.dp,
monthLabel = 12.sp,
dayHeader = 13.sp,
dayHeaderTopPad = 10.dp,
)
private val MEDIUM_METRICS = AgendaMetrics(
@@ -88,8 +75,6 @@ private val MEDIUM_METRICS = AgendaMetrics(
rowVPad = 5.dp,
dayGap = 9.dp,
monthLabel = 14.sp,
dayHeader = 14.sp, // M3 Title Small
dayHeaderTopPad = 11.dp,
)
private val LARGE_METRICS = AgendaMetrics(
@@ -104,8 +89,6 @@ private val LARGE_METRICS = AgendaMetrics(
rowVPad = 6.dp,
dayGap = 10.dp,
monthLabel = 14.sp,
dayHeader = 16.sp, // M3 Title Medium
dayHeaderTopPad = 12.dp,
)
private val EXTRA_LARGE_METRICS = AgendaMetrics(
@@ -120,8 +103,6 @@ private val EXTRA_LARGE_METRICS = AgendaMetrics(
rowVPad = 8.dp,
dayGap = 12.dp,
monthLabel = 16.sp,
dayHeader = 18.sp, // †
dayHeaderTopPad = 14.dp,
)
/** Indexed by [WidgetSize.ordinal] so lookup allocates nothing per recomposition. */
@@ -6,12 +6,11 @@ import de.jeanlucmakiola.calendula.widget.widgetLocale
import de.jeanlucmakiola.calendula.widget.WidgetKind
import de.jeanlucmakiola.calendula.widget.previewSizeOf
import de.jeanlucmakiola.calendula.widget.provideSamplePreview
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isDeclined
import de.jeanlucmakiola.calendula.widget.glanceDeclinedDecoration
import android.content.Context
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.glance.GlanceId
import androidx.glance.GlanceModifier
@@ -56,15 +55,8 @@ import de.jeanlucmakiola.calendula.ui.agenda.anchorTodayIfMissing
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.formatCalendarTitle
import de.jeanlucmakiola.floret.locale.localizedDateFormatter
import de.jeanlucmakiola.calendula.widget.widgetEventFill
import de.jeanlucmakiola.calendula.ui.common.eventAccent
import de.jeanlucmakiola.calendula.ui.common.EventDimAlpha
import de.jeanlucmakiola.calendula.widget.AgendaWidgetStyle
import de.jeanlucmakiola.floret.glance.LocalWidgetBackground
import de.jeanlucmakiola.floret.glance.LocalWidgetSeeThrough
import androidx.compose.runtime.CompositionLocalProvider
import de.jeanlucmakiola.floret.glance.WidgetBackground
import de.jeanlucmakiola.floret.glance.withAlpha
import de.jeanlucmakiola.calendula.ui.common.eventFill
import de.jeanlucmakiola.calendula.widget.WidgetDimFillAlpha
import de.jeanlucmakiola.calendula.widget.widgetEventInk
import de.jeanlucmakiola.calendula.ui.common.SECONDARY_INK_ALPHA
import de.jeanlucmakiola.calendula.widget.AgendaWidgetData
@@ -73,8 +65,6 @@ import de.jeanlucmakiola.calendula.widget.CalendulaWidgetRoot
import de.jeanlucmakiola.calendula.widget.WidgetAppearance
import de.jeanlucmakiola.calendula.widget.widgetCardColor
import de.jeanlucmakiola.calendula.widget.widgetTimeLabel
import de.jeanlucmakiola.calendula.widget.openIntent
import de.jeanlucmakiola.calendula.widget.openDayAction
import de.jeanlucmakiola.calendula.widget.loadAgendaWidget
import de.jeanlucmakiola.calendula.widget.widgetAppearance
import de.jeanlucmakiola.floret.components.Position
@@ -97,8 +87,7 @@ import kotlinx.datetime.toJavaDayOfWeek
/**
* "Upcoming" agenda widget — a continuously scrolling list of the next ~30 days
* of events: each day one card of grouped rows with its date pill beside it, or
* in the classic style a label line over plain colour-stripe rows (#489).
* of events, each day one card of grouped rows with its date pill beside it.
* Reuses the app's [groupAgendaDays] grouping so it matches the in-app agenda.
*/
class AgendaWidget : GlanceAppWidget() {
@@ -161,10 +150,10 @@ private const val PREVIEW_ROWS = 10
* user scrolling a home-screen widget past a hundred rows is not a case worth
* risking a failed update for.
*/
internal const val MAX_AGENDA_ROWS = 100
private const val MAX_AGENDA_ROWS = 100
/** Flat row model: one [LazyColumn] item per event or placeholder, a day's first one carrying its date pill. */
internal sealed interface AgendaRow {
private sealed interface AgendaRow {
val date: LocalDate
data class Event(override val date: LocalDate, val event: EventInstance) : AgendaRow
@@ -179,21 +168,16 @@ private fun AgendaWidgetBody(data: AgendaWidgetData, preview: Boolean) {
val size = (data as? AgendaWidgetData.Ready)?.textSize ?: WidgetSize.SMALL
val fontScale = androidx.glance.LocalContext.current.resources.configuration.fontScale
val metrics = metricsFor(size).scaledForFont(fontScale)
// The classic style adds no backings for a faded fill, only on a transparent one (#489).
val classic = (data as? AgendaWidgetData.Ready)?.style == AgendaWidgetStyle.CLASSIC
val seeThrough = if (classic) LocalWidgetBackground.current == WidgetBackground.TRANSPARENT else LocalWidgetSeeThrough.current
CompositionLocalProvider(LocalWidgetSeeThrough provides seeThrough) {
Column(
modifier = GlanceModifier
.fillMaxSize()
.padding(horizontal = 8.dp, vertical = 6.dp),
) {
AgendaHeader()
Spacer(GlanceModifier.height(6.dp))
when (data) {
AgendaWidgetData.NeedsPermission -> WidgetMessage(R.string.widget_needs_permission, metrics)
is AgendaWidgetData.Ready -> AgendaRows(data = data, metrics = metrics, preview = preview)
}
Column(
modifier = GlanceModifier
.fillMaxSize()
.padding(horizontal = 8.dp, vertical = 6.dp),
) {
AgendaHeader()
Spacer(GlanceModifier.height(6.dp))
when (data) {
AgendaWidgetData.NeedsPermission -> WidgetMessage(R.string.widget_needs_permission, metrics)
is AgendaWidgetData.Ready -> AgendaRows(data = data, metrics = metrics, preview = preview)
}
}
}
@@ -235,248 +219,60 @@ private fun AgendaRows(
day.events.forEach { add(AgendaRow.Event(day.date, it)) }
}
}
}
when (data.style) {
AgendaWidgetStyle.CARDS -> CardRows(rows, data, metrics, preview)
AgendaWidgetStyle.CLASSIC -> ClassicRows(rows, data, metrics, preview)
}
}
}
/** Each day is one card of grouped rows (#71), with its date pill beside the first row. */
@Composable
private fun CardRows(allRows: List<AgendaRow>, data: AgendaWidgetData.Ready, metrics: AgendaMetrics, preview: Boolean) {
val rows = allRows.take(MAX_AGENDA_ROWS)
val positions = dayPositions(rows.map { it.date })
val cardColor = widgetCardColor()
val item: @Composable (Int) -> Unit = { index ->
val row = rows[index]
val position = positions[index]
val first = position == Position.Top || position == Position.Alone
val dayRow: @Composable (GlanceModifier) -> Unit = { modifier ->
Row(modifier = modifier.fillMaxWidth()) {
Box(modifier = GlanceModifier.width(metrics.pillWidth)) {
if (first) DatePill(row.date, data.today, cardColor, metrics)
}
Spacer(GlanceModifier.width(GUTTER_GAP))
Box(modifier = GlanceModifier.defaultWeight()) {
val rowColor = when (row) {
is AgendaRow.Event -> row.fill(data).let { themedColor(day = it.day, night = it.night) }
is AgendaRow.Placeholder -> cardColor
}.take(MAX_AGENDA_ROWS)
// Each day is one card of grouped rows (#71), with its date pill
// beside the first row.
val positions = dayPositions(rows)
val cardColor = widgetCardColor()
val item: @Composable (Int) -> Unit = { index ->
val row = rows[index]
val position = positions[index]
val first = position == Position.Top || position == Position.Alone
val dayRow: @Composable (GlanceModifier) -> Unit = { modifier ->
Row(modifier = modifier.fillMaxWidth()) {
Box(modifier = GlanceModifier.width(metrics.pillWidth)) {
if (first) DatePill(row.date, data.today, cardColor, metrics)
}
WidgetGroupedRow(position = position, color = rowColor) {
AgendaRowContent(row, data, metrics)
Spacer(GlanceModifier.width(GUTTER_GAP))
Box(modifier = GlanceModifier.defaultWeight()) {
val rowColor = when (row) {
is AgendaRow.Event -> row.fill(data).let { themedColor(day = it.day, night = it.night) }
is AgendaRow.Placeholder -> cardColor
}
WidgetGroupedRow(position = position, color = rowColor) {
AgendaRowContent(row, data, metrics)
}
}
}
}
}
val gap = GlanceModifier.padding(top = if (first && index > 0) metrics.dayGap else 0.dp)
// The pills carry no month, so a new month gets its name above its first day.
if (first && index > 0 && row.date.month != rows[index - 1].date.month) {
Column(modifier = gap.fillMaxWidth()) {
MonthLabel(row.date, data.today, metrics)
dayRow(GlanceModifier)
}
} else {
dayRow(gap)
}
}
RowList(rows.size, preview, item)
}
/** [count] rows of [item]: a plain column in a [preview], else a [LazyColumn]. */
@Composable
private fun RowList(count: Int, preview: Boolean, item: @Composable (Int) -> Unit) {
if (preview) {
Column(modifier = GlanceModifier.fillMaxSize()) {
repeat(minOf(count, PREVIEW_ROWS)) { item(it) }
}
} else {
LazyColumn(modifier = GlanceModifier.fillMaxSize()) {
items(count) { item(it) }
}
}
}
/** A classic list entry: a day's label line, or one of its rows. */
internal sealed interface ClassicItem {
val date: LocalDate
data class Header(override val date: LocalDate) : ClassicItem
data class Entry(val row: AgendaRow) : ClassicItem {
override val date: LocalDate get() = row.date
}
}
/**
* [rows] with a label before each day's first, held to [limit] items in all,
* headers included; a label the cut leaves with nothing under it is dropped.
*/
internal fun classicItems(rows: List<AgendaRow>, limit: Int = MAX_AGENDA_ROWS): List<ClassicItem> = buildList {
rows.forEachIndexed { index, row ->
if (index == 0 || row.date != rows[index - 1].date) add(ClassicItem.Header(row.date))
add(ClassicItem.Entry(row))
}
}.take(limit).dropLastWhile { it is ClassicItem.Header }
/**
* v2.23's look (#489): a label line per day over plain rows with a colour
* stripe. On a transparent root each day sits on its own backing card, so the
* text stays readable over the wallpaper; a faded fill is left to the opacity
* and "Invert text colour" options.
*/
@Composable
private fun ClassicRows(rows: List<AgendaRow>, data: AgendaWidgetData.Ready, metrics: AgendaMetrics, preview: Boolean) {
val items = classicItems(rows, if (preview) PREVIEW_ROWS else MAX_AGENDA_ROWS)
val backed = LocalWidgetBackground.current == WidgetBackground.TRANSPARENT
val ink = classicInk(inverted = data.invertText && !backed)
val positions = if (backed) dayPositions(items.map { it.date }) else emptyList()
val cardColor = widgetCardColor()
val item: @Composable (Int) -> Unit = { index ->
val entry = items[index]
val content: @Composable () -> Unit = {
when (entry) {
is ClassicItem.Header -> DayHeaderRow(
date = entry.date,
today = data.today,
startPad = if (backed) CLASSIC_CARD_H_PAD else 8.dp,
topPad = when {
backed -> CLASSIC_CARD_TOP_PAD
index == 0 -> 0.dp
else -> metrics.dayHeaderTopPad
},
ink = ink,
metrics = metrics,
)
is ClassicItem.Entry -> when (val row = entry.row) {
is AgendaRow.Placeholder -> ClassicPlaceholderRow(row.date, backed, ink, metrics)
is AgendaRow.Event -> ClassicEventRow(row, data, backed, ink, metrics)
val gap = GlanceModifier.padding(top = if (first && index > 0) metrics.dayGap else 0.dp)
// The pills carry no month, so a new month gets its name above its first day.
if (first && index > 0 && row.date.month != rows[index - 1].date.month) {
Column(modifier = gap.fillMaxWidth()) {
MonthLabel(row.date, data.today, metrics)
dayRow(GlanceModifier)
}
} else {
dayRow(gap)
}
}
if (backed) {
val gap = if (entry is ClassicItem.Header && index > 0) metrics.dayGap else 0.dp
WidgetGroupedRow(
position = positions[index],
modifier = GlanceModifier.padding(top = gap),
color = cardColor,
gapBelow = false,
content = content,
)
if (preview) {
Column(modifier = GlanceModifier.fillMaxSize()) {
repeat(minOf(rows.size, PREVIEW_ROWS)) { item(it) }
}
} else {
content()
}
}
RowList(items.size, preview, item)
}
/** The classic style's text colours: the theme's, or its inverse for the "Invert text colour" option. */
private data class ClassicInk(val title: ColorProvider, val secondary: ColorProvider, val today: ColorProvider)
@Composable
private fun classicInk(inverted: Boolean): ClassicInk = with(GlanceTheme.colors) {
if (inverted) {
ClassicInk(inverseOnSurface, inverseOnSurface.withAlpha(INVERTED_SECONDARY_INK), inversePrimary)
} else {
ClassicInk(onSurface, onSurfaceVariant, primary)
}
}
/** A classic day label, "Today · Wed, 17 Jun"; opens that day in the app. */
@Composable
private fun DayHeaderRow(date: LocalDate, today: LocalDate, startPad: Dp, topPad: Dp, ink: ClassicInk, metrics: AgendaMetrics) {
val context = androidx.glance.LocalContext.current
Text(
text = agendaDayLabel(context, date, today),
maxLines = 1,
style = TextStyle(
color = if (date == today) ink.today else ink.secondary,
fontSize = metrics.dayHeader,
fontWeight = FontWeight.Medium,
),
modifier = GlanceModifier
.fillMaxWidth()
.padding(start = startPad, end = 8.dp, top = topPad, bottom = metrics.rowVPad)
.clickable(openDayAction(context, date)),
)
}
/** "No more events today" as a muted line under an anchored, event-less today (#35), indented to the titles. */
@Composable
private fun ClassicPlaceholderRow(date: LocalDate, backed: Boolean, ink: ClassicInk, metrics: AgendaMetrics) {
val context = androidx.glance.LocalContext.current
Text(
text = context.getString(R.string.agenda_no_more_today),
maxLines = 1,
style = TextStyle(color = ink.secondary, fontSize = metrics.placeholder),
modifier = GlanceModifier
.fillMaxWidth()
.padding(start = if (backed) CLASSIC_CARD_H_PAD + STRIPE_INSET else TEXT_INDENT, end = 8.dp, top = 2.dp, bottom = metrics.rowVPad + 2.dp)
.clickable(openDayAction(context, date)),
)
}
/** A classic event row: the calendar's colour stripe beside the title and time; a dimmed one fades both. */
@Composable
private fun ClassicEventRow(row: AgendaRow.Event, data: AgendaWidgetData.Ready, backed: Boolean, ink: ClassicInk, metrics: AgendaMetrics) {
val context = androidx.glance.LocalContext.current
val event = row.event
val dimmed = row.dimmed(data)
fun accent(dark: Boolean) = eventAccent(event.color, dark, data.soften).let {
if (dimmed) it.copy(alpha = EventDimAlpha) else it
}
Row(
modifier = GlanceModifier
.fillMaxWidth()
.padding(horizontal = if (backed) CLASSIC_CARD_H_PAD else CLASSIC_ROW_H_PAD, vertical = metrics.rowVPad)
.clickable(actionStartActivity(event.openIntent(context, CalendarView.Agenda))),
verticalAlignment = Alignment.CenterVertically,
) {
Box(
modifier = GlanceModifier
.width(STRIPE_WIDTH)
.height(metrics.contentH)
.cornerRadius(3.dp)
.background(themedColor(day = accent(dark = false), night = accent(dark = true))),
) {}
Spacer(GlanceModifier.width(STRIPE_GAP))
Column(modifier = GlanceModifier.defaultWeight()) {
Text(
text = event.title.ifBlank { context.getString(R.string.event_untitled) },
maxLines = 1,
style = TextStyle(
color = if (dimmed) ink.title.withAlpha(CLASSIC_DIM_INK) else ink.title,
fontSize = metrics.eventTitle,
textDecoration = glanceDeclinedDecoration(event.isCrossedOut),
),
)
Text(
text = eventTimeSummary(context, event, row.date, data.is24Hour),
maxLines = 1,
style = TextStyle(
color = if (dimmed) ink.secondary.withAlpha(CLASSIC_DIM_INK) else ink.secondary,
fontSize = metrics.eventTime,
),
)
LazyColumn(modifier = GlanceModifier.fillMaxSize()) {
items(rows.size) { item(it) }
}
}
}
}
/** Space above a day's label on its own backing card, and its rows' inset, clear of the card's corners. */
private val CLASSIC_CARD_TOP_PAD = 8.dp
private val CLASSIC_CARD_H_PAD = 10.dp
/** How strongly a finished event's text shows in the classic style, on any fill. */
private const val CLASSIC_DIM_INK = 0.5f
/** The inverted secondary text's strength, as `onSurfaceVariant` sits below `onSurface`. */
private const val INVERTED_SECONDARY_INK = 0.75f
/** Where each row sits among the rows of its day, from each row's date, for the grouped-card shapes. */
private fun dayPositions(dates: List<LocalDate>): List<Position> = buildList {
/** Where each row sits among the rows of its day, for the grouped-card shapes. */
private fun dayPositions(rows: List<AgendaRow>): List<Position> = buildList {
var start = 0
for (end in 1..dates.size) {
if (end == dates.size || dates[end] != dates[start]) {
for (end in 1..rows.size) {
if (end == rows.size || rows[end].date != rows[start].date) {
for (i in start until end) add(positionOf(i - start, end - start))
start = end
}
@@ -547,7 +343,7 @@ private fun DatePill(date: LocalDate, today: LocalDate, cardColor: ColorProvider
.height(metrics.rowHeight)
.cornerRadius(metrics.pillWidth / 2)
.background(container)
.clickable(openDayAction(context, date))
.clickable(actionStartActivity(MainActivity.openDateIntent(context, date, CalendarView.Agenda)))
.semantics { contentDescription = label },
horizontalAlignment = Alignment.CenterHorizontally,
verticalAlignment = Alignment.CenterVertically,
@@ -579,7 +375,11 @@ private fun PlaceholderRow(date: LocalDate, metrics: AgendaMetrics) {
.fillMaxWidth()
.height(metrics.rowHeight)
.padding(horizontal = ROW_H_PAD)
.clickable(openDayAction(context, date)),
.clickable(
actionStartActivity(
MainActivity.openDateIntent(context, date, CalendarView.Agenda),
),
),
contentAlignment = Alignment.CenterStart,
) {
Text(
@@ -591,19 +391,14 @@ private fun PlaceholderRow(date: LocalDate, metrics: AgendaMetrics) {
}
/** An event row's light and dark fill: its calendar's container tone, faded when the row is dimmed. */
private data class EventFill(val day: Color, val night: Color, val dimmed: Boolean)
/** Whether this row is drawn faded as a finished event. */
private fun AgendaRow.Event.dimmed(data: AgendaWidgetData.Ready): Boolean =
data.pastDisplay == PastEventDisplay.DIM && event.hasEnded(data.now)
private data class EventFill(val day: Color, val night: Color)
private fun AgendaRow.Event.fill(data: AgendaWidgetData.Ready): EventFill {
val dimmed = dimmed(data)
return EventFill(
day = widgetEventFill(event.color, dark = false, data.soften, dimmed),
night = widgetEventFill(event.color, dark = true, data.soften, dimmed),
dimmed = dimmed,
)
val dimmed = data.pastDisplay == PastEventDisplay.DIM && event.hasEnded(data.now)
fun tone(dark: Boolean) = eventFill(event.color, dark, data.soften).let {
if (dimmed) it.copy(alpha = WidgetDimFillAlpha) else it
}
return EventFill(day = tone(dark = false), night = tone(dark = true))
}
@Composable
@@ -616,17 +411,27 @@ private fun EventRow(
) {
val context = androidx.glance.LocalContext.current
val title = event.title.ifBlank { context.getString(R.string.event_untitled) }
val titleInk = themedColor(day = widgetEventInk(fill.day, 1f, fill.dimmed), night = widgetEventInk(fill.night, 1f, fill.dimmed))
val titleInk = themedColor(day = widgetEventInk(fill.day, 1f), night = widgetEventInk(fill.night, 1f))
val timeInk = themedColor(
day = widgetEventInk(fill.day, SECONDARY_INK_ALPHA, fill.dimmed),
night = widgetEventInk(fill.night, SECONDARY_INK_ALPHA, fill.dimmed),
day = widgetEventInk(fill.day, SECONDARY_INK_ALPHA),
night = widgetEventInk(fill.night, SECONDARY_INK_ALPHA),
)
Column(
modifier = GlanceModifier
.fillMaxWidth()
.height(metrics.rowHeight)
.padding(horizontal = ROW_H_PAD)
.clickable(actionStartActivity(event.openIntent(context, CalendarView.Agenda))),
.clickable(
actionStartActivity(
MainActivity.openEventIntent(
context = context,
eventId = event.eventId,
beginMillis = event.start.toEpochMilliseconds(),
endMillis = event.end.toEpochMilliseconds(),
source = CalendarView.Agenda,
),
),
),
verticalAlignment = Alignment.CenterVertically,
) {
Text(
@@ -636,7 +441,7 @@ private fun EventRow(
color = titleInk,
fontSize = metrics.eventTitle,
fontWeight = FontWeight.Medium,
textDecoration = glanceDeclinedDecoration(event.isCrossedOut),
textDecoration = glanceDeclinedDecoration(event.isDeclined),
),
)
Text(
@@ -669,7 +474,7 @@ private fun agendaDayLabel(context: Context, date: LocalDate, today: LocalDate):
val java = java.time.LocalDate.of(date.year, date.month.ordinal + 1, date.day)
// Weekday + date in the locale's own field order (compact: no year), rather
// than a hardcoded day-month layout.
val formatted = localizedDateFormatter(locale, if (date.year == today.year) "EEEdMMM" else "EEEdMMMy").format(java)
val formatted = localizedDateFormatter(locale, "EEEdMMM").format(java)
return if (relative != null) "$relative · $formatted" else formatted
}
@@ -69,16 +69,6 @@ import de.jeanlucmakiola.floret.glance.GlanceWidgetPreview
import de.jeanlucmakiola.floret.glance.WallpaperWindow
import de.jeanlucmakiola.floret.glance.WidgetBackground
import kotlin.math.roundToInt
import de.jeanlucmakiola.floret.components.GroupedSliderRow
import de.jeanlucmakiola.floret.components.InfoPopover
import de.jeanlucmakiola.calendula.widget.AgendaWidgetStyle
import java.text.NumberFormat
import de.jeanlucmakiola.floret.locale.currentLocale
import androidx.compose.runtime.remember
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material3.Switch
import androidx.compose.foundation.layout.Row
private val PreviewMaxHeight = 280.dp
@@ -246,42 +236,6 @@ private fun ConfigOptions(
onSelect = { onAppearance(state.appearance.copy(background = it)) },
position = Position.Top,
)
val faded = state.appearance.background != WidgetBackground.TRANSPARENT
val content = state.draft.content
val classic = state.kind == WidgetKind.AGENDA && content.style == AgendaWidgetStyle.CLASSIC
if (faded) {
val opacity = state.appearance.opacity
GroupedSliderRow(
title = stringResource(R.string.widget_config_opacity),
value = opacity,
onValueChange = { onAppearance(state.appearance.copy(opacity = it)) },
position = Position.Middle,
valueLabel = currentLocale().let { locale ->
remember(opacity, locale) { NumberFormat.getPercentInstance(locale).format(opacity) }
},
valueRange = MIN_OPACITY..1f,
steps = OPACITY_STEPS,
titleAccessory = {
InfoPopover(
text = stringResource(
if (classic) R.string.widget_config_readability_hint_classic else R.string.widget_config_readability_hint,
),
contentDescription = stringResource(R.string.widget_config_readability_info),
)
},
)
}
if (faded && classic) {
GroupedRow(
title = stringResource(R.string.widget_config_invert_text),
summary = stringResource(R.string.widget_config_invert_text_summary),
position = Position.Middle,
trailing = {
Switch(checked = content.invertText, onCheckedChange = { onContent(content.copy(invertText = it)) })
},
onClick = { onContent(content.copy(invertText = !content.invertText)) },
)
}
GroupedChoiceRow(
title = stringResource(R.string.settings_theme),
options = WidgetTheme.entries,
@@ -311,7 +265,6 @@ private fun ContentOptions(
onCalendarShown: (Long, Boolean) -> Unit,
) {
val options = state.draft.content
var showStyle by rememberSaveable { mutableStateOf(false) }
var showRange by rememberSaveable { mutableStateOf(false) }
var showSize by rememberSaveable { mutableStateOf(false) }
var showPast by rememberSaveable { mutableStateOf(false) }
@@ -324,12 +277,6 @@ private fun ContentOptions(
GroupedSectionHeader(stringResource(R.string.widget_config_content))
rows.forEach { option ->
when (option) {
WidgetOption.STYLE -> GroupedRow(
title = stringResource(R.string.widget_config_style),
summary = agendaStyleLabel(options.style),
position = position(option),
onClick = { showStyle = true },
)
WidgetOption.RANGE -> GroupedRow(
title = stringResource(R.string.widget_config_range),
summary = agendaRangeLabel(options.range),
@@ -372,17 +319,6 @@ private fun ContentOptions(
)
}
if (showStyle) {
OptionPicker(
title = stringResource(R.string.widget_config_style),
predictiveBack = true,
options = AgendaWidgetStyle.entries,
selected = options.style,
label = { agendaStyleLabel(it) },
onSelect = { onChange(options.copy(style = it)) },
onDismiss = { showStyle = false },
)
}
if (showRange) {
AgendaRangePicker(
title = stringResource(R.string.widget_config_range),
@@ -420,18 +356,6 @@ private fun ContentOptions(
}
}
@Composable
private fun agendaStyleLabel(style: AgendaWidgetStyle): String = stringResource(
when (style) {
AgendaWidgetStyle.CARDS -> R.string.widget_config_style_cards
AgendaWidgetStyle.CLASSIC -> R.string.widget_config_style_classic
},
)
/** The faintest fill the opacity slider allows, and its 10% steps between that and opaque. */
private const val MIN_OPACITY = 0.2f
private const val OPACITY_STEPS = 7
@Composable
internal fun backgroundLabel(background: WidgetBackground): String = stringResource(
when (background) {
@@ -1,9 +1,7 @@
package de.jeanlucmakiola.calendula.widget.countdown
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.EventStatus
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isDeclined
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.TimeZone
import kotlinx.datetime.atStartOfDayIn
@@ -76,18 +74,17 @@ fun nextLabelChange(event: EventInstance, now: Instant, zone: TimeZone): Instant
}
/**
* The next-event mode's pick: timed and not filling whole days (#296), not
* declined or cancelled, not over; of those, the one whose countdown changes
* soonest — a running event's end, else a start.
* The next-event mode's pick: timed, not declined, not over; of those, the one
* whose countdown changes soonest — a running event's end, else a start.
*/
fun pickNextEvent(instances: List<EventInstance>, now: Instant, zone: TimeZone): EventInstance? =
fun pickNextEvent(instances: List<EventInstance>, now: Instant): EventInstance? =
instances
.filter { !it.coversWholeDays(zone) && !it.isCrossedOut && it.end > now }
.filter { !it.isAllDay && !it.isDeclined && it.end > now }
.minByOrNull { target(it, now) }
/** A pinned event's occurrence to count to: the running or next one that is not cancelled (#388). */
/** A pinned event's occurrence to count to: the running or next one. */
fun pickPinnedOccurrence(occurrences: List<EventInstance>, now: Instant, zone: TimeZone): EventInstance? =
occurrences.filter { it.status != EventStatus.Cancelled && it.counted(zone).end > now }.minByOrNull { it.start }
occurrences.filter { it.counted(zone).end > now }.minByOrNull { it.start }
/**
* The span a countdown counts over. An all-day event is stored on UTC
@@ -75,11 +75,7 @@ internal suspend fun Context.loadCountdown(
val repository = widgetEntryPoint().calendarRepository()
val event = when (options.mode) {
CountdownMode.NEXT ->
pickNextEvent(
repository.instances(now..now + NextEventHorizon).first().withoutCalendars(load.hiddenCalendars),
now,
systemZone(),
)
pickNextEvent(repository.instances(now..now + NextEventHorizon).first().withoutCalendars(load.hiddenCalendars), now)
CountdownMode.PINNED -> options.eventId?.let { id ->
pickPinnedOccurrence(repository.eventOccurrences(id, now - 1.days..now + PinnedHorizon), now, systemZone())
}
@@ -40,9 +40,7 @@ import androidx.glance.text.TextStyle
import de.jeanlucmakiola.calendula.MainActivity
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.coversWholeDays
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.widget.openIntent
import de.jeanlucmakiola.calendula.ui.common.eventAccent
import de.jeanlucmakiola.calendula.widget.CalendulaWidgetReceiver
import de.jeanlucmakiola.calendula.widget.CalendulaWidgetRoot
@@ -133,7 +131,13 @@ private fun EventCountdown(event: EventInstance, data: CountdownData.Ready) {
val context = LocalContext.current
val label = countdownLabel(event.counted(systemZone()), data.now, systemZone())
val open = actionStartActivity(
event.openIntent(context, CalendarView.Agenda),
MainActivity.openEventIntent(
context = context,
eventId = event.eventId,
beginMillis = event.start.toEpochMilliseconds(),
endMillis = event.end.toEpochMilliseconds(),
source = CalendarView.Agenda,
),
)
// Over a wallpaper the text sits on its own card, as every other widget's rows do.
val card = GlanceModifier.wallpaperBacking(radius = 16.dp)
@@ -206,13 +210,12 @@ private fun whenText(context: Context, event: EventInstance, data: CountdownData
val at = if (running) counted.end else counted.start
val date = at.toLocalDateTime(systemZone()).date
val day = relativeDayLabel(context, date, data.today)
val wholeDays = event.coversWholeDays(systemZone())
return when {
wholeDays && running -> context.getString(
event.isAllDay && running -> context.getString(
R.string.widget_countdown_until,
relativeDayLabel(context, date.minus(1, DateTimeUnit.DAY), data.today),
)
wholeDays -> "$day · ${context.getString(R.string.event_detail_all_day)}"
event.isAllDay -> "$day · ${context.getString(R.string.event_detail_all_day)}"
running -> context.getString(R.string.agenda_span_ends, "$day · ${formatWidgetTime(at, data.is24Hour)}")
else -> "$day · ${formatWidgetTime(at, data.is24Hour)}"
}
@@ -36,25 +36,11 @@ internal fun <T : Any> mergeGaps(columns: Int, cellAt: (Int) -> GridCell<T>?): L
return cells
}
/** What a cell of the single mixed lane shows: an event's bar, or a day's event count. */
internal sealed interface LaneItem {
data class Bar(val event: EventInstance) : LaneItem
data class Count(val count: Int) : LaneItem
}
/**
* One week of the grid seated with [laneCap] lanes, drawn [compact] when the
* row is too short for a full one. [showsOverflow] is off when the week has no
* room for the "+N" row; a [mixed] single lane then shows each day's count in
* place of its bar where the day has more than fits (#491).
* One week of the grid seated with [laneCap] lanes. [showsOverflow] is off when
* the week has no room for even the "+N" row.
*/
internal class WeekLayout(
val week: MonthWeek,
val laneCap: Int,
val showsOverflow: Boolean = true,
val compact: Boolean = false,
val mixed: Boolean = false,
) {
internal class WeekLayout(val week: MonthWeek, val laneCap: Int, val showsOverflow: Boolean = true) {
private val seating: List<DaySeating> = week.days.indices.map { week.seating(it, laneCap) }
/** Lanes filled from the top; empty lanes below are not drawn. */
@@ -69,16 +55,6 @@ internal class WeekLayout(
}
}
/** The single lane of a [mixed] week, bars cut short where a day shows its count instead; null otherwise. */
val mixedLane: List<GridCell<LaneItem>>? = if (!mixed) null else mergeGaps(week.days.size) { col ->
val day = seating[col]
if (day.hidden.isNotEmpty()) return@mergeGaps GridCell(LaneItem.Count(week.countByDay[week.days[col]] ?: day.hidden.size), 1)
val seat = day.seated.firstOrNull() ?: return@mergeGaps null
val spanEnd = if (seat.bar) week.spanAt(col, seat.lane)?.endCol ?: col else col
val end = (col + 1..spanEnd).firstOrNull { seating[it].hidden.isNotEmpty() }?.minus(1) ?: spanEnd
GridCell(LaneItem.Bar(seat.event), end - col + 1)
}
/** The "+N" row as counts and merged gaps; empty when everything fits. */
val overflow: List<GridCell<Int>> = seating.map { it.hidden.size }.let { hidden ->
if (hidden.none { it > 0 }) emptyList()
@@ -86,31 +62,19 @@ internal class WeekLayout(
}
}
/** How many lanes a week row holds, and whether they're the [compact] height. */
internal data class LaneFit(val lanes: Int, val compact: Boolean = false)
/**
* Event lanes a week row [weekHeight] tall holds under its day number, held to
* [MAX_LANES] so a tall widget's payload stays bounded (#214). A row too short
* for one full lane still gets a compact one when its text fits at [fontScale] (#491).
* [MAX_LANES] so a tall widget's payload stays bounded (#214).
*/
internal fun lanesFitting(weekHeight: Dp, fontScale: Float): LaneFit {
val room = weekHeight.value - DAY_ROW_DP - LANES_TOP_DP
val full = (room / LANE_ROW_DP).toInt().coerceIn(0, MAX_LANES)
val compactFits = room >= COMPACT_LANE_ROW_DP && fontScale <= COMPACT_MAX_FONT_SCALE
return if (full == 0 && compactFits) LaneFit(1, compact = true) else LaneFit(full)
}
internal fun lanesFitting(weekHeight: Dp): Int =
((weekHeight.value - DAY_ROW_DP - LANES_TOP_DP) / LANE_ROW_DP).toInt().coerceIn(0, MAX_LANES)
/**
* Seats each week in [fit]'s lanes. A week whose events need more gives its
* last lane to the "+N" row instead. A single lane has no room for that row,
* so it mixes bars and per-day counts (#491).
* Seats each week in [lanes] lanes. A week whose events need more gives its
* last lane to the "+N" row instead.
*/
internal fun fitWeeks(weeks: List<MonthWeek>, fit: LaneFit): List<WeekLayout> = weeks.map { week ->
val lanes = fit.lanes
if (lanes <= 1) {
return@map WeekLayout(week, laneCap = lanes, showsOverflow = false, compact = fit.compact, mixed = lanes == 1)
}
internal fun fitWeeks(weeks: List<MonthWeek>, lanes: Int): List<WeekLayout> = weeks.map { week ->
if (lanes == 0) return@map WeekLayout(week, laneCap = 0, showsOverflow = false)
val needed = WeekLayout(week, UNCAPPED_LANES).usedLanes
WeekLayout(week, if (needed <= lanes) lanes else lanes - 1)
}
@@ -121,7 +85,4 @@ internal const val MAX_LANES = 8
private const val DAY_ROW_DP = 18f
private const val LANES_TOP_DP = 2f
private const val LANE_ROW_DP = 15f
/** Matches `widget_month_lane_compact`'s height; its 9sp text clips past [COMPACT_MAX_FONT_SCALE]. */
private const val COMPACT_LANE_ROW_DP = 12f
private const val COMPACT_MAX_FONT_SCALE = 1f
private const val UNCAPPED_LANES = 64
@@ -13,7 +13,7 @@ import androidx.compose.ui.graphics.Color
import de.jeanlucmakiola.calendula.MainActivity
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.domain.isDeclined
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.eventFill
import de.jeanlucmakiola.calendula.ui.common.eventInk
@@ -91,21 +91,6 @@ private fun weekViews(
week.setViewVisibility(TODAY_IDS[col], if (isToday) View.VISIBLE else View.GONE)
if (isToday) week.setImageTint(context, TODAY_IDS[col], colors.primary)
}
layout.mixedLane?.let { cells ->
val lane = laneViews(context, layout.compact)
cells.forEach { cell ->
lane.addView(
R.id.lane,
when (val item = cell.item) {
null -> gap(context, cell.cols)
is LaneItem.Bar -> bar(context, item.event, cell.cols, soften, mode)
is LaneItem.Count -> more(context, item.count, colors)
},
)
}
week.addView(R.id.week_lanes, lane)
return week
}
layout.lanes.forEach { cells ->
val lane = laneViews(context)
cells.forEach { cell ->
@@ -121,7 +106,10 @@ private fun weekViews(
if (count == null) {
lane.addView(R.id.lane, gap(context, cell.cols))
} else {
lane.addView(R.id.lane, more(context, count, colors))
val more = RemoteViews(context.packageName, R.layout.widget_month_more)
more.setTextViewText(R.id.more, "+$count")
more.setTextColor(context, R.id.more, colors.onSurfaceVariant)
lane.addView(R.id.lane, more)
}
}
week.addView(R.id.week_lanes, lane)
@@ -129,15 +117,8 @@ private fun weekViews(
return week
}
private fun more(context: Context, count: Int, colors: GridColors) =
RemoteViews(context.packageName, R.layout.widget_month_more).apply {
setTextViewText(R.id.more, "+$count")
setTextColor(context, R.id.more, colors.onSurfaceVariant)
}
private fun laneViews(context: Context, compact: Boolean = false) =
RemoteViews(context.packageName, if (compact) R.layout.widget_month_lane_compact else R.layout.widget_month_lane)
.apply { removeAllViews(R.id.lane) }
private fun laneViews(context: Context) =
RemoteViews(context.packageName, R.layout.widget_month_lane).apply { removeAllViews(R.id.lane) }
private fun gap(context: Context, cols: Int) = RemoteViews(context.packageName, GAP_LAYOUTS[cols - 1])
@@ -148,7 +129,7 @@ private fun bar(context: Context, event: EventInstance, cols: Int, soften: Boole
views.setImageTint(context, R.id.bar_bg, mode.remoteColor(dayFill, nightFill))
val title = event.title.ifBlank { context.getString(R.string.event_untitled) }
// A span, like Glance's own decoration: paint flags would drop the text's defaults.
views.setTextViewText(R.id.bar_title, if (event.isCrossedOut) span(title, StrikethroughSpan()) else title)
views.setTextViewText(R.id.bar_title, if (event.isDeclined) span(title, StrikethroughSpan()) else title)
views.setTextColor(context, R.id.bar_title, mode.remoteColor(eventInk(dayFill), eventInk(nightFill)))
return views
}
@@ -254,7 +254,7 @@ private fun MonthWidgetBody(source: MonthWidgetSource, index: Int) {
val context = LocalContext.current
val fontScale = context.resources.configuration.fontScale
val weekHeight = (LocalSize.current.height - gridChromeHeight(fontScale)) / weeks.size
val layouts = fitWeeks(weeks, lanesFitting(weekHeight, fontScale))
val layouts = fitWeeks(weeks, lanesFitting(weekHeight))
val mode = LocalWidgetThemeMode.current
val colors = GridColors(
onSurface = remoteColor(WidgetColorRole.ON_SURFACE),
@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.widget.split
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.widget.InAppLanguage
import de.jeanlucmakiola.calendula.widget.WidgetKind
import de.jeanlucmakiola.calendula.widget.previewSizeOf
@@ -269,9 +268,7 @@ internal fun MonthDayWidgetContent(
val day = selected ?: source.today
val zone = systemZone()
val days = monthGridDays(index, source.weekStart)
// Declined and cancelled events are no plan for the day, as on the week strip (#388).
val planned = source.instances.filterNot { it.isCrossedOut }
val busy = groupAgendaDays(days.first(), days.last(), planned, zone).map { it.date }.toSet()
val busy = groupAgendaDays(days.first(), days.last(), source.instances, zone).map { it.date }.toSet()
Column(modifier = GlanceModifier.fillMaxSize().padding(horizontal = 8.dp, vertical = 6.dp)) {
Header(index, source.today)
Spacer(GlanceModifier.height(4.dp))
@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.widget.week
import de.jeanlucmakiola.calendula.domain.isCrossedOut
import de.jeanlucmakiola.calendula.widget.InAppLanguage
import de.jeanlucmakiola.calendula.widget.WidgetKind
import de.jeanlucmakiola.calendula.widget.previewSizeOf
@@ -146,9 +145,7 @@ private fun DayTile(date: LocalDate, data: DaysWidgetData.Ready) {
else -> GlanceTheme.colors.onSurface
}
val locale = widgetLocale()
// A declined or cancelled event is no plan for the day, so it adds no dot and no count (#388).
val events = data.eventsOn(date).filterNot { it.isCrossedOut }
val colors = events.map { it.color }.distinct()
val colors = data.eventsOn(date).map { it.color }.distinct()
val label = localizedDateFormatter(locale, "EEEEdMMMM").format(date.toJavaLocalDate())
Column(
modifier = GlanceModifier
@@ -158,7 +155,7 @@ private fun DayTile(date: LocalDate, data: DaysWidgetData.Ready) {
.clickable(actionStartActivity(MainActivity.openDateIntent(context, date, CalendarView.Week)))
.semantics {
contentDescription = if (colors.isEmpty()) label else context.resources.getQuantityString(
R.plurals.widget_day_with_events, events.size, label, events.size,
R.plurals.widget_day_with_events, data.eventsOn(date).size, label, data.eventsOn(date).size,
)
},
horizontalAlignment = Alignment.CenterHorizontally,
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lane"
android:layout_width="match_parent"
android:layout_height="12dp"
android:orientation="horizontal"
android:paddingBottom="1dp"
android:weightSum="7" />
+16 -182
View File
@@ -34,7 +34,7 @@
<string name="month_today_action">اليوم</string>
<string name="month_action_settings">الإعدادات</string>
<string name="settings_title">الإعدادات</string>
<string name="settings_theme">السمة</string>
<string name="settings_theme">الثيم</string>
<string name="settings_theme_system">النظام</string>
<string name="settings_theme_light">فاتح</string>
<string name="settings_theme_dark">داكن</string>
@@ -179,7 +179,7 @@
<string name="reminder_channel_description">الإشعارات في أوقات التذكير بأحداثك</string>
<string name="reminder_onboarding_title">لا تفوّت أي حدث أبدًا</string>
<string name="reminder_onboarding_body">أندرويد لا يعرض تذكيرات الأحداث من نفسه — بل يجب أن يقوم تطبيق تقويم بذلك. دع Calendula يتولى هذه المهمة.</string>
<string name="reminder_benefit_delivery_body">كل تذكير لأحداثك يصِل كإشعار، في الوقت المحدّد تمامًا.</string>
<string name="reminder_benefit_delivery_body">كل تذكير لأحداثك يصِل كإشعار، في الوقت المحدد تمامًا.</string>
<string name="reminder_benefit_duplicates_title">هل تستخدم تطبيق تقويم ثانٍ؟</string>
<string name="reminder_benefit_duplicates_body">إذا تطبيق آخر أيضًا ينشر تذكيرات، فستراهم مرتين — قم بإيقاف تشغيلهم هناك أو هنا.</string>
<string name="reminder_benefit_reversible_title">يمكنك تغييره في أي وقت</string>
@@ -206,8 +206,8 @@
<string name="search_back">الرجوع</string>
<string name="search_action">البحث</string>
<string name="widget_agenda_title">القادم</string>
<string name="widget_agenda_label">جدول</string>
<string name="widget_month_label">شهر</string>
<string name="widget_agenda_label">جدول Calendula</string>
<string name="widget_month_label">شهر Calendula</string>
<string name="widget_new_event">حدث جديد</string>
<string name="widget_needs_permission">افتح Calendula لمنح الوصول إلى التقويم</string>
<string name="widget_prev_month">الشهر السابق</string>
@@ -238,7 +238,7 @@
<string name="settings_time_format_24h">٢٤-ساعة (١٤:٠٠)</string>
<string name="agenda_range_day">اليوم</string>
<string name="settings_agenda_show_today">إظهار اليوم دائمًا</string>
<string name="settings_agenda_show_today_hint">اترك اليوم في أعلى الجدول، حتى بعد عدم وجود أي شيء اليوم. لكل أداة مصغرة إعداداتها الخاصة.</string>
<string name="settings_agenda_show_today_hint">اترك اليوم في أعلى الجدول و أداته المصغرة، حتى بعد عدم وجود أي شيء اليوم.</string>
<string name="agenda_range_this_month">هذا الشهر</string>
<string name="agenda_range_this_week">هذا الأسبوع</string>
<string name="settings_past_events_show">إظهار</string>
@@ -292,7 +292,7 @@
<string name="settings_dim_completed_summary">تعتيم الأحداث التي انتهت بالفعل في عرض الشهر والأسبوع</string>
<string name="settings_today_toolbar">زر اليوم في شريط الأدوات</string>
<string name="settings_today_toolbar_summary">إظهار زر الانتقال إلى اليوم في شريط الأدوات بدلاً من زر عائم</string>
<string name="settings_app_name_summary">اعرض Calendula كـ ”التقويم“ في مشغّل التطبيقات الخاص بك. فقط الاسم في المشغّل يتغير؛ وقد ينتقل الرمز إلى مكان جديد بعد التبديل.</string>
<string name="settings_app_name_summary">اعرض Calendula كـ ”Calendar“ في مشغّل التطبيقات الخاص بك. فقط الاسم في المشغّل يتغير؛ وقد ينتقل الرمز إلى مكان جديد بعد التبديل.</string>
<string name="settings_past_events_dim">تعتيم</string>
<string name="settings_past_events">الأحداث السابقة</string>
<string name="settings_agenda_range">مدى الجدول</string>
@@ -419,7 +419,7 @@
<string name="settings_calendar_reminder_inherits">الافتراضي (%1$s)</string>
<string name="settings_translate">المساعدة في الترجمة</string>
<string name="settings_translate_hint">إضافة أو تحسين لغة على Weblate</string>
<string name="settings_appearance_subtitle">السمة، الألوان، الخطوط</string>
<string name="settings_appearance_subtitle">الثيم، الألوان، الخطوط</string>
<string name="settings_views_subtitle">العرض، التخطيط، الترتيب</string>
<string name="settings_event_form_subtitle">الخانات الافتراضية و السلوك</string>
<string name="settings_notifications_subtitle">التذكيرات و التسليم</string>
@@ -456,7 +456,7 @@
<string name="calendars_restore_action">استعادة من ملف ‎.ics</string>
<string name="calendars_restore_hint">استيراد الأحداث من نسخة احتياطية أو تطبيق تقويم آخر.</string>
<string name="calendars_auto_backup">النسخ الاحتياطي التلقائي</string>
<string name="calendars_auto_backup_hint">تصدير تقويماتك المحلية بشكل دوري إلى مجلد كـ ملف ‎.ics</string>
<string name="calendars_auto_backup_hint">قم بتصدير تقويماتك المحلية بشكل دوري إلى مجلد كـ ملف ‎.ics.</string>
<string name="calendars_auto_backup_folder">مجلد النسخ الاحتياطي</string>
<string name="calendars_auto_backup_folder_unset">اضغط لاختيار مجلد</string>
<string name="calendars_auto_backup_every">كل %1$s</string>
@@ -638,7 +638,7 @@
<item quantity="many">يتم استيراد %d حدث</item>
<item quantity="other">يتم استيراد %d حدث</item>
</plurals>
<string name="event_move_recurring_title">نقل الحدث المتكرّر</string>
<string name="event_move_recurring_title">نقل الحدث المتكرر</string>
<string name="event_edit_conflict_overwrite_hint">فقط الحقول التي عدلتها هي التي ستحل محل التغيير الخارجي</string>
<string name="reorder_drag_handle">اسحب لإعادة الترتيب</string>
<string name="settings_drawer_order_hint">اسحب لإعادة ترتيب طرق العرض المدرجة في قائمة التنقل.</string>
@@ -646,7 +646,7 @@
<string name="settings_default_reminder_allday">أحداث يوم كامل</string>
<string name="settings_allday_reminder_time">وقت تذكير اليوم الكامل</string>
<string name="reminder_none">لا شئ</string>
<string name="settings_reliable_delivery_hint">أندرويد قد يؤخر التذكيرات لتوفير البطارية. استثنِ Calendula لكي تصل في الوقت المحدّد.</string>
<string name="settings_reliable_delivery_hint">أندرويد قد يؤخر التذكيرات لتوفير البطارية. استثنِ Calendula لكي تصل في الوقت المحدد.</string>
<string name="settings_calendar_reminders_title">التذكيرات لكل تقويم</string>
<string name="settings_license_value">MIT</string>
<string name="settings_special_dates_paused_title">متوقف</string>
@@ -655,7 +655,7 @@
<string name="settings_allday_reminder_fires_at">يتم الإشعار في %1$s</string>
<string name="settings_agenda_widget_range">مدى أداة الجدول</string>
<string name="settings_widget_size">حجم أداة الجدول</string>
<string name="settings_widgets_subtitle">أدواتك المصغرة، عنصر الإعدادات السريعة</string>
<string name="settings_widgets_subtitle">أداة الجدول، عنصر الإعدادات السريعة</string>
<string name="settings_drag_to_reschedule">السحب لتعديل الموعد</string>
<string name="settings_drag_to_reschedule_summary">انقل حدثًا عن طريق سحبه إلى يوم أو وقت آخر</string>
<string name="event_move_blocked_series_end">لا يمكن نقل حدث بعد نهاية سلسلته</string>
@@ -663,9 +663,9 @@
<string name="settings_quick_switch_hint">اختر أي طُرق العرض التي يتم التنقل بينها باستخدام الزر في أعلى اليمين، واسحب لإعادة ترتيبهم. مع تشغيل أقل من عرضين اثنين يكون الزر مخفيًا. تظل طُرق العرض التي تم إيقافها متاحة من قائمة التنقل.</string>
<string name="calendars_account_from_source">%1$s (%2$s)</string>
<string name="duration_hours_minutes">%1$s %2$s</string>
<string name="settings_widgets_hint">لكل أداة مصغرة مظهرها وخياراتها الخاصة بها. انقر بواحدة أدناه، أو اضغط مُطوّلًا عليها على شاشتك الرئيسية واختر تعديل. أضف تطبيقًا مصغرًا \"أداة مصغرة\" بالضغط مُطوّلاً بشاشتك الرئيسية.</string>
<string name="settings_widgets_hint">إعدادات لأدوات الشاشة الرئيسية وعنصر الإعدادات السريعة. أضف أداة عن طريق الضغط لفترة طويلة على شاشتك الرئيسية.</string>
<string name="import_warning_attendees">لم يتم استيراد قوائم الضيوف.</string>
<string name="settings_reliable_delivery_exempt">معفى من تحسين البطارية — تصل التذكيرات في الوقت المحدّد.</string>
<string name="settings_reliable_delivery_exempt">معفى من تحسين البطارية — تصل التذكيرات في الوقت المحدد.</string>
<string name="settings_reliable_delivery">توصيل موثوق</string>
<string name="settings_allday_reminder_time_hint">تنطلق التذكيرات لأحداث التي تستمر طوال اليوم عند %1$s</string>
<string name="agenda_range_override_hint">فقط للآن — يعيد التعيين للمدى المحفوظ خاصتك عند إعادة فتح Calendula.</string>
@@ -679,8 +679,8 @@
<string name="settings_font_specimen_heading">الخميس، 14 مايو</string>
<string name="settings_font_specimen_body">مراجعة الفريق في 10:00، ثم الغداء مع روبن في المقهى في ماركتبلاتز.</string>
<string name="settings_section_widgets">الأدوات المصغّرة والعناصر</string>
<string name="settings_widget_size_hint">مدى حجم النص الذي تعرضه هذه الأداة المصغرة.</string>
<string name="settings_agenda_widget_range_hint">كم مدى تُدرج هذه الأداة المصغرة الأحداث.</string>
<string name="settings_widget_size_hint">مدى حجم النص الذي يعرضه جدول أداة الشاشة الرئيسية. أداة الشهر ليس لديه إعداد — تتناسب شبكته دائمًا نفسه للمساحة التي تمنحها إيّاه.</string>
<string name="settings_agenda_widget_range_hint">كم مدى يُدرج جدول أداة الشاشة الرئيسية الأحداث.</string>
<string name="settings_agenda_range_hint">كم مدى يُدرج شاشة الجدول الأحداث.</string>
<string name="app_name">Calendula</string>
<string name="font_atkinson_hyperlegible">Atkinson Hyperlegible</string>
@@ -699,7 +699,7 @@
<string name="settings_special_dates_type_anniversary">الذكرات السنوية</string>
<string name="settings_special_dates_template_hint">استخدم {name} لجهة الاتصال و{year} للسنة (سنة الميلاد، أو سنة بدء الذكرى السنوية؛ مخفية عندما تكون غير معروفة).</string>
<string name="settings_special_dates_template">صيغة العنوان</string>
<string name="settings_calendar_reminders_hint">تجاوز الافتراضي لكل تقويم — بشكل منفصل للمحدّد بوقت وأحداث طوال اليوم. يمكن لتقويم الاحتفاظ بالافتراضي، إسقاطه أو تعيين خاصّته.</string>
<string name="settings_calendar_reminders_hint">تجاوز الافتراضي لكل تقويم — بشكل منفصل للمحدد بوقت وأحداث طوال اليوم. يمكن لتقويم الاحتفاظ بالافتراضي، إسقاطه أو تعيين خاصّته.</string>
<string name="event_move_occurrence_only">سيؤدي نقل السلسلة بأكملها لتغيير أيٍّ الأيام التي تقع فيها، لذلك يمكن نقل هذا الحدث فقط.</string>
<string name="agenda_empty_title">أنت بالكل على آخر اطلاع</string>
<string name="reminder_after">%1$s بعد</string>
@@ -804,170 +804,4 @@
<string name="reminder_day_today">اليوم</string>
<string name="event_detail_open_in_maps">فتح في الخرائط</string>
<string name="link_open_failed">لا تطبيق يمكنه فتح هذا الرابط</string>
<string name="settings_support_kofi">Ko-fi</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="settings_support_liberapay_hint">التبرعات المتكررة</string>
<string name="settings_support_kofi_hint">الإكراميات لمرة واحدة</string>
<string name="settings_theme_black">أسود</string>
<string name="settings_theme_black_summary">داكن مع خلفيات سوداء نقية، لشاشات AMOLED</string>
<string name="event_resize_done">تم التغيير إلى %1$s</string>
<string name="event_resize_recurring_title">تغيير الحدث المتكرّر</string>
<string name="event_selection_actions">إجراءات الحدث</string>
<string name="event_selection_hide">إخفاء إجراءات الحدث</string>
<string name="event_selection_close">إلغاء تحديد الحدث</string>
<string name="event_draft_create">إنشاء حدث</string>
<string name="event_draft_discard">تجاهل الحدث الجديد</string>
<string name="event_action_load_failed">تعذّر فتح الحدث</string>
<string name="event_edit_more_actions">المزيد من الإجراءات</string>
<string name="event_edit_unsaved_title">تغييرات غير محفوظة</string>
<string name="event_edit_unsaved_save">حفظ التغييرات</string>
<string name="event_edit_unsaved_discard">تجاهل التغييرات</string>
<string name="event_edit_create">إنشاء</string>
<string name="settings_tap_opens_details">التفاصيل</string>
<string name="settings_tap_opens_editor">نموذج التعديل</string>
<string name="process_text_create_event">إنشاء حدث</string>
<string name="settings_events_header">الأحداث</string>
<string name="settings_tap_opens">النقر بحدث يفتح</string>
<string name="settings_tap_opens_hint">الأحداث التي لا يمكنك تعديلها وإشعارات التذكير دائمًا تفتح التفاصيل.</string>
<string name="event_edit_unsaved_keep">متابعة التعديل</string>
<string name="event_edit_status">الحالة</string>
<string name="event_status_confirmed">مُؤكّد</string>
<string name="widget_agenda_description">أحداثك القادمة، مُجمَّعة حسب اليوم</string>
<string name="widget_month_description">الشهر في لمحة، مع أحداثك</string>
<string name="widget_quick_add_label">إضافة سريعة</string>
<string name="widget_quick_add_description">ابدأ حدث جديد في نقرة واحدة</string>
<string name="widget_date_label">التاريخ</string>
<string name="widget_date_description">تاريخ اليوم</string>
<string name="widget_week_strip_label">شريط أسبوع</string>
<string name="widget_week_strip_description">هذا الأسبوع، مع الأيام التي تتضمن أحداث</string>
<plurals name="widget_day_with_events">
<item quantity="zero">%1$s، %2$d حدث</item>
<item quantity="one">%1$s، %2$d حدث</item>
<item quantity="two">%1$s، %2$d حدثان</item>
<item quantity="few">%1$s، %2$d أحداث</item>
<item quantity="many">%1$s، %2$d حدث</item>
<item quantity="other">%1$s، %2$d حدث</item>
</plurals>
<string name="widget_upcoming_label">القادم</string>
<string name="widget_upcoming_description">تاريخ اليوم فوق أحداثك القادمة</string>
<string name="widget_upcoming_empty">لا أحداث قادمة</string>
<string name="widget_today_label">اليوم</string>
<string name="widget_today_description">أحداث اليوم، ثم الغد</string>
<string name="widget_nothing_left_today">لا شيء متبقي اليوم</string>
<string name="widget_countdown_label">عد تنازلي</string>
<string name="widget_countdown_description">الوقت حتى حدث، أو الحدث التالي</string>
<string name="widget_countdown_now">الآن</string>
<string name="widget_countdown_ending_now">ينتهي الآن</string>
<string name="widget_countdown_tomorrow">غدًا</string>
<string name="widget_countdown_ends_tomorrow">ينتهي غدًا</string>
<string name="widget_countdown_until">حتى %1$s</string>
<plurals name="widget_countdown_in_minutes">
<item quantity="zero">في %d دقيقة</item>
<item quantity="one">في %d دقيقة</item>
<item quantity="two">في %d دقيقتان</item>
<item quantity="few">في %d دقائق</item>
<item quantity="many">في %d دقيقة</item>
<item quantity="other">في %d دقيقة</item>
</plurals>
<plurals name="widget_countdown_in_hours">
<item quantity="zero">في %d ساعة</item>
<item quantity="one">في %d ساعة</item>
<item quantity="two">في %d ساعتان</item>
<item quantity="few">في %d ساعات</item>
<item quantity="many">في %d ساعة</item>
<item quantity="other">في %d ساعة</item>
</plurals>
<plurals name="widget_countdown_in_days">
<item quantity="zero">في %d يوم</item>
<item quantity="one">في %d يوم</item>
<item quantity="two">في %d يومان</item>
<item quantity="few">في %d أيام</item>
<item quantity="many">في %d يوم</item>
<item quantity="other">في %d يوم</item>
</plurals>
<plurals name="widget_countdown_ends_minutes">
<item quantity="zero">ينتهي في %d دقيقة</item>
<item quantity="one">ينتهي في %d دقيقة</item>
<item quantity="two">ينتهي في %d دقيقتان</item>
<item quantity="few">ينتهي في %d دقائق</item>
<item quantity="many">ينتهي في %d دقيقة</item>
<item quantity="other">ينتهي في %d دقيقة</item>
</plurals>
<plurals name="widget_countdown_ends_hours">
<item quantity="zero">ينتهي في %d ساعة</item>
<item quantity="one">ينتهي في %d ساعة</item>
<item quantity="two">ينتهي في %d ساعتان</item>
<item quantity="few">ينتهي في %d ساعات</item>
<item quantity="many">ينتهي في %d ساعة</item>
<item quantity="other">ينتهي في %d ساعة</item>
</plurals>
<plurals name="widget_countdown_ends_days">
<item quantity="zero">ينتهي في %d يوم</item>
<item quantity="one">ينتهي في %d يوم</item>
<item quantity="two">ينتهي في %d يومان</item>
<item quantity="few">ينتهي في %d أيام</item>
<item quantity="many">ينتهي في %d يوم</item>
<item quantity="other">ينتهي في %d يوم</item>
</plurals>
<string name="widget_countdown_choose">اضغط لاختيار حدث للعد التنازلي إليه</string>
<string name="widget_countdown_over">انتهى %1$s</string>
<string name="widget_config_countdown">العد التنازلي إلى</string>
<string name="widget_config_countdown_next">الحدث التالي</string>
<string name="widget_config_countdown_pinned">الحدث المُختار</string>
<string name="widget_config_countdown_next_hint">الحدث التالي المحدّد بوقت في تقويمات هذه الأداة، أو الحدث الجاري الآن. يتم تخطي أحداث طوال اليوم وأحداث تم رفضها.</string>
<string name="widget_config_countdown_event">الحدث</string>
<string name="widget_config_countdown_event_none">لا شئ تم اختياره بعد</string>
<string name="widget_config_countdown_search">البحث عن الأحداث</string>
<string name="widget_config_countdown_empty">لا أحداث مطابقة في العام المقبل.</string>
<string name="widget_config_countdown_load_failed">تعذّر تحميل أحداثك.</string>
<string name="widget_config_countdown_repeats">%1$s · يتكرّر</string>
<string name="widget_month_day_label">شهر و يوم</string>
<string name="widget_month_day_description">الشهر والأحداث من اليوم الذي تختاره</string>
<string name="widget_day_empty">لا أحداث</string>
<string name="widget_config_background">الخلفية</string>
<string name="widget_config_background_solid">سادة</string>
<string name="widget_config_background_tinted">مُلونة</string>
<string name="widget_config_background_transparent">شفافة</string>
<string name="widget_config_content">المحتوى</string>
<string name="widget_config_range">مدى الوقت</string>
<string name="widget_config_text_size">حجم النص</string>
<string name="widget_config_load_failed">تعذّر قراءة إعدادات هذه الأداة المصغرة.</string>
<string name="widget_config_preview_failed">المعاينة غير متاحة</string>
<string name="widget_config_save_failed">تعذّر حفظ الأداة المصغرة. حاول مجددًا.</string>
<string name="widget_numbered">%1$s %2$d</string>
<string name="widget_appearance_summary">%1$s · %2$s</string>
<string name="widget_config_calendars">التقويمات</string>
<string name="widget_config_calendars_hint">التقويمات التي تعرضها هذه الأداة المصغرة. التقويمات التي أخفيتها في التطبيق تبقى مخفية هنا أيضًا.</string>
<string name="widget_config_calendars_all">جميع التقويمات</string>
<plurals name="widget_config_calendars_some">
<item quantity="zero">%1$d من (%2$d) لا تقويمات</item>
<item quantity="one">%1$d من %2$d تقويم واحد</item>
<item quantity="two">%1$d من %2$d تقويمان</item>
<item quantity="few">%1$d من %2$d تقويمات</item>
<item quantity="many">%1$d من %2$d تقويم</item>
<item quantity="other">%1$d من %2$d تقويم</item>
</plurals>
<string name="settings_month_start_times">أوقات البدء</string>
<string name="settings_month_start_times_summary">إظهار وقت البدء قبل عنوان حدث عندما يكون هناك مساحة</string>
<string name="month_split_no_events_month">لا شيء مجدول هذا الشهر</string>
<string name="month_split_no_more_events">لا شيء آخر مجدول هذا الشهر</string>
<string name="settings_widgets_hint_legacy">لكل أداة مصغرة مظهرها وخياراتها الخاصة بها. انقر بواحدة أدناه لتغييرها. أضف تطبيقًا مصغرًا \"أداة مصغرة\" بالضغط مُطوّلاً بشاشتك الرئيسية.</string>
<string name="settings_widgets_placed">على شاشتك الرئيسية</string>
<string name="settings_widgets_none">لا أدوات Calendula مصغرة على شاشتك الرئيسية بعد.</string>
<string name="widget_preview_sample_dentist">طبيب أسنان</string>
<string name="widget_preview_sample_trip">رحلة عطلة نهاية الأسبوع</string>
<string name="event_move_blocked_cancelled_series">يمكن نقل سلسلة مُلغاة ككل فقط، وسيؤدي هذا إلى تغيير أيًّا الأيام التي تقع عليها</string>
<string name="widget_config_theme_follow_app">اتبع التطبيق</string>
<string name="widget_config_invert_text">عكس لون النص</string>
<string name="widget_config_invert_text_summary">النص الفاتح على السمة الداكن يتحول لداكن، والعكس صحيح</string>
<string name="widget_config_readability_info">حول سهولة القراءة</string>
<string name="widget_config_readability_hint">عند درجة العتامة المنخفضة تظهر الخلفية من خلاله، لذلك قد تكون بعض النصوص أصعب للقراءة. ارفع درجة العتامة إذا كان كذلك.</string>
<string name="widget_config_readability_hint_classic">عند درجة العتامة المنخفضة تظهر الخلفية من خلاله، لذلك قد تكون بعض النصوص أصعب للقراءة. إذا كان كذلك، ارفع درجة العتامة أو اعكس لون النص.</string>
<string name="widget_config_style">النمط</string>
<string name="widget_config_style_cards">بطاقات</string>
<string name="widget_config_style_classic">كلاسيكي</string>
<string name="widget_config_opacity">درجة العتامة</string>
<string name="event_move_stale">تم نقل ذلك الحدث قبل أن يمكن حفظ إفلاتك</string>
<string name="event_move_queue_full">عدد كبير جدًا من التنقلات في وقت واحد، لذلك لم يُحفظ ذلك الحدث</string>
<string name="event_move_skipped">لم تُحفظ التنقلات التي أُجريَت أثناء فتح السؤال</string>
</resources>
+1 -37
View File
@@ -697,7 +697,7 @@
<string name="onboarding_calendars_benefit_sync_title">Або наладзьце сынхранізацыю з уліковым запісам</string>
<string name="onboarding_calendars_created_more_title">Прастора для іншых</string>
<string name="onboarding_calendars_created_title">«%1$s» гатовы</string>
<string name="onboarding_calendars_benefit_sync_body">Calendula паказвае ўліковыя запісы, якія ўжо сынхранізуюцца. Для выкананьня сынхранізацыі сэрвэры CalDAV патрабуець DAVx.</string>
<string name="onboarding_calendars_benefit_sync_body">Calendula паказвае ўліковыя запісы, якія ўжо сынхранізуюцца. Для выкананьня сынхранізацыі сэрвэры CalDAV патрабуець DAVx\\u2075.</string>
<string name="onboarding_calendars_created_body">Ён застаецца на гэтай прыладзе. У ім будуць запісвацца новыя падзеі, пакуль ня будзе выбраны іншы каляндар.</string>
<string name="onboarding_calendars_created_more_body">Праз мэню Налады → Календары можна задаць колькасьць, назвы і колеры наяўных календароў.</string>
<string name="onboarding_calendars_created_continue">Далей</string>
@@ -708,40 +708,4 @@
<string name="onboarding_hidden_failed">Гэты не атрымалася ўключыць. У мэню Налады → Календары знаходзяцца такія самыя перамыкачы.</string>
<string name="onboarding_calendars_create_failed">Не атрымалася стварыць каляндар з-за адмовы сховішча вашай прылады.</string>
<string name="reminder_day_today">Сёньня</string>
<string name="event_resize_done">Зьменена на %1$s</string>
<string name="event_resize_recurring_title">Зьмяніць пэрыядычную падзею</string>
<string name="event_selection_actions">Дзеяньні падзеі</string>
<string name="event_selection_hide">Схаваць дзеяньні падзеі</string>
<string name="event_selection_close">Адмяніць выбар падзеі</string>
<string name="event_draft_create">Стварыць падзею</string>
<string name="event_draft_discard">Адкінуць новую падзею</string>
<string name="event_action_load_failed">Не атрымалася адкрыць падзею</string>
<string name="event_edit_more_actions">Іншыя дзеяньні</string>
<string name="event_edit_unsaved_title">Незахаваныя зьмены</string>
<string name="event_edit_unsaved_save">Захаваць зьмены</string>
<string name="event_edit_unsaved_discard">Адкінуць зьмены</string>
<string name="event_edit_unsaved_keep">Працягнуць рэдагаваньне</string>
<string name="event_edit_create">Стварыць</string>
<plurals name="view_multi_day">
<item quantity="one">%d суткі</item>
<item quantity="few">%d сутак</item>
<item quantity="many">%d сутак</item>
<item quantity="other">%d сутак</item>
</plurals>
<string name="settings_theme_black">Чорная</string>
<string name="settings_theme_black_summary">Цёмная з чыста чорным тлом для экранаў AMOLED</string>
<string name="settings_multi_day_count">Паказ некалькіх сутак</string>
<string name="settings_multi_day_count_hint">Сколькі сутак бачныя ў рэжыме паказу некалькіх сутак. Сёньня адкрываецца ў першым слупку.</string>
<string name="settings_timeline_scale_by_visible_hours">Задаецца праз бачныя гадзіны</string>
<string name="settings_visible_hours">Бачныя гадзіны</string>
<string name="settings_visible_hours_summary">Упісваць дыяпазон гадзін на экране пры праглядзе тыдня, некалькіх сутак або адных сутак</string>
<string name="settings_visible_hours_on_summary">Пры адкрыцьці прагляду на экране зьявіцца дыяпазон %1$s—%2$s</string>
<string name="settings_visible_hours_start">Ад</string>
<string name="settings_visible_hours_end">Да</string>
<string name="settings_visible_hours_start_hint">Гадзіна зьверху экрана ў рэжыме прагляду тыдня, некалькіх сутак або сутак. Каб пабачыць ранейшыя гадзіны, трэба прагортка.</string>
<string name="settings_visible_hours_end_hint">Апошняя гадзіна ўнізе экрану ў рэжыме прагляду. Каб пабачыць пазьнейшыя гадзіны трэба прагортка. Таксама зьвядзеньнем пальцаў па экране можна зьмяніць маштаб да наступнага адкрыцьця рэжыму.</string>
<string name="settings_events_header">Падзеі</string>
<string name="event_move_queue_full">Зашмат адначасовых рухаў, і таму той ня быў захаваны</string>
<string name="event_move_skipped">Рухі, зробленыя, калі пытаньне было адкрытым, не былі захаваныя</string>
<string name="event_move_blocked_cancelled_series">Скасаваную сэрыю можна перасунуць толькі цалкам; пры гэтым зьменяцца дні, на якія яна прыпадае</string>
</resources>
+9 -31
View File
@@ -471,7 +471,7 @@
<string name="settings_reminders_hint">Vidíte připomínky dvakrát? Zobrazuje je i jiná aplikace kalendáře – v jedné z nich je vypněte.</string>
<string name="settings_default_reminder">Výchozí připomínka</string>
<string name="settings_default_reminder_allday">Celodenní události</string>
<string name="settings_allday_reminder_time">Čas připomínky celodenní události</string>
<string name="settings_allday_reminder_time">Čas celodenní připomínky</string>
<string name="settings_allday_reminder_time_hint">Připomínky na celodenní události se spouštějí v %1$s</string>
<string name="settings_allday_reminder_fires_at">Upozorní v %1$s</string>
<string name="reminder_none">Žádná</string>
@@ -489,7 +489,7 @@
<string name="settings_snooze_duration">Doba odložení</string>
<string name="settings_section_calendars">Kalendáře</string>
<string name="settings_manage_calendars">Správa kalendářů</string>
<string name="settings_manage_calendars_hint">Správa místních a synchronizovaných kalendářů</string>
<string name="settings_manage_calendars_hint">Vytvořte místní kalendáře; spravujte synchronizované kalendáře</string>
<string name="settings_section_language">Jazyk</string>
<string name="settings_language">Jazyk aplikace</string>
<string name="settings_language_auto">Výchozí nastavení systému</string>
@@ -515,9 +515,9 @@
<string name="settings_time_format_hint">Způsob zápisu času v celé aplikaci. Funkce „Automaticky“ se řídí nastavením vašeho systému.</string>
<string name="settings_past_events_hint">Jak program zachází s událostmi, které již skončily.</string>
<string name="settings_dynamic_color_summary">Aplikace převezme barvy z vaší tapety.</string>
<string name="settings_section_special_dates">Události kontaktů</string>
<string name="settings_special_dates_enable">Zobrazit události kontaktů</string>
<string name="settings_special_dates_enable_hint">Zkopírujte data narozenin či dalších událostí svých kontaktů do místních kalendářů. Aplikace čte pouze kontakty v tomto zařízení – nikam se nic nenahrává, vaše kontakty zůstávají beze změny.</string>
<string name="settings_section_special_dates">Speciální data kontaktů</string>
<string name="settings_special_dates_enable">Zobrazit data kontaktů</string>
<string name="settings_special_dates_enable_hint">Zkopírujte data narozenin a další data svých kontaktů do místních kalendářů. Aplikace čte pouze kontakty v tomto zařízení – nikam se nic nenahrává, vaše kontakty zůstávají beze změny.</string>
<string name="settings_special_dates_type_birthday">Narozeniny</string>
<string name="settings_special_dates_type_anniversary">Výročí</string>
<string name="settings_special_dates_type_custom">Ostatní data</string>
@@ -529,11 +529,11 @@
<string name="settings_special_dates_never_synced">Zatím nesynchronizováno</string>
<string name="settings_special_dates_last_synced">Naposledy synchronizováno %1$s</string>
<string name="settings_special_dates_calendar_hint">Barvu a viditelnost jednotlivých kalendářů nastavte v nastavení kalendářů.</string>
<string name="settings_calendar_reminders_managed_hint">Nastavte v části Události kontaktů</string>
<string name="settings_calendar_reminders_managed_hint">Nastavte v části Speciální data kontaktu</string>
<string name="settings_special_dates_paused_title">Pozastaveno</string>
<string name="settings_special_dates_paused_hint">Calendula už nemá přístup k vašim kontaktům, tudíž zůstávají bez aktualizace.</string>
<string name="settings_special_dates_grant">Udělit přístup</string>
<string name="settings_special_dates_disable_title">Vypnout události kontaktů?</string>
<string name="settings_special_dates_disable_title">Vypnout data kontaktů?</string>
<string name="settings_special_dates_disable_type_message">Tímto se odstraní kalendář „%1$s“ a jeho události. Veškeré připomínky a poznámky, které jste do nich přidali, budou ztraceny.</string>
<string name="settings_special_dates_disable_confirm">Vypnout</string>
<string name="dialog_save">Uložit</string>
@@ -566,7 +566,7 @@
<string name="calendars_state_read_only">Pouze pro čtení</string>
<string name="calendars_state_not_synced">Není synchronizováno s tímto zařízením</string>
<string name="calendars_state_managed">Vyplněno z vašich kontaktů</string>
<string name="calendars_managed_delete_locked">Tento kalendář se plní ze seznamu vašich kontaktů, takže jej aplikace Calendula při příští synchronizaci znovu vytvoří. Chcete-li jej odstranit, vypněte možnost událostí kontaktů v nabídce Nastavení → Události kontaktů.</string>
<string name="calendars_managed_delete_locked">Tento kalendář se plní z vašich kontaktů, takže jej aplikace Calendula při příští synchronizaci znovu vytvoří. Chcete-li jej odstranit, vypněte možnost speciálních dat v nabídce Nastavení → Speciální data.</string>
<string name="calendars_synced_header">Synchronizované kalendáře</string>
<string name="calendars_synced_hint">Tyto kontakty pocházejí z účtů ve vašem zařízení. Vytvářejte je a upravujte v příslušné aplikaci.</string>
<string name="calendars_manage_in_app">Spravovat v aplikaci</string>
@@ -689,7 +689,7 @@
<string name="crash_report_open_failed">Nepodařilo se otevřít systém pro hlášení problémů. Zpráva je zkopírována ve vaší schránce.</string>
<string name="special_dates_calendar_birthday">Narozeniny</string>
<string name="special_dates_calendar_anniversary">Výročí</string>
<string name="special_dates_calendar_custom">Ostatní data</string>
<string name="special_dates_calendar_custom">Speciální data</string>
<string name="special_dates_default_title_birthday">Narozeniny má {name} ({year})</string>
<string name="special_dates_default_title_anniversary">Výročí má {name} ({year})</string>
<string name="special_dates_default_title_custom">{name}</string>
@@ -764,26 +764,4 @@
<string name="settings_support_kofi_hint">Jednorázové příspěvky</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="settings_support_liberapay_hint">Pravidelné příspěvky</string>
<string name="event_resize_done">Změněno na %1$s</string>
<string name="event_resize_recurring_title">Změnit opakující se událost</string>
<string name="event_selection_actions">Akce událostí</string>
<string name="event_selection_hide">Skrýt akce událostí</string>
<string name="event_selection_close">Zrušit výběr události</string>
<string name="event_draft_create">Vytvořit událost</string>
<string name="event_draft_discard">Zahodit novou událost</string>
<string name="event_action_load_failed">Událost se nepodařilo otevřít</string>
<string name="event_edit_more_actions">Další akce</string>
<string name="event_edit_unsaved_title">Neuložené změny</string>
<string name="event_edit_unsaved_save">Uložit změny</string>
<string name="event_edit_unsaved_discard">Zahodit změny</string>
<string name="event_edit_unsaved_keep">Pokračovat v úpravách</string>
<string name="event_edit_create">Vytvořit</string>
<string name="settings_theme_black">Černý</string>
<string name="settings_theme_black_summary">Tmavý s čistě černým pozadím, pro AMOLED obrazovky</string>
<string name="settings_events_header">Události</string>
<string name="settings_tap_opens">Klepnutím na událost se otevře</string>
<string name="settings_tap_opens_details">Podrobnosti</string>
<string name="settings_tap_opens_editor">Formulář pro úpravu</string>
<string name="settings_tap_opens_hint">U upomínek a událostí, které nelze upravit, se vždy otevře stránka s podrobnostmi.</string>
<string name="process_text_create_event">Vytvořit událost</string>
</resources>
+22 -166
View File
@@ -118,7 +118,7 @@
<string name="event_edit_recurrence_end_until">An einem Datum</string>
<string name="event_edit_recurrence_end_count">Nach einer Anzahl</string>
<string name="event_edit_recurrence_times">Mal</string>
<string name="event_edit_error_recurrence_ends_before_start">Wiederholung endet vor dem Beginn des Termins</string>
<string name="event_edit_error_recurrence_ends_before_start">Wiederholung endet vor dem Beginn</string>
<string name="event_availability_busy">Beschäftigt</string>
<string name="event_access_default">Standard</string>
<string name="event_access_public">Öffentlich</string>
@@ -159,7 +159,7 @@
<string name="event_attendee_optional">Optional</string>
<string name="event_attendee_resource">Ressource</string>
<string name="event_detail_self_response">Deine Antwort: %1$s</string>
<string name="reminder_at_time">Zur Zeit des Termins</string>
<string name="reminder_at_time">Zur Startzeit</string>
<string name="reminder_default">Standarderinnerung</string>
<plurals name="reminder_minutes">
<item quantity="one">%d Minute vorher</item>
@@ -225,8 +225,8 @@
<string name="search_empty">Keine Termine passen zu „%1$s“.</string>
<!-- Startbildschirm-Widgets -->
<string name="widget_agenda_title">Anstehend</string>
<string name="widget_agenda_label">Agenda</string>
<string name="widget_month_label">Monat</string>
<string name="widget_agenda_label">Calendula Agenda</string>
<string name="widget_month_label">Calendula Monat</string>
<string name="widget_refresh">Aktualisieren</string>
<string name="widget_new_event">Neuer Termin</string>
<string name="widget_needs_permission">Öffne Calendula, um Kalenderzugriff zu erlauben</string>
@@ -264,7 +264,7 @@
<string name="settings_agenda_range">Agenda-Zeitraum</string>
<string name="settings_agenda_range_hint">Wie weit im Voraus die Agenda-Ansicht Termine anzeigt.</string>
<string name="settings_agenda_widget_range">Agenda-Widget-Zeitraum</string>
<string name="settings_agenda_widget_range_hint">Wie weit im Voraus das Agenda-Widget Termine anzeigt.</string>
<string name="settings_agenda_widget_range_hint">Wie weit im Voraus das Agenda-Widget auf dem Startbildschirm Termine anzeigt.</string>
<string name="settings_agenda_range_bar">Zeitraum-Leiste</string>
<string name="settings_agenda_range_bar_hint">Eine Leiste oben in der Agenda anzeigen, die den dargestellten Zeitraum benennt, mit einer Schaltfläche zum Wechseln des Zeitraums für die Sitzung</string>
<string name="agenda_range_day">Heute</string>
@@ -400,7 +400,7 @@
<string name="font_jetbrains_mono">JetBrains Mono</string>
<string name="settings_font_choose_file">Datei auswählen…</string>
<string name="settings_font_import_failed">Die Datei konnte nicht als Schriftart gelesen werden</string>
<string name="settings_dim_completed">Vergangene Termine abdunkeln</string>
<string name="settings_dim_completed">Vergangene Ereignisse abdunkeln</string>
<string name="settings_dim_completed_summary">Vergangene Termine in der Monats- und Wochenansicht abdunkeln</string>
<string name="settings_past_events">Vergangene Termine</string>
<string name="settings_past_events_show">Zeigen</string>
@@ -428,7 +428,7 @@
<string name="settings_special_dates_enable_hint">Spiegle die Geburtstage und andere Termine deiner Kontakte in lokale Kalender. Liest nur Kontakte auf diesem Gerät – es wird nichts hochgeladen und Ihre Kontakte werden nie geändert.</string>
<string name="settings_special_dates_type_birthday">Geburtstage</string>
<string name="settings_special_dates_type_anniversary">Jahrestage</string>
<string name="settings_special_dates_type_custom">Andere Daten</string>
<string name="settings_special_dates_type_custom">Andere Ereignisse</string>
<string name="settings_special_dates_template">Titelformat</string>
<string name="settings_special_dates_template_hint">Verwende {Name} für den Kontakt und {Jahr} für das Jahr (das Geburtsjahr oder das Anfangsjahr eines Jahrestages; versteckt, wenn unbekannt).</string>
<string name="settings_special_dates_show_year">Jahr anzeigen</string>
@@ -441,9 +441,9 @@
<string name="settings_calendar_reminders_managed_hint">In den besonderen Terminen der Kontakte setzen</string>
<string name="settings_special_dates_paused_hint">Calendula kann deine Kontakte nicht mehr lesen, daher werden diese Kalender nicht aktualisiert.</string>
<string name="settings_special_dates_disable_title">Kontakttermine deaktivieren?</string>
<string name="settings_special_dates_disable_all_message">Dadurch werden die Kontaktterminkalender und ihre Termine gelöscht. Alle von dir hinzugefügten Erinnerungen oder Notizen gehen verloren.</string>
<string name="settings_special_dates_disable_all_message">Dadurch werden die Kontaktterminkalender und ihre Ereignisse gelöscht. Alle von dir hinzugefügten Erinnerungen oder Notizen gehen verloren.</string>
<string name="settings_special_dates_grant">Zugriff gewähren</string>
<string name="settings_special_dates_disable_type_message">Dadurch werden der Kalender „%1$s“ und seine Termine gelöscht. Alle von dir hinzugefügten Erinnerungen oder Notizen gehen verloren.</string>
<string name="settings_special_dates_disable_type_message">Dadurch werden der Kalender „%1$s“ und seine Ereignisse gelöscht. Alle von dir hinzugefügten Erinnerungen oder Notizen gehen verloren.</string>
<string name="settings_special_dates_disable_confirm">Deaktivieren</string>
<string name="dialog_save">Speichern</string>
<string name="calendars_account_menu_a11y">Weitere Optionen für %1$s</string>
@@ -477,18 +477,18 @@
<string name="calendars_restore_header">Wiederherstellen</string>
<string name="calendars_restore_action">Aus .ics-Datei wiederherstellen</string>
<string name="calendars_restore_hint">Einträge von einem Backup oder einer anderen Kalender App importieren.</string>
<string name="import_done_dedup_note">Bereits im Kalender vorhandene Termine wurden übersprungen.</string>
<string name="import_done_dedup_note">Bereits im Kalender vorhandene Ereignisse wurden übersprungen.</string>
<string name="import_done_added_label">Hinzugefügt</string>
<string name="import_done_skipped_label">Dopplungen</string>
<string name="import_button">Importieren</string>
<plurals name="import_title_count">
<item quantity="one">%d Termin wird importiert</item>
<item quantity="other">%d Termine werden importiert</item>
<item quantity="one">%d Ereignis wird importiert</item>
<item quantity="other">%d Ereignisse werden importiert</item>
</plurals>
<string name="event_detail_duplicate">Duplikate</string>
<string name="reminder_day_tomorrow">Morgen</string>
<string name="event_edit_timezone_device">Zeitzone des Gerätes</string>
<string name="event_edit_timezone_device_summary">Passt sich an wo du bist</string>
<string name="event_edit_timezone_device_summary">Passt sich an wo Sie sind</string>
<string name="event_edit_timezone_search">Zeitzonen durchsuchen</string>
<string name="event_edit_timezone_recent">Kürzliche</string>
<string name="event_edit_timezone_all">Alle Zeitzonen</string>
@@ -502,7 +502,7 @@
<string name="settings_widget_size">Agenda-Widget-Größe</string>
<string name="import_reminder_prompt_body_none">Dieser Termin wurde ohne eine Erinnerung importiert.</string>
<string name="import_reminder_prompt_apply">Standart anwenden</string>
<string name="settings_widgets_subtitle">Deine Widgets, Schnelleinstellungen-Kachel</string>
<string name="settings_widgets_subtitle">Agenda-Widget, Schnelleinstellungen-Kachel</string>
<string name="import_reminder_prompt_keep">unverändert lassen</string>
<string name="event_access_public_summary">Jeder mit Zugriff sieht jedes Detail</string>
<string name="event_access_private_summary">Andere sehen nur das du beschäftigt bist</string>
@@ -514,7 +514,7 @@
<string name="event_move_gone">Dieser Termin existiert nicht mehr</string>
<string name="duration_custom_max">Maximal %1$s</string>
<string name="reminder_day_yesterday">Gestern</string>
<string name="agenda_no_more_today">Keine Termine mehr heute</string>
<string name="agenda_no_more_today">Keine Events mehr heute</string>
<string name="agenda_span_starts">Beginnt %1$s</string>
<string name="agenda_span_ends">Endet %1$s</string>
<string name="today_jump_action">Zu Heute springen</string>
@@ -581,18 +581,18 @@
<string name="settings_past_events_sample_morning">Team-Besprechung</string>
<string name="settings_past_events_sample_midday">Mittagessen mit Robin</string>
<string name="settings_past_events_sample_evening">Chorprobe</string>
<string name="settings_widget_size_hint">Wie groß das Agenda-Widget seinen Text zeichnet.</string>
<string name="settings_widget_size_hint">Wie groß das Agenda-Widget auf dem Startbildschirm seinen Text zeichnet. Für das Monats-Widget gibt es keine Einstellung – sein Raster passt sich immer dem Platz an, den du ihm gibst.</string>
<string name="settings_widget_size_small">Klein</string>
<string name="settings_widget_size_medium">Mittel</string>
<string name="settings_widget_size_large">Groß</string>
<string name="settings_widget_size_extra_large">Sehr groß</string>
<string name="settings_widget_size_summary">Termintext %1$d%%</string>
<string name="settings_agenda_show_today">Heute immer zeigen</string>
<string name="settings_agenda_show_today_hint">Behält Heute oben in der Agenda, auch wenn für heute nichts mehr ansteht. Jedes Widget hat seine eigenen Einstellungen.</string>
<string name="settings_agenda_show_today_hint">Behält Heute oben in der Agenda und ihrem Widget, auch wenn für heute nichts mehr ansteht.</string>
<string name="settings_month_header">Monatsansicht</string>
<string name="settings_month_view_style">Stil der Monatsansicht</string>
<string name="month_style_paged">Seiten</string>
<string name="month_style_paged_summary">Ein Monat füllt den Bildschirm. Wische nach links oder rechts, um den Monat zu wechseln, oder wische nach oben, um die Monatsagenda anzuzeigen.</string>
<string name="month_style_paged_summary">Ein Monat füllt den Bildschirm. Wische nach links oder rechts, um den Monat zu wechseln.</string>
<string name="month_style_continuous">Fortlaufende Monate</string>
<string name="month_style_continuous_summary">Jeder Monat steht unter seiner eigenen Überschrift, mit etwas Abstand zum nächsten.</string>
<string name="month_style_dense">Nahtlose Wochen</string>
@@ -613,7 +613,7 @@
<string name="settings_group_app">App</string>
<string name="settings_backup_subtitle">Export, Import, automatische Sicherung</string>
<string name="settings_section_widgets">Widgets &amp; Kacheln</string>
<string name="settings_widgets_hint">Jedes Widget hat ein eigenes Design und eigene Optionen. Tippe unten auf ein Widget oder drücke lange auf deinen Startbildschirm lange und wähle „Bearbeiten“. Füge ein Widget hinzu, indem du den Startbildschirm lange drückst.</string>
<string name="settings_widgets_hint">Einstellungen für die Widgets auf dem Startbildschirm und die Schnelleinstellungen-Kachel. Füge ein Widget hinzu, indem du lange auf den Startbildschirm drückst.</string>
<string name="settings_section_backup">Sicherung &amp; Wiederherstellung</string>
<string name="settings_views_all_header">Alle Ansichten</string>
<string name="settings_week_day_header">Woche &amp; Tag</string>
@@ -646,8 +646,8 @@
<item quantity="other">%d Termine gelöscht</item>
</plurals>
<string name="state_failure_permission_body">Calendula liest deine Termine direkt vom Systemkalender, daher braucht es Kalenderzugriff um etwas anzuzeigen.</string>
<string name="state_failure_no_calendars_body">Füge einen Kalenderaccount zu diesem Gerät hinzu, dann werden dessen Kalender hier angezeigt.</string>
<string name="state_failure_all_hidden">All deine Kalender sind ausgeschaltet.</string>
<string name="state_failure_no_calendars_body">Füge einen Kalenderaccount zu diesem Gerät hinzu, dann werden ihre Kalender hier angezeigt.</string>
<string name="state_failure_all_hidden">All Ihre Kalender sind ausgeschaltet.</string>
<string name="state_failure_all_hidden_body">Schalte mindestens einen Kalender wieder an um dessen Termine zu sehen.</string>
<string name="state_failure_all_hidden_action">Kalender verwalten</string>
<string name="state_failure_no_import_target">Kein Kalender akzeptiert neue Termine.</string>
@@ -693,7 +693,7 @@
<string name="color_name_red">Rot</string>
<string name="color_name_orange">Orange</string>
<string name="color_name_amber">Bernstein</string>
<string name="color_name_olive">Oliv</string>
<string name="color_name_olive">Olive</string>
<string name="color_name_green">Grün</string>
<string name="color_name_teal">Türkis</string>
<string name="color_name_cyan">Cyan</string>
@@ -727,148 +727,4 @@
<string name="settings_visible_hours">Sichtbare Stunden</string>
<string name="settings_visible_hours_start">Von</string>
<string name="settings_visible_hours_end">Bis</string>
<string name="month_open_week">Woche %1$d öffnen</string>
<string name="month_split_clear_filter">Zeig die Agenda des ganzen Monats</string>
<string name="event_resize_done">Zu %1$s geändert</string>
<string name="event_selection_actions">Termin Aktionen</string>
<string name="event_selection_hide">Termin Aktionen verstecken</string>
<string name="event_selection_close">Termin abwählen</string>
<string name="event_draft_discard">Neuen Termin verwerfen</string>
<string name="event_action_load_failed">Termin konnte nicht geöffnet werden</string>
<string name="event_edit_unsaved_title">Ungespeicherte Änderungen</string>
<string name="event_edit_unsaved_save">Änderungen speichern</string>
<string name="event_edit_unsaved_discard">Änderungen verwerfen</string>
<string name="event_edit_create">Erstellen</string>
<string name="event_detail_open_in_maps">In Maps öffnen</string>
<string name="settings_theme_black_summary">Dunkel mit schwarzem Hintergrund, für AMOLED Bildschirme</string>
<string name="settings_multi_day_count">Mehrtagesansicht</string>
<string name="settings_multi_day_count_hint">Bestimmt, wie viele Tage in der Mehrtagesansicht angezeigt werden sollen. Die erste Spalte ist immer der aktuelle Tag.</string>
<string name="settings_timeline_scale_by_visible_hours">Durch sichtbares Zeitfenster bestimmt</string>
<string name="settings_visible_hours_summary">Zeigt in Wochen-, Mehrtages- und Tagesansicht anstatt aller Stunden ein bestimmtes Zeitfenster an</string>
<string name="settings_visible_hours_on_summary">Ansicht zeigt nur Zeit von %1$s bis %2$s</string>
<string name="settings_visible_hours_start_hint">Die Stunde am oberen Bildschirmrand, wenn die Wochen-, Mehrtages- oder Tagesansicht geöffnet wird. Frühere Stunden können durch Scrollen erreicht werden.</string>
<string name="settings_visible_hours_end_hint">Die Stunde am unteren Bildschirmrand, wenn eine Ansicht geöffnet wird. Spätere Stunden erreichst du weiterhin durch Scrollen, und das Zoomen per Pinch-Geste bleibt bestehen, bis die Ansicht erneut geöffnet wird.</string>
<string name="settings_events_header">Termine</string>
<string name="settings_tap_opens">Aktion beim Tippen auf einen Termin</string>
<string name="settings_tap_opens_details">Details</string>
<string name="settings_tap_opens_editor">Termin-Formular</string>
<string name="settings_tap_opens_hint">Termine, die nicht bearbeitet werden können, und Erinnerungsbenachrichtigungen öffnen immer die Details.</string>
<string name="settings_support_kofi_hint">Einmalige Spenden</string>
<string name="settings_support_liberapay_hint">Regelmäßige Spenden</string>
<string name="process_text_create_event">Termin erstellen</string>
<string name="settings_support_kofi">Ko-fi</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="event_resize_recurring_title">Wiederkehrenden Termin verschieben</string>
<string name="event_draft_create">Termin erstellen</string>
<string name="event_edit_more_actions">Weitere Aktionen</string>
<string name="event_edit_unsaved_keep">Weiter bearbeiten</string>
<string name="settings_theme_black">Zurück</string>
<string name="event_edit_status">Status</string>
<string name="event_status_confirmed">Bestätigt</string>
<string name="event_move_stale">Dieser Termin wurde verschoben, bevor dein Drop gespeichert werden konnte</string>
<string name="event_move_queue_full">Zu viele Verschiebungen auf einmal, deshalb wurde diese nicht gespeichert</string>
<string name="event_move_skipped">Die während der Bearbeitung der Frage vorgenommenen Verschiebungen wurden nicht gespeichert</string>
<string name="event_move_blocked_cancelled_series">Eine abgesagte Serie kann nur als Ganzes verschoben werden, wodurch sich die Tage ändern würden, an denen sie stattfindet</string>
<string name="widget_agenda_description">Deine nächsten Termine, nach Tagen geordnet</string>
<string name="widget_month_description">Der Monat im Überblick, mit deinen Terminen</string>
<string name="widget_quick_add_label">Schnell hinzufügen</string>
<string name="widget_quick_add_description">Mit einem Klick einen neuen Termin erstellen</string>
<string name="widget_date_label">Datum</string>
<string name="widget_date_description">Das heutige Datum</string>
<string name="widget_week_strip_label">Wochenstreifen</string>
<string name="widget_week_strip_description">Diese Woche, an den Tagen, an denen Termine stattfinden</string>
<plurals name="widget_day_with_events">
<item quantity="one">%1$s, %2$d Termin</item>
<item quantity="other">%1$s, %2$d Termine</item>
</plurals>
<string name="widget_upcoming_label">Anstehend</string>
<string name="widget_upcoming_description">Das heutige Datum und deine nächsten Termine</string>
<string name="widget_upcoming_empty">Keine anstehenden Termine</string>
<string name="widget_today_label">Heute</string>
<string name="widget_today_description">Heutige Termine, dann die morgigen</string>
<string name="widget_nothing_left_today">Heute keine Fälligkeiten</string>
<string name="widget_countdown_label">Countdown</string>
<string name="widget_countdown_now">Jetzt</string>
<string name="widget_countdown_ending_now">Endet jetzt</string>
<string name="widget_countdown_tomorrow">Morgen</string>
<plurals name="widget_countdown_in_minutes">
<item quantity="one">in %d Minute</item>
<item quantity="other">in %d Minuten</item>
</plurals>
<plurals name="widget_countdown_in_hours">
<item quantity="one">in %d Stunde</item>
<item quantity="other">in %d Stunden</item>
</plurals>
<plurals name="widget_countdown_in_days">
<item quantity="one">in %d Tag</item>
<item quantity="other">in %d Tagen</item>
</plurals>
<string name="widget_config_countdown_search">Termine suchen</string>
<string name="widget_config_style">Stil</string>
<string name="widget_config_style_cards">Karten</string>
<string name="widget_config_countdown">Countdown bis</string>
<string name="widget_config_countdown_next">Nächster Termin</string>
<string name="widget_config_countdown_event">Termin</string>
<string name="widget_numbered">%1$s %2$d</string>
<string name="widget_appearance_summary">%1$s · %2$s</string>
<string name="widget_config_calendars_all">Alle Kalender</string>
<string name="widget_countdown_description">Zeit bis zu einem Termin oder dem nächsten</string>
<string name="widget_config_countdown_pinned">Ausgewählter Termin</string>
<string name="widget_config_countdown_next_hint">Der nächste Termin in den Kalendern dieses Widgets oder ein aktuell laufender Termin. Ganztägige und abgelehnte Termine werden übersprungen.</string>
<string name="widget_config_countdown_event_none">Noch keiner ausgewählt</string>
<string name="widget_config_countdown_empty">Keine passenden Termine im kommenden Jahr.</string>
<string name="widget_config_countdown_load_failed">Deine Termine konnten nicht geladen werden.</string>
<string name="widget_month_day_description">Der Monat und die Termine des gewählten Tages</string>
<string name="widget_day_empty">Keine Termine</string>
<string name="settings_month_start_times_summary">Die Startzeit vor dem Titel eines Termins anzeigen, sofern genügend Platz vorhanden ist</string>
<string name="month_split_no_events_month">Nichts geplant diesen Monat</string>
<string name="month_split_no_more_events">Sonst nichts geplant diesen Monat</string>
<string name="widget_countdown_ends_tomorrow">Endet morgen</string>
<string name="widget_countdown_until">Bis %1$s</string>
<plurals name="widget_countdown_ends_minutes">
<item quantity="one">endet in %d Minute</item>
<item quantity="other">endet in %d Minuten</item>
</plurals>
<plurals name="widget_countdown_ends_hours">
<item quantity="one">endet in %d Stunde</item>
<item quantity="other">endet in %d Stunden</item>
</plurals>
<plurals name="widget_countdown_ends_days">
<item quantity="one">endet in %d Tag</item>
<item quantity="other">endet in %d Tagen</item>
</plurals>
<string name="widget_countdown_over">%1$s ist vorbei</string>
<string name="widget_config_countdown_repeats">%1$s · wird wiederholt</string>
<string name="widget_month_day_label">Monat und Tag</string>
<string name="widget_config_background">Hintergrund</string>
<string name="widget_config_background_tinted">Getönt</string>
<string name="widget_config_background_transparent">Transparent</string>
<string name="widget_config_background_solid">Einfarbig</string>
<string name="widget_config_theme_follow_app">App folgen</string>
<string name="widget_config_opacity">Deckkraft</string>
<string name="widget_config_invert_text">Textfarbe invertieren</string>
<string name="widget_config_invert_text_summary">Heller Text auf einem dunklen Hintergrund wird dunkel, und umgekehrt</string>
<string name="widget_config_readability_info">Lesbarkeit</string>
<string name="widget_config_readability_hint">Bei geringer Deckkraft scheint der Hintergrund durch, sodass manche Textstellen möglicherweise schwer lesbar sind. Erhöhe in diesem Fall die Deckkraft.</string>
<string name="widget_config_readability_hint_classic">Bei geringer Deckkraft scheint der Hintergrund durch, sodass manche Textstellen möglicherweise schwer lesbar sind. Sollte dies der Fall sein, erhöhe die Deckkraft oder invertiere die Textfarbe.</string>
<string name="widget_config_content">Inhalt</string>
<string name="widget_config_range">Zeitraum</string>
<string name="widget_config_text_size">Textgröße</string>
<string name="widget_config_load_failed">Konnte die Einstellungen dieses Widgets nicht lesen.</string>
<string name="widget_config_preview_failed">Vorschau nicht verfügbar</string>
<string name="widget_config_save_failed">Das Widget konnte nicht gespeichert werden. Versuche es erneut.</string>
<string name="widget_config_calendars_hint">Die Kalender, die dieses Widget anzeigt. Kalender, die du in der App ausgeblendet hast, bleiben auch hier ausgeblendet.</string>
<plurals name="widget_config_calendars_some">
<item quantity="one">%1$d von %2$d Kalender</item>
<item quantity="other">%1$d von %2$d Kalendern</item>
</plurals>
<string name="settings_month_start_times">Startzeiten</string>
<string name="widget_preview_sample_trip">Wochenendausflug</string>
<string name="widget_preview_sample_dentist">Zahnarzt</string>
<string name="settings_widgets_hint_legacy">Jedes Widget hat sein eigenes Aussehen und Optionen. Tippe unten auf eines, um es zu ändern. Füge ein Widget hinzu, indem du lange auf deinen Startbildschirm drückst.</string>
<string name="settings_widgets_placed">Auf deinem Startbildschirm</string>
<string name="settings_widgets_none">Noch keine Calendula-Widgets auf deinem Startbildschirm.</string>
<string name="widget_countdown_choose">Tippe auf einen Termin, um den Countdown dafür zu starten</string>
<string name="widget_config_style_classic">Klassisch</string>
<string name="widget_config_calendars">Kalender</string>
</resources>
+13 -404
View File
@@ -17,14 +17,14 @@
<string name="state_failure_no_calendars_action">Abrir los ajustes del calendario del sistema</string>
<string name="state_failure_provider">No se pudo leer el calendario.</string>
<string name="permission_rationale_title">Mira todos sus eventos, a la perfección</string>
<string name="permission_rationale_body">Calendula necesita acceso a tu calendario para mostrar y administrar tus eventos.</string>
<string name="permission_rationale_body">Calendula necesita acceso a tu calendario para mostrarte y administrar eventos. Ese es el único permiso que pedirá para comenzar a funcionar. Y nada de información sale de tu dispositivo.</string>
<string name="permission_request_button">Conceder el acceso al calendario</string>
<string name="permission_denied_title">Acceso a calendario denegado</string>
<string name="permission_denied_body">Calendula no puede mostrar eventos sin acceso al calendario. Puedes concederlo en ajustes del sistema.</string>
<string name="permission_open_settings_button">Abrir ajustes del sistema</string>
<string name="permission_retry_button">Intentarlo de nuevo</string>
<string name="permission_benefit_private_title">Privado por diseño</string>
<string name="permission_benefit_private_body">Sin permiso de acceso a internet, sin telemetría: nada sale nunca de tu teléfono.</string>
<string name="permission_benefit_private_title">Permanece en tu dispositivo</string>
<string name="permission_benefit_private_body">Tus calendarios se leen localmente y nunca abandonan tu celular.</string>
<string name="permission_benefit_sync_title">Todos tus calendarios, juntos</string>
<string name="permission_benefit_sync_body">Google, CalDAV, local — todo lo sincronizado en el dispositivo aparecerá.</string>
<string name="permission_benefit_privacy_title">Sin rastreo, jamás</string>
@@ -243,8 +243,8 @@
<string name="search_idle_hint">Buscar eventos por titulo, ubicación o notas.</string>
<string name="search_empty">No evento coincide con “%1$s”.</string>
<string name="widget_agenda_title">Próximamente</string>
<string name="widget_agenda_label">Agenda</string>
<string name="widget_month_label">Mes</string>
<string name="widget_agenda_label">Calendula agenda</string>
<string name="widget_month_label">Calendula mes</string>
<string name="widget_refresh">Actualizar</string>
<string name="widget_needs_permission">Abre Calendula para conceder acceso al calendario</string>
<string name="settings_section_appearance">Apariencia</string>
@@ -261,8 +261,8 @@
<string name="settings_time_format_auto">Automático</string>
<string name="settings_time_format_12h">12-horas (2:00 PM)</string>
<string name="settings_time_format_24h">24-horas (14:00)</string>
<string name="settings_hour_lines">Cuadrícula horaria</string>
<string name="settings_hour_lines_summary">Ubica cada hora en su propia celda en las vistas semanal y diaria</string>
<string name="settings_hour_lines">Lineas entre horas</string>
<string name="settings_hour_lines_summary">Muestra una linea que separa cada hora en la vista diaria y semanal</string>
<string name="settings_dim_completed">Oscurecer eventos completados</string>
<string name="settings_dim_completed_summary">Oscurece eventos que ya han terminado en vista semanal y mensual</string>
<string name="settings_past_events">Eventos pasados</string>
@@ -273,7 +273,7 @@
<string name="settings_agenda_range">Rango de agenda</string>
<string name="settings_agenda_range_hint">Cuanto tiempo abarca la agenda al mostrar eventos.</string>
<string name="settings_agenda_widget_range">Rango del widget de agenda</string>
<string name="settings_agenda_widget_range_hint">Con cuánta antelación muestra eventos este widget.</string>
<string name="settings_agenda_widget_range_hint">Cuanto tiempo abarca el widget de agenda en la pantalla principal al mostrar eventos.</string>
<string name="settings_agenda_range_bar">Barra de tiempo</string>
<string name="settings_agenda_range_bar_hint">Muestra una barra en la parte superior de la agenda con las fechas mostradas, con un botón para cambiar el rango durante la sesión</string>
<string name="agenda_range_this_month">Este mes</string>
@@ -318,9 +318,9 @@
<string name="settings_language_auto">Igual que el sistema</string>
<string name="settings_translate">Ayuda a traducir</string>
<string name="settings_translate_hint">Añade o mejora un idioma en Weblate</string>
<string name="settings_appearance_subtitle">Tema, colores, tipografía</string>
<string name="settings_event_form_subtitle">Campos y comportamiento predeterminados</string>
<string name="settings_notifications_subtitle">Recordatorios y entrega</string>
<string name="settings_appearance_subtitle">Tema, vista por defecto, inicio de semana</string>
<string name="settings_event_form_subtitle">Campos por defecto en nuevos eventos</string>
<string name="settings_notifications_subtitle">Recordatorios de eventos</string>
<string name="settings_license">Licencia</string>
<string name="settings_license_value">MIT</string>
<string name="settings_about_author">Por Jean-Luc Makiola</string>
@@ -424,11 +424,11 @@
<string name="settings_font_import_failed">No se pude leer el archivo como fuente</string>
<string name="settings_section_views">Vistas</string>
<string name="settings_quick_switch_header">Botón de cambio rápido</string>
<string name="settings_quick_switch_hint">Elige qué vistas se alternan al pulsar el botón de la esquina superior derecha y arrástralas para reordenarlas. Si hay menos de dos vistas activadas, el botón permanece oculto. Las vistas desactivadas siguen estando accesibles desde el menú de navegación.</string>
<string name="settings_quick_switch_hint">Escoge que vistas muestra el botón superior derecho y arrastralas para reordenalas. Las vistas deshabitadas permanecen accesibles desde el menú de navegación.</string>
<string name="settings_drawer_order_header">Menú de navegación</string>
<string name="settings_drawer_order_hint">Arrastra para cambiar el orden de las vistas que aparecen en el menú de navegación.</string>
<string name="reorder_drag_handle">Arrastra para reordenar</string>
<string name="settings_views_subtitle">Vista predeterminada, diseño, orden</string>
<string name="settings_views_subtitle">Orden del botón de cambio rápido y menú</string>
<string name="settings_special_dates_subtitle">Aniversarios y cumpleaños de los contactos</string>
<string name="settings_section_special_dates">Fechas especiales de contactos</string>
<string name="settings_special_dates_enable">Mostrar fechas de contactos</string>
@@ -489,395 +489,4 @@
<item quantity="other">Importando %d eventos</item>
</plurals>
<string name="settings_soften_colors">Armoniza los colores del calendario</string>
<string name="app_name_calendar_alias">Calendario</string>
<string name="state_failure_permission_body">Calendula lee tus eventos directamente desde el calendario del sistema, por lo que necesita acceso al calendario para mostrarlos.</string>
<string name="state_failure_no_calendars_body">Agregua una cuenta de calendario a este dispositivo y tus calendarios aparecerán aquí.</string>
<string name="state_failure_all_hidden">Todos tus calendarios están desactivados.</string>
<string name="state_failure_all_hidden_body">Vuelve a activar al menos un calendario para ver tus eventos.</string>
<string name="state_failure_all_hidden_action">Gestionar calendarios</string>
<string name="state_failure_no_import_target">Ningún calendario puede admitir nuevos eventos.</string>
<string name="state_failure_no_import_target_body">Los calendarios que están activados son de sólo lectura, están gestionados por otra aplicación o no están sincronizados con este dispositivo. Activa un calendario que admita eventos o añade uno local.</string>
<string name="state_failure_event_not_found">Este evento ya no está ahí.</string>
<string name="state_failure_event_not_found_body">Es posible que se haya eliminado o movido a un calendario que está desactivado.</string>
<string name="state_failure_provider_body">El calendario del sistema no respondió. Inténtalo de nuevo.</string>
<string name="field_copy_action">Copiar</string>
<string name="field_copied">Copiado al portapapeles</string>
<string name="field_copy_failed">No se pudo copiar</string>
<string name="month_open_week">Semana abierta %1$d</string>
<string name="month_split_clear_filter">Mostrar la agenda del mes completo</string>
<string name="timeline_earlier_events">Eventos anteriores</string>
<string name="timeline_later_events">Eventos posteriores</string>
<string name="event_detail_duplicate">Duplicar</string>
<string name="event_move_action">Mover…</string>
<string name="event_move_recurring_title">Mover evento recurrente</string>
<string name="event_move_occurrence_only">Trasladar toda la serie cambiaría los días en los que tiene lugar, por lo que solo es posible mover este evento.</string>
<string name="event_move_done">Movido a %1$s</string>
<string name="event_resize_done">Cambiado a %1$s</string>
<string name="event_resize_recurring_title">Modificar evento recurrente</string>
<string name="event_selection_actions">Acciones de evento</string>
<string name="event_selection_hide">Ocultar acciones de evento</string>
<string name="event_selection_close">Anular la selección del evento</string>
<string name="event_draft_create">Crear evento</string>
<string name="event_draft_discard">Descartar nuevo evento</string>
<string name="event_action_load_failed">No se pudo abrir el evento</string>
<string name="event_move_undo">Deshacer</string>
<string name="event_move_undone">Movimiento anulado</string>
<string name="event_move_failed">No se pudo mover el evento</string>
<string name="event_move_write_denied">Calendula necesita acceso de escritura para mover eventos</string>
<string name="event_move_gone">Este evento ya no existe</string>
<string name="event_move_stale">Ese evento se desplazó antes de que se pudiera guardar tu elemento soltado</string>
<string name="event_move_queue_full">Demasiados movimientos a la vez, por lo que no se guardó</string>
<string name="event_move_skipped">Los movimientos realizados mientras la pregunta estaba abierta no se guardaron</string>
<string name="event_move_blocked_series_end">No es posible mover un evento más allá del final de su serie</string>
<string name="event_move_blocked_cancelled_series">Una serie cancelada solo puede trasladarse en su totalidad, y esto cambiaría los días en que se emite</string>
<string name="event_edit_more_actions">Más acciones</string>
<string name="event_edit_unsaved_title">Cambios sin guardar</string>
<string name="event_edit_unsaved_save">Cambios guardados</string>
<string name="event_edit_unsaved_discard">Descartar cambios</string>
<string name="event_edit_unsaved_keep">Seguir editando</string>
<string name="event_edit_create">Crear</string>
<string name="event_edit_status">Estado</string>
<string name="event_edit_timezone_device">Zona horaria del dispositivo</string>
<string name="event_edit_timezone_device_summary">Te sigue dondequiera que estés</string>
<string name="event_edit_timezone_search">Buscar zonas horarias</string>
<string name="event_edit_timezone_recent">Reciente</string>
<string name="event_edit_timezone_all">Todas las zonas horarias</string>
<string name="event_edit_timezone_none">Ninguna zona horaria coincide con «%1$s»</string>
<string name="event_edit_timezone_local_time">%1$s tu hora</string>
<string name="event_edit_recurrence_incomplete">Introduce un número del 1 al 999</string>
<string name="event_edit_recurrence_next">Siguiente: %1$s</string>
<string name="event_edit_recurrence_next_none">Esta regla nunca se repite</string>
<string name="event_detail_title">Título</string>
<string name="event_detail_open_in_maps">Abrir en el mapa</string>
<string name="link_open_failed">Ninguna aplicación puede abrir este enlace</string>
<string name="event_status_confirmed">Confirmado</string>
<string name="event_access_default_summary">Sea lo que sea que haga normalmente este calendario</string>
<string name="event_access_public_summary">Todos los que tienen acceso ven todos los detalles</string>
<string name="event_access_private_summary">Las demás solo ven que estás ocupado</string>
<string name="event_access_confidential_summary">Marcado como confidencial; lo que eso significa depende de la cuenta de calendario</string>
<string name="reminder_after">%1$s después</string>
<string name="duration_hours_minutes">%1$s%2$s</string>
<string name="duration_custom_max">Como máximo %1$s</string>
<string name="calendar_unnamed">(Sin nombre)</string>
<string name="onboarding_step_counter">Paso %1$d de %2$d</string>
<string name="onboarding_backup_title">Tus eventos solo residen aquí</string>
<string name="onboarding_backup_body">En este teléfono no hay nada que se sincronice con una cuenta, por lo que, si lo pierdes, perderás también tu calendario. Calendula puede crear una copia de seguridad para ti.</string>
<string name="onboarding_backup_benefit_folder_title">Una carpeta que elijas</string>
<string name="onboarding_backup_benefit_folder_body">Las copias de seguridad son archivos .ics; guárdalas en una ubicación que se sincronice o en una tarjeta SD.</string>
<string name="onboarding_backup_benefit_daily_title">Una vez al día, por sí solo</string>
<string name="onboarding_backup_benefit_daily_body">Calendula exporta tus calendarios locales en segundo plano. Puedes modificar la frecuencia en la configuración.</string>
<string name="onboarding_calendars_title">Un lugar donde incluir tus eventos</string>
<string name="onboarding_calendars_body">Este dispositivo aún no tiene ningún calendario. Calendula escribe en los calendarios que ya están en tu teléfono; necesita al menos uno.</string>
<string name="onboarding_calendars_local_button">Crear un calendario en este dispositivo</string>
<string name="onboarding_calendars_caldav_button">Sincronizar con un servidor CalDAV</string>
<string name="onboarding_calendars_skip_button">Ahora no</string>
<string name="onboarding_calendars_benefit_local_title">Permanece en este teléfono</string>
<string name="onboarding_calendars_benefit_local_body">El calendario del dispositivo no se sincroniza con ningún otro lugar; por tanto, haz una copia de seguridad si los eventos son importantes.</string>
<string name="onboarding_calendars_benefit_sync_title">O sincroniza desde una cuenta</string>
<string name="onboarding_calendars_benefit_sync_body">Calendula muestra lo que tus cuentas ya tienen sincronizado. Los servidores CalDAV requieren DAVx⁵ para realizar la sincronización.</string>
<string name="onboarding_calendars_created_title">«%1$s» está listo</string>
<string name="onboarding_calendars_created_body">Reside en este dispositivo y los nuevos eventos se añaden a él, a menos que elijas otro calendario.</string>
<string name="onboarding_calendars_created_more_title">Espacio para más</string>
<string name="onboarding_calendars_created_more_body">En Configuración → Calendarios, puedes crear tantos calendarios como necesites, así como cambiar el nombre o el color de los que ya tienes.</string>
<string name="onboarding_calendars_created_continue">Continuar</string>
<string name="onboarding_hidden_title">Tus calendarios están desactivados</string>
<string name="onboarding_hidden_body">Calendula muestra los calendarios que están activados en este teléfono; en este momento, no hay ninguno. Activa los que quieras ver; también aparecerán en tus otras aplicaciones de calendario.</string>
<string name="onboarding_hidden_switch_all_button">Actívalos todos</string>
<string name="onboarding_hidden_skip_button">Ahora no</string>
<string name="onboarding_hidden_failed">No se pudo activar. En Configuración → Calendarios aparecen los mismos interruptores.</string>
<string name="onboarding_calendars_create_failed">No se pudo crear el calendario. El almacenamiento de calendarios de tu teléfono lo rechazó.</string>
<string name="onboarding_backup_enable_button">Seleccionar carpeta y realizar copia de seguridad</string>
<string name="onboarding_backup_skip_button">Ahora no</string>
<string name="onboarding_view_title">¿Qué debería abrirse primero?</string>
<string name="onboarding_month_style_title">¿Cómo se debería ver el Mes?</string>
<string name="onboarding_view_continue_button">Continuar</string>
<string name="onboarding_back">Atrás</string>
<string name="onboarding_visibility_button">Entendido</string>
<string name="onboarding_done_title">Todo listo</string>
<string name="onboarding_done_body">Tus calendarios están listos. Todo lo que acabas de elegir se puede modificar más adelante en la configuración.</string>
<string name="onboarding_done_button">Abrir mi calendario</string>
<string name="reminder_day_today">Hoy</string>
<string name="reminder_day_tomorrow">Mañana</string>
<string name="reminder_day_yesterday">Ayer</string>
<plurals name="view_multi_day">
<item quantity="one">%d día</item>
<item quantity="many">%d días</item>
<item quantity="other">%d días</item>
</plurals>
<string name="agenda_no_more_today">No hay más eventos hoy</string>
<string name="agenda_span_starts">Comienza %1$s</string>
<string name="agenda_span_ends">Finaliza %1$s</string>
<string name="today_jump_action">Ir a Hoy</string>
<plurals name="search_selected_count">
<item quantity="one">%d seleccionado</item>
<item quantity="many">%d seleccionados</item>
<item quantity="other">%d seleccionados</item>
</plurals>
<string name="search_in_descriptions">Se encuentra en las descripciones</string>
<string name="search_selection_close">Cancelar selección</string>
<string name="search_select_all">Seleccionar todo</string>
<string name="search_delete_selected">Eliminar selección</string>
<plurals name="search_delete_title">
<item quantity="one">Eliminar %d evento?</item>
<item quantity="many">Eliminar %d eventos?</item>
<item quantity="other">Eliminar %d eventos?</item>
</plurals>
<plurals name="search_delete_done">
<item quantity="one">%d evento eliminado</item>
<item quantity="many">%d eventos eliminados</item>
<item quantity="other">%d eventos eliminados</item>
</plurals>
<string name="search_delete_partial">%1$d eliminado, %2$d no se pudo eliminar</string>
<string name="search_delete_denied_partial">%1$d eliminado; posteriormente, se retiró el acceso de escritura</string>
<string name="widget_agenda_description">Tus próximos eventos, agrupados por día</string>
<string name="widget_month_description">Un vistazo al mes, con tus eventos</string>
<string name="widget_quick_add_label">Añadir rápidamente</string>
<string name="widget_quick_add_description">Inicia un nuevo evento con un solo toque</string>
<string name="widget_date_label">Fecha</string>
<string name="widget_date_description">Fecha de hoy</string>
<string name="widget_week_strip_label">Tira semanal</string>
<string name="widget_week_strip_description">Esta semana, con los días que tienen eventos</string>
<plurals name="widget_day_with_events">
<item quantity="one">%1$s, %2$d evento</item>
<item quantity="many">%1$s, %2$d eventos</item>
<item quantity="other">%1$s, %2$d eventos</item>
</plurals>
<string name="widget_upcoming_label">Próximo</string>
<string name="widget_upcoming_description">Fecha de hoy sobre tus próximos eventos</string>
<string name="widget_upcoming_empty">No hay próximos eventos</string>
<string name="widget_today_label">Hoy</string>
<string name="widget_today_description">Los eventos de hoy, y luego los de mañana</string>
<string name="widget_nothing_left_today">Hoy no queda nada</string>
<string name="widget_countdown_label">Cuenta atrás</string>
<string name="widget_countdown_description">Tiempo hasta un evento, o hasta el siguiente</string>
<string name="widget_countdown_now">Ahora</string>
<string name="widget_countdown_ending_now">Terminando ahora</string>
<string name="widget_countdown_tomorrow">Mañana</string>
<string name="widget_countdown_ends_tomorrow">Termina mañana</string>
<string name="widget_countdown_until">Hasta %1$s</string>
<plurals name="widget_countdown_in_minutes">
<item quantity="one">en %d min</item>
<item quantity="many">en %d min</item>
<item quantity="other">en %d min</item>
</plurals>
<plurals name="widget_countdown_in_hours">
<item quantity="one">en %d h</item>
<item quantity="many">en %d h</item>
<item quantity="other">en %d h</item>
</plurals>
<plurals name="widget_countdown_in_days">
<item quantity="one">en %d día</item>
<item quantity="many">en %d días</item>
<item quantity="other">en %d días</item>
</plurals>
<plurals name="widget_countdown_ends_minutes">
<item quantity="one">termina en %d min</item>
<item quantity="many">termina en %d min</item>
<item quantity="other">termina en %d min</item>
</plurals>
<plurals name="widget_countdown_ends_hours">
<item quantity="one">termina en %d h</item>
<item quantity="many">termina en %d h</item>
<item quantity="other">termina en %d h</item>
</plurals>
<plurals name="widget_countdown_ends_days">
<item quantity="one">termina en %d día</item>
<item quantity="many">termina en %d días</item>
<item quantity="other">termina en %d días</item>
</plurals>
<string name="widget_countdown_choose">Toca para elegir un evento para la cuenta atrás</string>
<string name="widget_countdown_over">%1$s ha terminado</string>
<string name="widget_config_countdown">Cuenta atrás hasta</string>
<string name="widget_config_countdown_next">Siguiente evento</string>
<string name="widget_config_countdown_pinned">Evento elegido</string>
<string name="widget_config_countdown_next_hint">El próximo evento programado en los calendarios de este widget, o el que está teniendo lugar en este momento. Se omiten los eventos de día completo y los rechazados.</string>
<string name="widget_config_countdown_event">Evento</string>
<string name="widget_config_countdown_event_none">Aún no se ha seleccionado ninguno</string>
<string name="widget_config_countdown_search">Buscar eventos</string>
<string name="widget_config_countdown_empty">No hay eventos que coincidan en el próximo año.</string>
<string name="widget_config_countdown_load_failed">No se pudieron cargar tus eventos.</string>
<string name="widget_config_countdown_repeats">%1$s · repeticiones</string>
<string name="widget_month_day_label">Mes y día</string>
<string name="widget_month_day_description">El mes y los eventos del día que elijas</string>
<string name="widget_day_empty">Sin eventos</string>
<string name="widget_config_background">Fondo</string>
<string name="widget_config_background_solid">Sólido</string>
<string name="widget_config_background_tinted">Tintado</string>
<string name="widget_config_background_transparent">Transparente</string>
<string name="widget_config_theme_follow_app">Según la aplicación</string>
<string name="widget_config_opacity">Opacidad</string>
<string name="widget_config_invert_text">Invertir el color del texto</string>
<string name="widget_config_invert_text_summary">El texto claro en un tema oscuro se vuelve oscuro, y viceversa</string>
<string name="widget_config_readability_info">Sobre la legibilidad</string>
<string name="widget_config_readability_hint">Con una opacidad baja, el fondo de pantalla se deja ver, por lo que es posible que algunos textos resulten más difíciles de leer. Si es así, aumenta la opacidad.</string>
<string name="widget_config_readability_hint_classic">Con una opacidad baja, el fondo de pantalla queda visible, por lo que puede resultar difícil leer parte del texto. Si es así, aumenta la opacidad o invierte el color del texto.</string>
<string name="widget_config_style">Estilo</string>
<string name="widget_config_style_cards">Tarjetas</string>
<string name="widget_config_style_classic">Clásico</string>
<string name="widget_config_content">Contenido</string>
<string name="widget_config_range">Intervalo de tiempo</string>
<string name="widget_config_text_size">Tamaño del texto</string>
<string name="widget_config_load_failed">No se pudo leer la configuración de este widget.</string>
<string name="widget_config_preview_failed">Vista previa no disponible</string>
<string name="widget_config_save_failed">No se pudo guardar el widget. Inténtalo de nuevo.</string>
<string name="widget_numbered">%1$s %2$d</string>
<string name="widget_appearance_summary">%1$s · %2$s</string>
<string name="widget_config_calendars">Calendarios</string>
<string name="widget_config_calendars_hint">Los calendarios que muestra este widget. Los calendarios que has ocultado en la aplicación también permanecen ocultos aquí.</string>
<string name="widget_config_calendars_all">Todos los calendarios</string>
<plurals name="widget_config_calendars_some">
<item quantity="one">%1$d de %2$d calendario</item>
<item quantity="many">%1$d de %2$d calendarios</item>
<item quantity="other">%1$d de %2$d calendarios</item>
</plurals>
<string name="settings_theme_black">Negro</string>
<string name="settings_theme_black_summary">Oscuro con fondos negros puros, para pantallas AMOLED</string>
<string name="settings_theme_hint">Tanto si la aplicación es clara u oscura. La elección se aplica de inmediato.</string>
<string name="settings_theme_system_summary">Actualmente %1$s</string>
<string name="settings_soften_colors_summary">Mantén el tono de cada calendario, pero unifica su luminosidad para que todos los eventos sigan siendo legibles y los colores armonicen entre sí. Desactiva esta opción para mostrar los colores originales tal como provienen de la fuente del calendario.</string>
<string name="settings_font_specimen_heading">Jueves, 14 de Mayo</string>
<string name="settings_font_specimen_body">Revisión en equipo a las 10:00; después, almuerzo con Pepín en la cafetería de Marktplatz.</string>
<string name="settings_week_start_auto_summary">Actualmente %1$s</string>
<string name="settings_month_start_times">Horas de inicio</string>
<string name="settings_month_start_times_summary">Muestra la hora de inicio antes del título de un evento cuando haya espacio</string>
<string name="settings_today_toolbar">Botón «Hoy» en la barra de herramientas</string>
<string name="settings_today_toolbar_summary">Muestra un botón para ir al día de hoy en la barra de herramientas, en lugar de un botón flotante</string>
<string name="settings_app_name">Nombre de la aplicación</string>
<string name="settings_app_name_summary">Muestra Calendula como «Calendario» en tu lanzador. Solo cambia el nombre en el lanzador; es posible que el icono se desplace a una nueva ubicación tras realizar el cambio.</string>
<string name="settings_time_format_auto_summary">Según el sistema: %1$s</string>
<string name="settings_multi_day_count">Vista de varios días</string>
<string name="settings_multi_day_count_hint">Cuántos días muestra la vista de varios días, dispuestos uno al lado del otro. El día de hoy aparece en la primera columna.</string>
<string name="settings_timeline_scale">Altura de la hora</string>
<string name="settings_timeline_scale_by_visible_hours">Establecido según las horas visibles</string>
<string name="settings_timeline_scale_hint">Define cuánto espacio vertical ocupa una hora en las vistas semanal y diaria. Ambas vistas comparten esta configuración. También puedes pellizcar la línea de tiempo con dos dedos para establecer cualquier altura intermedia.</string>
<string name="timeline_scale_fit_day">Ocupar todo el día</string>
<string name="timeline_scale_fit_day_summary">Las 24 horas en una sola pantalla, sin necesidad de desplazarse</string>
<string name="timeline_scale_compact">Compacto</string>
<string name="timeline_scale_compact_summary">Más horas por pantalla, bloques más pequeños</string>
<string name="timeline_scale_regular">Normal</string>
<string name="timeline_scale_regular_summary">Espaciado estándar</string>
<string name="timeline_scale_comfortable">Cómodo</string>
<string name="timeline_scale_comfortable_summary">Bloques más espaciosos, más desplazamiento</string>
<string name="timeline_scale_custom">Personalizado</string>
<string name="timeline_scale_custom_summary">La altura a la que ajustaste la línea de tiempo</string>
<string name="settings_visible_hours">Horas visibles</string>
<string name="settings_visible_hours_summary">Ajustar un intervalo de horas a la pantalla al abrir la vista semanal, de varios días o diaria</string>
<string name="settings_visible_hours_on_summary">%1$s – %2$s ocupa toda la pantalla al abrirse una vista</string>
<string name="settings_visible_hours_start">Desde</string>
<string name="settings_visible_hours_end">Hasta</string>
<string name="settings_visible_hours_start_hint">La hora que aparece en la parte superior de la pantalla al abrir la vista semanal, de varios días o diaria. Las horas anteriores siguen estando accesibles mediante desplazamiento.</string>
<string name="settings_visible_hours_end_hint">La hora que aparece en la parte inferior de la pantalla al abrir una vista. Las horas posteriores se encuentran más adelante, accesibles mediante desplazamiento; al realizar un gesto de pellizco, se aplica zoom hasta que la vista vuelve a abrirse.</string>
<string name="settings_drag_to_reschedule">Arrastra para reprogramar</string>
<string name="settings_drag_to_reschedule_summary">Mueve un evento arrastrándolo a otro día u otra hora</string>
<string name="settings_events_header">Eventos</string>
<string name="settings_tap_opens">Al tocar un evento, se abre</string>
<string name="settings_tap_opens_details">Detalles</string>
<string name="settings_tap_opens_editor">Editar formulario</string>
<string name="settings_tap_opens_hint">Los eventos que no puedes editar y las notificaciones de recordatorio siempre abren los detalles.</string>
<string name="settings_past_events_sample_morning">Revisión de equipo</string>
<string name="settings_past_events_sample_midday">Comer con Milikito</string>
<string name="settings_past_events_sample_evening">Ensayo con la coral</string>
<string name="widget_preview_sample_trip">Viaje de fin de semana</string>
<string name="widget_preview_sample_dentist">Dentista</string>
<string name="settings_widget_size">Tamaño del widget de la agenda</string>
<string name="settings_widget_size_hint">El tamaño con el que este widget muestra su texto.</string>
<string name="settings_widget_size_small">Pequeño</string>
<string name="settings_widget_size_medium">Medio</string>
<string name="settings_widget_size_large">Grande</string>
<string name="settings_widget_size_extra_large">Extralargo</string>
<string name="settings_widget_size_summary">Texto del evento %1$d%%</string>
<string name="settings_agenda_show_today">Mostrar siempre «Hoy»</string>
<string name="settings_agenda_show_today_hint">Mantén el día de hoy en la parte superior de la agenda, incluso cuando ya no quede nada por hacer hoy. Cada widget tiene su propia configuración.</string>
<string name="settings_month_header">Vista por mes</string>
<string name="settings_month_view_style">Estilo de la vista por mes</string>
<string name="month_style_paged">Páginas</string>
<string name="month_style_paged_summary">Un mes ocupa toda la pantalla. Desliza hacia la izquierda o hacia la derecha para cambiar de mes, o desliza hacia arriba para mostrar la agenda del mes.</string>
<string name="month_style_continuous">Desplazamiento por meses</string>
<string name="month_style_continuous_summary">Cada mes aparece bajo su propio encabezado, con un pequeño espacio que lo separa del siguiente.</string>
<string name="month_style_dense">Semanas sin contratiempos</string>
<string name="month_style_dense_summary">Las semanas transcurren sin pausa, cada mes se sucede directamente al siguiente sin ningún intervalo entre ellos.</string>
<string name="month_style_split">Dividir</string>
<string name="month_style_split_summary">Una cuadrícula compacta indica los días en que hay eventos, y el día que pulses aparecerá debajo.</string>
<string name="month_split_no_events">No hay nada programado</string>
<string name="month_split_no_events_month">No hay nada programado este mes</string>
<string name="month_split_no_more_events">No hay nada más programado para este mes</string>
<string name="month_split_expand">Mostrar el mes completo</string>
<string name="month_split_collapse">Mostrar los eventos del día</string>
<string name="settings_event_duration">Duración por defecto</string>
<string name="settings_event_duration_hint">Duración de un evento nuevo hasta que modifiques su hora de finalización. Los eventos de día completo no se ven afectados.</string>
<string name="settings_calendar_durations_title">Duración por calendario</string>
<string name="settings_calendar_durations_hint">Asigna a un calendario su propia duración predeterminada; por ejemplo, 8 horas para los turnos de trabajo.</string>
<string name="settings_calendar_duration_inherits">Predeterminado (%1$s)</string>
<string name="settings_calendar_duration_use_default">Usar duración predeterminada (%1$s)</string>
<string name="settings_allday_reminder_fires_at">Notifica a las %1$s</string>
<string name="settings_group_look">Apariencia y comportamiento</string>
<string name="settings_group_data">Datos</string>
<string name="settings_group_app">Aplicación</string>
<string name="settings_group_about">Acerca de</string>
<string name="settings_widgets_subtitle">Tus widgets, mosaico de Ajustes rápidos</string>
<string name="settings_backup_subtitle">Exportar, importar, copia de seguridad automática</string>
<string name="settings_section_widgets">Widgets y mosaicos</string>
<string name="settings_widgets_hint">Cada widget tiene su propio aspecto y sus propias opciones. Toca uno a continuación, o mantenlo presionado en la pantalla de inicio y selecciona Editar. Para añadir un widget, mantén presionada la pantalla de inicio.</string>
<string name="settings_widgets_hint_legacy">Cada widget tiene su propio aspecto y sus propias opciones. Toca uno a continuación para cambiarlo. Para añadir un widget, mantén pulsada la pantalla de inicio.</string>
<string name="settings_widgets_placed">En tu pantalla de inicio</string>
<string name="settings_widgets_none">Todavía no hay widgets de Calendula en tu pantalla de inicio.</string>
<string name="settings_section_backup">Copia de seguridad y restauración</string>
<string name="settings_views_all_header">Todas las vistas</string>
<string name="settings_week_day_header">Semana y día</string>
<string name="settings_default_view_hint">La vista que muestra Calendula al iniciarse.</string>
<string name="settings_week_start_hint">El día en que comienza cada semana, en todas las vistas y widgets.</string>
<string name="settings_time_format_hint">Cómo se muestran las horas en toda la aplicación. La opción «Automático» sigue la configuración de tu sistema.</string>
<string name="settings_past_events_hint">Qué hace la agenda con los eventos que ya han finalizado.</string>
<string name="settings_dynamic_color_summary">Haz que los colores de la aplicación se basen en tu fondo de pantalla.</string>
<string name="settings_licences">Licencias de código abierto</string>
<string name="settings_licences_subtitle">Los proyectos sobre los que se construye Calendula</string>
<string name="settings_about_privacy">Política de privacidad</string>
<string name="settings_support_kofi">Ko-fi</string>
<string name="settings_support_kofi_hint">Consejos puntuales</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="settings_support_liberapay_hint">Donaciones recurrentes</string>
<string name="licences_title">Licencias de código abierto</string>
<string name="licences_intro">Calendula incluye el trabajo que aparece a continuación. Toca cualquier elemento para obtener su código fuente.</string>
<string name="licences_footer">Todos los proyectos aquí incluidos aparecen sin modificaciones, bajo la licencia indicada.</string>
<string name="calendars_visibility_hint">Desactiva un calendario para ocultarlo en este dispositivo: sus eventos desaparecerán de la aplicación y dejarás de recibir recordatorios. Este es el mismo control que utilizan tus otras aplicaciones de calendario, por lo que también lo ocultarán. No se elimina nada, ningún otro dispositivo se ve afectado y puedes volver a activarlo aquí en cualquier momento.</string>
<string name="calendars_visibility_a11y">Mostrar «%1$s»</string>
<string name="calendars_visibility_notice_title">Algunos calendarios están desactivados</string>
<string name="calendars_visibility_notice_message">Calendula muestra los calendarios que están activados para este dispositivo; algunos de los tuyos están desactivados. Para ver sus eventos, actívalos en Configuración → Calendarios.</string>
<string name="calendar_picker_missing_title">¿Te falta un calendario?</string>
<string name="calendar_picker_missing_summary">Puede estar desactivado, ser de solo lectura o completarse a partir de tus contactos; gestiona tus calendarios aquí.</string>
<string name="calendars_state_read_only">Solo lectura</string>
<string name="calendars_state_not_synced">No sincronizado con este dispositivo</string>
<string name="calendars_state_managed">Rellenado a partir de tus contactos</string>
<string name="calendars_managed_delete_locked">Este calendario se alimenta de tus contactos, por lo que Calendula volverá a crearlo en la próxima sincronización. Para eliminarlo, desactiva las fechas especiales en Configuración → Fechas especiales.</string>
<string name="calendars_account_from_source">%1$s (%2$s)</string>
<string name="calendars_description_label">Descripción</string>
<string name="color_name_mauve">Malva</string>
<string name="color_name_red">Rojo</string>
<string name="color_name_orange">Naranja</string>
<string name="color_name_amber">Ámbar</string>
<string name="color_name_olive">Oliva</string>
<string name="color_name_green">Verde</string>
<string name="color_name_teal">Turquesa</string>
<string name="color_name_cyan">Cian</string>
<string name="color_name_blue">Azul</string>
<string name="color_name_indigo">Índigo</string>
<string name="color_name_purple">Púrpura</string>
<string name="color_name_pink">Rosa</string>
<string name="calendars_restore_unavailable">Todavía no hay ningún calendario que pueda recibir los eventos importados.</string>
<string name="import_done_failed_label">No añadido</string>
<string name="import_done_failed_note">Algunos eventos no pudieron añadirse y quedaron fuera.</string>
<string name="import_done_stopped_title">Importación detenida</string>
<string name="import_warning_tasks">Las tareas en este archivo se agregaron como eventos.</string>
<string name="import_warning_recurrence_repaired">Se corrigió una regla de repetición defectuosa.</string>
<plurals name="import_done_stopped">
<item quantity="one">El calendario dejó de aceptar eventos a mitad del proceso. %d evento del archivo no llegó a añadirse.</item>
<item quantity="many">El calendario dejó de aceptar eventos a mitad del proceso. %d eventos del archivo no llegaron a añadirse.</item>
<item quantity="other">El calendario dejó de aceptar eventos a mitad del proceso. %d eventos del archivo no llegaron a añadirse.</item>
</plurals>
<plurals name="import_done_failed">
<item quantity="one">%d evento no se pudo añadir.</item>
<item quantity="many">%d eventos no se pudieron añadir.</item>
<item quantity="other">%d eventos no se pudieron añadir.</item>
</plurals>
<string name="process_text_create_event">Crear evento</string>
</resources>
+18 -18
View File
@@ -374,7 +374,7 @@
<string name="settings_special_dates_type_anniversary">Anniversaires</string>
<string name="settings_special_dates_type_custom">Autres dates</string>
<string name="settings_special_dates_template">Format du titre</string>
<string name="settings_special_dates_template_hint">Utilisez {name} pour le nom et {year} pour l’année (celle de naissance ou celle du début d’un anniversaire ; masqué si inconnu).</string>
<string name="settings_special_dates_template_hint">Utilisez {name} pour le nom et {year} pour l’année (celle de naissance ou celle du début d’un anniversaire ; masqué si inconnu).</string>
<string name="settings_special_dates_show_year">Montrer l\'année</string>
<string name="settings_special_dates_show_year_hint">Inclure {year} dans les titres lorsque l\'année est connue</string>
<string name="settings_special_dates_sync_now">Synchroniser maintenant</string>
@@ -412,7 +412,7 @@
<string name="calendars_edit_title">Editer un agenda</string>
<string name="calendars_name_label">Nom</string>
<string name="calendars_description_hint">Ajouter une description</string>
<string name="calendars_delete_confirm_title">Supprimer ce calendrier ?</string>
<string name="calendars_delete_confirm_title">Supprimer ce calendrier ?</string>
<string name="calendars_delete_confirm_message">\"%1$s\" et tous ses événements seront définitivement retirés de cet appareil.</string>
<string name="calendars_write_error">Impossible de sauvegarder les changements.</string>
<string name="calendars_backup_hint">Les calendriers locaux ne sont synchronisés nulle part, alors exportez-les vers un fichier .ics pour en garder une copie.</string>
@@ -515,16 +515,16 @@
<string name="event_edit_timezone_all">Toutes les zones horaire</string>
<string name="event_edit_timezone_none">Aucune zone horaire ne correspond à “%1$s”</string>
<string name="event_edit_recurrence_incomplete">Entrez un nombre entre 1 et 999</string>
<string name="event_edit_recurrence_next">Prochain : %1$s</string>
<string name="event_edit_recurrence_next">Prochain : %1$s</string>
<string name="event_detail_title">Titre</string>
<string name="event_access_private_summary">Les autres ne voient seulement que vous êtes occupé</string>
<string name="event_access_confidential_summary">Marqué confidentiel ; ce que cela veut dire est au bon vouloir de votre compte de calendrier</string>
<string name="event_access_confidential_summary">Marqué confidentiel ; ce que cela veut dire est au bon vouloir de votre compte de calendrier</string>
<string name="reminder_after">%1$s après</string>
<string name="duration_custom_max">Au plus %1$s</string>
<string name="onboarding_step_counter">Étape %1$d sur %2$d</string>
<string name="settings_today_toolbar_summary">Afficher un bouton pour revenir au jour présent dans la barre d\'outils au lieu d\'un bouton flottant</string>
<string name="settings_app_name">Nom de l\'application</string>
<string name="settings_app_name_summary">Afficher Calendula comme \"Calendrier\" dans votre lanceur d\'applications. Le nom change seulement dans le lanceur ; l\'icône pourrait changer d\'emplacement après le renommage.</string>
<string name="settings_app_name_summary">Afficher Calendula comme \"Calendrier\" dans votre lanceur d\'applications. Le nom change seulement dans le lanceur ; l\'icône pourrait changer d\'emplacement après le renommage.</string>
<string name="settings_timeline_scale">Hauteur d\'une heure</string>
<string name="timeline_scale_fit_day">Remplir complètement</string>
<string name="timeline_scale_fit_day_summary">Affiche les 24 heures à l\'écran, pas de défilement</string>
@@ -551,15 +551,15 @@
<string name="event_access_public_summary">Toute personne ayant accès voit tous les détails</string>
<string name="duration_hours_minutes">%1$s:%2$s</string>
<string name="onboarding_backup_title">Vos événements ne sont accessibles qu\'ici</string>
<string name="onboarding_backup_body">Aucune synchronisation n\'existe sur ce téléphone : le perdre signifierait perdre votre calendrier. Calendula peut faire des sauvegardes pour vous.</string>
<string name="onboarding_backup_body">Aucune synchronisation n\'existe sur ce téléphone : le perdre signifierait perdre votre calendrier. Calendula peut faire des sauvegardes pour vous.</string>
<string name="onboarding_backup_benefit_folder_title">Un dossier que vous choisissez</string>
<string name="onboarding_backup_benefit_folder_body">Les sauvegardes sont juste des fichiers .ics — enregistrez-les dans un dossier synchronisé, ou bien sur une carte SD.</string>
<string name="onboarding_backup_benefit_daily_title">Une fois par jour, automatiquement</string>
<string name="onboarding_backup_benefit_daily_body">Calendula exporte vos calendriers locaux en arrière-plan. Changez la fréquence dans les réglages.</string>
<string name="onboarding_backup_enable_button">Choisissez un dossier et sauvegarder</string>
<string name="onboarding_backup_skip_button">Pas pour l\'instant</string>
<string name="onboarding_view_title">Que doit s\'afficher en premier ?</string>
<string name="onboarding_month_style_title">À quoi doivent ressembler les mois ?</string>
<string name="onboarding_view_title">Que doit s\'afficher en premier ?</string>
<string name="onboarding_month_style_title">À quoi doivent ressembler les mois ?</string>
<string name="onboarding_view_continue_button">Continuer</string>
<string name="onboarding_back">Retour</string>
<string name="onboarding_visibility_button">Compris</string>
@@ -579,9 +579,9 @@
<string name="search_select_all">Tout sélectionner</string>
<string name="search_delete_selected">Supprimer la sélection</string>
<plurals name="search_delete_title">
<item quantity="one">Supprimer %d événement ?</item>
<item quantity="many">Supprimer %d événements ?</item>
<item quantity="other">Supprimer %d événements ?</item>
<item quantity="one">Supprimer %d événement ?</item>
<item quantity="many">Supprimer %d événements ?</item>
<item quantity="other">Supprimer %d événements ?</item>
</plurals>
<plurals name="search_delete_done">
<item quantity="one">%d événement supprimé</item>
@@ -595,9 +595,9 @@
<string name="settings_font_specimen_heading">Jeudi 14 mai</string>
<string name="settings_font_specimen_body">Revue d\'équipe à 10h00, puis déjeuner avec Robin au café de la Place du Marché.</string>
<string name="settings_week_start_auto_summary">Actuellement %1$s</string>
<string name="settings_today_toolbar">Bouton « aujourd\'hui » dans la barre d\'outils</string>
<string name="settings_time_format_auto_summary">Suivant le système : %1$s</string>
<string name="settings_timeline_scale_hint">Espace vertical occupé par une heure dans les vues « Semaine » et « Jour ». Ce paramètre s\'applique aux deux vues. Vous pouvez également étirer l\'affichage avec deux doigts pour utiliser n\'importe quelle hauteur.</string>
<string name="settings_today_toolbar">Bouton « aujourd\'hui » dans la barre d\'outils</string>
<string name="settings_time_format_auto_summary">Suivant le système : %1$s</string>
<string name="settings_timeline_scale_hint">Espace vertical occupé par une heure dans les vues « Semaine » et « Jour ». Ce paramètre s\'applique aux deux vues. Vous pouvez également étirer l\'affichage avec deux doigts pour utiliser n\'importe quelle hauteur.</string>
<string name="settings_widget_size_hint">Taille du texte affiché par le widget d\'agenda sur l\'écran d\'accueil. Le widget mensuel n\'a pas ce réglage — sa grille s\'adapte toujours à l\'espace que vous lui allouez.</string>
<string name="settings_widget_size_small">Petit</string>
<string name="settings_widget_size_medium">Moyen</string>
@@ -637,7 +637,7 @@
<string name="settings_week_day_header">Semaine &amp; jour</string>
<string name="settings_default_view_hint">La vue ouverte par Calendula au démarrage.</string>
<string name="settings_week_start_hint">Le jour par lequel chaque semaine commence, dans toutes les vues et widgets.</string>
<string name="settings_time_format_hint">Format d\'affichage de l\'heure dans l\'application. Le format « Automatique » suit les paramètres de votre système.</string>
<string name="settings_time_format_hint">Format d\'affichage de l\'heure dans l\'application. Le format « Automatique » suit les paramètres de votre système.</string>
<string name="settings_past_events_hint">Comment l\'agenda gère les événements déjà terminés.</string>
<string name="settings_dynamic_color_summary">Les couleurs de l\'application proviennent de votre fond d\'écran.</string>
<string name="settings_licences">Licences open source</string>
@@ -646,16 +646,16 @@
<string name="licences_title">Licences open source</string>
<string name="licences_intro">Calendula comprend les projets ci-dessous. Appuyez sur n\'importe quelle entrée pour afficher son code source.</string>
<string name="licences_footer">Chaque projet présenté ici est inclus tel quel, sans modifications, sous la licence indiquée.</string>
<string name="calendars_visibility_hint">Désactivez un calendrier pour le masquer sur cet appareil : ses événements disparaîtront de l\'application et vous ne recevrez plus de rappels. Il s\'agit du même bouton que celui utilisé par vos autres applications de calendrier, ce qui signifie qu\'il sera aussi masqué sur ces dernières. Rien n\'est supprimé, aucun autre appareil n\'est affecté et vous pouvez le réactiver ici à tout moment.</string>
<string name="calendars_visibility_hint">Désactivez un calendrier pour le masquer sur cet appareil : ses événements disparaîtront de l\'application et vous ne recevrez plus de rappels. Il s\'agit du même bouton que celui utilisé par vos autres applications de calendrier, ce qui signifie qu\'il sera aussi masqué sur ces dernières. Rien n\'est supprimé, aucun autre appareil n\'est affecté et vous pouvez le réactiver ici à tout moment.</string>
<string name="calendars_visibility_a11y">Montrer \"%1$s\"</string>
<string name="calendars_visibility_notice_title">Certains calendriers sont masqués</string>
<string name="calendars_visibility_notice_message">Calendula affiche les calendriers activés pour cet appareil, et certains des vôtres sont désactivés. Pour voir leurs événements, activez-les dans Réglages → Calendriers.</string>
<string name="calendar_picker_missing_title">Il vous manque un calendrier ?</string>
<string name="calendar_picker_missing_title">Il vous manque un calendrier ?</string>
<string name="calendar_picker_missing_summary">Il est peut-être désactivé, en lecture seule ou rempli à partir de vos contacts — gérez vos calendriers ici.</string>
<string name="calendars_state_read_only">Lecture seule</string>
<string name="calendars_state_not_synced">Non synchronisé avec cet appareil</string>
<string name="calendars_state_managed">Rempli à partir de vos contacts</string>
<string name="calendars_managed_delete_locked">Ce calendrier est rempli à partir de vos contacts ; Calendula le recréera donc lors de la prochaine synchronisation. Pour le supprimer, désactivez les dates spéciales dans Paramètres → Dates spéciales.</string>
<string name="calendars_managed_delete_locked">Ce calendrier est rempli à partir de vos contacts ; Calendula le recréera donc lors de la prochaine synchronisation. Pour le supprimer, désactivez les dates spéciales dans Paramètres → Dates spéciales.</string>
<string name="calendars_account_from_source">%1$s (%2$s)</string>
<string name="import_done_failed_label">Non ajouté</string>
<string name="import_done_failed_note">Certains événements n\'ont pas pu être ajoutés et ont donc été omis.</string>
-853
View File
@@ -1,853 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="backup_interval_units">
<item>Minutes</item>
<item>Hours</item>
<item>Days</item>
<item>Weeks</item>
</string-array>
<string name="app_name">Calendula</string>
<string name="app_tagline">Un calendario moderno.</string>
<string name="app_name_calendar_alias">Calendario</string>
<string name="state_loading">Cargando…</string>
<string name="state_retry">Tentar de novo</string>
<string name="state_failure_unknown">Algo foi mal.</string>
<string name="state_failure_permission">É necesario o acceso ao calendario.</string>
<string name="state_failure_permission_body">Calendula le os teus eventos directamente do calendario do sistema, polo que precisa acceso ao calendario para amosar calquera cousa.</string>
<string name="state_failure_permission_action">Garantir o acceso</string>
<string name="state_failure_no_calendars">Non hai calendarios configurados.</string>
<string name="state_failure_no_calendars_body">Engade unha conta de calendario a este dispositivo e os teus calendarios amosaranse aquí.</string>
<string name="state_failure_no_calendars_action">Abrir a configuración do calendario do sistema</string>
<string name="state_failure_all_hidden">Todos os teus calendarios están desactivados.</string>
<string name="state_failure_all_hidden_body">Volve activar polo menos un calendario para ver os teus eventos.</string>
<string name="state_failure_all_hidden_action">Xestionar os calendarios</string>
<string name="state_failure_no_import_target">Ningún calendario pode aceptar novos eventos.</string>
<string name="state_failure_no_import_target_body">Os calendarios activados son de só lectura, están xestionados por outra aplicación ou non están sincronizados con este dispositivo. Activa un calendario que acepte eventos ou engade un local.</string>
<string name="state_failure_event_not_found">Este evento xa non está aí.</string>
<string name="state_failure_event_not_found_body">É posible que se eliminase, ou que se movese a un calendario que está desactivado.</string>
<string name="state_failure_provider">Non se puido ler o calendario.</string>
<string name="state_failure_provider_body">O calendario do sistema non respondeu. Téntao de novo nun intre.</string>
<string name="field_copy_action">Copiar</string>
<string name="field_copied">Copiado ao portarretallos</string>
<string name="field_copy_failed">Non se puido copiar</string>
<string name="permission_rationale_title">Consulta todos os teus eventos, dun xeito fermoso</string>
<string name="permission_rationale_body">Calendula precisa acceso ao teu calendario para amosar e xestionar os teus eventos.</string>
<string name="permission_request_button">Garantir acceso ao calendario</string>
<string name="permission_denied_title">Acceso ao calendario rexeitado</string>
<string name="permission_denied_body">Calendula non pode amosar eventos sen acceso ao calendario. Podes concederllo de novo na configuración do sistema.</string>
<string name="permission_open_settings_button">Abrir a configuración do sistema</string>
<string name="permission_retry_button">Téntao de novo</string>
<string name="permission_benefit_private_title">Privado por deseño</string>
<string name="permission_benefit_private_body">Sen permiso de acceso a Internet, sen telemetría; nada sae nunca do teu teléfono.</string>
<string name="permission_benefit_sync_title">Todos os teus calendarios, xuntos</string>
<string name="permission_benefit_sync_body">Google, CalDAV, local — amosarase todo o que estea sincronizado co dispositivo.</string>
<string name="permission_benefit_privacy_title">Sen rastrexo, nunca</string>
<string name="permission_benefit_privacy_body">Cero telemetría, cero analíticas, sen publicidade.</string>
<string name="permission_privacy_footnote">Permanece no teu dispositivo · sen permiso de acceso a Internet</string>
<string name="month_prev">Mes anterior</string>
<string name="month_next">O próximo mes</string>
<string name="month_open_week">Semana aberta %1$d</string>
<string name="month_today_action">Hoxe</string>
<string name="month_split_clear_filter">Amosar a axenda completa do mes</string>
<string name="month_more_actions">Máis accións</string>
<string name="month_open_menu">Abrir o menú</string>
<string name="month_action_settings">Configuración</string>
<string name="month_a11y_today_prefix">Hoxe</string>
<string name="week_today_action">Esta semana</string>
<string name="week_number_label">Sem</string>
<string name="day_today_action">Hoxe</string>
<string name="timeline_earlier_events">Eventos anteriores</string>
<string name="timeline_later_events">Eventos posteriores</string>
<string name="event_detail_back">Atrás</string>
<string name="event_detail_edit">Editar</string>
<string name="event_detail_delete">Eliminar</string>
<string name="event_detail_share">Compartir</string>
<string name="event_detail_duplicate">Duplicar</string>
<string name="event_share_chooser_title">Compartir o evento</string>
<string name="event_share_failed">Non se puido compartir este evento.</string>
<string name="event_delete_title">Eliminar o evento?</string>
<string name="event_delete_body">O evento elimínase do teu calendario e de todos os dispositivos cos que se sincroniza.</string>
<string name="event_delete_recurring_title">Eliminar evento recorrente</string>
<string name="event_delete_option_occurrence">Só este evento</string>
<string name="event_delete_option_following">Este e todos os eventos vindeiros</string>
<string name="event_delete_option_series">Todos os eventos na serie</string>
<string name="event_edit_recurring_title">Editar evento recorrente</string>
<string name="event_delete_failed">Non se puido eliminar o evento</string>
<string name="event_delete_write_denied">Calendula precisa acceso de escritura para eliminar eventos</string>
<string name="event_move_action">Mover…</string>
<string name="event_move_recurring_title">Mover evento recorrente</string>
<string name="event_move_occurrence_only">Desprazar a serie completa cambiaría os días nos que ten lugar, polo que só se pode mover este evento.</string>
<string name="event_move_done">Desprazado a %1$s</string>
<string name="event_resize_done">Cambiado a %1$s</string>
<string name="event_resize_recurring_title">Cambiar evento recorrente</string>
<string name="event_selection_actions">Accións do evento</string>
<string name="event_selection_hide">Agochar as accións do evento</string>
<string name="event_selection_close">Non seleccionar o evento</string>
<string name="event_draft_create">Crear evento</string>
<string name="event_draft_discard">Rexeitar o novo evento</string>
<string name="event_action_load_failed">Non se puido abrir o evento</string>
<string name="event_move_undo">Desfacer</string>
<string name="event_move_undone">Movemento desfeito</string>
<string name="event_move_failed">Non se puido mover o evento</string>
<string name="event_move_write_denied">Calendula precisa acceso de escritura para mover eventos</string>
<string name="event_move_gone">Este evento xa non existe</string>
<string name="event_move_stale">Este evento desprazouse antes de que se puidese gardar a túa solta</string>
<string name="event_move_queue_full">Demasiados movementos á vez, de xeito que non quedou gardado</string>
<string name="event_move_skipped">Os movementos feitos mentres a pregunta estaba aberta non se gardaron</string>
<string name="event_move_blocked_series_end">Non se pode mover un evento máis alá do final da súa serie</string>
<string name="event_move_blocked_cancelled_series">Unha serie cancelada só pode desprazarse como un conxunto, e isto cambiaría os días nos que cae</string>
<string name="dialog_cancel">Cancelar</string>
<string name="dialog_ok">De acordo</string>
<string name="event_edit_new_title">Novo evento</string>
<string name="event_edit_close">Pechar</string>
<string name="event_edit_more_actions">Máis accións</string>
<string name="event_edit_unsaved_title">Cambios non gardados</string>
<string name="event_edit_unsaved_save">Cambios gardados</string>
<string name="event_edit_unsaved_discard">Rexeitar os cambios</string>
<string name="event_edit_unsaved_keep">Sigue editando</string>
<string name="event_edit_save">Gardar</string>
<string name="event_edit_create">Crear</string>
<string name="event_edit_title_hint">Engadir título</string>
<string name="event_edit_managed_hint">Xestionado por «%1$s»: o título, a data e a repetición mantéñense sincronizados cos teus contactos. Podes editar os recordatorios, a localización e as notas.</string>
<string name="event_edit_starts">Comezo</string>
<string name="event_edit_ends">Remate</string>
<string name="event_edit_error_end_before_start">Remata antes de comezar</string>
<string name="event_edit_error_no_calendar">Non hai ningún calendario no que se poida escribir</string>
<string name="event_edit_save_failed">Non se puido gardar o evento</string>
<string name="event_edit_write_denied">Calendula precisa acceso de escritura para crear eventos</string>
<string name="event_edit_more_fields">Máis campos</string>
<string name="event_edit_add">Engadir</string>
<string name="event_edit_add_reminder">Engadir recordatorio</string>
<string name="event_edit_remove_reminder">Eliminar o recordatorio</string>
<string name="event_edit_attendees">Convidados</string>
<string name="event_edit_add_guest">Engadir convidado</string>
<string name="event_edit_add_guest_hint">Engadir un convidado por correo…</string>
<string name="event_edit_add_guest_from_contacts">Engadir dende contactos</string>
<string name="event_edit_location_from_contacts">Escoller unha dirección dende contactos</string>
<string name="event_edit_remove_guest">Eliminar convidado</string>
<string name="event_edit_attendee_required">Obrigatorio</string>
<string name="event_edit_attendee_optional">Opcional</string>
<string name="event_edit_attendees_note_synced">Calendula non envía invitacións. A túa conta de calendario pode enviar correos electrónicos aos convidados ao sincronizarse.</string>
<string name="event_edit_attendees_note_local">Almacenado neste dispositivo. Non se notifica a ninguén.</string>
<string name="event_edit_reminder_custom">Personalizado</string>
<string name="reminder_unit_minutes">minutos</string>
<string name="reminder_unit_hours">horas</string>
<string name="reminder_unit_days">días</string>
<string name="reminder_unit_weeks">semanas</string>
<string name="event_edit_availability">Dispoñibilidade</string>
<string name="event_edit_status">Estado</string>
<string name="event_edit_visibility">Visibilidade</string>
<string name="event_edit_timezone_device">Fuso horario do dispositivo</string>
<string name="event_edit_timezone_device_summary">Séguete onde queira que esteas</string>
<string name="event_edit_timezone_search">Procurar fusos horarios</string>
<string name="event_edit_timezone_recent">Recente</string>
<string name="event_edit_timezone_all">Todos os fusos horarios</string>
<string name="event_edit_timezone_none">Ningún fuso horario cadra con «%1$s»</string>
<string name="event_edit_timezone_local_time">%1$s o teu horario</string>
<string name="event_edit_color">Cor</string>
<string name="event_edit_color_default">Cor do calendario</string>
<string name="event_edit_color_custom">Cor personalizada</string>
<string name="event_edit_color_reset">Restablecer</string>
<string name="event_edit_color_unsupported">Non dispoñible para este calendario</string>
<string name="event_edit_color_unsupported_hint">Este calendario non publica con unha cor definida. Podes permitir cores personalizadas para os calendarios na configuración.</string>
<string name="event_edit_color_sync_warning">Este calendario pode eliminar ou sobrescribir a cor na súa próxima sincronización.</string>
<string name="event_edit_conflict_title">O evento cambiou noutro lugar</string>
<string name="event_edit_conflict_body">Mentres estabas editando, este evento foi modificado, xa sexa por sincronización ou por outra aplicación. Que debería ocorrer cos teus cambios?</string>
<string name="event_edit_conflict_overwrite">Gardar os meus cambios</string>
<string name="event_edit_conflict_overwrite_hint">Só os campos que editaches sobrescriben a modificación externa</string>
<string name="event_edit_conflict_discard">Rexeitar os meus cambios</string>
<string name="event_edit_conflict_discard_hint">O evento permanece como está agora</string>
<string name="event_edit_gone_title">Evento eliminado</string>
<string name="event_edit_gone_body">Este evento foi eliminado mentres tanto, por exemplo noutro dispositivo. Os cambios xa non se poden gardar.</string>
<string name="import_reminder_prompt_title">Aplicar o teu recordatorio predeterminado?</string>
<string name="import_reminder_prompt_body_none">Este evento importouse sen ningún recordatorio.</string>
<plurals name="import_reminder_prompt_body_existing">
<item quantity="one">Este evento importouse con %1$d recordatorio.</item>
<item quantity="other">Este evento importouse con %1$d recordatorios.</item>
</plurals>
<string name="import_reminder_prompt_apply">Aplicar o predeterminado</string>
<string name="import_reminder_prompt_keep">Deixar tal como está</string>
<string name="event_edit_recurrence_none">Non se repite</string>
<string name="event_edit_recurrence_custom">Personalizado</string>
<string name="event_edit_recurrence_every">Todo</string>
<string name="recurrence_unit_days">días</string>
<string name="recurrence_unit_weeks">semanas</string>
<string name="recurrence_unit_months">meses</string>
<string name="recurrence_unit_years">anos</string>
<string name="event_edit_recurrence_incomplete">Insire un número do 1 ao 999</string>
<string name="event_edit_recurrence_next">Seguinte: %1$s</string>
<string name="event_edit_recurrence_next_none">Esta regra nunca se repite</string>
<string name="event_edit_recurrence_ends">Remata</string>
<string name="event_edit_recurrence_end_never">Endexamais</string>
<string name="event_edit_recurrence_end_until">Nunha data</string>
<string name="event_edit_recurrence_end_count">Despois dun número de veces</string>
<string name="event_edit_recurrence_times">veces</string>
<string name="event_edit_error_recurrence_ends_before_start">As repeticións rematan antes de que comece o evento</string>
<string name="event_availability_busy">Ocupado</string>
<string name="event_access_default">Predeterminado</string>
<string name="event_access_public">Público</string>
<string name="event_detail_all_day">Todo o día</string>
<string name="event_detail_calendar">Calendario</string>
<string name="event_detail_calendar_unknown">Calendario descoñecido</string>
<string name="event_detail_title">Título</string>
<string name="event_detail_location">Localización</string>
<string name="event_detail_open_in_maps">Abrir no mapa</string>
<string name="link_open_failed">Ningunha aplicación pode abrir esta ligazón</string>
<string name="event_detail_description">Descrición</string>
<string name="event_detail_attendees">Asistentes</string>
<string name="event_detail_recurrence">Recorrencia</string>
<string name="event_detail_recurring">Evento recorrente</string>
<string name="recurrence_daily">Cada día</string>
<string name="recurrence_weekly">Cada semana</string>
<string name="recurrence_monthly">Cada mes</string>
<string name="recurrence_yearly">Cada ano</string>
<string name="recurrence_every_n_days">Cada %1$d días</string>
<string name="recurrence_every_n_weeks">Cada %1$d semanas</string>
<string name="recurrence_every_n_months">Cada %1$d meses</string>
<string name="recurrence_every_n_years">Cada %1$d anos</string>
<string name="recurrence_on_days">%1$s en %2$s</string>
<string name="recurrence_with_until">%1$s ata %2$s</string>
<string name="recurrence_with_count">%1$s, %2$d veces</string>
<string name="event_detail_not_found">Este evento xa non existe.</string>
<string name="event_attendee_accepted">Aceptado</string>
<string name="event_attendee_declined">Rexeitado</string>
<string name="event_attendee_tentative">Provisorio</string>
<string name="event_attendee_needs_action">Sen resposta</string>
<string name="event_attendee_unknown">—</string>
<string name="event_detail_reminders">Recordatorios</string>
<string name="event_detail_timezone">Fuso horario</string>
<string name="event_status_confirmed">Confirmado</string>
<string name="event_status_tentative">Provisorio</string>
<string name="event_status_cancelled">Cancelado</string>
<string name="event_availability_free">Dispoñíbel</string>
<string name="event_access_private">Privado</string>
<string name="event_access_confidential">Confidencial</string>
<string name="event_access_default_summary">O que sexa que este calendario faga normalmente</string>
<string name="event_access_public_summary">Todas as persoas con acceso ven os detalles completos</string>
<string name="event_access_private_summary">Outros só ven que andas ocupado</string>
<string name="event_access_confidential_summary">Marcado como confidencial; o que iso significa depende da conta do calendario</string>
<string name="event_attendee_organizer">Organizador</string>
<string name="event_attendee_optional">Opcional</string>
<string name="event_attendee_resource">Recurso</string>
<string name="event_detail_self_response">A túa resposta: %1$s</string>
<string name="reminder_at_time">No momento do evento</string>
<string name="reminder_default">Recordatorio predeterminado</string>
<string name="reminder_after">%1$s despois</string>
<plurals name="reminder_minutes">
<item quantity="one">%d minuto antes</item>
<item quantity="other">%d minutos antes</item>
</plurals>
<plurals name="reminder_hours">
<item quantity="one">%d hora antes</item>
<item quantity="other">%d horas antes</item>
</plurals>
<plurals name="reminder_days">
<item quantity="one">%d día antes</item>
<item quantity="other">%d días antes</item>
</plurals>
<plurals name="reminder_weeks">
<item quantity="one">%d semana antes</item>
<item quantity="other">%d semanas antes</item>
</plurals>
<plurals name="duration_minutes">
<item quantity="one">%d minuto</item>
<item quantity="other">%d minutos</item>
</plurals>
<plurals name="duration_hours">
<item quantity="one">%d hora</item>
<item quantity="other">%d horas</item>
</plurals>
<plurals name="duration_days">
<item quantity="one">%d día</item>
<item quantity="other">%d días</item>
</plurals>
<string name="duration_hours_minutes">%1$s%2$s</string>
<string name="duration_custom_max">Como máximo %1$s</string>
<plurals name="duration_weeks">
<item quantity="one">%d semana</item>
<item quantity="other">%d semanas</item>
</plurals>
<string name="event_untitled">(Sen título)</string>
<string name="calendar_unnamed">(Sen nome)</string>
<string name="onboarding_step_counter">Paso %1$d de %2$d</string>
<string name="onboarding_backup_title">Os teus eventos só están dispoñibles aquí</string>
<string name="onboarding_backup_body">Nada neste teléfono se sincroniza cunha conta, polo que se o perdes perderías o teu calendario. Calendula pode facer unha copia de seguridade por ti.</string>
<string name="onboarding_backup_benefit_folder_title">Un cartafol que escollas</string>
<string name="onboarding_backup_benefit_folder_body">As copias de seguridade son ficheiros .ics simples; gárdaas nun lugar que se sincronice ou nunha tarxeta SD.</string>
<string name="onboarding_backup_benefit_daily_title">Unha vez ao día, por si só</string>
<string name="onboarding_backup_benefit_daily_body">Calendula exporta os teus calendarios locais en segundo plano. Podes modificar a frecuencia na configuración.</string>
<string name="onboarding_calendars_title">Un lugar onde poñer os teus eventos</string>
<string name="onboarding_calendars_body">Este dispositivo aínda non ten ningún calendario. Calendula escribe nos calendarios que xa están no teu teléfono; precisa polo menos un.</string>
<string name="onboarding_calendars_local_button">Crea un calendario neste dispositivo</string>
<string name="onboarding_calendars_caldav_button">Sincronizar cun servidor CalDAV</string>
<string name="onboarding_calendars_skip_button">Agora non</string>
<string name="onboarding_calendars_benefit_local_title">Permanece neste teléfono</string>
<string name="onboarding_calendars_benefit_local_body">O calendario do dispositivo non se sincroniza con ningures; polo tanto, fai unha copia de seguridade se os eventos son importantes.</string>
<string name="onboarding_calendars_benefit_sync_title">Ou sincroniza dende unha conta</string>
<string name="onboarding_calendars_benefit_sync_body">Calendula amosa o que as túas contas xa sincronizan. Os servidores CalDAV precisan DAVx⁵ para facer a sincronización.</string>
<string name="onboarding_calendars_created_title">“%1$s” está listo</string>
<string name="onboarding_calendars_created_body">Reside neste dispositivo e os novos eventos gárdanse nel, a non ser que elixas outro calendario.</string>
<string name="onboarding_calendars_created_more_title">Espazo para máis</string>
<string name="onboarding_calendars_created_more_body">Configuración → Calendarios: crea tantos como precises e cambia o nome ou a cor dos que xa tes.</string>
<string name="onboarding_calendars_created_continue">Continuar</string>
<string name="onboarding_hidden_title">Os teus calendarios están desactivados</string>
<string name="onboarding_hidden_body">Calendula amosa os calendarios que están activados neste teléfono; neste momento, non hai ningún activado. Activa os que queiras ver; tamén aparecerán nas túas outras aplicacións de calendario.</string>
<string name="onboarding_hidden_switch_all_button">Acendeos todos</string>
<string name="onboarding_hidden_skip_button">Agora non</string>
<string name="onboarding_hidden_failed">Non se puido activar. En Configuración → Calendarios hai os mesmos interruptores.</string>
<string name="onboarding_calendars_create_failed">Non foi posible crear o calendario. O almacenamento de calendarios do teu teléfono rexeitouno.</string>
<string name="onboarding_backup_enable_button">Escolle un cartafol e fai unha copia de seguridade</string>
<string name="onboarding_backup_skip_button">Agora non</string>
<string name="onboarding_view_title">Que debería abrirse primeiro?</string>
<string name="onboarding_month_style_title">Como deberíase de ver o Mes?</string>
<string name="onboarding_view_continue_button">Proseguir</string>
<string name="onboarding_back">Atrás</string>
<string name="onboarding_visibility_button">Entendido</string>
<string name="onboarding_done_title">Xa está todo listo</string>
<string name="onboarding_done_body">Os teus calendarios están listos. Todo o que acabas de elixir pódese modificar máis tarde na Configuración.</string>
<string name="onboarding_done_button">Abrir o meu calendario</string>
<string name="reminder_channel_name">Recordatorios de eventos</string>
<string name="reminder_channel_description">Notificacións nos momentos de recordatorio dos teus eventos</string>
<string name="reminder_onboarding_title">Non perder ningún evento</string>
<string name="reminder_onboarding_body">Android non amosa recordatorios de eventos por si só; ten que facelo unha aplicación de calendario. Deixa que Calendula leve a cabo esta tarefa.</string>
<string name="reminder_benefit_delivery_title">Recordatorios, entregados</string>
<string name="reminder_benefit_delivery_body">Cada recordatorio dos teus eventos chega como unha notificación, xusto a tempo.</string>
<string name="reminder_benefit_duplicates_title">Estás a empregar unha segunda aplicación de calendario?</string>
<string name="reminder_benefit_duplicates_body">Se outra aplicación tamén mostra recordatorios, veralos dúas veces; desactívaos alí ou aquí.</string>
<string name="reminder_benefit_reversible_title">Cámbiao en calquera momento</string>
<string name="reminder_benefit_reversible_body">O interruptor atópase na Configuración, dentro das Notificacións.</string>
<string name="reminder_onboarding_enable_button">Activar os recordatorios</string>
<string name="reminder_onboarding_skip_button">Agora non</string>
<string name="reminder_action_snooze">Pospoñer</string>
<string name="reminder_action_dismiss">Descartar</string>
<string name="reminder_day_today">Hoxe</string>
<string name="reminder_day_tomorrow">Mañá</string>
<string name="reminder_day_yesterday">Onte</string>
<string name="view_month">Mes</string>
<string name="view_week">Semana</string>
<plurals name="view_multi_day">
<item quantity="one">%d día</item>
<item quantity="other">%d días</item>
</plurals>
<string name="view_day">Día</string>
<string name="view_agenda">Axenda</string>
<string name="view_section">Ver</string>
<string name="drawer_jump_to_date">Ir á data</string>
<string name="agenda_today_action">Hoxe</string>
<string name="agenda_header_today">Hoxe</string>
<string name="agenda_header_tomorrow">Mañá</string>
<string name="agenda_empty_title">Xa estás ao día</string>
<string name="agenda_no_more_today">Xa non hai máis eventos hoxe</string>
<string name="agenda_span_starts">Comeza %1$s</string>
<string name="agenda_span_ends">Remata %1$s</string>
<string name="today_jump_action">Ir a hoxe</string>
<string name="search_action">Busca</string>
<string name="search_hint">Busca eventos</string>
<string name="search_back">Atrás</string>
<string name="search_clear">Limpar</string>
<string name="search_idle_hint">Busca os teus eventos por título, localización ou notas.</string>
<string name="search_empty">Non hai eventos que coincidan con «%1$s».</string>
<plurals name="search_selected_count">
<item quantity="one">%d seleccionado</item>
<item quantity="other">%d seleccionados</item>
</plurals>
<string name="search_in_descriptions">Atopado nas descricións</string>
<string name="search_selection_close">Cancelar selección</string>
<string name="search_select_all">Seleccionar todo</string>
<string name="search_delete_selected">Eliminar seleccionados</string>
<plurals name="search_delete_title">
<item quantity="one">Eliminar %d evento?</item>
<item quantity="other">Eliminar %d eventos?</item>
</plurals>
<plurals name="search_delete_done">
<item quantity="one">%d evento eliminado</item>
<item quantity="other">%d eventos eliminados</item>
</plurals>
<string name="search_delete_partial">%1$d eliminado, %2$d non se puido eliminar</string>
<string name="search_delete_denied_partial">%1$d eliminados; con posterioridade, retirouse o acceso de escritura</string>
<string name="widget_agenda_title">Próximamente</string>
<string name="widget_agenda_label">Axenda</string>
<string name="widget_agenda_description">Os teus próximos eventos, agrupados por día</string>
<string name="widget_month_label">Mes</string>
<string name="widget_month_description">Unha ollada ao mes, cos teus eventos</string>
<string name="widget_quick_add_label">Engadir axiña</string>
<string name="widget_quick_add_description">Comeza un novo evento cun só premido</string>
<string name="widget_date_label">Data</string>
<string name="widget_date_description">Data de hoxe</string>
<string name="widget_week_strip_label">Tira semanal</string>
<string name="widget_week_strip_description">Esta semana, cos días que teñen eventos</string>
<plurals name="widget_day_with_events">
<item quantity="one">%1$s, %2$d evento</item>
<item quantity="other">%1$s, %2$d eventos</item>
</plurals>
<string name="widget_upcoming_label">Próximamente</string>
<string name="widget_upcoming_description">A data de hoxe sobre os teus próximos eventos</string>
<string name="widget_upcoming_empty">Non hai próximos eventos</string>
<string name="widget_today_label">Hoxe</string>
<string name="widget_today_description">Os acontecementos de hoxe, e logo os de mañá</string>
<string name="widget_nothing_left_today">Hoxe non queda nada</string>
<string name="widget_countdown_label">Conta atrás</string>
<string name="widget_countdown_description">Tempo ata un evento, ou ata o seguinte</string>
<string name="widget_countdown_now">Agora</string>
<string name="widget_countdown_ending_now">Rematando agora</string>
<string name="widget_countdown_tomorrow">Mañá</string>
<string name="widget_countdown_ends_tomorrow">Remata mañá</string>
<string name="widget_countdown_until">Ata %1$s</string>
<plurals name="widget_countdown_in_minutes">
<item quantity="one">en %d min</item>
<item quantity="other">en %d min</item>
</plurals>
<plurals name="widget_countdown_in_hours">
<item quantity="one">en %d h</item>
<item quantity="other">en %d h</item>
</plurals>
<plurals name="widget_countdown_in_days">
<item quantity="one">en %d día</item>
<item quantity="other">en %d días</item>
</plurals>
<plurals name="widget_countdown_ends_minutes">
<item quantity="one">remata en %d min</item>
<item quantity="other">remata en %d min</item>
</plurals>
<plurals name="widget_countdown_ends_hours">
<item quantity="one">remata en %d h</item>
<item quantity="other">remata en %d h</item>
</plurals>
<plurals name="widget_countdown_ends_days">
<item quantity="one">remata en %d día</item>
<item quantity="other">remata en %d días</item>
</plurals>
<string name="widget_countdown_choose">Preme para escoller un evento para a conta atrás</string>
<string name="widget_countdown_over">%1$s rematou</string>
<string name="widget_config_countdown">Conta atrás para</string>
<string name="widget_config_countdown_next">Seguinte evento</string>
<string name="widget_config_countdown_pinned">Evento escollido</string>
<string name="widget_config_countdown_next_hint">O seguinte evento con horario nos calendarios deste widget, ou o que está a ter lugar agora. Os eventos de todo o día e os rexeitados omítense.</string>
<string name="widget_config_countdown_event">Evento</string>
<string name="widget_config_countdown_event_none">Aínda non se seleccionou ningún</string>
<string name="widget_config_countdown_search">Busca de eventos</string>
<string name="widget_config_countdown_empty">Non hai eventos que coincidan no vindeiro ano.</string>
<string name="widget_config_countdown_load_failed">Non se puideron cargar os teus eventos.</string>
<string name="widget_config_countdown_repeats">%1$s · repeticións</string>
<string name="widget_month_day_label">Mes e día</string>
<string name="widget_month_day_description">O mes e os eventos do día que escollas</string>
<string name="widget_day_empty">Non hai eventos</string>
<string name="widget_refresh">Actualizar</string>
<string name="widget_new_event">Novo evento</string>
<string name="widget_needs_permission">Abre Calendula para conceder acceso ao calendario</string>
<string name="widget_prev_month">Mes anterior</string>
<string name="widget_next_month">O mes vindeiro</string>
<string name="widget_today">Hoxe</string>
<string name="widget_config_background">Fondo</string>
<string name="widget_config_background_solid">Sólido</string>
<string name="widget_config_background_tinted">Tinxido</string>
<string name="widget_config_background_transparent">Transparente</string>
<string name="widget_config_theme_follow_app">Segundo a aplicación</string>
<string name="widget_config_opacity">Opacidade</string>
<string name="widget_config_invert_text">Inverter a cor do texto</string>
<string name="widget_config_invert_text_summary">O texto claro nun tema escuro vólvese escuro e viceversa</string>
<string name="widget_config_readability_info">En canto á lexibilidade</string>
<string name="widget_config_readability_hint">Con pouca opacidade, o fondo de pantalla vese, polo que parte do texto pode ser máis complicado de ler. Aumenta a opacidade se é así.</string>
<string name="widget_config_readability_hint_classic">Cunha opacidade baixa, o fondo da pantalla vese a través, polo que pode resultar complicado ler parte do texto. Se é o caso, aumenta a opacidade ou inverte a cor do texto.</string>
<string name="widget_config_style">Estilo</string>
<string name="widget_config_style_cards">Tarxetas</string>
<string name="widget_config_style_classic">Clásico</string>
<string name="widget_config_content">Contido</string>
<string name="widget_config_range">Intervalo de tempo</string>
<string name="widget_config_text_size">Tamaño do texto</string>
<string name="widget_config_load_failed">Non se puido ler a configuración deste widget.</string>
<string name="widget_config_preview_failed">Vista previa non dispoñible</string>
<string name="widget_config_save_failed">Non se puido gardar o widget. Téntao de novo.</string>
<string name="widget_numbered">%1$s %2$d</string>
<string name="widget_appearance_summary">%1$s · %2$s</string>
<string name="widget_config_calendars">Calendarios</string>
<string name="widget_config_calendars_hint">Os calendarios que amosa este widget. Os calendarios que ocultaches na aplicación tamén permanecen ocultos aquí.</string>
<string name="widget_config_calendars_all">Todos os calendarios</string>
<plurals name="widget_config_calendars_some">
<item quantity="one">%1$d de %2$d calendario</item>
<item quantity="other">%1$d de %2$d calendarios</item>
</plurals>
<string name="filter_title">Calendarios</string>
<string name="settings_title">Configuración</string>
<string name="settings_back">Atrás</string>
<string name="back">Atrás</string>
<string name="settings_section_appearance">Aparencia</string>
<string name="settings_theme">Tema</string>
<string name="settings_theme_system">Sistema</string>
<string name="settings_theme_light">Claro</string>
<string name="settings_theme_dark">Escuro</string>
<string name="settings_theme_black">Negro</string>
<string name="settings_theme_black_summary">Escuro con fondos de cor negra pura, para pantallas AMOLED</string>
<string name="settings_theme_hint">Se a aplicación é clara ou escura. A elección aplícase decontado.</string>
<string name="settings_theme_system_summary">Actualmente %1$s</string>
<string name="settings_default_view">Vista predeterminada</string>
<string name="settings_dynamic_color">Cor dinámica</string>
<string name="settings_dynamic_color_unavailable">Require Android 12 ou posterior</string>
<string name="settings_soften_colors">Harmonizar as cores do calendario</string>
<string name="settings_soften_colors_summary">Mantén o ton de cada calendario pero unifica o seu brillo, de xeito que todos os eventos sexan lexibles e as cores combinen entre si. Desactívao para amosar as cores orixinais da fonte do calendario.</string>
<string name="settings_font_headings">Tipo de letra dos encabezados</string>
<string name="settings_font_body">Tipo de letra do corpo</string>
<string name="settings_font_system">Predeterminado do sistema</string>
<string name="font_atkinson_hyperlegible">Atkinson Hyperlegible</string>
<string name="font_lora">Lora</string>
<string name="font_jetbrains_mono">JetBrains Mono</string>
<string name="settings_font_choose_file">Escoller ficheiro…</string>
<string name="settings_font_custom_selected">Tipo de letra personalizado</string>
<string name="settings_font_import_failed">Non se puido ler ese ficheiro como tipo de letra</string>
<string name="settings_font_specimen_heading">Xoves, 14 de Maio</string>
<string name="settings_font_specimen_body">Xuntanza do equipo ás 10:00; despois, xantar con Robin na cafetería da Marktplatz.</string>
<string name="settings_week_start">A semana comeza en</string>
<string name="settings_week_start_auto">Automático</string>
<string name="settings_week_start_auto_summary">Actualmente %1$s</string>
<string name="settings_week_numbers">Números de semana</string>
<string name="settings_week_numbers_summary">Amosar os números da semana na vista mensual</string>
<string name="settings_month_start_times">Horas de inicio</string>
<string name="settings_month_start_times_summary">Amosar a hora de inicio antes do título dun evento cando haxa espazo</string>
<string name="settings_today_toolbar">Botón «Hoxe» na barra de ferramentas</string>
<string name="settings_today_toolbar_summary">Amosar un botón para ir ao «día de hoxe» na barra de ferramentas, na vez dun botón flotante</string>
<string name="settings_app_name">Nome da aplicación</string>
<string name="settings_app_name_summary">Amosar Calendula como «Calendario» no teu lanzador. Só cambia o nome no lanzador; é posible que a icona se desprace a unha nova posición despois do cambio.</string>
<string name="settings_time_format">Formato da hora</string>
<string name="settings_time_format_auto">Automático</string>
<string name="settings_time_format_12h">12-horas (2:00 PM)</string>
<string name="settings_time_format_24h">24-horas (14:00)</string>
<string name="settings_time_format_auto_summary">Segundo o sistema: %1$s</string>
<string name="settings_hour_lines">Grella horaria</string>
<string name="settings_hour_lines_summary">Sitúa cada hora na súa propia cela nas vistas semanal e diaria</string>
<string name="settings_multi_day_count">Vista de varios días</string>
<string name="settings_multi_day_count_hint">Cantos días amosa a vista de varios días, un ao lado do outro. O día de hoxe ábrese na primeira columna.</string>
<string name="settings_timeline_scale">Altura da hora</string>
<string name="settings_timeline_scale_by_visible_hours">Establecido segundo as horas visibles</string>
<string name="settings_timeline_scale_hint">Canto espazo vertical ocupa unha hora nas vistas semanal e diaria. Ambas as vistas comparten esta configuración. Tamén podes beliscar a liña de tempo con dous dedos para establecer calquera altura intermedia.</string>
<string name="timeline_scale_fit_day">Ocupa todo o día</string>
<string name="timeline_scale_fit_day_summary">As 24 horas nunha soa pantalla, sen desprazamento</string>
<string name="timeline_scale_compact">Compacto</string>
<string name="timeline_scale_compact_summary">Máis horas por pantalla, bloques máis pequenos</string>
<string name="timeline_scale_regular">Normal</string>
<string name="timeline_scale_regular_summary">O espazamento estándar</string>
<string name="timeline_scale_comfortable">Cómodo</string>
<string name="timeline_scale_comfortable_summary">Bloques máis amplos, máis desprazamento</string>
<string name="timeline_scale_custom">Personalizado</string>
<string name="timeline_scale_custom_summary">A altura á que axustaches a liña de tempo</string>
<string name="settings_visible_hours">Horas visibles</string>
<string name="settings_visible_hours_summary">Axusta un intervalo de horas á pantalla ao abrir a vista semanal, de varios días ou diaria</string>
<string name="settings_visible_hours_on_summary">%1$s – %2$s ocupa toda a pantalla ao abrir unha vista</string>
<string name="settings_visible_hours_start">Dende</string>
<string name="settings_visible_hours_end">Ata</string>
<string name="settings_visible_hours_start_hint">A hora na parte superior da pantalla ao abrir a vista semanal, de varios días ou diaria. As horas previas están dispoñibles desprazando a pantalla.</string>
<string name="settings_visible_hours_end_hint">A hora na parte inferior da pantalla cando se abre unha vista. As horas posteriores están a un desprazamento de distancia, e o xesto de beliscar permite ampliar ata que a vista se abra de novo.</string>
<string name="settings_dim_completed">Atenuar eventos completados</string>
<string name="settings_dim_completed_summary">Esvaecer os eventos que xa remataron na vista mensual e semanal</string>
<string name="settings_drag_to_reschedule">Arrastra para reprogramar</string>
<string name="settings_drag_to_reschedule_summary">Mover un evento arrastrándoo a outro día ou hora</string>
<string name="settings_events_header">Eventos</string>
<string name="settings_tap_opens">Ao premer nun evento, ábrese</string>
<string name="settings_tap_opens_details">Detalles</string>
<string name="settings_tap_opens_editor">Editar o formulario</string>
<string name="settings_tap_opens_hint">Os eventos que non podes editar e as notificacións de recordatorios sempre abren os detalles.</string>
<string name="settings_past_events">Eventos pasados</string>
<string name="settings_past_events_show">Amosar</string>
<string name="settings_past_events_dim">Escurecer</string>
<string name="settings_past_events_hide">Agochar</string>
<string name="settings_past_events_sample_morning">Revisión do equipo</string>
<string name="settings_past_events_sample_midday">Xantar con Brais</string>
<string name="settings_past_events_sample_evening">Ensaio coa coral</string>
<string name="widget_preview_sample_trip">Viaxe da fin de semana</string>
<string name="widget_preview_sample_dentist">Dentista</string>
<string name="settings_agenda_header">Axenda</string>
<string name="settings_agenda_range">Intervalo da axenda</string>
<string name="settings_agenda_range_hint">Con canta antelación a pantalla da Axenda amosa os eventos.</string>
<string name="settings_agenda_widget_range">Intervalo do widget da axenda</string>
<string name="settings_agenda_widget_range_hint">Con canta antelación lista os eventos este widget.</string>
<string name="settings_widget_size">Tamaño do widget da axenda</string>
<string name="settings_widget_size_hint">O tamaño no que este widget amosa o seu texto.</string>
<string name="settings_widget_size_small">Pequeno</string>
<string name="settings_widget_size_medium">Medio</string>
<string name="settings_widget_size_large">Grande</string>
<string name="settings_widget_size_extra_large">Moi grande</string>
<string name="settings_widget_size_summary">Texto do evento %1$d%%</string>
<string name="settings_agenda_show_today">Amosar sempre hoxe</string>
<string name="settings_agenda_show_today_hint">Mantén o día de hoxe na parte superior da axenda, mesmo cando xa non quede nada para hoxe. Cada widget ten a súa propia configuración.</string>
<string name="settings_agenda_range_bar">Barra de intervalo</string>
<string name="settings_agenda_range_bar_hint">Amosar unha barra na parte superior da axenda que indique as datas amosadas, cun botón para cambiar o intervalo da sesión</string>
<string name="agenda_range_day">Hoxe</string>
<string name="agenda_range_this_week">Esta semana</string>
<string name="agenda_range_this_month">Este mes</string>
<string name="agenda_range_week">Os vindeiros 7 días</string>
<string name="agenda_range_month">Os vindeiros 30 días</string>
<string name="agenda_range_custom">Personalizado…</string>
<string name="agenda_range_custom_hint">Días</string>
<string name="agenda_range_override_hint">Polo de agora; restablécese ao intervalo gardado cando volvas abrir Calendula.</string>
<string name="agenda_range_showing_label">Amosando todos os vindeiros eventos para</string>
<plurals name="agenda_range_days">
<item quantity="one">%d día</item>
<item quantity="other">%d días</item>
</plurals>
<string name="settings_section_views">Vistas</string>
<string name="settings_month_header">Vista mensual</string>
<string name="settings_month_view_style">Estilo da vista mensual</string>
<string name="month_style_paged">Páxinas</string>
<string name="month_style_paged_summary">Un mes ocupa a pantalla. Esvara cara á esquerda ou cara á dereita para cambiar de mes, ou esvara cara arriba para amosar a axenda do mes.</string>
<string name="month_style_continuous">Desprazar meses</string>
<string name="month_style_continuous_summary">Cada mes sitúase baixo o seu propio encabezado, cun pequeno espazo que o separa do seguinte.</string>
<string name="month_style_dense">Semanas sen interrupcións</string>
<string name="month_style_dense_summary">As semanas pasan sen interrupción, e cada mes flúe directamente cara ao seguinte, sen ocos entre eles.</string>
<string name="month_style_split">Dividir</string>
<string name="month_style_split_summary">Unha grella compacta sinala os días que teñen eventos, e o día que premes aparece listado embaixo.</string>
<string name="month_split_no_events">Nada programado</string>
<string name="month_split_no_events_month">Non se programou nada este mes</string>
<string name="month_split_no_more_events">Non hai nada máis programado este mes</string>
<string name="month_split_expand">Amosar o mes completo</string>
<string name="month_split_collapse">Amosar os eventos do día</string>
<string name="settings_quick_switch_header">Botón de cambio rápido</string>
<string name="settings_quick_switch_hint">Escolle as vistas a amosar ao premer o botón da parte superior dereita e arrástraas para reordenalas. Se hai menos de dúas vistas activadas, o botón quedará oculto. As vistas desactivadas seguen sendo accesibles dende o menú de navegación.</string>
<string name="settings_drawer_order_header">Menú da navegación</string>
<string name="settings_drawer_order_hint">Arrastra para reordenar as vistas que aparecen no menú da navegación.</string>
<string name="reorder_drag_handle">Arrastrar para reordenar</string>
<string name="settings_section_event_form">Formulario de novo evento</string>
<string name="settings_form_fields_hint">Campos que se amosan de xeito predeterminado; todo o demais atópase detrás de \"Máis campos\"</string>
<string name="settings_autofocus_title">Centrar o título no novo evento</string>
<string name="settings_autofocus_title_hint">Cando inicies un evento novo, coloca o cursor no campo do título e abre o teclado decontado.</string>
<string name="settings_event_duration">Duración predeterminada</string>
<string name="settings_event_duration_hint">A duración dun evento novo ata que cambies a súa hora do remate. Os eventos de todo o día non se verán afectados.</string>
<string name="settings_calendar_durations_title">Duración por calendario</string>
<string name="settings_calendar_durations_hint">Adxudicar a un calendario a súa propia duración predeterminada; por exemplo, 8 horas para as quendas de traballo.</string>
<string name="settings_calendar_duration_inherits">Predeterminado (%1$s)</string>
<string name="settings_calendar_duration_use_default">Empregar a duración predeterminada (%1$s)</string>
<string name="settings_color_unsupported">Permitir cores en calendarios non compatibles</string>
<string name="settings_color_unsupported_hint">Algúns calendarios (por exemplo, certos CalDAV) non definen ningunha cor; polo tanto, unha cor personalizada dun evento podería perderse ou sobrescribirse na seguinte sincronización. Trátase dunha limitación deses calendarios, non de algo que Calendula poida solucionar.</string>
<string name="settings_section_notifications">Notificacións</string>
<string name="settings_reminders">Recordatorios de eventos</string>
<string name="settings_reminders_hint">Ves os recordatorios dúas veces? Outra aplicación de calendario tamén os está a amosar; desactívaos nunha das dúas.</string>
<string name="settings_default_reminder">Recordatorio predeterminado</string>
<string name="settings_default_reminder_allday">Eventos de todo o día</string>
<string name="settings_allday_reminder_time">Hora do recordatorio para todo o día</string>
<string name="settings_allday_reminder_time_hint">Os recordatorios para eventos de todo o día actívanse ás %1$s</string>
<string name="settings_allday_reminder_fires_at">Notifica ás %1$s</string>
<string name="reminder_none">Ningún</string>
<string name="reminder_use_default">Empregar o recordatorio predeterminado</string>
<string name="reminder_custom_amount">Cantidade</string>
<string name="reminder_custom_set">Establecer</string>
<string name="settings_calendar_reminders_title">Recordatorios por calendario</string>
<string name="settings_calendar_reminders_hint">Substitúe a configuración predeterminada para cada calendario, por separado para os eventos con hora específica e para os eventos de todo o día. Un calendario pode manter a configuración predeterminada, prescindir dela ou establecer a súa propia.</string>
<string name="settings_calendar_reminder_inherits">Predeterminado (%1$s)</string>
<string name="settings_reliable_delivery">Entrega fiable</string>
<string name="settings_reliable_delivery_hint">Android pode atrasar os recordatorios para aforrar batería. Exclúe a Calendula para que cheguen a tempo.</string>
<string name="settings_reliable_delivery_exempt">Exento da optimización da batería: os recordatorios chegan a tempo.</string>
<string name="settings_snooze_duration">Duración da posposición</string>
<string name="settings_section_calendars">Calendarios</string>
<string name="settings_manage_calendars">Xestionar os calendarios</string>
<string name="settings_manage_calendars_hint">Crear calendarios locais; xestionar os sincronizados</string>
<string name="settings_section_language">Idioma</string>
<string name="settings_language">Idioma da aplicación</string>
<string name="settings_language_auto">Predeterminado do sistema</string>
<string name="settings_translate">Axuda a traducir</string>
<string name="settings_translate_hint">Engadir ou mellorar un idioma en Weblate</string>
<string name="settings_group_look">Aparencia e comportamento</string>
<string name="settings_group_data">Datos</string>
<string name="settings_group_app">Aplicación</string>
<string name="settings_group_about">En canto a</string>
<string name="settings_appearance_subtitle">Tema, cores, tipografía</string>
<string name="settings_views_subtitle">Vista predeterminada, deseño, orde</string>
<string name="settings_event_form_subtitle">Campos predeterminados e comportamento</string>
<string name="settings_notifications_subtitle">Recordatorios e entrega</string>
<string name="settings_special_dates_subtitle">Aniversarios dos contactos e efemérides</string>
<string name="settings_widgets_subtitle">Os teus widgets, mosaico de configuración rápida</string>
<string name="settings_backup_subtitle">Exportar, importar, copia de seguridade automática</string>
<string name="settings_section_widgets">Widgets e mosaicos</string>
<string name="settings_widgets_hint">Cada widget ten o seu propio aspecto e as súas propias opcións. Preme un a continuación, ou mantén premido un na pantalla do inicio e escolle Editar. Para engadir un widget, mantén premida a pantalla do inicio.</string>
<string name="settings_widgets_hint_legacy">Cada widget ten o seu propio aspecto e as súas propias opcións. Preme un a continuación para cambialo. Engade un widget mantendo premida a pantalla do inicio.</string>
<string name="settings_widgets_placed">Na túa pantalla de inicio</string>
<string name="settings_widgets_none">Aínda non hai widgets de Calendula na túa pantalla do inicio.</string>
<string name="settings_section_backup">Copia de seguridade e restauración</string>
<string name="settings_views_all_header">Todas as vistas</string>
<string name="settings_week_day_header">Semana e día</string>
<string name="settings_default_view_hint">A vista que abre Calendula ao iniciarse.</string>
<string name="settings_week_start_hint">O día no que comeza cada semana, en todas as vistas e widgets.</string>
<string name="settings_time_format_hint">Como se amosan as horas en toda a aplicación. A opción «Automático» axústase á configuración do teu sistema.</string>
<string name="settings_past_events_hint">O que fai a axenda cos eventos que xa remataron.</string>
<string name="settings_dynamic_color_summary">Toma as cores da aplicación do teu fondo de pantalla.</string>
<string name="settings_section_special_dates">Datas especiais do contacto</string>
<string name="settings_special_dates_enable">Amosar as datas do contacto</string>
<string name="settings_special_dates_enable_hint">Replica os aniversarios e outras datas dos teus contactos nos calendarios locais. Le só os contactos neste dispositivo; non se carga nada e os teus contactos nunca se modifican.</string>
<string name="settings_special_dates_type_birthday">Aniversarios</string>
<string name="settings_special_dates_type_anniversary">Efemérides</string>
<string name="settings_special_dates_type_custom">Outras datas</string>
<string name="settings_special_dates_template">Formato do título</string>
<string name="settings_special_dates_template_hint">Usa {name} para o contacto e {year} para o ano (o ano de nacemento ou o ano de inicio dun aniversario; agóchase se se descoñece).</string>
<string name="settings_special_dates_reminders">Recordatorios</string>
<string name="settings_special_dates_show_year">Amosar o ano</string>
<string name="settings_special_dates_show_year_hint">Inclúe {year} nos títulos cando se coñeza</string>
<string name="settings_special_dates_sync_now">Sincronizar agora</string>
<string name="settings_special_dates_never_synced">Aínda non se sincronizou</string>
<string name="settings_special_dates_last_synced">Última sincronización: %1$s</string>
<string name="settings_special_dates_calendar_hint">Establece a cor e a visibilidade de cada calendario na configuración de Calendario.</string>
<string name="settings_calendar_reminders_managed_hint">Establecer datas especiais en Contacto</string>
<string name="settings_special_dates_paused_title">En pausa</string>
<string name="settings_special_dates_paused_hint">Calendula xa non pode ler os teus contactos, polo que estes calendarios non se están a actualizar.</string>
<string name="settings_special_dates_grant">Garantir o acceso</string>
<string name="settings_special_dates_disable_title">Desactivar as datas de contacto?</string>
<string name="settings_special_dates_disable_all_message">Isto elimina os calendarios de datas de contacto e os seus eventos. Perderanse todos os recordatorios ou notas que engadiches neles.</string>
<string name="settings_special_dates_disable_type_message">Isto elimina o calendario «%1$s» e os seus eventos. Perderanse todos os recordatorios ou notas que engadiches a eles.</string>
<string name="settings_special_dates_disable_confirm">Apagar</string>
<string name="dialog_save">Gardar</string>
<string name="settings_section_about">En canto a</string>
<string name="settings_license">Licenza</string>
<string name="settings_license_value">MIT</string>
<string name="settings_about_author">por Jean-Luc Makiola</string>
<string name="settings_about_source">Fonte</string>
<string name="settings_licences">Licenzas de código aberto</string>
<string name="settings_licences_subtitle">Os proxectos sobre os que se basea Calendula</string>
<string name="settings_about_privacy">Política de privacidade</string>
<string name="settings_about_support">Apoiar o desenvolvemento</string>
<string name="settings_support_kofi">Ko-fi</string>
<string name="settings_support_kofi_hint">Consellos puntuais</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="settings_support_liberapay_hint">Doazóns recorrentes</string>
<string name="settings_about_version">Versión %1$s</string>
<string name="settings_about_logo_desc">Icona da aplicación Calendula</string>
<string name="settings_report_problem">Informar dun problema</string>
<string name="settings_report_problem_hint">Enviar un informe de erro ou abrir o sistema de seguimento de incidencias</string>
<string name="licences_title">Licenzas de Código aberto</string>
<string name="licences_intro">Calendula inclúe o traballo que aparece a continuación. Preme calquera entrada para obter o seu código fonte.</string>
<string name="licences_footer">Todos os proxectos aquí presentes inclúense sen modificacións, baixo a licenza indicada.</string>
<string name="calendars_title">Calendarios</string>
<string name="calendars_local_header">Os teus calendarios</string>
<string name="calendars_local_empty">Aínda non hai calendarios locais. Crea un para manter os eventos só neste dispositivo.</string>
<string name="calendars_add">Engadir calendario</string>
<string name="calendars_visibility_hint">Desactiva un calendario para ocultalo neste dispositivo: os seus eventos desaparecerán da aplicación e deixará de enviarte recordatorios. Trátase do mesmo interruptor que empregan as túas outras aplicacións de calendario, polo que nelas tamén quedará oculto. Non se elimina nada, ningún outro dispositivo se verá afectado e podes reactivalo aquí en calquera momento.</string>
<string name="calendars_visibility_a11y">Amosar \"%1$s\"</string>
<string name="calendars_visibility_notice_title">Algúns calendarios están desactivados</string>
<string name="calendars_visibility_notice_message">Calendula amosa os calendarios que están activados neste dispositivo, e algúns dos teus están desactivados. Para ver os seus eventos, actívaos en Configuración → Calendarios.</string>
<string name="calendar_picker_missing_title">Fáltache un calendario?</string>
<string name="calendar_picker_missing_summary">Pode estar desactivado, ser de só lectura ou estar cuberto a partir dos teus contactos; xestiona os teus calendarios aquí.</string>
<string name="calendars_state_read_only">Só de lectura</string>
<string name="calendars_state_not_synced">Non sincronizado con este dispositivo</string>
<string name="calendars_state_managed">Cuberto a partir dos teus contactos</string>
<string name="calendars_managed_delete_locked">Este calendario énchese a partir dos teus contactos, polo que Calendula voltará crealo na seguinte sincronización. Para eliminalo, desactiva as datas especiais en Configuración → Datas especiais.</string>
<string name="calendars_synced_header">Calendarios sincronizados</string>
<string name="calendars_synced_hint">Estes proveñen de contas no teu dispositivo. Créaos e edítaos na súa propia aplicación.</string>
<string name="calendars_manage_in_app">Xestionar na aplicación</string>
<string name="calendars_account_from_source">%1$s (%2$s)</string>
<string name="calendars_account_menu_a11y">Máis opcións para %1$s</string>
<string name="calendars_enable_all">Activar todo</string>
<string name="calendars_disable_all">Desactivar todo</string>
<string name="calendars_add_account">Engadir conta</string>
<string name="calendars_new_title">Novo calendario</string>
<string name="calendars_edit_title">Editar calendario</string>
<string name="calendars_name_label">Nome</string>
<string name="calendars_color_label">Cor</string>
<string name="calendars_description_label">Descrición</string>
<string name="calendars_description_hint">Engadir unha descrición</string>
<string name="color_name_mauve">Malva</string>
<string name="color_name_red">Vermello</string>
<string name="color_name_orange">Laranxa</string>
<string name="color_name_amber">Ámbar</string>
<string name="color_name_olive">Oliva</string>
<string name="color_name_green">Verde</string>
<string name="color_name_teal">Augamariña</string>
<string name="color_name_cyan">Ciano</string>
<string name="color_name_blue">Azul</string>
<string name="color_name_indigo">Índigo</string>
<string name="color_name_purple">Violeta</string>
<string name="color_name_pink">Rosa</string>
<string name="calendars_delete_confirm_title">Eliminar o calendario?</string>
<string name="calendars_delete_confirm_message">\"%1$s\" e todos os seus eventos eliminaranse permanentemente deste dispositivo.</string>
<string name="calendars_write_error">Non se puido gardar o cambio.</string>
<string name="calendars_backup_header">Copia de seguridade</string>
<string name="calendars_backup_hint">Os calendarios locais non se sincronizan en ningures; polo tanto, expórtaos a un ficheiro .ics para conservar unha copia.</string>
<string name="calendars_backup_action">Exportar como ficheiro .ics</string>
<string name="calendars_export_title">Exportar calendarios</string>
<string name="calendars_export_hint">Escolle os calendarios a incluír no ficheiro .ics.</string>
<string name="calendars_export_action">Exportar</string>
<string name="calendars_restore_header">Restaurar</string>
<string name="calendars_restore_action">Restaurar dende un ficheiro .ics</string>
<string name="calendars_restore_hint">Importar eventos dende unha copia de seguridade ou de outra aplicación de calendario.</string>
<string name="calendars_restore_unavailable">Ningún calendario pode acoller aínda os eventos importados.</string>
<string name="calendars_auto_backup">Copia de seguridade automática</string>
<string name="calendars_auto_backup_hint">Exporta periodicamente os teus calendarios locais a un cartafol como un ficheiro .ics.</string>
<string name="calendars_auto_backup_folder">Cartafol da copia de seguridade</string>
<string name="calendars_auto_backup_folder_unset">Preme para escoller un cartafol</string>
<string name="calendars_auto_backup_interval">Intervalo</string>
<string name="calendars_auto_backup_every">Cada %1$s</string>
<string name="calendars_auto_backup_interval_min">Mínimo 30 minutos.</string>
<string name="calendars_auto_backup_status_never">Aínda non hai copia de seguridade automática</string>
<string name="calendars_auto_backup_status_ok">Última copia de seguridade: %1$s</string>
<string name="calendars_auto_backup_status_failed">A última copia de seguridade fallou: %1$s</string>
<string name="backup_channel_name">Copia de seguridade</string>
<string name="backup_channel_description">Advirte se as copias de seguridade automáticas fallan repetidamente.</string>
<string name="backup_failed_title">A copia de seguridade automática fallou</string>
<string name="backup_failed_text">Calendula non puido escribir o ficheiro de copia de seguridade. Comproba o cartafol de copias de seguridade en Configuración.</string>
<string name="calendars_backup_failed">Non se puido exportar a copia de seguridade.</string>
<plurals name="calendars_backup_done">
<item quantity="one">Exportado %d evento.</item>
<item quantity="other">Exportados %d eventos.</item>
</plurals>
<string name="import_title">Importar eventos</string>
<string name="import_target_header">Engadir ao calendario</string>
<string name="import_empty">Non se atoparon eventos neste ficheiro.</string>
<string name="import_failed">Non se puido ler este ficheiro.</string>
<string name="import_no_calendar">Non hai ningún calendario no que se poida escribir para realizar a importación. Crea primeiro un calendario local.</string>
<string name="import_done_title">Importación completada</string>
<string name="import_done_dedup_note">Os eventos que xa estaban no calendario foron omitidos.</string>
<string name="import_done_added_label">Engadido</string>
<string name="import_done_skipped_label">Duplicados</string>
<string name="import_done_failed_label">Non engadido</string>
<string name="import_done_failed_note">Algúns eventos non se puideron engadir e quedaron fóra.</string>
<string name="import_done_stopped_title">A importación detívose</string>
<string name="import_close">Pechar</string>
<string name="import_warning_recurrence">Omitíronse algunhas aparicións modificadas de eventos recorrentes.</string>
<string name="import_warning_no_start">Omitiuse un evento sen hora de inicio.</string>
<string name="import_warning_attendees">As listas de convidados non se importaron.</string>
<string name="import_warning_timezone">Un fuso horario descoñecido axustouse ao do teu dispositivo.</string>
<string name="import_warning_tasks">As tarefas neste ficheiro engadíronse como eventos.</string>
<string name="import_warning_recurrence_repaired">Corrixiuse unha regra de repetición defectuosa.</string>
<string name="import_button">Importar</string>
<plurals name="import_title_count">
<item quantity="one">Importando %d evento</item>
<item quantity="other">Importando %d eventos</item>
</plurals>
<plurals name="import_event_count">
<item quantity="one">%d evento neste ficheiro.</item>
<item quantity="other">%d eventos neste ficheiro.</item>
</plurals>
<plurals name="import_action">
<item quantity="one">Importar %d evento</item>
<item quantity="other">Importar %d eventos</item>
</plurals>
<plurals name="import_done_stopped">
<item quantity="one">O calendario deixou de aceptar eventos a medio camiño. Non se engadiu %d evento do ficheiro.</item>
<item quantity="other">O calendario deixou de aceptar eventos a medio camiño. Non se engadiron %d eventos do ficheiro.</item>
</plurals>
<plurals name="import_done_imported">
<item quantity="one">Importado %d evento.</item>
<item quantity="other">Importados %d eventos.</item>
</plurals>
<plurals name="import_done_skipped">
<item quantity="one">Omitiuse %d; xa está neste calendario.</item>
<item quantity="other">Omitíronse %d; xa están neste calendario.</item>
</plurals>
<plurals name="import_done_failed">
<item quantity="one">%d evento non se puido engadir.</item>
<item quantity="other">%d eventos non se puideron engadir.</item>
</plurals>
<string name="shortcut_new_event_short">Novo evento</string>
<string name="shortcut_new_event_long">Crear un novo evento</string>
<string name="process_text_create_event">Crear evento</string>
<string name="qs_tile_new_event_label">Novo evento</string>
<string name="settings_qs_tile">Engadir un mosaico de Configuración rápida</string>
<string name="settings_qs_tile_hint">Engade un mosaico de «Novo evento» ao panel de Configuración rápida.</string>
<string name="crash_dialog_title">%1$s fallou</string>
<string name="crash_dialog_message">%1$s pechouse inesperadamente a última vez. Podes axudar a solucionalo enviando este informe como un problema. Permanece no teu dispositivo ata que decidas compartilo e non inclúe datos persoais nin contido de calendario, só os detalles técnicos que se indican a continuación.</string>
<string name="crash_dialog_report">Reportar</string>
<string name="crash_dialog_dismiss">Agora non</string>
<string name="crash_report_clip_label">Informe de erro de %1$s</string>
<string name="crash_report_copied">Informe copiado no portarretallos</string>
<string name="crash_report_open_failed">Non se puido abrir o rastrexador de problemas. O informe está no portarretallos.</string>
<string name="special_dates_calendar_birthday">Aniversarios</string>
<string name="special_dates_calendar_anniversary">Efemérides</string>
<string name="special_dates_calendar_custom">Datas especiais</string>
<string name="special_dates_default_title_birthday">Aniversario de {name} ({year})</string>
<string name="special_dates_default_title_anniversary">Efeméride de {name} ({year})</string>
<string name="special_dates_default_title_custom">{name}</string>
</resources>
+17 -161
View File
@@ -222,8 +222,8 @@
<string name="search_idle_hint">Cerca gli eventi per titolo, luogo o note.</string>
<string name="search_empty">Nessun risultato per \"%1$s\".</string>
<string name="widget_agenda_title">Prossimamente</string>
<string name="widget_agenda_label">Agenda</string>
<string name="widget_month_label">Mese</string>
<string name="widget_agenda_label">Agenda Calendula</string>
<string name="widget_month_label">Mese Calendula</string>
<string name="widget_refresh">Aggiorna</string>
<string name="widget_new_event">Nuovo evento</string>
<string name="widget_needs_permission">Apri Calendula per concedere l\'accesso al calendario</string>
@@ -244,7 +244,7 @@
<string name="settings_time_format_12h">12 ore</string>
<string name="settings_time_format_24h">24 ore</string>
<string name="settings_hour_lines">Grglia oraria</string>
<string name="settings_hour_lines_summary">Mostra una linea di separazione per ogni ora in una cella a sé stante nella visualizzazione settimanale e giornaliera</string>
<string name="settings_hour_lines_summary">Mostra una riga separatrice per ogni ora nella vista Settimana e Giorno</string>
<string name="settings_dim_completed">Attenua gli eventi completati</string>
<string name="settings_dim_completed_summary">Attenua gli eventi conclusi nella vista Mese e Settimana</string>
<string name="settings_past_events">Eventi passati</string>
@@ -255,7 +255,7 @@
<string name="settings_agenda_range">Intervallo dell\'Agenda</string>
<string name="settings_agenda_range_hint">Intervallo di visualizzazione degli eventi nell\'Agenda.</string>
<string name="settings_agenda_widget_range">Intervallo di visualizzazione degli eventi nel widget Agenda</string>
<string name="settings_agenda_widget_range_hint">Indica con quanto anticipo questo widget elenca gli eventi.</string>
<string name="settings_agenda_widget_range_hint">Intervallo di visualizzazione degli eventi nel widget Agenda.</string>
<string name="settings_agenda_range_bar">Barra dell\'intervallo</string>
<string name="settings_agenda_range_bar_hint">Nella vista Agenda, mostra una barra che indica l\'intervallo di date visualizzato, con un pulsante per cambiarlo</string>
<string name="agenda_range_day">Oggi</string>
@@ -422,7 +422,7 @@
<string name="settings_font_import_failed">Impossibile leggere il file come font</string>
<string name="settings_section_views">Vista</string>
<string name="settings_quick_switch_header">Pulsante di cambio rapido</string>
<string name="settings_quick_switch_hint">Scegli attraverso quali viste scorrere col pulsante in alto a destra, trascinale per riordinarle. Se sono attive meno di due schermate, il pulsante viene nascosto. Le viste disattivate rimangono accessibili dal menu di navigazione.</string>
<string name="settings_quick_switch_hint">Scegli attraverso quali viste scorrere col pulsante in alto a destra, trascinale per riordinarle. Le viste disattivate rimangono raggiungibili dal menù di navigazione.</string>
<string name="settings_drawer_order_header">Menù di navigazione</string>
<string name="settings_drawer_order_hint">Trascina per riordinare le viste elencate nel menù di navigazione.</string>
<string name="reorder_drag_handle">Trascina per riordinare</string>
@@ -480,7 +480,7 @@
<string name="settings_week_numbers">Numeri di settimana</string>
<string name="settings_week_numbers_summary">Mostra i numeri di settimana nella vista Mese</string>
<string name="settings_agenda_show_today">Mostra sempre Oggi</string>
<string name="settings_agenda_show_today_hint">Mantieni la giornata di oggi in cima all\'agenda, anche quando non ci sono altri eventi in giornata. Ogni widget ha le sue impostazioni.</string>
<string name="settings_agenda_show_today_hint">Mantieni Oggi in alto nell\'Agenda e nel widget, anche se non ci sono altri eventi in giornata.</string>
<string name="calendars_export_title">Esporta calendari</string>
<string name="calendars_export_hint">Scegli quali calendari includere nel file .ics.</string>
<string name="calendars_export_action">Esporta</string>
@@ -551,14 +551,12 @@
<string name="search_select_all">Seleziona tutti</string>
<string name="search_delete_selected">Elimina i selezionati</string>
<plurals name="search_delete_title">
<item quantity="one">Eliminare %d l\'evento?</item>
<item quantity="many">Eliminare %d gli eventi?</item>
<item quantity="other">Eliminare %d eventi?</item>
<item quantity="one">Eliminare l\'evento?</item>
<item quantity="other">Eliminare l\'evento?</item>
</plurals>
<plurals name="search_delete_done">
<item quantity="one">%d evento eliminato</item>
<item quantity="many">%d eventi eliminati</item>
<item quantity="other">%d eventi eliminati</item>
<item quantity="one">Evento eliminato</item>
<item quantity="other">Evento eliminato</item>
</plurals>
<string name="search_delete_partial">%1$d eliminati, %2$d no</string>
<string name="search_delete_denied_partial">%1$d eliminati, poi permessi di scrittura negati</string>
@@ -591,7 +589,7 @@
<string name="settings_past_events_sample_midday">Pranzo con Ugo</string>
<string name="settings_past_events_sample_evening">Allenamento di scacchi</string>
<string name="settings_widget_size">Dimensioni del widget Agenda</string>
<string name="settings_widget_size_hint">Quanto grande è il testo visualizzato da questo widget.</string>
<string name="settings_widget_size_hint">Dimensioni del testo del widget agenda. Il widget mensile non ha impostazioni, si adatta da solo alla dimensione data.</string>
<string name="settings_widget_size_small">Piccolo</string>
<string name="settings_widget_size_medium">Medio</string>
<string name="settings_widget_size_large">Grande</string>
@@ -600,7 +598,7 @@
<string name="settings_month_header">Vista Mese</string>
<string name="settings_month_view_style">Stile vista Mese</string>
<string name="month_style_paged">Pagine</string>
<string name="month_style_paged_summary">Viene mostrato un singolo mese. Scorri a destra o a sinistra per cambiare mese oppure scorri verso l\'alto per visualizzare l\'agenda mensile.</string>
<string name="month_style_paged_summary">Viene mostrato un singolo mese. Scorri a destra o a sinistra per cambiare mese.</string>
<string name="month_style_continuous">Scorrimento</string>
<string name="settings_past_events_hint">Ciò che fa l\'Agenda con eventi conclusi.</string>
<string name="settings_dynamic_color_summary">Deduci il colore dell\'app dallo sfondo.</string>
@@ -635,10 +633,10 @@
<string name="settings_group_data">Dati</string>
<string name="settings_group_app">App</string>
<string name="settings_group_about">A proposito</string>
<string name="settings_widgets_subtitle">I tuoi widget, riquadro Impostazioni rapide</string>
<string name="settings_widgets_subtitle">Widget Agenda e riquadro Impostazioni rapide</string>
<string name="settings_backup_subtitle">Export, Import, backup automatici</string>
<string name="settings_section_widgets">Widget &amp; Riquardi</string>
<string name="settings_widgets_hint">Ogni widget ha un aspetto e delle opzioni diverse. Toccane uno qui sotto oppure tieni premuto a lungo sulla schermata iniziale e scegli Modifica. Aggiungi un widget tenendo premuto a lungo sulla schermata iniziale.</string>
<string name="settings_widgets_hint">Impostazioni per i widget e il riquardo delle Impostazioni rapide. Aggiungi i widget tenendo premuto sulla home.</string>
<string name="settings_section_backup">Backup e ripristino</string>
<string name="settings_views_all_header">Tutte le viste</string>
<string name="settings_week_day_header">Giorno e settimana</string>
@@ -698,9 +696,9 @@
<string name="onboarding_calendars_create_failed">Impossibile creare il calendario. La memoria del calendario del tuo telefono non lo ha accettato.</string>
<string name="reminder_day_today">Oggi</string>
<plurals name="view_multi_day">
<item quantity="one">%d giorno</item>
<item quantity="many">%d giorni</item>
<item quantity="other">%d giorni</item>
<item quantity="one">Giorno</item>
<item quantity="many">Giorni</item>
<item quantity="other">Giorno</item>
</plurals>
<string name="settings_multi_day_count">Visualizzazione su più giorni</string>
<string name="settings_multi_day_count_hint">La vista più giorni mostra, affiancati, i giorni. La data odierna è visualizzata nella prima colonna.</string>
@@ -738,146 +736,4 @@
<item quantity="many">Non è stato possibile aggiungere gli eventi %d.</item>
<item quantity="other">Non è stato possibile aggiungere l\'evento %d.</item>
</plurals>
<string name="event_draft_create">Crea evento</string>
<string name="event_draft_discard">Scarta nuovo evento</string>
<string name="event_action_load_failed">Impossibile aprire l\'evento</string>
<string name="event_selection_close">Deseleziona evento</string>
<string name="event_edit_more_actions">Più azioni</string>
<string name="event_edit_unsaved_title">Modifiche non salvate</string>
<string name="event_edit_unsaved_save">Salva modifiche</string>
<string name="event_edit_unsaved_discard">Scarta modifiche</string>
<string name="event_edit_unsaved_keep">Continua a modificare</string>
<string name="event_edit_create">Crea</string>
<string name="event_resize_done">Modificato in %1$s</string>
<string name="event_resize_recurring_title">Modifica evento ricorrente</string>
<string name="event_selection_actions">Azioni evento</string>
<string name="event_selection_hide">Nascondi azioni evento</string>
<string name="settings_theme_black">Nero</string>
<string name="settings_theme_black_summary">Scuro con sfondi completamente neri, per schermi AMOLED</string>
<string name="settings_events_header">Eventi</string>
<string name="settings_tap_opens">Cliccando su un evento si apre</string>
<string name="settings_tap_opens_details">Dettagli</string>
<string name="settings_tap_opens_editor">Modifica modulo</string>
<string name="settings_tap_opens_hint">Gli eventi che non è possibile modificare e le notifiche di promemoria, aprono sempre la pagina dei dettagli.</string>
<string name="settings_support_kofi">Ko-fi</string>
<string name="settings_support_kofi_hint">Contributi una tantum</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="settings_support_liberapay_hint">Donazioni ricorrenti</string>
<string name="process_text_create_event">Crea evento</string>
<string name="event_move_stale">Questo evento è stato spostato prima che il rilascio potesse essere salvato</string>
<string name="event_move_queue_full">Troppi spostamenti contemporanei, questa modifica non è stata salvata</string>
<string name="event_move_skipped">Gli spostamenti fatti mentre la richiesta era aperta non sono stati salvati</string>
<string name="event_move_blocked_cancelled_series">Una serie annullata può essere spostata solo nella sua interezza, e questo modificherebbe i giorni in cui si ripete</string>
<string name="event_edit_status">Stato</string>
<string name="event_status_confirmed">Confermato</string>
<string name="widget_agenda_description">I tuoi prossimi eventi, raggruppati per giorno</string>
<string name="widget_month_description">Il mese in un colpo d’occhio, con i tuoi eventi</string>
<string name="widget_quick_add_label">Aggiunta rapida</string>
<string name="widget_quick_add_description">Crea un nuovo evento con un tocco</string>
<string name="widget_date_label">Data</string>
<string name="widget_date_description">Data di oggi</string>
<string name="widget_week_strip_label">Settimana in evidenza</string>
<string name="widget_week_strip_description">Questa settimana, con i giorni che hanno eventi</string>
<plurals name="widget_day_with_events">
<item quantity="one">%1$s, %2$d evento</item>
<item quantity="many">%1$s, %2$d eventi</item>
<item quantity="other">%1$s, %2$d eventi</item>
</plurals>
<string name="widget_upcoming_label">In arrivo</string>
<string name="widget_upcoming_description">La data di oggi sopra i tuoi prossimi eventi</string>
<string name="widget_upcoming_empty">Nessun prossimo evento</string>
<string name="widget_today_label">Oggi</string>
<string name="widget_today_description">Gli eventi di oggi, poi quelli di domani</string>
<string name="widget_nothing_left_today">Nient’altro per oggi</string>
<string name="widget_countdown_label">Conto alla rovescia</string>
<string name="widget_countdown_description">Quanto manca a un evento, oppure al prossimo</string>
<string name="widget_countdown_now">Adesso</string>
<string name="widget_countdown_ending_now">Termina adesso</string>
<string name="widget_countdown_tomorrow">Domani</string>
<string name="widget_countdown_ends_tomorrow">Termina domani</string>
<string name="widget_countdown_until">Fino a %1$s</string>
<plurals name="widget_countdown_in_minutes">
<item quantity="one">in %d minuto</item>
<item quantity="many">in %d minuti</item>
<item quantity="other">in %d minuti</item>
</plurals>
<plurals name="widget_countdown_in_hours">
<item quantity="one">in %d ora</item>
<item quantity="many">in %d ore</item>
<item quantity="other">in %d ore</item>
</plurals>
<plurals name="widget_countdown_in_days">
<item quantity="one">in %d giorno</item>
<item quantity="many">in %d giorni</item>
<item quantity="other">in %d giorni</item>
</plurals>
<plurals name="widget_countdown_ends_minutes">
<item quantity="one">termina in %d minuto</item>
<item quantity="many">termina in %d minuti</item>
<item quantity="other">termina in %d minuti</item>
</plurals>
<plurals name="widget_countdown_ends_hours">
<item quantity="one">termina in %d ora</item>
<item quantity="many">termina in %d ore</item>
<item quantity="other">termina in %d ore</item>
</plurals>
<plurals name="widget_countdown_ends_days">
<item quantity="one">termina in %d giorno</item>
<item quantity="many">termina in %d giorni</item>
<item quantity="other">termina in %d giorni</item>
</plurals>
<string name="widget_countdown_choose">Tocca per scegliere un evento per il conto alla rovescia</string>
<string name="widget_countdown_over">%1$s è terminato</string>
<string name="widget_config_countdown">Conto alla rovescia per</string>
<string name="widget_config_countdown_next">Prossimo evento</string>
<string name="widget_config_countdown_pinned">Evento selezionato</string>
<string name="widget_config_countdown_next_hint">Il prossimo evento con orario nei calendari di questo widget, o quello in corso. Gli eventi che durano tutto il giorno e quelli rifiutati non vengono considerati.</string>
<string name="widget_config_countdown_event">Evento</string>
<string name="widget_config_countdown_event_none">Nessuno scelto ancora</string>
<string name="widget_config_countdown_search">Cerca eventi</string>
<string name="widget_config_countdown_empty">Nessun evento nel prossimo anno corrisponde alla ricerca.</string>
<string name="widget_config_countdown_load_failed">Impossibile caricare i tuoi eventi.</string>
<string name="widget_config_countdown_repeats">%1$s · si ripete</string>
<string name="widget_month_day_label">Mese e giorno</string>
<string name="widget_month_day_description">Il mese e gli eventi del giorno che scegli</string>
<string name="widget_day_empty">Nessun evento</string>
<string name="widget_config_background">Sfondo</string>
<string name="widget_config_background_solid">Colore unico</string>
<string name="widget_config_background_tinted">Colorato</string>
<string name="widget_config_background_transparent">Trasparente</string>
<string name="widget_config_theme_follow_app">Usa le impostazioni dell’app</string>
<string name="widget_config_opacity">Opacità</string>
<string name="widget_config_invert_text">Inverti il colore del testo</string>
<string name="widget_config_invert_text_summary">Il testo chiaro su un tema scuro diventa scuro, e viceversa</string>
<string name="widget_config_readability_info">Informazioni sulla leggibilità</string>
<string name="widget_config_readability_hint">Con un’opacità bassa si vede lo sfondo del dispositivo attraverso il widget, quindi alcuni testi possono essere più difficili da leggere. In tal caso, aumenta l’opacità.</string>
<string name="widget_config_readability_hint_classic">Con un’opacità bassa lo sfondo del dispositivo traspare e alcuni testi possono essere difficili da leggere. In tal caso, aumenta l’opacità oppure inverti il colore del testo.</string>
<string name="widget_config_style">Stile</string>
<string name="widget_config_style_cards">Schede</string>
<string name="widget_config_style_classic">Classico</string>
<string name="widget_config_content">Contenuto</string>
<string name="widget_config_range">Intervallo di tempo</string>
<string name="widget_config_text_size">Dimensione del testo</string>
<string name="widget_config_load_failed">Impossibile leggere le impostazioni di questo widget.</string>
<string name="widget_config_preview_failed">Anteprima non disponibile</string>
<string name="widget_config_save_failed">Impossibile salvare il widget. Riprova.</string>
<string name="widget_numbered">%1$s %2$d</string>
<string name="widget_appearance_summary">%1$s · %2$s</string>
<string name="widget_config_calendars">Calendari</string>
<string name="widget_config_calendars_hint">I calendari mostrati da questo widget. I calendari che hai nascosto nell’app restano nascosti anche qui.</string>
<string name="widget_config_calendars_all">Tutti i calendari</string>
<plurals name="widget_config_calendars_some">
<item quantity="one">%1$d di %2$d calendario</item>
<item quantity="many">%1$d di %2$d calendari</item>
<item quantity="other">%1$d di %2$d calendari</item>
</plurals>
<string name="settings_month_start_times">Orari di inizio</string>
<string name="settings_month_start_times_summary">Mostra l’ora di inizio prima del titolo dell’evento quando c’è spazio</string>
<string name="widget_preview_sample_trip">Viaggio nel weekend</string>
<string name="widget_preview_sample_dentist">Dentista</string>
<string name="month_split_no_events_month">Niente in programma questo mese</string>
<string name="month_split_no_more_events">Nient’altro in programma questo mese</string>
<string name="settings_widgets_hint_legacy">Ogni widget ha il suo aspetto e le sue opzioni. Tocca un widget qui sotto per modificarlo. Per aggiungerne uno, tieni premuta la schermata Home.</string>
<string name="settings_widgets_placed">Sulla schermata Home</string>
<string name="settings_widgets_none">Nessun widget di Calendula nella schermata Home finora.</string>
</resources>
-26
View File
@@ -716,30 +716,4 @@
<string name="settings_visible_hours_end">Tot</string>
<string name="settings_visible_hours_start_hint">Het uur bovenaan het scherm bij het openen van de week-, meerdaagse of dagweergave. Eerdere uren blijven bereikbaar door te scrollen.</string>
<string name="settings_visible_hours_end_hint">Het uur onderaan het scherm bij het openen van een weergave. Latere uren blijven bereikbaar door te scrollen, en in- of uitzoomen met twee vingers geldt totdat de weergave opnieuw wordt geopend.</string>
<string name="event_resize_done">Gewijzigd naar %1$s</string>
<string name="event_resize_recurring_title">Terugkerende gebeurtenis wijzigen</string>
<string name="event_selection_actions">Acties voor gebeurtenis</string>
<string name="event_selection_hide">Acties voor gebeurtenis verbergen</string>
<string name="event_selection_close">Selectie van gebeurtenis opheffen</string>
<string name="event_draft_create">Gebeurtenis maken</string>
<string name="event_draft_discard">Nieuwe gebeurtenis verwerpen</string>
<string name="event_action_load_failed">Kan de gebeurtenis niet openen</string>
<string name="event_edit_more_actions">Meer acties</string>
<string name="event_edit_unsaved_title">Niet-opgeslagen wijzigingen</string>
<string name="event_edit_unsaved_save">Wijzigingen opslaan</string>
<string name="event_edit_unsaved_discard">Wijzigingen verwerpen</string>
<string name="event_edit_unsaved_keep">Verder bewerken</string>
<string name="event_edit_create">Maken</string>
<string name="settings_theme_black">Zwart</string>
<string name="settings_theme_black_summary">Donker met volledig zwarte achtergronden, voor AMOLED-schermen</string>
<string name="settings_events_header">Gebeurtenissen</string>
<string name="settings_tap_opens">Tikken op een gebeurtenis opent</string>
<string name="settings_tap_opens_details">Details</string>
<string name="settings_tap_opens_editor">Bewerkformulier</string>
<string name="settings_tap_opens_hint">Gebeurtenissen die je niet kunt bewerken en meldingen van herinneringen openen altijd de details.</string>
<string name="settings_support_kofi">Ko-fi</string>
<string name="settings_support_kofi_hint">Eenmalige bijdragen</string>
<string name="settings_support_liberapay">Liberapay</string>
<string name="settings_support_liberapay_hint">Terugkerende donaties</string>
<string name="process_text_create_event">Gebeurtenis maken</string>
</resources>
-28
View File
@@ -303,32 +303,4 @@
</plurals>
<string name="agenda_range_this_week">Tento týždeň</string>
<string name="agenda_range_custom">Vlastné…</string>
<string name="app_name_calendar_alias">Kalendár</string>
<string name="state_failure_permission_body">Calendula číta vaše udalosti priamo zo systémového kalendára. Aby ich mohla zobraziť, potrebuje prístup ku kalendáru.</string>
<string name="state_failure_no_calendars_body">Pridajte do tohto zariadenia kalendárny účet a jeho kalendáre sa tu zobrazia.</string>
<string name="state_failure_all_hidden_body">Zapnite aspoň jeden kalendár aby ste mohli pozerať udalosti.</string>
<string name="state_failure_no_import_target">Žiadny kalendár neumožňuje pridávať nové udalosti.</string>
<string name="state_failure_no_import_target_body">Zapnuté kalendáre sú iba na čítanie, spravuje ich iná aplikácia alebo nie sú synchronizované s týmto zariadením. Zapnite kalendár do ktorého sa dajú pridávať udalosti alebo pridajte lokálny kalendár.</string>
<string name="state_failure_event_not_found">Táto udalosť sa tu už nenachádza.</string>
<string name="state_failure_event_not_found_body">Bola možno zmazaná alebo presunutá do kalendára, ktorý je vypnutý.</string>
<string name="state_failure_provider_body">Systémový kalendár neodpovedal. Skúste to znovu za chvíľu.</string>
<string name="month_open_week">Otvoriť týždeň %1$d</string>
<string name="month_split_clear_filter">Zobraziť agendu pre celý mesiac</string>
<string name="timeline_earlier_events">Skoršie udalosti</string>
<string name="timeline_later_events">Neskoršie udalosti</string>
<string name="event_resize_done">Zmenené na %1$s</string>
<string name="event_resize_recurring_title">Zmeniť opakujúcu sa udalosť</string>
<string name="event_selection_actions">Akcie udalostí</string>
<string name="event_selection_hide">Schovať akcie udalostí</string>
<string name="event_selection_close">Zrušiť výber udalosti</string>
<string name="event_draft_create">Vytvoriť udalosť</string>
<string name="event_draft_discard">Zahodiť novú udalosť</string>
<string name="event_action_load_failed">Udalosť sa nepodarilo otvoriť</string>
<string name="event_move_stale">Tá udalosť sa presunula skôr, ako sa stihlo uložiť vaše vloženie</string>
<string name="event_move_queue_full">Priveľa presunov naraz, tento sa neuložil</string>
<string name="event_move_skipped">Presuny vykonané keď bola otázka otvorená sa neuložii</string>
<string name="event_move_blocked_cancelled_series">Zrušená séria sa môže presunúť iba ako celok a to by zmenilo dni na ktoré spadá</string>
<string name="event_edit_more_actions">Ďalšie akcie</string>
<string name="event_edit_unsaved_title">Neuložené zmeny</string>
<string name="event_edit_unsaved_save">Uložiť zmeny</string>
</resources>
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="backup_interval_units">
<item>Minutes</item>
<item>Hours</item>
<item>Days</item>
<item>Weeks</item>
</string-array>
<string name="app_tagline">一個現代的行事曆。</string>
<string name="app_name_calendar_alias">行事曆</string>
<string name="state_loading">加載中……</string>
<string name="state_retry">重試</string>
<string name="state_failure_unknown">出錯了。</string>
<string name="state_failure_permission">需使用行事曆。</string>
<string name="state_failure_permission_body">Calendula會直接從系統行事曆讀取你的活動,即需要有行事曆存取才能顯示行程。</string>
<string name="state_failure_permission_action">授權進入</string>
<string name="state_failure_no_calendars">無設定行事曆。</string>
<string name="state_failure_no_calendars_body">在這台裝置新增行事曆帳號,行程將會顯示在這。</string>
<string name="state_failure_no_calendars_action">開放系統行事曆設定</string>
<string name="state_failure_all_hidden">你所有的行事曆都關閉了。</string>
<string name="state_failure_all_hidden_body">至少開啟一項行事曆以查看其活動。</string>
<string name="state_failure_all_hidden_action">管理行事曆</string>
<string name="state_failure_no_import_target">沒有一個行事曆能加入新行程。</string>
<string name="state_failure_no_import_target_body">被開啟的行事曆是唯讀的、由其他應用程式管理,或未與此裝置同步。開啟一個可以記錄活動的行事曆或新增一個本地活動。</string>
<string name="state_failure_event_not_found">該事項已不存在。</string>
<string name="state_failure_event_not_found_body">可能被刪除或被關閉。</string>
<string name="state_failure_provider">無法識別該行事曆。</string>
</resources>
-19
View File
@@ -110,11 +110,7 @@
<string name="event_move_failed">Couldn\'t move the event</string>
<string name="event_move_write_denied">Calendula needs write access to move events</string>
<string name="event_move_gone">That event no longer exists</string>
<string name="event_move_stale">That event moved before your drop could be saved</string>
<string name="event_move_queue_full">Too many moves at once, so that one wasn\'t saved</string>
<string name="event_move_skipped">Moves made while the question was open weren\'t saved</string>
<string name="event_move_blocked_series_end">Can\'t move an event past the end of its series</string>
<string name="event_move_blocked_cancelled_series">A cancelled series can only move as a whole, and this would change which days it falls on</string>
<string name="dialog_cancel">Cancel</string>
<string name="dialog_ok">OK</string>
@@ -158,7 +154,6 @@
<string name="reminder_unit_days">days</string>
<string name="reminder_unit_weeks">weeks</string>
<string name="event_edit_availability">Availability</string>
<string name="event_edit_status">Status</string>
<string name="event_edit_visibility">Visibility</string>
<!-- Event form — time zone -->
@@ -257,7 +252,6 @@
<!-- Event detail — full read (v0.6) -->
<string name="event_detail_reminders">Reminders</string>
<string name="event_detail_timezone">Time zone</string>
<string name="event_status_confirmed">Confirmed</string>
<string name="event_status_tentative">Tentative</string>
<string name="event_status_cancelled">Cancelled</string>
<string name="event_availability_free">Free</string>
@@ -520,15 +514,6 @@
<string name="widget_config_background_tinted">Tinted</string>
<string name="widget_config_background_transparent">Transparent</string>
<string name="widget_config_theme_follow_app">Follow app</string>
<string name="widget_config_opacity">Opacity</string>
<string name="widget_config_invert_text">Invert text colour</string>
<string name="widget_config_invert_text_summary">Light text on a dark theme turns dark, and the other way round</string>
<string name="widget_config_readability_info">About readability</string>
<string name="widget_config_readability_hint">At low opacity the wallpaper shows through, so some text may be harder to read. Raise the opacity if it is.</string>
<string name="widget_config_readability_hint_classic">At low opacity the wallpaper shows through, so some text may be hard to read. If it is, raise the opacity or invert the text colour.</string>
<string name="widget_config_style">Style</string>
<string name="widget_config_style_cards">Cards</string>
<string name="widget_config_style_classic">Classic</string>
<string name="widget_config_content">Content</string>
<string name="widget_config_range">Time range</string>
<string name="widget_config_text_size">Text size</string>
@@ -590,8 +575,6 @@
<string name="settings_week_start_auto_summary">Currently %1$s</string>
<string name="settings_week_numbers">Week numbers</string>
<string name="settings_week_numbers_summary">Show calendar-week numbers in month view</string>
<string name="settings_month_start_times">Start times</string>
<string name="settings_month_start_times_summary">Show the start time before an event\'s title when there is room</string>
<string name="settings_today_toolbar">Today button in toolbar</string>
<string name="settings_today_toolbar_summary">Show a jump-to-today button in the toolbar instead of a floating button</string>
<string name="settings_app_name">App name</string>
@@ -694,8 +677,6 @@
<string name="month_style_split">Split</string>
<string name="month_style_split_summary">A compact grid marks the days that have events, and the day you tap is listed underneath.</string>
<string name="month_split_no_events">Nothing scheduled</string>
<string name="month_split_no_events_month">Nothing scheduled this month</string>
<string name="month_split_no_more_events">Nothing else scheduled this month</string>
<string name="month_split_expand">Show the whole month</string>
<string name="month_split_collapse">Show the day\'s events</string>
<string name="settings_quick_switch_header">Quick-switch button</string>
Loaded 100 of 232 files, more files were not shown because too many files have changed in this diff. Show more