Compare commits

..

5 Commits

Author SHA1 Message Date
Jean-Luc Makiola
7e8119be02 Hide the quick-switch button below two views (#150) (#221)
Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/221
2026-08-18 17:14:43 +02:00
Jean-Luc Makiola
7e843aa740 Drop the ellipsis in week and day event chips too (#164) (#222)
Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/222
2026-08-18 17:14:12 +02:00
9775e0a652 Drop the ellipsis in week and day event chips too (#164)
#183 only covered the month grid, but a week column is just as narrow. The
all-day chips and the drag copy take the same treatment; the timed blocks
only when they are showing a single line, since wrapping needs softWrap on
and clipping with it on breaks at the last whole word.

The rule now lives in one helper instead of being copied per chip.
2026-08-18 15:57:17 +02:00
2cf7d590bd Hide the quick-switch button below two views (#150)
The pill only appears with something to switch between, so one enabled view
hides it just like zero. The floor that blocked disabling is gone from both
the settings screen and the view model.
2026-08-18 15:52:39 +02:00
Jean-Luc Makiola
8c76cbdf5e Show as much of a month event title as fits (#164) (#183)
Month-view event titles no longer truncate with "…". `MonthBar` — the single
chip renderer for every month style and for the drag's floating copy — now uses
`TextOverflow.Clip` with `softWrap = false`, so a title runs to the chip's edge
and clips mid-glyph instead of spending two characters' width on an ellipsis.

`softWrap = false` is load-bearing: `Clip` on its own still breaks a `maxLines = 1`
line at the last whole word, so "Team standup meeting" would render as "Team" —
less title than the ellipsis showed, not more.

Deviation from the issue: right-to-left layouts keep the ellipsis. With
`softWrap` off Compose lays the line out at its full intrinsic width and clips to
the node's left edge, which in RTL is the *end* of the string — an Arabic title
would have lost its beginning. `Ellipsis` truncates at the logical end in both
directions, so RTL keeps it.

The Glance month widget needs nothing: its `Text` has no overflow parameter, and
a RemoteViews `TextView` with `maxLines = 1` and no ellipsize already clips.

Closes #164

Co-authored-by: Jean-Luc Makiola <business@jeanlucmakiola.de>
Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/183
2026-08-13 15:26:31 +02:00
48 changed files with 324 additions and 1271 deletions

View File

@@ -7,40 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.19.2] — 2026-08-17
### Changed
- **A meeting you declined is now struck through** wherever it appears — month,
week, day, agenda, search and both widgets — and no longer schedules a
reminder. Declining an invitation in Google Calendar left the event looking
like any other in Calendula, and it still notified you about a meeting you had
said no to. It stays visible rather than disappearing: the organiser still
expects an answer from you, and the slot is still spoken for ([#180]).
### Fixed
- **Tapping an event in month view opens the event**, not the day it sits on.
Every month style is affected — page, rolling, seamless weeks — and until now
the only way to reach an event from the month was to open its day first and
find it again there. Tapping anywhere else in the cell still opens the day
([#187]).
- **An edit made to an event now shows the moment you re-open it.** Adding a
description to an event and opening it again showed the sheet as it was before
the save, because the detail was only re-read when a different occurrence was
opened ([#196]).
- **The month widget's arrows stopped working after a couple of taps.** The grid
was serialised as roughly 740 views, and one update ran to half a megabyte —
more than the launcher's buffer takes. The third update overran it, and Android
responded by dropping the whole widget host, which killed updates for *every*
widget on the home screen, ours and other apps', until the launcher rebound.
The grid now draws 192 views, and a resized widget reflows to its new size
instead of clipping ([#214]).
- Tapping a widget's refresh or month arrows redraws that widget by its own id
instead of asking Android to update all of them, which does nothing in a
process the tap has just woken from cold ([#18]).
- **Jump-to-today in seamless weeks lands on the current week** instead of
leaving a sliver of the previous row on screen ([#191]).
- Day and week view no longer run their events flush against the right edge
([#192]).
- Month-view event titles no longer end in an ellipsis. The "…" took the width
of a couple of characters and told you nothing you couldn't already see, so
the title now simply runs to the edge of its chip — a few more letters per
cell, which is often the difference between two events you can tell apart and
two you can't ([#164]).
## [2.19.1] — 2026-08-11
@@ -1449,9 +1421,4 @@ automatically, with zero telemetry and no internet permission.
[#123]: https://codeberg.org/jlmakiola/calendula/issues/123
[#163]: https://codeberg.org/jlmakiola/calendula/issues/163
[#173]: https://codeberg.org/jlmakiola/calendula/issues/173
[#180]: https://codeberg.org/jlmakiola/calendula/issues/180
[#187]: https://codeberg.org/jlmakiola/calendula/issues/187
[#191]: https://codeberg.org/jlmakiola/calendula/issues/191
[#192]: https://codeberg.org/jlmakiola/calendula/issues/192
[#196]: https://codeberg.org/jlmakiola/calendula/issues/196
[#214]: https://codeberg.org/jlmakiola/calendula/issues/214
[#164]: https://codeberg.org/jlmakiola/calendula/issues/164

View File

@@ -28,8 +28,8 @@ android {
// which builds this version and then creates the matching vX.Y.Z tag +
// release itself (versionCode is pinned to MAJOR*10000 + MINOR*100 +
// PATCH from versionName, e.g. 2.7.2 -> 20702). See docs/RELEASING.md.
versionCode = 21902
versionName = "2.19.2"
versionCode = 21901
versionName = "2.19.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

View File

@@ -1,7 +1,6 @@
package de.jeanlucmakiola.calendula.data.calendar
import de.jeanlucmakiola.floret.time.toKotlinInstantFromEpochMillis
import android.provider.CalendarContract
import android.util.Log
import de.jeanlucmakiola.calendula.domain.EventInstance
@@ -39,7 +38,5 @@ internal fun ColumnReader.toEventInstance(): EventInstance? {
isAllDay = getInt(InstanceProjection.IDX_ALL_DAY) != 0,
color = color,
location = getString(InstanceProjection.IDX_LOCATION),
isDeclined = getInt(InstanceProjection.IDX_SELF_ATTENDEE_STATUS) ==
CalendarContract.Attendees.ATTENDEE_STATUS_DECLINED,
)
}

View File

@@ -52,7 +52,6 @@ internal object InstanceProjection {
CalendarContract.Instances.EVENT_COLOR,
CalendarContract.Instances.CALENDAR_COLOR,
CalendarContract.Instances.EVENT_LOCATION,
CalendarContract.Instances.SELF_ATTENDEE_STATUS,
)
const val IDX_INSTANCE_ID = 0
@@ -65,7 +64,6 @@ internal object InstanceProjection {
const val IDX_EVENT_COLOR = 7
const val IDX_CALENDAR_COLOR = 8
const val IDX_LOCATION = 9
const val IDX_SELF_ATTENDEE_STATUS = 10
}
internal object EventDetailProjection {
@@ -184,7 +182,6 @@ internal object SearchProjection {
CalendarContract.Events.RDATE,
// Excerpted, not just filtered on: a hit has to show what it matched.
CalendarContract.Events.DESCRIPTION,
CalendarContract.Events.SELF_ATTENDEE_STATUS,
)
const val IDX_ID = 0
@@ -200,7 +197,6 @@ internal object SearchProjection {
const val IDX_RRULE = 10
const val IDX_RDATE = 11
const val IDX_DESCRIPTION = 12
const val IDX_SELF_ATTENDEE_STATUS = 13
}
/**

View File

@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.data.calendar
import android.provider.CalendarContract
import de.jeanlucmakiola.floret.time.toKotlinInstantFromEpochMillis
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.ics.parseRfc2445DurationMillis
@@ -43,7 +42,5 @@ internal fun ColumnReader.toSearchResult(): EventInstance? {
location = getString(SearchProjection.IDX_LOCATION),
isRecurring = !getString(SearchProjection.IDX_RRULE).isNullOrEmpty() ||
!getString(SearchProjection.IDX_RDATE).isNullOrEmpty(),
isDeclined = getInt(SearchProjection.IDX_SELF_ATTENDEE_STATUS) ==
CalendarContract.Attendees.ATTENDEE_STATUS_DECLINED,
)
}

View File

@@ -44,16 +44,9 @@ class ProviderReminderInstanceSource @Inject constructor(
// `visible` is the flag the app's one visibility model writes (#75).
// The status clause mirrors CalendarDataSource.instances: NULL means
// "normal", so a bare `!= CANCELED` would drop every ordinary event.
// An invitation the user declined is answered — it stays on the calendar
// struck through, but it plans nothing (#180). NULL again means "no
// answer recorded", which is not a "no".
val selection = "${CalendarContract.Calendars.VISIBLE} = 1 AND " +
"(${CalendarContract.Instances.STATUS} IS NULL OR " +
"${CalendarContract.Instances.STATUS} != " +
"${CalendarContract.Events.STATUS_CANCELED}) AND " +
"(${CalendarContract.Instances.SELF_ATTENDEE_STATUS} IS NULL OR " +
"${CalendarContract.Instances.SELF_ATTENDEE_STATUS} != " +
"${CalendarContract.Attendees.ATTENDEE_STATUS_DECLINED})"
"${CalendarContract.Instances.STATUS} != ${CalendarContract.Events.STATUS_CANCELED})"
return context.contentResolver.query(
uri, OCCURRENCE_PROJECTION, selection, null, null,
)?.use { c ->

View File

@@ -67,13 +67,6 @@ data class EventInstance(
* Instances query already yields one row per occurrence.
*/
val isRecurring: Boolean = false,
/**
* This device user answered "no" to the invitation
* (`Events.SELF_ATTENDEE_STATUS`). The event stays on the calendar — it is
* still an appointment someone expects an answer about — but every surface
* strikes it through, and it plans no reminders (#180).
*/
val isDeclined: Boolean = false,
)
/**

View File

@@ -24,13 +24,11 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
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.ui.common.EventDimAlpha
import de.jeanlucmakiola.calendula.ui.common.declinedTitle
import de.jeanlucmakiola.calendula.ui.common.LocalSoftenColors
import de.jeanlucmakiola.calendula.ui.common.LocalUse24HourFormat
import de.jeanlucmakiola.calendula.ui.common.eventAccent
@@ -131,8 +129,8 @@ 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.isDeclined),
summary = AnnotatedString(agendaTimeSummary(event, day, zone)),
title = title,
summary = agendaTimeSummary(event, day, zone),
position = position,
minHeight = 64.dp,
leading = {

View File

@@ -135,6 +135,7 @@ fun AgendaScreen(
AgendaTopBar(
selectedView = selectedView,
onCycleView = { onSelectView(selectedView.next(quickSwitchViews)) },
quickSwitchViews = quickSwitchViews,
onOpenDrawer = { scope.launch { drawerState.open() } },
onOpenSearch = onOpenSearch,
showTodayButton = todayInToolbar,
@@ -409,6 +410,7 @@ private fun AgendaEmpty(modifier: Modifier = Modifier) {
private fun AgendaTopBar(
selectedView: CalendarView,
onCycleView: () -> Unit,
quickSwitchViews: List<CalendarView>,
onOpenDrawer: () -> Unit,
onOpenSearch: () -> Unit,
showTodayButton: Boolean,
@@ -440,6 +442,7 @@ private fun AgendaTopBar(
}
ViewSwitcherPill(
current = selectedView,
cycle = quickSwitchViews,
onCycle = onCycleView,
modifier = Modifier.padding(end = 8.dp),
)

View File

@@ -57,7 +57,8 @@ fun CalendarView.next(available: List<CalendarView> = IMPLEMENTED_VIEWS): Calend
* implemented view — the settings screen reorders the whole set — while [cycle]
* is the subset the pill actually steps through, in [order]. The navigation
* drawer keeps its own separate order and always lists every view, so a view
* disabled here stays reachable there.
* disabled here stays reachable there — including when [cycle] is emptied and
* the pill disappears altogether.
*/
data class QuickSwitchConfig(
val order: List<CalendarView>,
@@ -67,14 +68,15 @@ data class QuickSwitchConfig(
val cycle: List<CalendarView> get() = order.filter { it in enabled }
companion object {
/**
* Fewest views that keep the switch meaningful. A single target is not a
* switch, so below this the pill is hidden rather than special-cased (#150);
* the drawer still reaches every view.
*/
const val MIN_CYCLE = 2
/** All views, in default order, all enabled. */
val Default = QuickSwitchConfig(IMPLEMENTED_VIEWS, IMPLEMENTED_VIEWS.toSet())
/**
* Fewest views that keep the switch meaningful — a "switch" needs at
* least two targets, so the settings screen blocks disabling below this.
*/
const val MIN_ENABLED = 2
}
}

View File

@@ -0,0 +1,39 @@
package de.jeanlucmakiola.calendula.ui.common
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.LayoutDirection
/** How an event chip's title should overflow: what to pass to `Text`. */
data class EventTitleOverflow(val overflow: TextOverflow, val softWrap: Boolean)
/**
* Overflow for an event chip's title (#164). Chips are narrow enough that the
* "…" costs a couple of readable characters, so the title runs to the chip's
* edge and clips mid-glyph instead.
*
* Two cases keep the ellipsis:
*
* - **[rtl].** With `softWrap` off Compose lays the line out at its full
* intrinsic width and clips to the node's left edge, which in RTL is the *end*
* of the string — an Arabic title would lose its beginning. The ellipsis
* truncates at the logical end in both directions.
* - **More than one line** ([singleLine] false). Wrapping needs `softWrap` on,
* and clipping with it on breaks the last line at the last whole word — less
* title than the ellipsis showed, not more.
*/
fun eventTitleOverflowFor(rtl: Boolean, singleLine: Boolean): EventTitleOverflow =
if (rtl || !singleLine) {
EventTitleOverflow(TextOverflow.Ellipsis, softWrap = true)
} else {
EventTitleOverflow(TextOverflow.Clip, softWrap = false)
}
/** [eventTitleOverflowFor] against the current layout direction. */
@Composable
fun eventTitleOverflow(singleLine: Boolean = true): EventTitleOverflow =
eventTitleOverflowFor(
rtl = LocalLayoutDirection.current == LayoutDirection.Rtl,
singleLine = singleLine,
)

View File

@@ -36,14 +36,6 @@ val GUTTER_WIDTH = 48.dp
*/
val GUTTER_CONTENT_START_INSET = 8.dp
/**
* End inset for everything that lines up with the day columns — the week's day
* header, the all-day strip and the timeline itself. Without it the last column
* runs flush into the screen edge while the gutter gives the other side room
* (#192); 8dp mirrors [GUTTER_CONTENT_START_INSET].
*/
val TIMELINE_CONTENT_END_INSET = 8.dp
private val BADGE_HEIGHT = 20.dp
/** How far the fixed hour labels recede while a block is being dragged. */

View File

@@ -1,10 +1,6 @@
package de.jeanlucmakiola.calendula.ui.common
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.style.TextDecoration
import kotlin.time.Instant
/**
@@ -18,30 +14,3 @@ val LocalDimCutoff = compositionLocalOf<Instant?> { null }
/** Opacity applied to a completed/past event chip when it is dimmed. */
const val EventDimAlpha = 0.4f
/**
* How a declined invitation's title is struck through (#180) — the mark every
* surface uses to say "you answered no", chosen over hiding the event because it
* is still something the organiser expects you at. Null for everything else, so
* it drops straight into a `Text`'s `textDecoration`.
*/
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, 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, isDeclined: Boolean): AnnotatedString =
if (!isDeclined) {
title
} else {
buildAnnotatedString {
append(title)
addStyle(SpanStyle(textDecoration = TextDecoration.LineThrough), 0, title.length)
}
}

View File

@@ -464,11 +464,13 @@ fun TimelineDragOverlay(controller: TimelineDragController, modifier: Modifier =
.padding(horizontal = 4.dp, vertical = 2.dp),
) {
Column {
val titleOverflow = eventTitleOverflow()
Text(
text = title,
style = MaterialTheme.typography.labelMedium,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
overflow = titleOverflow.overflow,
softWrap = titleOverflow.softWrap,
color = eventInk(fill, alpha = 0.85f),
)
Text(

View File

@@ -10,13 +10,19 @@ import androidx.compose.ui.res.stringResource
/**
* Top-bar pill that shows the current view and cycles to the next one on tap
* (spec M1: Month → Week → Day → Month, restricted to [IMPLEMENTED_VIEWS]).
*
* Renders nothing when [cycle] holds fewer than [QuickSwitchConfig.MIN_CYCLE]
* views (#150), so it drops straight into an app bar's `actions` slot without a
* wrapping condition — the same way [TodayAction] handles being turned off.
*/
@Composable
fun ViewSwitcherPill(
current: CalendarView,
cycle: List<CalendarView>,
onCycle: () -> Unit,
modifier: Modifier = Modifier,
) {
if (cycle.size < QuickSwitchConfig.MIN_CYCLE) return
FilledTonalButton(
onClick = onCycle,
shape = MaterialTheme.shapes.large,

View File

@@ -65,7 +65,6 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
@@ -94,6 +93,7 @@ import de.jeanlucmakiola.calendula.ui.common.TimelineDrop
import de.jeanlucmakiola.calendula.ui.common.beginsOn
import de.jeanlucmakiola.calendula.ui.common.eventDragAllowed
import de.jeanlucmakiola.calendula.ui.common.eventMoveAction
import de.jeanlucmakiola.calendula.ui.common.eventTitleOverflow
import de.jeanlucmakiola.calendula.ui.common.rememberEventDragSource
import de.jeanlucmakiola.calendula.ui.common.rememberTimelineDragController
import de.jeanlucmakiola.calendula.ui.common.startInstant
@@ -106,7 +106,6 @@ import de.jeanlucmakiola.calendula.ui.common.next
import de.jeanlucmakiola.calendula.ui.common.LocalSoftenColors
import de.jeanlucmakiola.calendula.ui.common.eventFill
import de.jeanlucmakiola.calendula.ui.common.eventInk
import de.jeanlucmakiola.calendula.ui.common.declinedDecoration
import de.jeanlucmakiola.calendula.ui.common.rememberCalendarSlideSpec
import de.jeanlucmakiola.floret.locale.currentLocale
import de.jeanlucmakiola.calendula.ui.common.LocalUse24HourFormat
@@ -119,7 +118,6 @@ import de.jeanlucmakiola.calendula.ui.common.rememberTimelinePinchZoom
import de.jeanlucmakiola.calendula.ui.common.formatMinuteOfDay
import de.jeanlucmakiola.calendula.ui.common.GUTTER_WIDTH
import de.jeanlucmakiola.calendula.ui.common.HourGutter
import de.jeanlucmakiola.calendula.ui.common.TIMELINE_CONTENT_END_INSET
import de.jeanlucmakiola.calendula.ui.common.hourSeparatorLines
import de.jeanlucmakiola.calendula.ui.common.tappedMinuteOfDay
import de.jeanlucmakiola.calendula.ui.week.TimedBlock
@@ -245,6 +243,7 @@ fun DayScreen(
currentYear = currentYear,
selectedView = selectedView,
onCycleView = { onSelectView(selectedView.next(quickSwitchViews)) },
quickSwitchViews = quickSwitchViews,
onOpenDrawer = { scope.launch { drawerState.open() } },
onOpenSearch = onOpenSearch,
onJumpToDate = jumpToDate,
@@ -413,6 +412,7 @@ private fun DayTopBar(
currentYear: Int,
selectedView: CalendarView,
onCycleView: () -> Unit,
quickSwitchViews: List<CalendarView>,
onOpenDrawer: () -> Unit,
onOpenSearch: () -> Unit,
onJumpToDate: (LocalDate) -> Unit,
@@ -447,6 +447,7 @@ private fun DayTopBar(
}
ViewSwitcherPill(
current = selectedView,
cycle = quickSwitchViews,
onCycle = onCycleView,
modifier = Modifier.padding(end = 8.dp),
)
@@ -473,11 +474,7 @@ private fun AllDayStrip(
// Height is hoisted + animated so it resizes smoothly; padding sits
// inside it so the content area is lanes * row height.
.height(height)
.padding(
top = ALL_DAY_VERTICAL_PADDING,
bottom = ALL_DAY_VERTICAL_PADDING,
end = TIMELINE_CONTENT_END_INSET,
),
.padding(vertical = ALL_DAY_VERTICAL_PADDING),
) {
// Keep the gutter-width offset so the bars line up with the day column.
Spacer(Modifier.width(GUTTER_WIDTH))
@@ -525,13 +522,14 @@ private fun AllDayBar(
.semantics { contentDescription = title },
contentAlignment = Alignment.CenterStart,
) {
val titleOverflow = eventTitleOverflow()
Text(
text = title,
style = MaterialTheme.typography.labelSmall,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
overflow = titleOverflow.overflow,
softWrap = titleOverflow.softWrap,
color = eventInk(fill),
textDecoration = declinedDecoration(event.isDeclined),
)
}
}
@@ -577,7 +575,6 @@ private fun Timeline(
modifier = Modifier
.weight(1f)
.fillMaxHeight()
.padding(end = TIMELINE_CONTENT_END_INSET)
.clip(RoundedCornerShape(16.dp))
.verticalScroll(scrollState)
.onGloballyPositioned { dragController.geometry.viewport = it },
@@ -774,13 +771,14 @@ private fun EventBlock(
) {
Column {
if (showTitle) {
val titleOverflow = eventTitleOverflow(singleLine = showTime)
Text(
text = title,
style = MaterialTheme.typography.labelMedium,
maxLines = if (showTime) 1 else 2,
overflow = TextOverflow.Ellipsis,
overflow = titleOverflow.overflow,
softWrap = titleOverflow.softWrap,
color = eventInk(fill, alpha = 0.85f),
textDecoration = declinedDecoration(block.event.isDeclined),
)
}
if (showTime) {
@@ -801,12 +799,7 @@ private fun DayLoading() {
// Same scale resolution as the loaded timeline, so the skeleton's column
// doesn't resize the moment the real day arrives.
val totalHeight = scale.hourHeight(maxHeight) * 24
Row(
modifier = Modifier
.fillMaxSize()
.padding(end = TIMELINE_CONTENT_END_INSET)
.verticalScroll(scrollState),
) {
Row(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) {
Spacer(Modifier.width(GUTTER_WIDTH))
Box(
modifier = Modifier

View File

@@ -48,14 +48,9 @@ class EventDetailViewModel @Inject constructor(
) : ViewModel() {
private val _target = MutableStateFlow<Target?>(null)
// Bumped by retry() and by re-opening the target already shown, to re-run
// the load without changing the target.
// Bumped by retry() to re-run the load for the same target.
private val _reload = MutableStateFlow(0)
// Last target whose content is already on screen; a re-read of it skips the
// Loading skeleton so the sheet doesn't blank out between two identical reads.
private var loadedTarget: Target? = null
private val _deleteState = MutableStateFlow<DeleteUiState>(DeleteUiState.Idle)
val deleteState: StateFlow<DeleteUiState> = _deleteState.asStateFlow()
@@ -63,14 +58,11 @@ class EventDetailViewModel @Inject constructor(
combine(_target, _reload) { target, _ -> target }
.flatMapLatest { target ->
if (target == null) {
loadedTarget = null
flowOf<EventDetailUiState>(EventDetailUiState.Loading)
} else {
flow {
if (loadedTarget != target) emit(EventDetailUiState.Loading)
val loaded = loadDetail(target)
loadedTarget = target.takeIf { loaded is EventDetailUiState.Success }
emit(loaded)
emit(EventDetailUiState.Loading)
emit(loadDetail(target))
}
}
}
@@ -86,15 +78,9 @@ class EventDetailViewModel @Inject constructor(
* the occurrence's own times (from `CalendarContract.Instances`); they
* override the series DTSTART/DTEND so recurring events show the correct
* date instead of the first occurrence.
*
* Re-opening the *same* occurrence always re-reads it. The view model
* outlives the sheet, and a `StateFlow` conflates an identical value away,
* so assigning the target alone would leave an edit that changed no time —
* adding a description, say (#196) — showing the state from before the save.
*/
fun open(eventId: Long, beginMillis: Long, endMillis: Long) {
val target = Target(eventId, beginMillis, endMillis)
if (_target.value == target) _reload.value += 1 else _target.value = target
_target.value = Target(eventId, beginMillis, endMillis)
}
/** Re-run the current load after a failure. */

View File

@@ -19,8 +19,6 @@ import androidx.compose.animation.togetherWith
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.awaitEachGesture
import androidx.compose.foundation.gestures.awaitFirstDown
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
@@ -91,6 +89,7 @@ import androidx.compose.ui.geometry.Offset
import kotlin.math.roundToInt
import de.jeanlucmakiola.calendula.ui.common.rememberDragSurface
import de.jeanlucmakiola.calendula.ui.common.eventMoveAction
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
@@ -113,7 +112,6 @@ import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.input.pointer.PointerEventPass
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
@@ -141,7 +139,6 @@ import de.jeanlucmakiola.calendula.ui.common.CALENDAR_SWIPE_THRESHOLD
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.IMPLEMENTED_VIEWS
import de.jeanlucmakiola.calendula.ui.common.EventDimAlpha
import de.jeanlucmakiola.calendula.ui.common.declinedDecoration
import de.jeanlucmakiola.calendula.ui.common.LocalDimCutoff
import de.jeanlucmakiola.calendula.ui.common.LocalSoftenColors
import de.jeanlucmakiola.calendula.ui.common.eventAccent
@@ -390,6 +387,7 @@ fun MonthScreen(
titleDate = LocalDate(titleMonth.year, titleMonth.month, 1),
selectedView = selectedView,
onCycleView = { onSelectView(selectedView.next(quickSwitchViews)) },
quickSwitchViews = quickSwitchViews,
onOpenDrawer = { scope.launch { drawerState.open() } },
onOpenSearch = onOpenSearch,
onJumpToDate = jumpToDate,
@@ -443,7 +441,6 @@ fun MonthScreen(
showWeekNumbers = showWeekNumbers,
onRetry = jumpToToday,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
} else if (viewStyle == MonthViewStyle.Split) {
SplitMonthContent(
@@ -468,7 +465,6 @@ fun MonthScreen(
onSwipePrev = goPrev,
onRetry = jumpToToday,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
}
}
@@ -579,7 +575,6 @@ private fun MonthContent(
onSwipePrev: () -> Unit,
onRetry: () -> Unit,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
) {
val slideSpec = rememberCalendarSlideSpec()
val fadeSpec = rememberCalendarFadeSpec()
@@ -606,7 +601,6 @@ private fun MonthContent(
state = s,
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
}
}
@@ -625,7 +619,6 @@ private fun ContinuousMonthContent(
showWeekNumbers: Boolean,
onRetry: () -> Unit,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
) {
when (state) {
// The scrolling styles get their own skeleton rather than the paged
@@ -640,7 +633,6 @@ private fun ContinuousMonthContent(
listState = listState,
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
} else {
ContinuousMonthGrid(
@@ -648,7 +640,6 @@ private fun ContinuousMonthContent(
listState = listState,
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
}
}
@@ -661,6 +652,7 @@ private fun MonthTopBar(
titleDate: LocalDate,
selectedView: CalendarView,
onCycleView: () -> Unit,
quickSwitchViews: List<CalendarView>,
onOpenDrawer: () -> Unit,
onOpenSearch: () -> Unit,
onJumpToDate: (LocalDate) -> Unit,
@@ -694,6 +686,7 @@ private fun MonthTopBar(
}
ViewSwitcherPill(
current = selectedView,
cycle = quickSwitchViews,
onCycle = onCycleView,
modifier = Modifier.padding(end = 8.dp),
)
@@ -747,8 +740,7 @@ private val CELL_SHAPE = RoundedCornerShape(CELL_CORNER)
/** Width of the split style's selected-day outline. */
private val SPLIT_SELECTION_STROKE = 1.5.dp
/** Lanes of bars/pills a day cell draws before the rest become overflow dots. */
internal const val MAX_EVENT_ROWS = 3
private const val MAX_EVENT_ROWS = 3
/**
* Row height in the continuous grid. The paged grid divides the viewport between
@@ -766,15 +758,11 @@ private val CONTINUOUS_ROW_HEIGHT = 112.dp
*/
private val CONTINUOUS_MONTH_GAP = 20.dp
/** Gap between the weekday header and the seamless stream's first week row. */
private val DENSE_HEADER_GAP = 4.dp
@Composable
internal fun MonthGrid(
state: MonthUiState.Success,
showWeekNumbers: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
/** See [MonthWeekRow]'s `selected`: an anchor for the morph, never a mark. */
selected: LocalDate? = null,
) {
@@ -795,7 +783,6 @@ internal fun MonthGrid(
inMonth = { it.month == month.month && it.year == month.year },
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
selected = selected,
modifier = Modifier
.fillMaxWidth()
@@ -826,7 +813,6 @@ internal fun ContinuousMonthGrid(
listState: LazyListState,
showWeekNumbers: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
modifier: Modifier = Modifier,
) {
val monthCount = remember { continuousMonthCount() }
@@ -854,7 +840,6 @@ internal fun ContinuousMonthGrid(
today = state.today,
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
)
}
}
@@ -874,7 +859,6 @@ private fun ContinuousMonthBlock(
today: LocalDate,
showWeekNumbers: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
) {
val rowCount = remember(month, weekStart) { weekRowsInMonth(month, weekStart) }
Column(
@@ -897,7 +881,6 @@ private fun ContinuousMonthBlock(
blankOutside = true,
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
modifier = Modifier
.fillMaxWidth()
.height(CONTINUOUS_ROW_HEIGHT),
@@ -956,7 +939,6 @@ internal fun DenseMonthGrid(
listState: LazyListState,
showWeekNumbers: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
modifier: Modifier = Modifier,
) {
val weekCount = remember(state.weekStart) { continuousWeekCount(state.weekStart) }
@@ -964,15 +946,10 @@ internal fun DenseMonthGrid(
state = listState,
modifier = modifier
.fillMaxSize()
// The gap under the weekday header is a real margin, not content
// padding: a lazy list scrolls its rows *through* the before-content
// padding, so scrolling to a week landed its row that far down with
// the tail of the previous one showing above it (#191).
.padding(horizontal = 8.dp)
.padding(top = DENSE_HEADER_GAP),
.padding(horizontal = 8.dp),
verticalArrangement = Arrangement.spacedBy(2.dp),
// Bottom inset clears the FAB stack so the last row stays tappable.
contentPadding = PaddingValues(bottom = 96.dp),
contentPadding = PaddingValues(top = 4.dp, bottom = 96.dp),
) {
items(count = weekCount, key = { it }) { index ->
val week = state.weeksByIndex[index]
@@ -987,7 +964,6 @@ internal fun DenseMonthGrid(
inMonth = { true },
showWeekNumbers = showWeekNumbers,
onOpenDay = onOpenDay,
onEventClick = onEventClick,
labelMonthOnFirst = true,
modifier = Modifier
.fillMaxWidth()
@@ -1215,9 +1191,6 @@ private fun SplitMonthBody(
onSelectDay(it)
onSetExpanded(false)
},
// A tapped chip is asking for that event, not for its day, so it
// opens the detail from here too rather than collapsing (#187).
onEventClick = onEventClick,
onCollapse = { onSetExpanded(false) },
)
} else {
@@ -1318,7 +1291,6 @@ private fun SplitMonthExpanded(
showWeekNumbers: Boolean,
swipeModifier: Modifier,
onPickDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
onCollapse: () -> Unit,
) {
val slideSpec = rememberCalendarSlideSpec()
@@ -1341,7 +1313,6 @@ private fun SplitMonthExpanded(
state = s,
showWeekNumbers = showWeekNumbers,
onOpenDay = onPickDay,
onEventClick = onEventClick,
selected = sel,
)
}
@@ -1822,7 +1793,7 @@ private fun ContinuousMonthSkeleton(dense: Boolean) {
modifier = Modifier.padding(bottom = 8.dp),
)
} else {
Spacer(Modifier.height(DENSE_HEADER_GAP))
Spacer(Modifier.height(4.dp))
}
// More rows than a viewport holds; the clip takes the overflow.
repeat(6) {
@@ -1870,7 +1841,6 @@ private fun MonthWeekRow(
inMonth: (LocalDate) -> Boolean,
showWeekNumbers: Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
modifier: Modifier = Modifier,
blankOutside: Boolean = false,
labelMonthOnFirst: Boolean = false,
@@ -2169,17 +2139,11 @@ private fun MonthWeekRow(
}
}
// Tap layer: a tap on a chip opens that event, anything else opens the
// day (#187). The chips take no pointer input of their own — this
// layer covers them — so the lane under the finger is resolved
// geometrically, exactly as the drag pickup above does it; the down
// position is read on the initial pass, which consumes nothing and so
// leaves both the click and a pickup in flight untouched. Padded and
// Tap layer: in month view a tap on any day opens that day. Padded and
// clipped to the background pill so the ripple matches it. A blanked
// cell isn't part of this month, so it takes no taps either.
val downY = remember(week.days.size) { FloatArray(week.days.size) { NO_DOWN_Y } }
Row(Modifier.matchParentSize()) {
week.days.forEachIndexed { col, d ->
week.days.forEach { d ->
if (blankOutside && !inMonth(d)) {
Spacer(Modifier.weight(1f).fillMaxHeight())
} else {
@@ -2187,33 +2151,9 @@ private fun MonthWeekRow(
Modifier
.weight(1f)
.fillMaxHeight()
.pointerInput(col) {
awaitEachGesture {
downY[col] = awaitFirstDown(
requireUnconsumed = false,
pass = PointerEventPass.Initial,
).position.y
}
}
.padding(horizontal = CELL_GAP, vertical = 1.dp)
.clip(CELL_SHAPE)
.clickable {
// Cleared on read: a click with no fresh down
// (TalkBack, D-pad) would otherwise resolve the
// previous tap's position and reopen its chip.
val cellY = downY[col]
downY[col] = NO_DOWN_Y
val chip = week.chipAtCellY(
col = col,
cellY = cellY,
bandTopInCell = bandTopInCell(
cellCoordinates,
bandCoordinates,
),
rowHeightPx = rowHeightPx,
)
if (chip != null) onEventClick(chip) else onOpenDay(d)
},
.clickable { onOpenDay(d) },
)
}
}
@@ -2222,43 +2162,6 @@ private fun MonthWeekRow(
}
}
/**
* How far the event band sits below the top of the row's day-column box, or null
* while either is unmeasured. Read off the live coordinates rather than summed
* from the padding constants, so it can't drift from what the row actually drew.
*/
private fun bandTopInCell(
cell: Array<LayoutCoordinates?>,
band: Array<LayoutCoordinates?>,
): Float? {
val cellTop = cell[0]?.takeIf { it.isAttached }?.positionInRoot()?.y ?: return null
val bandTop = band[0]?.takeIf { it.isAttached }?.positionInRoot()?.y ?: return null
return bandTop - cellTop
}
/**
* Stand-in [cellY] for "no touch down recorded", which resolves to no chip.
*/
private const val NO_DOWN_Y = Float.NEGATIVE_INFINITY
/**
* The chip at [cellY] in column [col], where [cellY] is measured from the top of
* the row's day-column box. Null for a tap above the band (the day number), on an
* empty lane, or on the overflow dots — all of which mean "open the day", the
* dots included: their point is that the day holds more than fits.
*/
internal fun MonthWeek.chipAtCellY(
col: Int,
cellY: Float,
bandTopInCell: Float?,
rowHeightPx: Float,
): EventInstance? {
if (bandTopInCell == null || rowHeightPx <= 0f) return null
val bandY = cellY - bandTopInCell
if (bandY < 0f) return null
return chipAt(col, (bandY / rowHeightPx).toInt(), MAX_EVENT_ROWS)
}
/**
* The row-level pickup for month chips: resolves which chip the press landed on
* from the geometry the row just laid out, and abandons the gesture on empty
@@ -2453,13 +2356,14 @@ private fun MonthBar(
},
contentAlignment = Alignment.CenterStart,
) {
val titleOverflow = eventTitleOverflow()
Text(
text = title,
style = MaterialTheme.typography.labelSmall,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
overflow = titleOverflow.overflow,
softWrap = titleOverflow.softWrap,
color = eventInk(fill),
textDecoration = declinedDecoration(event.isDeclined),
)
}
}

View File

@@ -45,7 +45,6 @@ internal fun MonthStylePreview(
state = sample.month,
showWeekNumbers = false,
onOpenDay = {},
onEventClick = {},
)
MonthViewStyle.Continuous -> ContinuousMonthGrid(
state = sample.continuous,
@@ -56,7 +55,6 @@ internal fun MonthStylePreview(
),
showWeekNumbers = false,
onOpenDay = {},
onEventClick = {},
)
MonthViewStyle.Dense -> DenseMonthGrid(
state = sample.continuous,
@@ -68,7 +66,6 @@ internal fun MonthStylePreview(
),
showWeekNumbers = false,
onOpenDay = {},
onEventClick = {},
)
MonthViewStyle.Split -> {
SplitMonthGrid(

View File

@@ -85,7 +85,6 @@ import de.jeanlucmakiola.calendula.domain.SearchMonth
import de.jeanlucmakiola.floret.identity.animateItemMotion
import de.jeanlucmakiola.floret.identity.fadeThrough
import de.jeanlucmakiola.floret.identity.predictiveBack
import de.jeanlucmakiola.calendula.ui.common.declinedTitle
import de.jeanlucmakiola.floret.components.GroupedRow
import de.jeanlucmakiola.floret.components.InlineTextField
import de.jeanlucmakiola.floret.components.Position
@@ -520,7 +519,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(event.title, hit.titleSpans, highlight), event.isDeclined),
title = marked(event.title, hit.titleSpans, highlight),
summary = searchSummary(hit, highlight),
position = position,
minHeight = 64.dp,

View File

@@ -591,15 +591,15 @@ class SettingsViewModel @Inject constructor(
/**
* Enable or disable [view] in the quick-switch cycle, via an atomic
* read-modify-write so a concurrent reorder can't clobber it. The
* MIN_ENABLED floor is re-checked inside the transform, because the screen's
* own guard reads an async-echoed snapshot.
* read-modify-write so a concurrent reorder can't clobber it. Any number of
* views may be turned off; below two the pill hides itself (#150).
*/
fun setQuickSwitchViewEnabled(view: CalendarView, enabled: Boolean) {
viewModelScope.launch {
prefs.updateQuickSwitch { config ->
val next = if (enabled) config.enabled + view else config.enabled - view
if (next.size < QuickSwitchConfig.MIN_ENABLED) config else config.copy(enabled = next)
config.copy(
enabled = if (enabled) config.enabled + view else config.enabled - view,
)
}
}
}

View File

@@ -32,7 +32,6 @@ import de.jeanlucmakiola.calendula.ui.common.AgendaRangePicker
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.IMPLEMENTED_VIEWS
import de.jeanlucmakiola.calendula.ui.common.PickerDescription
import de.jeanlucmakiola.calendula.ui.common.QuickSwitchConfig
import de.jeanlucmakiola.calendula.ui.common.TimelineScale
import de.jeanlucmakiola.calendula.ui.common.agendaRangeLabel
import de.jeanlucmakiola.calendula.ui.common.descriptionRes
@@ -55,8 +54,8 @@ import java.time.format.TextStyle as JavaTextStyle
* it belongs to, plus the two cross-view ordering lists (#24, #69).
*
* The quick-switch cycle and the drawer list are independent orders — a view
* off in the cycle is still reachable from the drawer. The cycle needs at least
* [QuickSwitchConfig.MIN_ENABLED] targets.
* off in the cycle is still reachable from the drawer, including when the cycle
* is emptied and the pill disappears (#150).
*/
@Composable
internal fun ViewsScreen(
@@ -221,8 +220,6 @@ internal fun ViewsScreen(
SectionHeader(stringResource(R.string.settings_quick_switch_header))
SettingsHint(stringResource(R.string.settings_quick_switch_hint))
Spacer(Modifier.height(8.dp))
// Turning a view off is blocked once only the minimum remain enabled.
val canDisable = config.enabled.size > QuickSwitchConfig.MIN_ENABLED
ReorderableColumn(
items = config.order,
keyOf = { it },
@@ -238,8 +235,6 @@ internal fun ViewsScreen(
trailing = {
Switch(
checked = checked,
// Keep the last two on: with fewer, the pill can't switch.
enabled = !checked || canDisable,
onCheckedChange = { on -> viewModel.setQuickSwitchViewEnabled(view, on) },
)
},

View File

@@ -72,7 +72,6 @@ import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
@@ -90,7 +89,6 @@ import de.jeanlucmakiola.calendula.ui.common.CalendarFailure
import de.jeanlucmakiola.calendula.ui.common.CalendarView
import de.jeanlucmakiola.calendula.ui.common.IMPLEMENTED_VIEWS
import de.jeanlucmakiola.calendula.ui.common.EventDimAlpha
import de.jeanlucmakiola.calendula.ui.common.declinedDecoration
import de.jeanlucmakiola.calendula.ui.common.BlockTimeLabel
import de.jeanlucmakiola.calendula.ui.common.animatedBlockPlacement
import de.jeanlucmakiola.calendula.ui.common.ghostAlpha
@@ -103,6 +101,7 @@ import de.jeanlucmakiola.calendula.ui.common.TimelineDrop
import de.jeanlucmakiola.calendula.ui.common.beginsOn
import de.jeanlucmakiola.calendula.ui.common.eventDragAllowed
import de.jeanlucmakiola.calendula.ui.common.eventMoveAction
import de.jeanlucmakiola.calendula.ui.common.eventTitleOverflow
import de.jeanlucmakiola.calendula.ui.common.rememberEventDragSource
import de.jeanlucmakiola.calendula.ui.common.rememberTimelineDragController
import de.jeanlucmakiola.calendula.ui.common.startInstant
@@ -130,7 +129,6 @@ import de.jeanlucmakiola.calendula.ui.common.formatMinuteOfDay
import de.jeanlucmakiola.calendula.ui.common.GUTTER_CONTENT_START_INSET
import de.jeanlucmakiola.calendula.ui.common.GUTTER_WIDTH
import de.jeanlucmakiola.calendula.ui.common.HourGutter
import de.jeanlucmakiola.calendula.ui.common.TIMELINE_CONTENT_END_INSET
import de.jeanlucmakiola.calendula.ui.common.hourSeparatorLines
import de.jeanlucmakiola.calendula.ui.common.tappedMinuteOfDay
import de.jeanlucmakiola.calendula.ui.common.rememberCalendarSlideSpec
@@ -268,6 +266,7 @@ fun WeekScreen(
currentYear = currentYear,
selectedView = selectedView,
onCycleView = { onSelectView(selectedView.next(quickSwitchViews)) },
quickSwitchViews = quickSwitchViews,
onOpenDrawer = { scope.launch { drawerState.open() } },
onOpenSearch = onOpenSearch,
onJumpToDate = jumpToDate,
@@ -448,6 +447,7 @@ private fun WeekTopBar(
currentYear: Int,
selectedView: CalendarView,
onCycleView: () -> Unit,
quickSwitchViews: List<CalendarView>,
onOpenDrawer: () -> Unit,
onOpenSearch: () -> Unit,
onJumpToDate: (LocalDate) -> Unit,
@@ -482,6 +482,7 @@ private fun WeekTopBar(
}
ViewSwitcherPill(
current = selectedView,
cycle = quickSwitchViews,
onCycle = onCycleView,
modifier = Modifier.padding(end = 8.dp),
)
@@ -508,7 +509,7 @@ private fun WeekDayHeader(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(top = 4.dp, bottom = 8.dp, end = TIMELINE_CONTENT_END_INSET),
.padding(top = 4.dp, bottom = 8.dp),
) {
// Mirror the day-column layout (empty weekday line + spacer) so the
// badge lines up vertically with the date numbers. The start inset centres
@@ -604,11 +605,7 @@ private fun AllDayStrip(
// Height is hoisted + animated so it slides and resizes smoothly;
// padding sits inside it so the content area is lanes * row height.
.height(height)
.padding(
top = ALL_DAY_VERTICAL_PADDING,
bottom = ALL_DAY_VERTICAL_PADDING,
end = TIMELINE_CONTENT_END_INSET,
),
.padding(vertical = ALL_DAY_VERTICAL_PADDING),
) {
// Keep the gutter-width offset so the bars line up with the day columns.
Spacer(Modifier.width(GUTTER_WIDTH))
@@ -662,13 +659,14 @@ private fun AllDayBar(
.semantics { contentDescription = title },
contentAlignment = Alignment.CenterStart,
) {
val titleOverflow = eventTitleOverflow()
Text(
text = title,
style = MaterialTheme.typography.labelSmall,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
overflow = titleOverflow.overflow,
softWrap = titleOverflow.softWrap,
color = eventInk(fill),
textDecoration = declinedDecoration(event.isDeclined),
)
}
}
@@ -715,7 +713,6 @@ private fun Timeline(
modifier = Modifier
.weight(1f)
.fillMaxHeight()
.padding(end = TIMELINE_CONTENT_END_INSET)
.clip(RoundedCornerShape(16.dp))
.verticalScroll(scrollState)
.onGloballyPositioned { dragController.geometry.viewport = it },
@@ -942,13 +939,14 @@ private fun EventBlock(
) {
Column {
if (showTitle) {
val titleOverflow = eventTitleOverflow(singleLine = titleMaxLines == 1)
Text(
text = title,
style = MaterialTheme.typography.labelMedium,
maxLines = titleMaxLines,
overflow = TextOverflow.Ellipsis,
overflow = titleOverflow.overflow,
softWrap = titleOverflow.softWrap,
color = eventInk(fill, alpha = 0.85f),
textDecoration = declinedDecoration(block.event.isDeclined),
)
}
if (showTime) {
@@ -986,12 +984,7 @@ private fun WeekLoading() {
// Same scale resolution as the loaded timeline, so the skeleton's
// columns don't resize the moment the real week arrives.
val totalHeight = scale.hourHeight(maxHeight) * 24
Row(
modifier = Modifier
.fillMaxSize()
.padding(end = TIMELINE_CONTENT_END_INSET)
.verticalScroll(scrollState),
) {
Row(modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) {
Spacer(Modifier.width(GUTTER_WIDTH))
repeat(7) {
Box(

View File

@@ -4,7 +4,6 @@ import android.os.Build
import androidx.compose.runtime.Composable
import androidx.glance.GlanceTheme
import androidx.glance.material3.ColorProviders
import androidx.glance.text.TextDecoration
import de.jeanlucmakiola.calendula.ui.theme.CalendulaDarkFallback
import de.jeanlucmakiola.calendula.ui.theme.CalendulaLightFallback
@@ -35,10 +34,3 @@ fun CalendulaGlanceTheme(content: @Composable () -> Unit) {
}
GlanceTheme(colors = colors, content = content)
}
/**
* 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(isDeclined: Boolean): TextDecoration =
if (isDeclined) TextDecoration.LineThrough else TextDecoration.None

View File

@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.widget.agenda
import de.jeanlucmakiola.calendula.widget.glanceDeclinedDecoration
import android.content.Context
import android.content.res.Configuration
import androidx.compose.runtime.Composable
@@ -25,6 +24,7 @@ import androidx.glance.appwidget.cornerRadius
import androidx.glance.appwidget.lazy.LazyColumn
import androidx.glance.appwidget.lazy.items
import androidx.glance.appwidget.provideContent
import androidx.glance.appwidget.updateAll
import androidx.glance.background
import androidx.glance.currentState
import androidx.glance.state.PreferencesGlanceStateDefinition
@@ -74,6 +74,11 @@ import kotlinx.datetime.toLocalDateTime
import kotlin.time.Instant
import java.util.Locale
/**
* "Upcoming" agenda widget — a continuously scrolling list of the next ~30 days
* of events grouped under day headers (the Google "Schedule" widget model).
* Reuses the app's [groupAgendaDays] grouping so it matches the in-app agenda.
*/
/**
* Per-instance Glance state key holding the agenda range (as [AgendaRange.storageValue]).
* The range is read reactively in the composition ([currentState]) so a settings
@@ -108,11 +113,6 @@ internal val AGENDA_SHOW_TODAY_STATE_KEY = booleanPreferencesKey("agenda_show_to
*/
internal val AGENDA_SIZE_KEY = stringPreferencesKey("widget_size")
/**
* "Upcoming" agenda widget — a continuously scrolling list of the next ~30 days
* of events grouped under day headers (the Google "Schedule" widget model).
* Reuses the app's [groupAgendaDays] grouping so it matches the in-app agenda.
*/
class AgendaWidget : GlanceAppWidget() {
override val stateDefinition = PreferencesGlanceStateDefinition
@@ -135,23 +135,17 @@ class AgendaWidget : GlanceAppWidget() {
}
}
/**
* Redraws the widget (header refresh button). Targets the tapped widget's own id
* rather than `updateAll`, whose provider-name lookup is empty in a process a tap
* woke from cold — see `ShiftMonthAction` (#18). A cold process re-reads the
* calendar in the `provideGlance` preamble; a live session only recomposes from
* the snapshot it already has (see [AGENDA_RANGE_KEY]).
*/
/** Re-reads the calendar and redraws the widget (header refresh button). */
class RefreshAgendaAction : ActionCallback {
override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) {
AgendaWidget().update(context.applicationContext, glanceId)
AgendaWidget().updateAll(context.applicationContext)
}
}
/**
* Upper bound on rows handed to the [LazyColumn], so the serialized RemoteViews
* stays well inside the binder transaction limit regardless of range and calendar
* size (see the [SizeMode.Single] note above). Far more than fits on screen — a
* size (see the [SizeMode.Exact] note above). Far more than fits on screen — a
* user scrolling a home-screen widget past a hundred rows is not a case worth
* risking a failed update for.
*/
@@ -422,11 +416,7 @@ private fun EventRow(
Text(
text = title,
maxLines = 1,
style = TextStyle(
color = titleColor,
fontSize = metrics.eventTitle,
textDecoration = glanceDeclinedDecoration(event.isDeclined),
),
style = TextStyle(color = titleColor, fontSize = metrics.eventTitle),
)
Text(
text = eventTimeSummary(context, event, day, is24Hour),

View File

@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.widget.month
import de.jeanlucmakiola.calendula.widget.glanceDeclinedDecoration
import android.content.Context
import android.content.res.Configuration
import androidx.compose.runtime.Composable
@@ -26,6 +25,7 @@ import androidx.glance.appwidget.action.actionStartActivity
import androidx.glance.appwidget.cornerRadius
import androidx.glance.appwidget.provideContent
import androidx.glance.appwidget.state.updateAppWidgetState
import androidx.glance.appwidget.updateAll
import androidx.glance.background
import androidx.glance.currentState
import androidx.glance.layout.Alignment
@@ -33,7 +33,6 @@ import androidx.glance.layout.Box
import androidx.glance.layout.Column
import androidx.glance.layout.Row
import androidx.glance.layout.Spacer
import androidx.glance.layout.fillMaxHeight
import androidx.glance.layout.fillMaxSize
import androidx.glance.layout.fillMaxWidth
import androidx.glance.layout.height
@@ -98,27 +97,10 @@ private fun yearMonthOf(index: Int): YearMonth =
* inter-cell seam, with rounded end caps. The displayed month lives in Glance
* state and is read reactively in the composition ([currentState]) so the arrows
* move it via plain recomposition, not a (here-unreliable) widget session reload.
*
* Everything here is written to keep the published `RemoteViews` small. A widget
* update reaches the launcher as a *oneway* binder call, and the host's async
* buffer is 1 MB for all of it; overrun throws `TransactionTooLargeException` and
* the system drops the whole host, freezing every widget on the home screen until
* the launcher rebinds. [SizeMode.Exact] serialises the grid once per size the
* host reports, so the ceiling arrives at half the view count you would expect: a
* grid that emitted a view per cell blew past it after three taps (#214). Every
* row here emits only what it fills.
*/
class MonthWidget : GlanceAppWidget() {
override val stateDefinition = PreferencesGlanceStateDefinition
/**
* Exact rather than [SizeMode.Single] or [SizeMode.Responsive], both of which
* return early from `GlanceAppWidget.resize` — under those the grid is never
* recomposed for a new size and a resized widget clips instead of reflowing.
* Exact costs one serialised copy per host size, which is affordable now that
* a rendering is ~190 views rather than ~740.
*/
override val sizeMode = SizeMode.Exact
override suspend fun provideGlance(context: Context, id: GlanceId) {
@@ -136,17 +118,7 @@ class MonthWidget : GlanceAppWidget() {
}
}
/**
* Step the displayed month by the `delta` action parameter (±1).
*
* Redrawn through [GlanceAppWidget.update] with the id the callback was handed,
* never `updateAll`. `updateAll` resolves its targets through the provider-name
* -> app-widget-id map Glance persists for the *receiver*, and in a process that
* has done nothing else yet — the one a tap wakes after a reboot — that lookup
* comes back empty and the redraw is dropped: the state write lands, nothing
* recomposes, and the arrows read as dead until something else opens the app and
* starts a session (#18). The tapped widget's own id needs no lookup.
*/
/** Step the displayed month by the `delta` action parameter (±1). */
class ShiftMonthAction : ActionCallback {
override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) {
val delta = parameters[deltaKey] ?: 0
@@ -154,7 +126,7 @@ class ShiftMonthAction : ActionCallback {
val cur = prefs[MONTH_INDEX_KEY] ?: currentMonthIndex(systemZone())
prefs[MONTH_INDEX_KEY] = cur + delta
}
MonthWidget().update(context.applicationContext, glanceId)
MonthWidget().updateAll(context.applicationContext)
}
companion object {
@@ -162,11 +134,11 @@ class ShiftMonthAction : ActionCallback {
}
}
/** Jump the displayed month back to the current month. See [ShiftMonthAction]. */
/** Jump the displayed month back to the current month. */
class ResetMonthAction : ActionCallback {
override suspend fun onAction(context: Context, glanceId: GlanceId, parameters: ActionParameters) {
updateAppWidgetState(context, glanceId) { prefs -> prefs.remove(MONTH_INDEX_KEY) }
MonthWidget().update(context.applicationContext, glanceId)
MonthWidget().updateAll(context.applicationContext)
}
}
@@ -314,75 +286,29 @@ private fun WeekRow(
colW: Dp,
modifier: GlanceModifier,
) {
val context = LocalContext.current
val hidden = week.hiddenPerDay()
Box(modifier = modifier.fillMaxWidth()) {
// Day-open targets, one full-height strip per column, sitting *under* the
// content: a tap anywhere in a day still opens it, as in the app, without
// every cell in the column carrying a click target of its own. The content
// above is not clickable, so touches fall through to this layer; only an
// event bar opts out to open its own detail.
Row(modifier = GlanceModifier.fillMaxSize()) {
Column(modifier = modifier.fillMaxWidth()) {
// Day numbers.
Row(modifier = GlanceModifier.fillMaxWidth()) {
week.days.forEach { date ->
Box(
modifier = GlanceModifier
.width(colW)
.fillMaxHeight()
.clickable(openDayAction(context, date)),
) {}
DayNumber(
date = date,
isToday = date == today,
inMonth = date.month == currentMonth,
colW = colW,
)
}
}
Column(modifier = GlanceModifier.fillMaxWidth()) {
// Day numbers. Fixed height so every week's number row lines up whether
// or not it holds today's larger pill.
Row(
modifier = GlanceModifier.fillMaxWidth().height(DAY_NUMBER_HEIGHT),
verticalAlignment = Alignment.CenterVertically,
) {
week.days.forEach { date ->
DayNumber(
date = date,
isToday = date == today,
inMonth = date.month == currentMonth,
colW = colW,
)
}
}
Spacer(GlanceModifier.height(2.dp))
// One lane row per event row. A multi-day span is a single Box spanning
// its columns (colW * n) so it's connected with no seam and rounded ends.
// Lanes past the last one this week fills emit nothing at all.
repeat(week.usedLanes()) { lane ->
LaneRow(week = week, lane = lane, dark = dark, soften = soften, colW = colW)
Spacer(GlanceModifier.height(1.dp))
}
if (hidden.any { it > 0 }) OverflowRow(hidden = hidden, colW = colW)
Spacer(GlanceModifier.height(2.dp))
// One lane row per event row. A multi-day span is a single Box spanning
// its columns (colW * n) so it's connected with no seam and rounded ends.
repeat(MAX_LANES) { lane ->
LaneRow(week = week, lane = lane, dark = dark, soften = soften, colW = colW)
Spacer(GlanceModifier.height(1.dp))
}
OverflowRow(week = week, colW = colW)
}
}
/**
* How many lanes this week actually fills, counting from the top. The grid draws
* that many rows instead of a fixed [MAX_LANES]; an empty lane costs three views
* per day and most weeks leave the last two empty.
*/
private fun MonthWeek.usedLanes(): Int {
for (lane in MAX_LANES - 1 downTo 0) {
val filled = spans.any { it.lane == lane } ||
days.indices.any { col -> timedEventAt(this, lane, col, days[col]) != null }
if (filled) return lane + 1
}
return 0
}
/** Events per day that no lane had room for — the "+N" counts, 0 where all fit. */
private fun MonthWeek.hiddenPerDay(): List<Int> = days.mapIndexed { col, date ->
val shownSpans = spans.count { col in it.startCol..it.endCol && it.lane < MAX_LANES }
val freeSlots = (MAX_LANES - shownSpans).coerceAtLeast(0)
val timedShown = minOf(freeSlots, timedByDay[date].orEmpty().size)
((countByDay[date] ?: 0) - shownSpans - timedShown).coerceAtLeast(0)
}
/**
* Open [date]'s day view rooted in the month view (so back returns to the month
* grid) — the same target the in-app month grid uses when a day cell is tapped.
@@ -392,93 +318,64 @@ private fun MonthWeek.hiddenPerDay(): List<Int> = days.mapIndexed { col, date ->
private fun openDayAction(context: Context, date: LocalDate) =
actionStartActivity(MainActivity.openDateIntent(context, date, CalendarView.Month))
/**
* A day's number. Every day but today is a bare centred [Text] carrying the column
* width itself — a wrapping Box costs three views, and there are 42 of these.
* Today keeps its filled circle, which does need the Box.
*/
@Composable
private fun DayNumber(date: LocalDate, isToday: Boolean, inMonth: Boolean, colW: Dp) {
val style = TextStyle(
color = when {
isToday -> GlanceTheme.colors.onPrimary
inMonth -> GlanceTheme.colors.onSurface
else -> GlanceTheme.colors.onSurfaceVariant
},
fontSize = 11.sp,
fontWeight = if (isToday) FontWeight.Bold else FontWeight.Normal,
textAlign = TextAlign.Center,
)
if (!isToday) {
Text(text = date.day.toString(), style = style, modifier = GlanceModifier.width(colW))
return
}
Box(modifier = GlanceModifier.width(colW), contentAlignment = Alignment.Center) {
val context = LocalContext.current
Box(
modifier = GlanceModifier
.width(colW)
.height(DAY_NUMBER_HEIGHT)
.clickable(openDayAction(context, date)),
contentAlignment = Alignment.Center,
) {
Box(
modifier = GlanceModifier
.size(DAY_NUMBER_HEIGHT)
.cornerRadius(DAY_NUMBER_HEIGHT / 2)
.background(GlanceTheme.colors.primary),
.then(if (isToday) GlanceModifier.cornerRadius(DAY_NUMBER_HEIGHT / 2).background(GlanceTheme.colors.primary) else GlanceModifier),
contentAlignment = Alignment.Center,
) {
Text(text = date.day.toString(), style = style)
Text(
text = date.day.toString(),
style = TextStyle(
color = when {
isToday -> GlanceTheme.colors.onPrimary
inMonth -> GlanceTheme.colors.onSurface
else -> GlanceTheme.colors.onSurfaceVariant
},
fontSize = 11.sp,
fontWeight = if (isToday) FontWeight.Bold else FontWeight.Normal,
),
)
}
}
}
/** A bar occupying [cols] columns, or — with a null event — that many blank ones. */
private data class LaneCell(val event: EventInstance?, val cols: Int)
/**
* A lane split into bars and the gaps between them, with consecutive blank columns
* merged into one gap: the week's day-open taps come from the strip underneath, so
* a gap needs no per-column view and a mostly-empty lane collapses to a spacer.
*/
private fun MonthWeek.laneCells(lane: Int): List<LaneCell> {
val cells = mutableListOf<LaneCell>()
var gap = 0
var col = 0
fun closeGap() {
if (gap > 0) cells += LaneCell(null, gap)
gap = 0
}
while (col < 7) {
val span = spans.firstOrNull { it.lane == lane && col in it.startCol..it.endCol }
val timed = if (span == null) timedEventAt(this, lane, col, days[col]) else null
when {
span != null -> {
closeGap()
cells += LaneCell(span.event, span.endCol - col + 1)
col = span.endCol + 1
}
timed != null -> {
closeGap()
cells += LaneCell(timed, 1)
col += 1
}
else -> {
gap += 1
col += 1
}
}
}
closeGap()
return cells
}
@Composable
private fun LaneRow(week: MonthWeek, lane: Int, dark: Boolean, soften: Boolean, colW: Dp) {
val context = LocalContext.current
Row(modifier = GlanceModifier.fillMaxWidth()) {
week.laneCells(lane).forEach { cell ->
if (cell.event == null) {
Spacer(GlanceModifier.width(colW * cell.cols).height(LANE_HEIGHT))
var col = 0
while (col < 7) {
val span = week.spans.firstOrNull { it.lane == lane && col in it.startCol..it.endCol }
if (span != null) {
val cols = span.endCol - col + 1
SpanBar(event = span.event, dark = dark, soften = soften, width = colW * cols)
col = span.endCol + 1
} else {
SpanBar(
event = cell.event,
dark = dark,
soften = soften,
width = colW * cell.cols,
)
val timed = timedEventAt(week, lane, col, week.days[col])
if (timed != null) {
SpanBar(event = timed, dark = dark, soften = soften, width = colW)
} else {
// Empty lane cell: a tap opens that day, so blank space in a
// day column is a day-open target just like the number is.
Box(
GlanceModifier
.width(colW)
.height(LANE_HEIGHT)
.clickable(openDayAction(context, week.days[col])),
) {}
}
col += 1
}
}
}
@@ -517,39 +414,41 @@ private fun SpanBar(event: EventInstance, dark: Boolean, soften: Boolean, width:
Text(
text = event.title.ifBlank { context.getString(R.string.event_untitled) },
maxLines = 1,
style = TextStyle(
color = ColorProvider(eventInk(fill)),
fontSize = 9.sp,
textDecoration = glanceDeclinedDecoration(event.isDeclined),
),
style = TextStyle(color = ColorProvider(eventInk(fill)), fontSize = 9.sp),
modifier = GlanceModifier.padding(horizontal = 3.dp),
)
}
}
}
/** The "+N" row, drawn only for weeks that hide something, gaps merged as in a lane. */
@Composable
private fun OverflowRow(hidden: List<Int>, colW: Dp) {
private fun OverflowRow(week: MonthWeek, colW: Dp) {
val context = LocalContext.current
Row(modifier = GlanceModifier.fillMaxWidth()) {
var gap = 0
hidden.forEach { count ->
if (count == 0) {
gap += 1
return@forEach
week.days.forEachIndexed { col, date ->
val shownSpans = week.spans.count { col in it.startCol..it.endCol && it.lane < MAX_LANES }
val freeSlots = (MAX_LANES - shownSpans).coerceAtLeast(0)
val timedShown = minOf(freeSlots, week.timedByDay[date].orEmpty().size)
val hidden = (week.countByDay[date] ?: 0) - shownSpans - timedShown
// The overflow row is part of the day column too: tapping it (whether
// it shows "+N" or is blank) opens that day, same as the app.
Box(
modifier = GlanceModifier
.width(colW)
.height(LANE_HEIGHT)
.clickable(openDayAction(context, date)),
contentAlignment = Alignment.CenterStart,
) {
if (hidden > 0) {
Text(
text = "+$hidden",
maxLines = 1,
style = TextStyle(color = GlanceTheme.colors.onSurfaceVariant, fontSize = 9.sp),
modifier = GlanceModifier.padding(start = 3.dp),
)
}
}
if (gap > 0) {
Spacer(GlanceModifier.width(colW * gap).height(LANE_HEIGHT))
gap = 0
}
Text(
text = "+$count",
maxLines = 1,
style = TextStyle(color = GlanceTheme.colors.onSurfaceVariant, fontSize = 9.sp),
modifier = GlanceModifier.width(colW).padding(start = 3.dp),
)
}
if (gap > 0) Spacer(GlanceModifier.width(colW * gap).height(LANE_HEIGHT))
}
}

View File

@@ -16,14 +16,14 @@
<string name="state_failure_no_calendars_action">فتح إعدادات تقويم النظام</string>
<string name="state_failure_provider">تعذّر قراءة التقويم.</string>
<string name="permission_rationale_title">شاهد جميع أحداثك، بشكل جميل</string>
<string name="permission_rationale_body">Calendula يحتاج للوصول إلى تقويمك لعرض و إدارة أحداثك.</string>
<string name="permission_rationale_body">Calendula يحتاج للوصول إلى تقويمك لعرض و إدارة أحداثك. هذا كل ما يطلبه مقدمًا — ولا يخرج أي شيء من جهازك على الإطلاق.</string>
<string name="permission_request_button">منح الوصول إلى التقويم</string>
<string name="permission_denied_title">رُفِض الوصول إلى التقويم</string>
<string name="permission_denied_body">Calendula لا يمكنه عرض الأحداث بدون الوصول إلى التقويم. يمكنك منحه مُجددًا في إعدادات النظام.</string>
<string name="permission_retry_button">أعِد المحاولة</string>
<string name="permission_open_settings_button">فتح إعدادات النظام</string>
<string name="permission_benefit_private_title">الخصوصية حسب التصميم</string>
<string name="permission_benefit_private_body">لا يوجد إذن بالإنترنت، ولا تتبع عن بُعد — لا شيء يغادر هاتفك أبدًا.</string>
<string name="permission_benefit_private_title">يبقى على جهازك</string>
<string name="permission_benefit_private_body">تقويماتك تتِم قراءتها محليًا ولا تُغادر الهاتف أبدًا.</string>
<string name="permission_benefit_sync_title">جميع تقويماتك، مع بعض</string>
<string name="permission_benefit_sync_body">جوجل، CalDAV، محلي — أي شيء تمت مزامنته مع الجهاز يظهر فورًا.</string>
<string name="permission_benefit_privacy_title">لا تتبع، أبدًا</string>
@@ -126,7 +126,6 @@
<string name="event_edit_recurrence_none">لا يتكرر</string>
<string name="import_reminder_prompt_body_none">تم استيراد هذا الحدث بدون أي تذكير.</string>
<plurals name="import_reminder_prompt_body_existing">
<item quantity="zero">تم استيراد هذا الحدث مع (%1$d) لا تذكيرات.</item>
<item quantity="one">تم استيراد هذا الحدث مع %1$d تذكير.</item>
<item quantity="two">تم استيراد هذا الحدث مع %1$d تذكيران.</item>
<item quantity="few">تم استيراد هذا الحدث مع %1$d تذكيرات.</item>
@@ -178,7 +177,7 @@
<string name="reminder_channel_name">تذكيرات الحدث</string>
<string name="reminder_channel_description">الإشعارات في أوقات التذكير الخاصه بأحداثك</string>
<string name="reminder_onboarding_title">لا تفوّت أي حدث أبدًا</string>
<string name="reminder_onboarding_body">أندرويد لا يعرض تذكيرات الأحداث من نفسه — بل يجب أن يقوم تطبيق تقويم بذلك. دع Calendula يتولى هذه المهمة.</string>
<string name="reminder_onboarding_body">Android لا يعرض تذكيرات الأحداث من نفسه — بل يجب أن يقوم تطبيق تقويم بذلك. دع Calendula يتولى هذه المهمة.</string>
<string name="reminder_benefit_delivery_body">كل تذكير لأحداثك يصِل كإشعار، في الوقت المحدد تمامًا.</string>
<string name="reminder_benefit_duplicates_title">هل تستخدم تطبيق تقويم ثانٍ؟</string>
<string name="reminder_benefit_duplicates_body">إذا تطبيق آخر أيضًا ينشر تذكيرات، فستراهم مرتين — قم بإيقاف تشغيلهم هناك أو هنا.</string>
@@ -243,17 +242,17 @@
<string name="agenda_range_this_week">هذا الأسبوع</string>
<string name="settings_past_events_show">إظهار</string>
<string name="settings_past_events_hide">إخفاء</string>
<string name="settings_agenda_header">الجدول</string>
<string name="settings_agenda_header">جدول</string>
<string name="event_edit_timezone_device">المنطقة الزمنية للجهاز</string>
<string name="event_edit_timezone_search">البحث عن المناطق الزمنية</string>
<string name="event_edit_timezone_all">جميع المناطق الزمنية</string>
<string name="event_edit_timezone_none">لا منطقة زمنية تطابق %1$s</string>
<string name="event_edit_timezone_none">لا منطقة زمنية تطابق \"%1$s\"</string>
<string name="event_edit_timezone_local_time">%1$s توقيتك</string>
<string name="event_edit_timezone_recent">الأحدث</string>
<string name="event_edit_recurrence_incomplete">أدخل رقمًا من ١ إلى ٩٩٩</string>
<plurals name="duration_minutes">
<item quantity="zero">(%d) لا دقائق</item>
<item quantity="one">%d دقيقة واحده</item>
<item quantity="one">(%d) دقيقة واحده</item>
<item quantity="two">%d دقيقتان</item>
<item quantity="few">%d دقائق</item>
<item quantity="many">%d دقيقة</item>
@@ -261,7 +260,7 @@
</plurals>
<plurals name="duration_hours">
<item quantity="zero">(%d) لا ساعات</item>
<item quantity="one">%d ساعة واحده</item>
<item quantity="one">(%d) ساعة واحده</item>
<item quantity="two">%d ساعتان</item>
<item quantity="few">%d ساعات</item>
<item quantity="many">%d ساعة</item>
@@ -269,7 +268,7 @@
</plurals>
<plurals name="duration_days">
<item quantity="zero">(%d) لا أيام</item>
<item quantity="one">%d يوم واحد</item>
<item quantity="one">(%d) يوم واحد</item>
<item quantity="two">%d يومان</item>
<item quantity="few">%d أيام</item>
<item quantity="many">%d يوم</item>
@@ -277,7 +276,7 @@
</plurals>
<plurals name="duration_weeks">
<item quantity="zero">(%d) لا أسابيع</item>
<item quantity="one">%d أسبوع واحد</item>
<item quantity="one">(%d) أسبوع واحد</item>
<item quantity="two">%d أسبوعان</item>
<item quantity="few">%d أسابيع</item>
<item quantity="many">%d أسبوع</item>
@@ -292,7 +291,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 كـ Calendar في مشغّل التطبيقات الخاص بك. فقط الاسم في المشغّل يتغير؛ وقد ينتقل الرمز إلى مكان جديد بعد التبديل.</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>
@@ -315,6 +314,7 @@
<string name="settings_form_fields_hint">الخانات المعروضة افتراضيًا — كل شيء آخر موجود ضمن \"المزيد من الخانات\"</string>
<string name="settings_section_event_form">نموذج حدث جديد</string>
<string name="settings_quick_switch_header">زر التبديل السريع</string>
<string name="app_name">التقويم</string>
<string name="settings_theme_system_summary">الحالي %1$s</string>
<string name="settings_theme_hint">سواء التطبيق فاتحًا أو داكنًا. الاختيار يُطبق على الفور.</string>
<string name="settings_week_start_auto_summary">الحالي %1$s</string>
@@ -329,7 +329,7 @@
<string name="settings_widget_size_extra_large">كبير جدًا</string>
<plurals name="agenda_range_days">
<item quantity="zero">(%d) لا أيام</item>
<item quantity="one">%d يوم واحد</item>
<item quantity="one">(%d) يوم واحد</item>
<item quantity="two">%d يومان</item>
<item quantity="few">%d أيام</item>
<item quantity="many">%d يوم</item>
@@ -383,7 +383,7 @@
<string name="event_edit_recurrence_next">التالي: %1$s</string>
<plurals name="reminder_minutes">
<item quantity="zero">(%d) لا دقائق قبل</item>
<item quantity="one">%d دقيقة واحده قبل</item>
<item quantity="one">(%d) دقيقة واحده قبل</item>
<item quantity="two">%d دقيقتان قبل</item>
<item quantity="few">%d دقائق قبل</item>
<item quantity="many">%d دقيقة قبل</item>
@@ -391,7 +391,7 @@
</plurals>
<plurals name="reminder_hours">
<item quantity="zero">(%d) لا ساعات قبل</item>
<item quantity="one">%d ساعة واحده قبل</item>
<item quantity="one">(%d) ساعة واحده قبل</item>
<item quantity="two">%d ساعتان قبل</item>
<item quantity="few">%d ساعات قبل</item>
<item quantity="many">%d ساعة قبل</item>
@@ -399,7 +399,7 @@
</plurals>
<plurals name="reminder_days">
<item quantity="zero">(%d) لا أيام قبل</item>
<item quantity="one">%d يوم واحد قبل</item>
<item quantity="one">(%d) يوم واحد قبل</item>
<item quantity="two">%d يومان قبل</item>
<item quantity="few">%d أيام قبل</item>
<item quantity="many">%d يوم قبل</item>
@@ -407,13 +407,13 @@
</plurals>
<plurals name="reminder_weeks">
<item quantity="zero">(%d) لا أسابيع قبل</item>
<item quantity="one">%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="reminder_benefit_reversible_body">يوجد مفتاح التبديل في الإعدادات، ضمن الإشعارات.</string>
<string name="reminder_benefit_reversible_body">يوجد المفتاح في الإعدادات، ضمن الإشعارات.</string>
<string name="reminder_custom_amount">القيمة</string>
<string name="settings_manage_calendars_hint">إنشاء تقويمات محلية؛ إدارة التقويمات المتزامنة</string>
<string name="settings_snooze_duration">مدة التأجيل</string>
@@ -451,13 +451,13 @@
<string name="settings_special_dates_grant">منح الوصول</string>
<string name="calendars_backup_action">تصدير كملف .ics</string>
<string name="calendars_export_title">تصدير التقويمات</string>
<string name="calendars_export_hint">اختر التقويمات التي تريد تضمينها في ملف .ics.</string>
<string name="calendars_export_hint">اختر التقويمات التي تريد تضمينها في .ics الملف.</string>
<string name="calendars_export_action">تصدير</string>
<string name="calendars_restore_header">استعادة</string>
<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>
@@ -472,7 +472,7 @@
<string name="calendars_backup_failed">تعذّر تصدير النسخة الاحتياطية.</string>
<plurals name="calendars_backup_done">
<item quantity="zero">تم تصدير (%d) لا أحداث.</item>
<item quantity="one">تم تصدير %d حدث واحد.</item>
<item quantity="one">تم تصدير (%d) حدث واحد.</item>
<item quantity="two">تم تصدير %d حدثان.</item>
<item quantity="few">تم تصدير %d أحداث.</item>
<item quantity="many">تم تصدير %d حدث.</item>
@@ -520,7 +520,7 @@
<string name="settings_past_events_hint">ما الذي يفعله جدول بالأحداث التي انتهت بالفعل.</string>
<string name="calendars_visibility_a11y">إظهار \"%1$s\"</string>
<string name="calendars_visibility_notice_title">بعض التقويمات متوقفة</string>
<string name="calendars_visibility_notice_message">Calendula يعرض التقويمات التي تم تشغيلها لهذا الجهاز، وبعض من خاصتك متوقفة. لرؤية أحداثهم، قم بتشغيلهم ضمن الإعدادات ← التقويمات.</string>
<string name="calendars_visibility_notice_message">Calendula يعرض الآن التقويمات التي تم تشغيلها لهذا الجهاز، لذلك ما تراه وما يذكرك لم يعد بإمكانه أن يختلف. بعض تقويماتك متوقفة حاليًا — تم إيقافها هنا أو في تطبيق تقويم آخر. أعد تشغيل أي منها في الإعدادات ← التقويمات.</string>
<string name="calendar_picker_missing_title">تفتقد تقويمًا؟</string>
<string name="calendar_picker_missing_summary">قد يكون متوقفًا عن التشغيل، للقراءة فقط أو مملوءًا من جهات الاتصال الخاصة بك — يمكنك إدارة تقويماتك هنا.</string>
<string name="calendars_state_read_only">للقراءة فقط</string>
@@ -542,140 +542,4 @@
<string name="timeline_scale_regular">العادي</string>
<string name="timeline_scale_comfortable_summary">مجموعات أوسع، تمرير أكثر</string>
<string name="timeline_scale_custom_summary">الارتفاع الذي قمت بضغظت المخطط الزمني إليه</string>
<string name="event_edit_timezone_device_summary">يتابعك أينما كنت</string>
<string name="event_access_confidential_summary">مُعَلَّم كـ سري؛ ما يعنيه ذلك متروك لحساب التقويم</string>
<string name="settings_widget_size_summary">نص الحدث %1$d%%</string>
<string name="settings_calendar_durations_hint">امنح تقويم طوله الافتراضي خاص به — للمثال. ٨ ساعات لمناوبات العمل.</string>
<string name="settings_backup_subtitle">تصدير، استيراد، النسخ الاحتياطي التلقائي</string>
<string name="settings_views_all_header">كل طُرق العرض</string>
<string name="settings_calendar_durations_title">المدة لكل تقويم</string>
<string name="event_move_done">تم النقل إلى %1$s</string>
<string name="event_move_undo">تراجع</string>
<string name="event_move_undone">تم التراجع عن النقل</string>
<string name="event_move_failed">تعذّر نقل الحدث</string>
<string name="event_move_write_denied">Calendula يحتاج إلى صلاحية للكتابة لنقل الأحداث</string>
<string name="event_move_gone">لم يعد هذا الحدث موجودًا</string>
<string name="onboarding_step_counter">الخطوة %1$d من %2$d</string>
<string name="onboarding_backup_title">أحداثك تعيش فقط هنا</string>
<string name="onboarding_backup_body">لا شئ على هذا الهاتف تتم مزامنته لحساب، لذلك فقدانها سيؤدي لفقدان تقويمك. Calendula يمكنه كتابة نسخة احتياطية لك.</string>
<string name="onboarding_backup_benefit_folder_body">النسخ الاحتياطية هي ملفات .ics عادية — ضعها في مكان ما يزامن، أو على بطاقة SD.</string>
<string name="onboarding_backup_benefit_daily_title">مرة واحدة يوميًا، من تلقاء نفسه</string>
<string name="onboarding_backup_benefit_daily_body">Calendula يقم بتصدير تقويماتك المحلية في الخلفية. يمكنك تغيير مدى المرات في الإعدادات.</string>
<string name="onboarding_backup_enable_button">اختر مجلد وانسخ احتياطيًا</string>
<string name="onboarding_backup_skip_button">ليس الآن</string>
<string name="onboarding_view_title">ما الذي يجب أن يفتح أولاً؟</string>
<string name="onboarding_month_style_title">كيف يجب أن يبدو الشهر؟</string>
<string name="onboarding_view_continue_button">متابعة</string>
<string name="onboarding_back">رجوع</string>
<string name="onboarding_visibility_button">فهمت</string>
<string name="onboarding_done_title">تم إعدادك بالكامل</string>
<string name="onboarding_done_body">تقويماتك جاهزه. يمكن تغيير كل ما اخترته للتو لاحقًا في الإعدادات.</string>
<string name="onboarding_done_button">افتح تقويمي</string>
<plurals name="search_selected_count">
<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="search_in_descriptions">عُثِر في الأوصاف</string>
<string name="search_selection_close">إلغاء التحديد</string>
<string name="search_select_all">تحديد الكل</string>
<string name="search_delete_selected">حذف المُحدّد</string>
<plurals name="search_delete_title">
<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="search_delete_done">
<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="search_delete_partial">تم حذف %1$d، وتعذّر حذف %2$d</string>
<string name="search_delete_denied_partial">تم حذف %1$d، ثم تم سحب صلاحية للكتابة</string>
<plurals name="import_done_skipped">
<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="import_done_imported">
<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="import_action">
<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="import_event_count">
<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="import_title_count">
<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="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>
<string name="settings_drawer_order_header">قائمة التنقل</string>
<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_calendar_reminders_title">التذكيرات لكل تقويم</string>
<string name="settings_license_value">MIT</string>
<string name="settings_special_dates_paused_title">متوقف</string>
<string name="settings_special_dates_calendar_hint">اضبط لون كل تقويم وإمكانية ظهوره في إعدادات التقويمات.</string>
<string name="calendars_visibility_hint">قم بإيقاف تقويم لإخفائه على هذا الجهاز — تختفي أحداثه من التطبيق ويتوقف عن تذكيرك. هذا هو مفتاح التبديل نفسه الذي تستخدمه تطبيقات التقويم الأخرى خاصتك، لذلك تقوم بإخفائه أيضًا. لا شيء يتم حذفه، ولا يتأثر أي جهاز آخر، ويمكنك إعادة تشغيله من هنا في أي وقت.</string>
<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_drag_to_reschedule">السحب لتعديل الموعد</string>
<string name="settings_drag_to_reschedule_summary">انقل حدثًا عن طريق سحبه إلى يوم أو وقت آخر</string>
<string name="event_move_blocked_series_end">لا يمكن نقل حدث بعد نهاية سلسلته</string>
<string name="crash_dialog_report">تقرير</string>
<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="import_warning_attendees">لم يتم استيراد قوائم الضيوف.</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>
<string name="settings_past_events_sample_morning">مراجعة الفريق</string>
<string name="settings_past_events_sample_midday">غداء مع روبن</string>
<string name="settings_past_events_sample_evening">ممارسة الجوقة</string>
<string name="settings_special_dates_last_synced">آخر مزامنة %1$s</string>
<string name="settings_special_dates_disable_type_message">يؤدي هذا لحذف التقويم ”%1$s“ وأحداثه. سيتم فقدان أي تذكيرات أو ملاحظات أضفتها إليه.</string>
<string name="special_dates_default_title_birthday">عيد ميلاد {name} ({year})</string>
</resources>

View File

@@ -17,14 +17,14 @@
<string name="state_failure_no_calendars_action">Apri le impostazioni calendario di sistema</string>
<string name="state_failure_provider">Errore nella lettura del calendario.</string>
<string name="permission_rationale_title">Gestisci magnificamente tutti i tuoi eventi</string>
<string name="permission_rationale_body">Calendula ha bisogno di accedere al tuo calendario per mostrare e gestire gli eventi.</string>
<string name="permission_rationale_body">Calendula ha bisogno di accedere al tuo calendario per mostrare e gestire gli eventi. È l\'unica cosa di cui ha bisogno: nessuna informazione lascerà mai il tuo dispositivo.</string>
<string name="permission_request_button">Concedi l\'accesso al calendario</string>
<string name="permission_denied_title">Accesso al calendario negato</string>
<string name="permission_denied_body">Calendula non può mostrare gli eventi senza accesso al calendario. Puoi concederlo dalle impostazioni di sistema.</string>
<string name="permission_open_settings_button">Apri le impostazioni di sistema</string>
<string name="permission_retry_button">Riprova</string>
<string name="permission_benefit_private_title">Privato by design</string>
<string name="permission_benefit_private_body">Nessun accesso a internet, nessun tracking: nulla lascia il tuo dispositivo.</string>
<string name="permission_benefit_private_title">Rimane sul tuo dispositivo</string>
<string name="permission_benefit_private_body">I tuoi calendari sono letti localmente e non lasciano mai il tuo dispositivo.</string>
<string name="permission_benefit_sync_title">Tutti i tuoi calendari, insieme</string>
<string name="permission_benefit_sync_body">Google, CalDAV, locali - qualsiasi calendario sincronizzato sul dispositivo, semplicemente, compare.</string>
<string name="permission_benefit_privacy_title">Nessun tracking, per sempre</string>
@@ -301,8 +301,8 @@
<string name="settings_language_auto">Lingua di sistema</string>
<string name="settings_translate">Aiuta a tradurre</string>
<string name="settings_translate_hint">Aggiungi o migliora una traduzione su Weblate</string>
<string name="settings_appearance_subtitle">Tema, colori, font</string>
<string name="settings_event_form_subtitle">Campi di default e comportamento</string>
<string name="settings_appearance_subtitle">Tema, vista di default, inizio settimana</string>
<string name="settings_event_form_subtitle">Campi di default per nuovi eventi</string>
<string name="settings_section_about">A proposito</string>
<string name="settings_license">Licenza</string>
<string name="settings_license_value">MIT</string>
@@ -414,7 +414,7 @@
<string name="agenda_range_this_week">Questa settimana</string>
<string name="settings_reminders">Promemoria per gli eventi</string>
<string name="settings_default_reminder">Promemoria per eventi standard</string>
<string name="settings_notifications_subtitle">Promemoria</string>
<string name="settings_notifications_subtitle">Promemoria evento</string>
<string name="shortcut_new_event_short">Nuovo evento</string>
<string name="event_edit_managed_hint">Gestito da “%1$s” - titolo, data e ripetizioni sono sincronizzate dai tuoi contatti. Promemoria e note sono modificabili dall\'utente.</string>
<string name="settings_font_headings">Carattere del titolo</string>
@@ -423,13 +423,13 @@
<string name="settings_font_choose_file">Scegli file…</string>
<string name="settings_font_custom_selected">Font personalizzato</string>
<string name="settings_font_import_failed">Impossibile leggere il file come font</string>
<string name="settings_section_views">Vista</string>
<string name="settings_section_views">Viste</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. 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>
<string name="settings_views_subtitle">Vista di default, layout, ordine</string>
<string name="settings_views_subtitle">Ordine del pulsante di cambio rapido e del menù</string>
<string name="settings_special_dates_subtitle">Compleanni e anniversari dei contatti</string>
<string name="settings_section_special_dates">Date speciali dei contatti</string>
<string name="settings_special_dates_enable">Mostra date dei contatti</string>
@@ -478,8 +478,8 @@
<string name="reminder_day_yesterday">Ieri</string>
<string name="agenda_no_more_today">Nessun altro evento per oggi</string>
<string name="back">Indietro</string>
<string name="settings_soften_colors">Armonizza i colori del calendario</string>
<string name="settings_soften_colors_summary">Mantieni i colori del calendario ma attenua la luminosità, così gli eventi rimangono leggibili e i colori sono armonizzati. Deseleziona per mostrare i colori originali.</string>
<string name="settings_soften_colors">Attenua i colori del calendario</string>
<string name="settings_soften_colors_summary">I colori dei calendari e degli eventi vengono attenuati per adattarsi al tema. Deseleziona per mostrare i colori naturali.</string>
<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>
@@ -499,151 +499,4 @@
<item quantity="many">Importando %d eventi</item>
<item quantity="other">Importando %d eventi</item>
</plurals>
<string name="event_move_action">Sposta…</string>
<string name="event_move_recurring_title">Sposta un evento ricorrente</string>
<string name="event_move_done">Spostato al %1$s</string>
<string name="event_move_undo">Annulla ripianificazione</string>
<string name="event_move_undone">Ripianificazione annullata</string>
<string name="event_move_failed">Impossibile ripianificare l\'evento</string>
<string name="event_move_write_denied">Calendula ha bisogno dei permessi di scrittura per ripianificare gli eventi</string>
<string name="event_move_gone">Questo evento è stato eliminato.</string>
<string name="event_move_blocked_series_end">Non è possibile ripianificare un evento oltre la data di fine della sua serie</string>
<string name="event_edit_timezone_device">Fuso orario del dispositivo</string>
<string name="event_edit_timezone_device_summary">Segue il fuso orario in cui ti trovi</string>
<string name="event_edit_timezone_search">Seleziona fuso orario</string>
<string name="event_edit_timezone_recent">Recenti</string>
<string name="event_edit_timezone_all">Tutti i fusi orari</string>
<string name="event_edit_timezone_none">Nessun fuso corrisponde a \"%1$s\"</string>
<string name="event_edit_timezone_local_time">%1$s nel tuo fuso orario</string>
<string name="event_edit_recurrence_incomplete">Inserisci un numero tra 1 e 999</string>
<string name="event_edit_recurrence_next">Prossimo evento: %1$s</string>
<string name="event_edit_recurrence_next_none">Questa regola non si ripete</string>
<string name="event_access_default_summary">In base all\'impostazione del calendario</string>
<string name="event_access_public_summary">Chiunque acceda può vedere i dettagli completi</string>
<string name="event_access_private_summary">Gli altri vedranno solo che sei impegnato</string>
<string name="event_access_confidential_summary">Confidenziale; dipende dalle impostazioni dell\'account</string>
<string name="duration_hours_minutes">%1$s %2$s</string>
<string name="duration_custom_max">Al più %1$s</string>
<string name="onboarding_step_counter">Step %1$d di %2$d</string>
<string name="onboarding_backup_title">I tuoi eventi rimangono qui</string>
<string name="onboarding_backup_body">Nulla viene sincronizzato, perdere i dati presenti su questo dispositivo significa perdere i tuoi calendari. Calendula può fare un backup per te.</string>
<string name="onboarding_backup_benefit_folder_title">Una cartella a scelta</string>
<string name="onboarding_backup_benefit_folder_body">I backup sono file .ics. Mettili al sicuro sul cloud o su una scheda SD.</string>
<string name="onboarding_backup_benefit_daily_title">Giornaliero, in automatico</string>
<string name="onboarding_backup_benefit_daily_body">Calendula esporta i tuoi calendari locali in background. Selezione la frequenza nelle Impostazioni.</string>
<string name="onboarding_backup_enable_button">Seleziona la cartella ed esegui il backup</string>
<string name="onboarding_backup_skip_button">Non ora</string>
<string name="onboarding_view_title">Cosa viene aperto per primo?</string>
<string name="onboarding_month_style_title">Seleziona la vista Mese</string>
<string name="onboarding_view_continue_button">Continua</string>
<string name="onboarding_back">Indietro</string>
<string name="onboarding_visibility_button">Capito</string>
<string name="onboarding_done_title">Tutto fatto</string>
<string name="onboarding_done_body">I tuoi calendari sono pronti. Tutto ciò che hai scelto può essere modificato più tardi nelle Impostazioni.</string>
<string name="onboarding_done_button">Apri i miei calendari</string>
<string name="agenda_span_starts">Inizia alle %1$s</string>
<string name="agenda_span_ends">Finisce alle %1$s</string>
<string name="today_jump_action">Vai ad oggi</string>
<plurals name="search_selected_count">
<item quantity="one">%d selezionato</item>
<item quantity="many">%d selezionati</item>
<item quantity="other">%d selezionati</item>
</plurals>
<string name="search_in_descriptions">Trovato nelle descrizioni</string>
<string name="search_selection_close">Cancella selezione</string>
<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 l\'evento?</item>
<item quantity="other">Eliminare l\'evento?</item>
</plurals>
<plurals name="search_delete_done">
<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>
<string name="event_move_occurrence_only">Ripianificare l\'intera serie cambia i giorni in cui cade, quindi puoi ripianificare solo questo evento.</string>
<string name="settings_theme_hint">Tema chiaro o scuro. La modifica viene applicata immediatamente.</string>
<string name="settings_theme_system_summary">Al momento %1$s</string>
<string name="settings_font_specimen_heading">Giovedì, 14 Maggio</string>
<string name="settings_font_specimen_body">Team review alle 10:00, poi pranzo con Ugo al bar a Piazza di Spagna.</string>
<string name="settings_week_start_auto_summary">Al momento %1$s</string>
<string name="settings_today_toolbar">Pulsante Oggi nella toolbar</string>
<string name="settings_today_toolbar_summary">Mostra il pulsante \"vai alla data\" nella toolbar invece che come pulsante flottante</string>
<string name="settings_app_name">Nome app</string>
<string name="settings_app_name_summary">Mostra Calendula come \"Calendario\" nel launcher. Il nome cambia solo nel launcher; l\'icona potrebbe spostarsi dopo la modifica.</string>
<string name="settings_time_format_auto_summary">Da sistema: %1$s</string>
<string name="settings_timeline_scale">Altezza ore</string>
<string name="settings_timeline_scale_hint">Spazio occupato verticalmente da un\'ora nella vista Giorno e Settimana. Puoi anche modificare l\'altezza come preverisci pizzicando la timeline.</string>
<string name="timeline_scale_fit_day">Occupa la giornata intera</string>
<string name="timeline_scale_fit_day_summary">Tutte le 24 ore in una schermata, senza scrolling</string>
<string name="timeline_scale_compact">Compatto</string>
<string name="timeline_scale_compact_summary">Più ore per schermata, blocchi più piccoli</string>
<string name="timeline_scale_regular">Regolare</string>
<string name="timeline_scale_regular_summary">La spaziatura standard</string>
<string name="timeline_scale_comfortable">Comodo</string>
<string name="timeline_scale_comfortable_summary">Blocchi più ampi, più scrolling</string>
<string name="timeline_scale_custom">Personalizza</string>
<string name="timeline_scale_custom_summary">L\'altezza a cui hai portato la timeline</string>
<string name="settings_drag_to_reschedule">Trascina per ripianificare</string>
<string name="settings_drag_to_reschedule_summary">Ripianifica un evento trascinandolo in un altro giorno o ora</string>
<string name="settings_past_events_sample_morning">Team review</string>
<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">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>
<string name="settings_widget_size_extra_large">Molto grande</string>
<string name="settings_widget_size_summary">Carattere %1$d%%</string>
<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.</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>
<string name="settings_about_privacy">Politica per la Privacy</string>
<string name="calendars_visibility_hint">Deseleziona un calendario per non mostrarlo sul dispositivo: scompariranno gli eventi e non riceverai più promemoria. Questa impostazione agisce anche su altre app calendario. Nulla viene eliminato e il calendario non scompare da nessun altro dispositivo. Puoi riselezionarlo in ogni momento.</string>
<string name="calendars_visibility_a11y">Mostra \"%1$s\"</string>
<string name="calendars_visibility_notice_title">Alcuni calendari non sono attivi</string>
<string name="calendars_visibility_notice_message">Calendula mostra solo i calendari che sono attivi sul dispositivo, e alcuni non lo sono. Per vedere gli eventi di quest\'ultimi, attivali dalle Impostazioni.</string>
<string name="calendar_picker_missing_title">Manca un calendario?</string>
<string name="calendar_picker_missing_summary">Può essere disattivato, in sola lettura o compilato in base ai tuoi contatti. Gestisci qui i tuoi calendari.</string>
<string name="calendars_state_read_only">Sola lettura</string>
<string name="calendars_state_not_synced">Non sincronizzato su questo dispositivo</string>
<string name="calendars_state_managed">Compilato dai tuoi contatti</string>
<string name="calendars_managed_delete_locked">Questo calendario è compilato in base ai tuoi contatti, quindi Calendula lo creerà di nuovo alla prossima sincronizzazione. Per eliminarlo disattiva l\'opzione \"Date Speciali\" nelle Impostazioni.</string>
<string name="calendars_account_from_source">%1$s (%2$s)</string>
<string name="month_style_continuous_summary">Ogni mese è sotto la sua testata, con un piccolo spazio a separarlo dal mese successivo.</string>
<string name="month_style_dense">Settimane continue</string>
<string name="month_style_dense_summary">Le settimane scorrono senza interruzione, ogni mese succede a quello precedente.</string>
<string name="month_style_split">Diviso</string>
<string name="month_style_split_summary">Una griglia compatta indica i giorni con eventi. Gli eventi del giorno selezionato sono elencati sotto.</string>
<string name="month_split_no_events">Nulla in programma</string>
<string name="month_split_expand">Mostra il mese completo</string>
<string name="month_split_collapse">Mostra gli eventi del giorno</string>
<string name="settings_event_duration">Durata standard</string>
<string name="settings_event_duration_hint">Quanto durano gli eventi se non modifichi l\'orario di fine. Non ha effetto sugli eventi giornalieri.</string>
<string name="settings_calendar_durations_title">Durata per calendario</string>
<string name="settings_calendar_durations_hint">Assegna a ciascun calendario la sua durata standard (e.g. 8 ore per il calendario dei turni lavorativi).</string>
<string name="settings_calendar_duration_inherits">Default (%1$s)</string>
<string name="settings_calendar_duration_use_default">Usa la durata standard (%1$s)</string>
<string name="settings_allday_reminder_fires_at">Promemoria alle %1$s</string>
<string name="settings_group_look">Aspetto e Comportamento</string>
<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">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">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>
<string name="settings_default_view_hint">La vista di default all\'apertura dell\'app.</string>
<string name="settings_week_start_hint">Il giorno in cui inizia ogni settimana, in tutta l\'app e i suoi widget.</string>
<string name="settings_time_format_hint">Formato degli orari in tutta l\'app. Di default viene seguito il formato di sistema.</string>
</resources>

View File

@@ -17,14 +17,14 @@
<string name="state_failure_no_calendars_action">Перейти в системные настройки календаря</string>
<string name="state_failure_provider">Не удалось просмотреть календарь.</string>
<string name="permission_rationale_title">Следите за всеми своими событиями. С красотой</string>
<string name="permission_rationale_body">Calendula требуется доступ к вашему календарю, чтобы показывать и управлять вашими событиями. Это всё, что приложение требует с самого начала и никакая информация не покидает ваше устройство.</string>
<string name="permission_rationale_body">Calendula требуется доступ к вашему календарю, чтобы показывать и управлять вашими событиями. Это всё, что приложение требует с самого начала и никакая информация не покидает ваш девайс.</string>
<string name="permission_request_button">Дать доступ к календарю</string>
<string name="permission_denied_title">В доступе к календарю отказано</string>
<string name="permission_denied_body">Calendula не может показать события без доступа к календарю. Предоставьте его снова в настройках телефона.</string>
<string name="permission_open_settings_button">Открыть настройки телефона</string>
<string name="permission_retry_button">Попытайтесь снова</string>
<string name="permission_benefit_private_title">Приватность по умолчанию</string>
<string name="permission_benefit_private_body">Нет доступа к интернету, нету телеметрии — ничто не покидает ваше устройство.</string>
<string name="permission_benefit_private_title">Остаётся на вашем устройстве</string>
<string name="permission_benefit_private_body">Ваши календари просматриваются локально и информация никогда не покидает устройство.</string>
<string name="permission_benefit_sync_title">Все ваши календари. Вместе</string>
<string name="permission_benefit_sync_body">Google, CalDAV, локальный календарь всё синхронизированное с устройством просто подключается.</string>
<string name="permission_benefit_privacy_title">Никакого отслеживания. Никогда</string>
@@ -62,75 +62,4 @@
<string name="event_edit_close">Закрыть</string>
<string name="event_edit_save">Сохранить</string>
<string name="event_edit_title_hint">Добавить имя</string>
<string name="event_move_action">Перенести…</string>
<string name="event_move_recurring_title">Перенести повторяющиеся события</string>
<string name="event_move_done">Перенесено на %1$s</string>
<string name="event_move_undo">Отменить</string>
<string name="event_move_occurrence_only">Перемещение всей серии изменит дни на которые она попадёт, поэтому можно переместить только это событие.</string>
<string name="event_move_undone">Перемещение отменено</string>
<string name="event_move_failed">Не удалось переместить событие</string>
<string name="event_move_write_denied">Приложению Calendula требуется доступ на запись, чтобы перемещать события</string>
<string name="event_move_gone">Это событие больше не существует</string>
<string name="event_move_blocked_series_end">Нельзя переместить событие дальше за пределы его серии</string>
<string name="event_edit_managed_hint">Управляется «%1$s» — название, дата и повторение синхронизируются с ваших контактов. Напоминания, местоположения и заметки могут быть редактированы вами.</string>
<string name="event_edit_starts">Начинается</string>
<string name="event_edit_ends">Заканчивается</string>
<string name="event_edit_error_end_before_start">Заканчивается раньше, чем начинается</string>
<string name="event_edit_error_no_calendar">Нет календарей с правами на запись</string>
<string name="event_edit_save_failed">Не удалось сохранить событие</string>
<string name="event_edit_write_denied">Приложению Calendula требуется доступ на запись, чтобы создавать события</string>
<string name="event_edit_more_fields">Больше полей</string>
<string name="event_edit_add">Добавить</string>
<string name="event_edit_add_reminder">Добавить напоминание</string>
<string name="event_edit_remove_reminder">Удалить напоминание</string>
<string name="event_edit_attendees">Гости</string>
<string name="event_edit_add_guest">Добавить гостя</string>
<string name="event_edit_add_guest_hint">Добавить гостя по почте…</string>
<string name="event_edit_add_guest_from_contacts">Добавить из контактов</string>
<string name="event_edit_location_from_contacts">Выбрать адрес из контактов</string>
<string name="event_edit_remove_guest">Удалить гостя</string>
<string name="event_edit_attendee_required">Обязательный</string>
<string name="event_edit_attendee_optional">Необязательный</string>
<string name="event_edit_attendees_note_synced">Calendula не отправляет приглашения. Ваша учётная запись календаря может отправить письма гостям при синхронизации.</string>
<string name="event_edit_attendees_note_local">Хранится на этом устройстве. Никто не получит уведомление.</string>
<string name="event_edit_reminder_custom">Другое</string>
<string name="reminder_unit_minutes">минуты</string>
<string name="reminder_unit_hours">часы</string>
<string name="reminder_unit_days">дни</string>
<string name="reminder_unit_weeks">недели</string>
<string name="event_edit_availability">Занятость</string>
<string name="event_edit_visibility">Видимость</string>
<string name="event_edit_timezone_device">Часовой пояс устройства</string>
<string name="event_edit_timezone_device_summary">Следует за вами, где бы вы ни были</string>
<string name="event_edit_timezone_search">Поиск часовых поясов</string>
<string name="event_edit_timezone_recent">Недавние</string>
<string name="event_edit_timezone_all">Все часовые пояса</string>
<string name="event_edit_timezone_none">Часовые пояса, соответсвующие «%1$s», не найдены</string>
<string name="event_edit_timezone_local_time">%1$s по вашему времени</string>
<string name="event_edit_color">Цвет</string>
<string name="event_edit_color_default">Цвет календаря</string>
<string name="event_edit_color_custom">Свой цвет</string>
<string name="event_edit_color_reset">Сбросить</string>
<string name="event_edit_color_unsupported">Недоступно для этого календаря</string>
<string name="event_edit_color_unsupported_hint">Этот календарь не публикует набор цветов. Вы можете разрешить пользовательские цвета для таких календарей в Настройках.</string>
<string name="event_edit_color_sync_warning">Этот календарь может потерять или перезаписать цвет при следующей синхронизации.</string>
<string name="event_edit_conflict_title">Событие изменено в другом месте</string>
<string name="event_edit_conflict_body">Пока вы редактировали, это событие было изменено — синхронизацией или другим приложением. Что вы хотите сделать с вашими изменениями?</string>
<string name="event_edit_conflict_overwrite">Сохранить мои изменения</string>
<string name="event_edit_conflict_overwrite_hint">Только изменённые вами поля, перезаписывают внешние изменения</string>
<string name="event_edit_conflict_discard">Отменить мои изменения</string>
<string name="event_edit_conflict_discard_hint">Событие остаётся таким, как сейчас</string>
<string name="event_edit_gone_title">Событие удалено</string>
<string name="event_edit_gone_body">Это событие было удалено, пока вы его редактировали, например на другом устройстве. Ваши изменения больше не могут быть сохранены.</string>
<string name="import_reminder_prompt_title">Применить ваше стандартное напоминание?</string>
<string name="import_reminder_prompt_body_none">Это событие было импортировано без каких-либо напоминаний.</string>
<plurals name="import_reminder_prompt_body_existing">
<item quantity="one">Это событие было импортировано с %1$d напоминанием.</item>
<item quantity="few">Это событие было импортировано с %1$d напоминаниями.</item>
<item quantity="many">Это событие было импортировано с %1$d напоминаниями.</item>
<item quantity="other">Это событие было импортировано с %1$d напоминаниями.</item>
</plurals>
<string name="import_reminder_prompt_apply">Применить стандартное</string>
<string name="import_reminder_prompt_keep">Оставить как есть</string>
<string name="event_edit_recurrence_none">Не повторяется</string>
</resources>

View File

@@ -496,7 +496,7 @@
<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>
<string name="settings_quick_switch_hint">Choose which views the top-right button cycles through, and drag to reorder them. Turned-off views stay reachable from the navigation menu.</string>
<string name="settings_quick_switch_hint">Choose which views the top-right button cycles through, and drag to reorder them. With fewer than two views turned on the button is hidden. Turned-off views stay reachable from the navigation menu.</string>
<string name="settings_drawer_order_header">Navigation menu</string>
<string name="settings_drawer_order_hint">Drag to reorder the views listed in the navigation menu.</string>
<string name="reorder_drag_handle">Drag to reorder</string>

View File

@@ -1,6 +1,5 @@
package de.jeanlucmakiola.calendula.data.calendar
import android.provider.CalendarContract
import com.google.common.truth.Truth.assertThat
import kotlin.time.Instant
import org.junit.jupiter.api.Test
@@ -18,7 +17,6 @@ class InstanceMapperTest {
eventColor: Any? = null,
calendarColor: Int = 0xFFAABBCC.toInt(),
location: String? = null,
selfAttendeeStatus: Int = CalendarContract.Attendees.ATTENDEE_STATUS_NONE,
): MapColumnReader = MapColumnReader(
InstanceProjection.IDX_INSTANCE_ID to instanceId,
InstanceProjection.IDX_EVENT_ID to eventId,
@@ -30,7 +28,6 @@ class InstanceMapperTest {
InstanceProjection.IDX_EVENT_COLOR to eventColor,
InstanceProjection.IDX_CALENDAR_COLOR to calendarColor,
InstanceProjection.IDX_LOCATION to location,
InstanceProjection.IDX_SELF_ATTENDEE_STATUS to selfAttendeeStatus,
)
@Test
@@ -93,20 +90,4 @@ class InstanceMapperTest {
val inst = reader(location = "Berlin").toEventInstance()
assertThat(inst!!.location).isEqualTo("Berlin")
}
@Test
fun `a declined invitation is marked, any other answer is not`() {
assertThat(reader().toEventInstance()!!.isDeclined).isFalse()
assertThat(
reader(selfAttendeeStatus = CalendarContract.Attendees.ATTENDEE_STATUS_DECLINED)
.toEventInstance()!!.isDeclined,
).isTrue()
listOf(
CalendarContract.Attendees.ATTENDEE_STATUS_ACCEPTED,
CalendarContract.Attendees.ATTENDEE_STATUS_TENTATIVE,
CalendarContract.Attendees.ATTENDEE_STATUS_INVITED,
).forEach { status ->
assertThat(reader(selfAttendeeStatus = status).toEventInstance()!!.isDeclined).isFalse()
}
}
}

View File

@@ -0,0 +1,40 @@
package de.jeanlucmakiola.calendula.ui.common
import androidx.compose.ui.text.style.TextOverflow
import com.google.common.truth.Truth.assertThat
import org.junit.jupiter.api.Test
class EventTitleOverflowTest {
@Test
fun `a single LTR line clips, so the title runs to the chip's edge`() {
val result = eventTitleOverflowFor(rtl = false, singleLine = true)
assertThat(result.overflow).isEqualTo(TextOverflow.Clip)
// Load-bearing: with softWrap on, a clipped line breaks at the last
// whole word and shows less title than the ellipsis did (#164).
assertThat(result.softWrap).isFalse()
}
@Test
fun `RTL keeps the ellipsis, which truncates at the logical end`() {
// Clipping with softWrap off cuts at the node's left edge, which in RTL
// is the end of the string — the title would lose its beginning.
val result = eventTitleOverflowFor(rtl = true, singleLine = true)
assertThat(result.overflow).isEqualTo(TextOverflow.Ellipsis)
assertThat(result.softWrap).isTrue()
}
@Test
fun `a multi-line block keeps the ellipsis, since wrapping needs softWrap`() {
val result = eventTitleOverflowFor(rtl = false, singleLine = false)
assertThat(result.overflow).isEqualTo(TextOverflow.Ellipsis)
assertThat(result.softWrap).isTrue()
}
@Test
fun `multi-line in RTL keeps the ellipsis too`() {
val result = eventTitleOverflowFor(rtl = true, singleLine = false)
assertThat(result.overflow).isEqualTo(TextOverflow.Ellipsis)
assertThat(result.softWrap).isTrue()
}
}

View File

@@ -120,4 +120,30 @@ class ViewBackStackTest {
)
assertThat(config.cycle).containsExactly(CalendarView.Agenda, CalendarView.Month).inOrder()
}
@Test
fun `a cycle can be emptied down to no views at all`() {
// #150: the settings screen no longer holds a floor, so every view may go.
val config = QuickSwitchConfig(order = IMPLEMENTED_VIEWS, enabled = emptySet())
assertThat(config.cycle).isEmpty()
assertThat(config.cycle.size).isLessThan(QuickSwitchConfig.MIN_CYCLE)
}
@Test
fun `one enabled view is below the cycle minimum, so the pill hides`() {
// A single target is not a switch — it hides rather than becoming a
// jump-to-one-view button, which would be dead once you were there.
val config = QuickSwitchConfig(order = IMPLEMENTED_VIEWS, enabled = setOf(CalendarView.Day))
assertThat(config.cycle).containsExactly(CalendarView.Day)
assertThat(config.cycle.size).isLessThan(QuickSwitchConfig.MIN_CYCLE)
}
@Test
fun `two enabled views are enough to show the pill`() {
val config = QuickSwitchConfig(
order = IMPLEMENTED_VIEWS,
enabled = setOf(CalendarView.Day, CalendarView.Month),
)
assertThat(config.cycle.size).isAtLeast(QuickSwitchConfig.MIN_CYCLE)
}
}

View File

@@ -1,124 +0,0 @@
package de.jeanlucmakiola.calendula.ui.detail
import android.content.ContextWrapper
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import com.google.common.truth.Truth.assertThat
import de.jeanlucmakiola.calendula.data.calendar.CalendarRepositoryImpl
import de.jeanlucmakiola.calendula.data.calendar.FakeCalendarDataSource
import de.jeanlucmakiola.calendula.data.ics.IcsExporter
import de.jeanlucmakiola.calendula.data.prefs.CalendarPrefs
import de.jeanlucmakiola.calendula.data.prefs.SettingsPrefs
import de.jeanlucmakiola.calendula.domain.CalendarSource
import de.jeanlucmakiola.calendula.domain.EventDetail
import de.jeanlucmakiola.calendula.domain.EventInstance
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.setMain
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir
import java.nio.file.Path
import kotlin.time.Instant
/**
* Re-opening an occurrence must re-read it (#196): the view model outlives the
* sheet, so an edit that changed no time would otherwise show the pre-save row.
* The re-read stays silent — the loaded content must not blink back to the
* skeleton on the way.
*/
@OptIn(ExperimentalCoroutinesApi::class)
class EventDetailViewModelTest {
private val dispatcher = UnconfinedTestDispatcher()
@BeforeEach fun setUp() = Dispatchers.setMain(dispatcher)
@AfterEach fun tearDown() = Dispatchers.resetMain()
private val beginMillis = 1_781_164_800_000L
private val endMillis = beginMillis + 3_600_000L
private fun detail(description: String?) = EventDetail(
instance = EventInstance(
instanceId = 42L, eventId = 42L, calendarId = 1L, title = "Standup",
start = Instant.fromEpochMilliseconds(beginMillis),
end = Instant.fromEpochMilliseconds(endMillis),
isAllDay = false, color = 0xFF000000.toInt(), location = null,
),
description = description, organizer = null, attendees = emptyList(), rrule = null,
)
private fun viewModel(tempDir: Path, fake: FakeCalendarDataSource): EventDetailViewModel {
val prefs = CalendarPrefs(
PreferenceDataStoreFactory.create(
scope = CoroutineScope(dispatcher),
produceFile = { tempDir.resolve("detail_prefs.preferences_pb").toFile() },
),
)
val settings = SettingsPrefs(
PreferenceDataStoreFactory.create(
scope = CoroutineScope(dispatcher),
produceFile = { tempDir.resolve("detail_settings.preferences_pb").toFile() },
),
)
val repo = CalendarRepositoryImpl(fake, prefs, settings, dispatcher as CoroutineDispatcher)
// Only `shareUri()` touches the exporter, and nothing here shares.
return EventDetailViewModel(repo, IcsExporter(ContextWrapper(null)), dispatcher)
}
private fun fakeSource(description: () -> String?) = FakeCalendarDataSource().apply {
calendarsResult = listOf(
CalendarSource(
id = 1L, displayName = "Cal", accountName = "acc@local", accountType = "LOCAL",
color = 0xFF112233.toInt(), isVisibleInSystem = true, canModifyContents = true,
),
)
eventDetailResult = { detail(description()) }
}
@Test
fun `re-opening the same occurrence re-reads it`(@TempDir tempDir: Path) = runTest(dispatcher) {
var stored: String? = null
val vm = viewModel(tempDir, fakeSource { stored })
val collector = launch(Job()) { vm.state.collect {} }
vm.open(42L, beginMillis, endMillis)
advanceUntilIdle()
assertThat((vm.state.value as EventDetailUiState.Success).detail.description).isNull()
// The edit screen saved a description; the tapped occurrence is unchanged.
stored = "Bring the roadmap"
vm.open(42L, beginMillis, endMillis)
advanceUntilIdle()
assertThat((vm.state.value as EventDetailUiState.Success).detail.description)
.isEqualTo("Bring the roadmap")
collector.cancel()
}
@Test
fun `the re-read does not fall back to the skeleton`(@TempDir tempDir: Path) = runTest(dispatcher) {
val vm = viewModel(tempDir, fakeSource { null })
val seen = mutableListOf<EventDetailUiState>()
val collector = launch(Job()) { vm.state.collect { seen += it } }
vm.open(42L, beginMillis, endMillis)
advanceUntilIdle()
assertThat(vm.state.value).isInstanceOf(EventDetailUiState.Success::class.java)
seen.clear()
vm.open(42L, beginMillis, endMillis)
advanceUntilIdle()
assertThat(seen).doesNotContain(EventDetailUiState.Loading)
collector.cancel()
}
}

View File

@@ -1,122 +0,0 @@
package de.jeanlucmakiola.calendula.ui.month
import com.google.common.truth.Truth.assertThat
import de.jeanlucmakiola.calendula.domain.EventInstance
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.DayOfWeek
import kotlinx.datetime.LocalDate
import kotlinx.datetime.Month
import kotlinx.datetime.TimeZone
import kotlinx.datetime.YearMonth
import kotlinx.datetime.atTime
import kotlinx.datetime.plus
import kotlinx.datetime.toInstant
import org.junit.jupiter.api.Test
/**
* Which chip a tap in a month cell lands on (#187) — the geometry the tap layer
* uses to tell "open this event" from "open this day", given that the chips take
* no pointer input of their own.
*/
class ChipAtCellYTest {
private val zone = TimeZone.UTC
private val jul26 = YearMonth(2026, Month.JULY)
/** Band starts 40px down the cell; each lane is 20px tall. */
private val bandTop = 40f
private val laneHeight = 20f
/** July 2026 starts on a Wednesday, so this row — Jul 612 — sits wholly inside it. */
private fun rowOfJuly6(events: List<EventInstance>) =
layoutMonthWeeks(jul26, DayOfWeek.MONDAY, events, zone)[1]
private fun allDay(from: LocalDate, toInclusive: LocalDate, id: Long) = EventInstance(
instanceId = id,
eventId = id,
calendarId = 1L,
title = "A$id",
start = from.atTime(0, 0).toInstant(zone),
end = toInclusive.plus(1, DateTimeUnit.DAY).atTime(0, 0).toInstant(zone),
isAllDay = true,
color = 0xFF2196F3.toInt(),
location = null,
)
private fun timed(date: LocalDate, hour: Int, id: Long) = EventInstance(
instanceId = id,
eventId = id,
calendarId = 1L,
title = "T$id",
start = date.atTime(hour, 0).toInstant(zone),
end = date.atTime(hour + 1, 0).toInstant(zone),
isAllDay = false,
color = 0xFFF44336.toInt(),
location = null,
)
private fun MonthWeek.chipAt(col: Int, cellY: Float) =
chipAtCellY(col = col, cellY = cellY, bandTopInCell = bandTop, rowHeightPx = laneHeight)
@Test
fun `a tap on a lane resolves to the chip seated there`() {
val bar = allDay(LocalDate(2026, 7, 7), LocalDate(2026, 7, 9), id = 1L)
val meeting = timed(LocalDate(2026, 7, 7), hour = 9, id = 2L)
val week = rowOfJuly6(listOf(bar, meeting))
// Jul 7 is column 1 of a Monday-anchored row starting Jul 6.
assertThat(week.chipAt(col = 1, cellY = bandTop + 5f)?.eventId).isEqualTo(1L)
assertThat(week.chipAt(col = 1, cellY = bandTop + laneHeight + 5f)?.eventId).isEqualTo(2L)
}
@Test
fun `a multi-day bar answers on every column it covers`() {
val bar = allDay(LocalDate(2026, 7, 7), LocalDate(2026, 7, 9), id = 1L)
val week = rowOfJuly6(listOf(bar))
(1..3).forEach { col ->
assertThat(week.chipAt(col = col, cellY = bandTop + 5f)?.eventId).isEqualTo(1L)
}
// Jul 10 is past the bar's last day.
assertThat(week.chipAt(col = 4, cellY = bandTop + 5f)).isNull()
}
@Test
fun `a tap above the band is the day number, not a chip`() {
val week = rowOfJuly6(listOf(timed(LocalDate(2026, 7, 7), hour = 9, id = 2L)))
assertThat(week.chipAt(col = 1, cellY = bandTop - 1f)).isNull()
assertThat(week.chipAt(col = 1, cellY = 0f)).isNull()
}
@Test
fun `a tap on an empty lane of a day that has chips falls through to the day`() {
val week = rowOfJuly6(listOf(timed(LocalDate(2026, 7, 7), hour = 9, id = 2L)))
assertThat(week.chipAt(col = 1, cellY = bandTop + laneHeight * 2 + 5f)).isNull()
}
@Test
fun `a tap on the overflow row opens the day rather than a hidden event`() {
val events = (1..MAX_EVENT_ROWS + 2).map {
timed(LocalDate(2026, 7, 7), hour = it, id = it.toLong())
}
val week = rowOfJuly6(events)
// The dots sit one lane below the last one the row draws.
val overflowY = bandTop + laneHeight * MAX_EVENT_ROWS + 2f
assertThat(week.chipAt(col = 1, cellY = overflowY)).isNull()
}
@Test
fun `unmeasured geometry resolves to no chip`() {
val week = rowOfJuly6(listOf(timed(LocalDate(2026, 7, 7), hour = 9, id = 2L)))
assertThat(
week.chipAtCellY(col = 1, cellY = 45f, bandTopInCell = null, rowHeightPx = laneHeight),
).isNull()
assertThat(
week.chipAtCellY(col = 1, cellY = 45f, bandTopInCell = bandTop, rowHeightPx = 0f),
).isNull()
}
}

View File

@@ -1,8 +0,0 @@
إصلاحات
• النقر على حدث في عرض الشهر يفتح الحدث نفسه بدل يومه.
• التعديل يظهر فور إعادة فتح الحدث.
• لم تعد أسهم أداة الشهر تتوقف بعد بضع نقرات: تحديث ضخم كان يُسقط مضيف الأدوات في المشغّل.
• «اليوم» في الأسابيع المتصلة يصل إلى الأسبوع الحالي تماماً، وعادت مسافة الهامش على يسار عرضي اليوم والأسبوع.
تغييرات
• الحدث الذي رفضته يظهر مشطوباً في كل مكان ولم يعد يُذكّرك به.

View File

@@ -1,8 +0,0 @@
Behoben
• Ein Tippen auf einen Termin in der Monatsansicht öffnet ihn statt des Tages.
• Eine Änderung ist sofort sichtbar, wenn der Termin neu geöffnet wird.
• Die Pfeile des Monats-Widgets sterben nicht mehr nach wenigen Tipps eine zu große Aktualisierung riss den Widget-Host mit.
• „Heute“ springt in nahtlosen Wochen genau auf die aktuelle Woche; Wochen- und Tagesansicht haben rechts wieder Abstand.
Geändert
• Ein abgelehnter Termin ist überall durchgestrichen und erinnert nicht mehr.

View File

@@ -1,8 +0,0 @@
Fixed
• Tapping an event in month view now opens the event instead of its day.
• An edit shows straight away when you re-open the event.
• The month widget's arrows no longer die after a few taps — an oversized update was killing the launcher's widget host.
• Jump-to-today in seamless weeks lands on the current week, and day/week view no longer run flush against the right edge.
Changed
• A meeting you declined is struck through everywhere and no longer reminds you.

View File

@@ -1,8 +0,0 @@
Fixed
• Tapping an event in month view now opens the event instead of its day.
• An edit shows straight away when you re-open the event.
• The month widget's arrows no longer die after a few taps — an oversized update was killing the launcher's widget host.
• Jump-to-today in seamless weeks lands on the current week, and day/week view no longer run flush against the right edge.
Changed
• A meeting you declined is struck through everywhere and no longer reminds you.

View File

@@ -1,8 +0,0 @@
Corregido
• Tocar un evento en la vista de mes abre el evento, no su día.
• Un cambio se ve en cuanto vuelves a abrir el evento.
• Las flechas del widget de mes ya no se quedan muertas tras unos toques: una actualización demasiado grande tumbaba el host de widgets del launcher.
• «Hoy» en semanas continuas llega justo a la semana actual, y las vistas de día y semana vuelven a tener margen a la derecha.
Cambios
• Un evento que has rechazado aparece tachado en todas partes y ya no avisa.

View File

@@ -1,8 +0,0 @@
Corrigé
• Appuyer sur un événement en vue mois ouvre l'événement, pas sa journée.
• Une modification apparaît dès que l'événement est rouvert.
• Les flèches du widget mois ne meurent plus après quelques appuis : une mise à jour trop lourde emportait l'hôte de widgets du lanceur.
• « Aujourd'hui » en semaines continues arrive pile sur la semaine en cours ; les vues jour et semaine ont de nouveau une marge à droite.
Modifié
• Un événement refusé est barré partout et ne vous rappelle plus rien.

View File

@@ -1,8 +0,0 @@
Corretto
• Toccare un evento nella vista mese apre l'evento, non il suo giorno.
• Una modifica si vede subito riaprendo l'evento.
• Le frecce del widget mese non muoiono più dopo pochi tocchi: un aggiornamento troppo grande abbatteva l'host dei widget del launcher.
• «Oggi» nelle settimane continue arriva esattamente sulla settimana corrente, e le viste giorno e settimana hanno di nuovo un margine a destra.
Modifiche
• Un evento rifiutato è barrato ovunque e non invia più promemoria.

View File

@@ -1,8 +0,0 @@
Poprawki
• Dotknięcie wydarzenia w widoku miesiąca otwiera wydarzenie, a nie jego dzień.
• Zmiana jest widoczna od razu po ponownym otwarciu wydarzenia.
• Strzałki widżetu miesiąca nie zamierają już po kilku dotknięciach zbyt duża aktualizacja kładła host widżetów launchera.
• „Dziś” w ciągłych tygodniach trafia dokładnie w bieżący tydzień, a widoki dnia i tygodnia znów mają margines z prawej.
Zmiany
• Odrzucone wydarzenie jest wszędzie przekreślone i nie przypomina o sobie.

View File

@@ -1,8 +0,0 @@
Corrigido
• Tocar em um evento na visualização de mês abre o evento, e não o seu dia.
• Uma alteração aparece assim que o evento é reaberto.
• As setas do widget de mês não morrem mais depois de alguns toques: uma atualização grande demais derrubava o host de widgets do launcher.
• "Hoje" nas semanas contínuas chega exatamente na semana atual, e as visualizações de dia e semana voltaram a ter margem à direita.
Alterações
• Um evento recusado fica riscado em todo lugar e não lembra mais você.

View File

@@ -1,8 +0,0 @@
Corrigido
• Tocar num evento na vista de mês abre o evento e não o seu dia.
• Uma alteração aparece assim que o evento é reaberto.
• As setas do widget de mês já não morrem ao fim de alguns toques: uma atualização demasiado grande derrubava o anfitrião de widgets do launcher.
• «Hoje» nas semanas contínuas chega mesmo à semana atual, e as vistas de dia e semana voltam a ter margem à direita.
Alterações
• Um evento recusado fica riscado em todo o lado e deixa de lembrar.

View File

@@ -1,8 +0,0 @@
Исправлено
• Нажатие на событие в виде месяца открывает событие, а не его день.
• Изменение видно сразу при повторном открытии события.
• Стрелки виджета месяца больше не отмирают после нескольких нажатий: слишком большое обновление роняло хост виджетов лаунчера.
• «Сегодня» в непрерывных неделях попадает точно на текущую неделю, а у видов дня и недели снова есть отступ справа.
Изменения
• Отклонённое событие везде зачёркнуто и больше не напоминает о себе.

View File

@@ -1,8 +0,0 @@
修复
• 在月视图中点按事件现在会打开该事件本身,而不是它所在的那一天。
• 编辑后再次打开事件,改动会立即显示。
• 月视图小部件的箭头不再点几下就失灵:过大的更新会拖垮启动器的小部件宿主。
• 连续周视图中的“今天”会精确定位到本周,日视图和周视图右侧也重新留出了间距。
变更
• 已拒绝的事件在各处均以删除线标记,并且不再提醒。

View File

@@ -1,7 +1,7 @@
[versions]
agp = "9.2.1"
kotlin = "2.3.21"
ksp = "2.3.11"
ksp = "2.3.10"
hilt = "2.60.1"
coreKtx = "1.19.0"
appcompat = "1.7.1"