Skip to content

feat: Calendar selection for event list widget#1160

Merged
naveensingh merged 11 commits intoFossifyOrg:mainfrom
kvithayathil:feature/widget_calendar_selection
Apr 28, 2026
Merged

feat: Calendar selection for event list widget#1160
naveensingh merged 11 commits intoFossifyOrg:mainfrom
kvithayathil:feature/widget_calendar_selection

Conversation

@kvithayathil
Copy link
Copy Markdown
Contributor

@kvithayathil kvithayathil commented Apr 25, 2026

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • User can select which calendars to display on the event list widget
  • Added a settings button on the event list widget

Tests performed

  • Manual testing that existing features work as expected

Before & after preview

Annotation Screenshot
Event list configuration ignoreImageMinify
Calendar selection ignoreImageMinify
Event list configuration with calendar selection result ignoreImageMinify

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

Add nullable calendars field (String? DEFAULT NULL) to Widget entity for
per-widget calendar filtering. NULL = fallback to global, empty = show nothing.

- Widget.kt: add calendars field, isCalendarsConfigured(), getCalendarIdsAsList()
- EventsDatabase.kt: bump version 11→12, MIGRATION_11_12 adds column
- Constants.kt: add EVENT_LIST_CALENDARS intent extra key
- ic_settings_vector.xml: Material Settings gear icon (24dp)
- strings.xml: add widget_calendars, widget_calendars_summary, widget_calendars_all
…widget

Add per-widget calendar selection to the event list widget. Each widget
instance can now filter events to specific calendars, overriding the
global display settings.

- Add overrideCalendarIds parameter to EventsHelper.getEventsSync() with
  widget-wins-completely logic (skips all global filter including
  birthday/anniversary)
- Add calendars Intent extra to WidgetService for per-instance filtering
- Add settings gear icon to widget header via direct PendingIntent
- Add calendar picker row to widget config screen with SelectCalendarsDialog
- Guard back press during re-configuration to avoid clearing widget
- Disable save button until existing config loads from Room
Generated by KSP during build. Captures the new nullable calendars
TEXT column on the widgets table introduced by migration 11->12.
Add calendar selection UI to the widget configuration screen with
explicit tracking of user intent to distinguish three states:

- null (never configured): falls back to global filter, shows 'All calendars'
- empty string (explicitly chose none): shows 'No calendars selected' + warning
- comma-separated IDs: shows 'N calendars selected'

Changes:
- Flatten widget_config_list.xml to ConstraintLayout
- Add calendar picker button with SelectCalendarsDialog
- Track mCalendarsExplicitlyChosen flag through config/reconfig cycle
- Fix saveConfig to preserve explicit-zero as empty string sentinel
- Fix updateCalendarPickerLabel for 3-state display
- Show warning when zero calendars explicitly selected
- Fix EventListWidgetAdapter intent parsing for null vs empty-string
- Fix MyWidgetListProvider to only set calendars extra when non-null
- Pre-check all calendars when default selection is used
- Add ic_calendar_add_vector drawable and dimension resources
@kvithayathil kvithayathil force-pushed the feature/widget_calendar_selection branch from 4e1fa50 to f0a9793 Compare April 25, 2026 23:18
@kvithayathil kvithayathil force-pushed the feature/widget_calendar_selection branch from 5dba819 to dea77fc Compare April 25, 2026 23:35
Replace ImageView with ImageButton and add accessibility labels
for configure, new event, and show today actions in the event
list widget header.
…Compat

Remove @deprecated onBackPressed override in WidgetListConfigureActivity
in favor of the compatibility-aware onBackPressedCompat/performDefaultBack
pattern from the commons library.
…urce

- Replace Map<Long, Int> with LongSparseArray<Int> in
  EventsHelper for Android-idiomatic long-keyed map usage
- Use @color/dark_grey reference instead of hardcoded hex in
  debug launcher background drawable
@naveensingh naveensingh merged commit 80dd4d9 into FossifyOrg:main Apr 28, 2026
8 checks passed
@naveensingh
Copy link
Copy Markdown
Member

Hey, this got merged accidentally without review (script failure). Could you please recreate this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option for widget to choose shown event types

2 participants