Repository navigation
Conversation
The app targets SDK 36, so from API 35 on the platform lays the window out edge to edge: the theme's android:statusBarColor is ignored, the window is transparent and the status bar icons are drawn on top of whatever the app paints there. The drawer layout still carried android:fitsSystemWindows, so the window background (colorPrimaryDark) showed through behind the status bar while the action bar and the now playing bar stopped short of the screen edges, and the navigation bar area was left black. Drop fitsSystemWindows from the drawer layout and handle the insets per view in SubsonicActivity.applyEdgeToEdgeInsets(), which listens on the decor for systemBars()|displayCutout(): - both toolbars grow by the top inset and take the same inset as padding, so their background paints the status bar while the title and the icons stay below it; the content of the main activity follows with its top margin - the now playing bar keeps the navigation bar area coloured: the swipe target is padded at the bottom and the panel height is raised by the same amount, so the collapsed bar stays the same visual height - the now playing fragment container and the drawer are padded at the bottom, the drawer header is padded and grown by the top inset (its height is fixed, padding alone would squeeze its content) - screens without a now playing bar (the settings activity) pad their content frame at the bottom instead - nothing is applied in full screen mode, where the bars are hidden anyway Since the status bar icons now sit on the action bar colour, take the icon contrast in applyEdgeToEdge() from actionbarBackgroundColor (or the custom action bar colour) instead of colorPrimaryDark.
The settings screens run on the deprecated android.preference framework, so their widgets are still platform styled. Two things were visibly non-M3: - Category headers: the platform layout hardcodes TextAppearance.Material.Body2 and ?android:attr/colorAccent. android:preferenceCategoryStyle now points at our own layout using the M3 type scale and colorPrimary. - Preference dialogs: the platform DialogPreference creates framework AlertDialogs, which read android:alertDialogTheme. MaterialComponents sets it to its Material 2 overlay, so these dialogs looked M2 next to the app's MaterialAlertDialogs. Point it at the M3 framework overlay instead. The overlay is applied on top of the activity theme, so the Light/Dark/Black/ Holo colour roles carry over without re-declaring them. Preference rows themselves needed nothing: the platform row layout already takes its typography from ?attr/textAppearanceListItem, which the M3 theme defines.
The last place that built a classic AppCompat AlertDialog. The preference framework still creates framework AlertDialogs; those are handled separately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.