From 97d5dad3479421fb4fc7c1356b37e95ccdde651e Mon Sep 17 00:00:00 2001 From: William Harris Date: Thu, 22 Jan 2026 03:37:03 +0000 Subject: [PATCH 01/16] fix: bottom sheet styles material --- android/app/src/main/res/values-night/styles.xml | 2 +- android/app/src/main/res/values/styles.xml | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml index 15e33162..c3a0b15c 100644 --- a/android/app/src/main/res/values-night/styles.xml +++ b/android/app/src/main/res/values-night/styles.xml @@ -2,7 +2,7 @@ - + - @@ -23,9 +25,9 @@ true - + - + - From 7ac33245355e6572e6c19cc2e1f4de7486d0bcfe Mon Sep 17 00:00:00 2001 From: William Harris Date: Thu, 22 Jan 2026 04:07:05 +0000 Subject: [PATCH 02/16] docs: plant for full material components migration --- docs/README.md | 1 + .../material_components_theme_migration.md | 269 ++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 docs/dev_todo/material_components_theme_migration.md diff --git a/docs/README.md b/docs/README.md index 85847f63..c567e366 100644 --- a/docs/README.md +++ b/docs/README.md @@ -60,6 +60,7 @@ Features and changes under consideration: - [Events View Lookahead](dev_todo/events_view_lookahead.md) - Upcoming events tab, pre-actions, filter pills ⭐ *Active* - [Milestone 2: Pre-Actions](dev_todo/event_lookahead_milestone2_pre_actions.md) - Pre-mute, pre-snooze, pre-dismiss ✅ - [Milestone 3: Filter Pills](dev_todo/event_lookahead_milestone3_filter_pills.md) - Status, Time, Calendar filters 🚧 +- [MaterialComponents Theme Migration](dev_todo/material_components_theme_migration.md) - Full Material Design support ([#15](https://github.com/williscool/CalendarNotification/issues/15), [#225](https://github.com/williscool/CalendarNotification/issues/225)) - [Deprecated Features Removal](dev_todo/deprecated_features.md) - QuietHours, CalendarEditor - [Android Modernization](dev_todo/android_modernization.md) - Coroutines, Hilt DI opportunities - [Raise Min SDK](dev_todo/raise_min_sdk.md) - API 24 → 26+ considerations diff --git a/docs/dev_todo/material_components_theme_migration.md b/docs/dev_todo/material_components_theme_migration.md new file mode 100644 index 00000000..2119cceb --- /dev/null +++ b/docs/dev_todo/material_components_theme_migration.md @@ -0,0 +1,269 @@ +# MaterialComponents Theme Migration + +## Status: Planning +## Related: [#15 - Upgrade the UI](https://github.com/williscool/CalendarNotification/issues/15), [#225 - Filter pills bottom sheet dark theme](https://github.com/williscool/CalendarNotification/issues/225) + +## Overview + +The app currently uses `Theme.AppCompat.DayNight` as its base theme. While this provides basic dark mode support, Material Components (bottom sheets, dialogs, etc.) don't automatically inherit the dark theme styling. + +This document outlines the migration path to `Theme.MaterialComponents.DayNight` for full Material Design support with automatic dark mode. + +## Background + +### Current State +- Base theme: `Theme.AppCompat.DayNight.DarkActionBar` +- Material library version: `com.google.android.material:material:1.12.0` +- Bottom sheets use `BottomSheetDialogFragment` from Material library +- Dialogs use `AlertDialog.Builder` from AppCompat + +### Problem +Material Components don't inherit dark mode styling from AppCompat themes. This causes: +- Bottom sheets with light backgrounds in dark mode +- Inconsistent dialog styling +- Manual theme overrides needed for each component + +### Solution Options + +| Option | Approach | Scope | Risk | +|--------|----------|-------|------| +| **A** | Add `bottomSheetDialogTheme` attribute | Targeted fix for bottom sheets only | Low | +| **B** | Switch to `Theme.MaterialComponents.DayNight` | App-wide Material styling | Medium | + +**Option A** was merged for the immediate bottom sheet fix. +**Option B** is tracked here for the broader UI upgrade. + +## Option B: Full MaterialComponents Migration + +### Changes Required + +#### 1. Theme Parent Change (DONE in test branch) + +**`values/styles.xml`:** +```xml + + ``` **`values-night/styles.xml`:** ```xml - - ``` +**Effort:** 30 minutes +**Impact:** High - enables all Material 3 component styling + --- -#### 2. AlertDialog → MaterialAlertDialogBuilder +## 1.2 AlertDialog → MaterialAlertDialogBuilder **Impact:** 52 usages across 14 files -**Effort:** Medium (2-3 hours) -**Visual Impact:** High (Material dialogs have rounded corners, different button styling) +**Effort:** 2-3 hours +**Visual Impact:** High (M3 dialogs have full-width buttons, more padding) **Files to update:** -- `MainActivityModern.kt` (3 usages) -- `MainActivityLegacy.kt` (4 usages) -- `MainActivityBase.kt` (4 usages) -- `ViewEventActivityNoRecents.kt` (7 usages) -- `SnoozeAllActivity.kt` (7 usages) -- `PreActionActivity.kt` (2 usages) -- `EditEventActivity.kt` (9 usages) -- `DismissedEventsActivity.kt` (2 usages) -- `CalendarsActivity.kt` (2 usages) -- `DismissedEventsFragment.kt` (2 usages) -- `NavigationSettingsFragmentX.kt` (3 usages) -- `MiscSettingsFragmentX.kt` (3 usages) -- `SnoozePresetPreferenceX.kt` (2 usages) -- `ListPreference.kt` (2 usages) +| File | Count | +|------|-------| +| `EditEventActivity.kt` | 9 | +| `ViewEventActivityNoRecents.kt` | 7 | +| `SnoozeAllActivity.kt` | 7 | +| `MainActivityLegacy.kt` | 4 | +| `MainActivityBase.kt` | 4 | +| `MainActivityModern.kt` | 3 | +| `NavigationSettingsFragmentX.kt` | 3 | +| `MiscSettingsFragmentX.kt` | 3 | +| `PreActionActivity.kt` | 2 | +| `DismissedEventsActivity.kt` | 2 | +| `CalendarsActivity.kt` | 2 | +| `DismissedEventsFragment.kt` | 2 | +| `SnoozePresetPreferenceX.kt` | 2 | +| `ListPreference.kt` | 2 | **Change pattern:** ```kotlin @@ -102,168 +129,344 @@ MaterialAlertDialogBuilder(context) --- -#### 3. Material Color Attributes +## 1.3 Fix EditText Styling -**Impact:** Improves theme consistency -**Effort:** Low (30 minutes) +**File:** `bottom_sheet_calendar_filter.xml` +**Effort:** 15 minutes -Add to `values/colors.xml`: ```xml - -@color/cardview_light_background -@color/primary_text -@color/icons -@color/primary_dark -@color/accent + + + + + + + + + ``` -Add to `values-night/colors.xml`: +--- + +## 1.4 CardView → MaterialCardView + +**File:** `content_main.xml` +**Effort:** 15 minutes + ```xml - -@color/cardview_light_background -@color/primary_text -@color/icons -@color/primary_dark -@color/accent + + + + + ``` -Add to `values/styles.xml` AppTheme: +--- + +## 1.5 Button Styling + +Material 3 buttons have different default styles: + ```xml -@color/colorSurface -@color/colorOnSurface -@color/colorOnPrimary -@color/colorPrimaryVariant -@color/colorSecondaryVariant + +