Repository navigation
Conversation
BottomSheetDialog takes its sheet style from the theme's bottomSheetDialogTheme. An AppCompat theme doesn't set it, so Material falls back to a sheet with a plain color background, and the cast to MaterialShapeDrawable in DevSheet throws when the sheet is laid out. Build the dialog on Material 3, as the tab bar already does.
|
@malopezr7 is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
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.
Opening the dev menu crashes an Android app whose Activity theme is not a Material theme, for example
Theme.AppCompat.DayNight.NoActionBar:BottomSheetDialog(activity)takes its theme from the Activity theme'sbottomSheetDialogTheme. AppCompat themes don't set it, so Material falls back toTheme.Design.Light.BottomSheetDialog, whose sheet style has no shape appearance and a?android:attr/colorBackgroundbackground. The sheet's background is then aColorDrawable, and the cast inDevSheetthrows. The 0.0.1-alpha.16 release notes say apps with a compatible AppCompat theme can keep it.This builds the dialog on a
ContextThemeWrapperwithTheme.Material3.DayNight.NoActionBar, asHybridNavigationTabsdoes for its tab bar.DevSheetsets its own fill color and corners, andDevStyleonly reads night mode, so the menu's content looks the same. Apps with a MaterialComponents theme or their ownbottomSheetDialogThemenow get the Material 3 sheet animation and insets for this menu.ModalSheetinnitro-ui-navigationcasts the sheet background the same way. I haven't reproduced it there, so it isn't changed here.Verification
Pixel 9 emulator, Android 37, example app connected to the dev server, menu opened with
m. With the example's theme switched toTheme.AppCompat.DayNight.NoActionBar(not part of this PR):main: the process dies with the trace above.With the example's own
Theme.Material3.DayNight.NoActionBar, screenshots of the open menu onmainand on this branch show no pixel below the status bar that differs by more than 16/255, in light and dark mode. I only ran the AppCompat and Material 3 themes../gradlew :runtime:testDebugUnitTestandbun run android --build-only --abi arm64-v8apass. I didn't run it on Android versions below 37; the theme is the one the tab bar already uses.bun run typecheckfails inpackages/bundler/test/inlinePlatform.test.ts, which this PR doesn't touch.