You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor preferences and Android Studio lessons to use Material 3 components
This commit updates the styling of preference items and Android Studio lesson items to align with Material 3 guidelines.
Specific changes include:
- Renamed layout files:
- `item_android_studio_lesson.xml` to `item_preference.xml`
- `item_android_studio_category.xml` to `item_preference_category.xml`
- Updated `AndroidStudioFragment.java`:
- Inflates `item_preference.xml` and `item_preference_category.xml` directly instead of using data binding for these layouts.
- Updated `LessonHolder` and `CategoryHolder` to use standard `findViewById` with new Android system IDs for title, summary, icon, etc.
- `LessonHolder` now inflates `item_preference_widget_open_in_new.xml` into its `widgetFrame`.
- Handles visibility and clickability of the external link button more robustly.
- Updated `preferences_settings.xml`:
- Assigns `item_preference_category.xml` as the layout for `PreferenceCategory`.
- Assigns `item_preference.xml` as the layout for individual `Preference` and `ListPreference` items.
- Assigns `widget_preference_switch.xml` as the `widgetLayout` for `SwitchPreferenceCompat`.
- Assigns `item_preference_widget_open_notifications.xml` and `item_preference_widget_open_in_new.xml` as `widgetLayout` for specific preferences.
- Sets `app:iconSpaceReserved="false"` for preferences to allow icon visibility to be controlled by the presence of an icon.
- Created `SettingsFragment.java`:
- Implements custom styling for preference items within a `RecyclerView`.
- Adds `PreferenceSpacingDecoration` to manage spacing between preference items.
- Dynamically updates the corner radius of `MaterialCardView` for preferences to create a grouped appearance within categories (first item has rounded top corners, last item has rounded bottom corners).
- Synchronizes the visibility of icon frames and widget frames based on the visibility of their content.
- Added new layout files:
- `item_preference_widget_open_notifications.xml`: Layout for an icon button to open notification settings.
- `item_preference_widget_open_in_new.xml`: Layout for an icon button to open links in a new window/browser.
- Added `ic_arrow_outward.xml` drawable.
- Modified `widget_preference_switch.xml`:
- Changed ID to `@android:id/switch_widget`.
- Set `clickable` and `focusable` to true.
- Added `preference_list_vertical_padding` dimension in `dimens.xml`.
- Added padding to the bottom of `activity_help.xml`'s ScrollView content.
0 commit comments