[BottomSheetDialog] Rounded corners in expanded state
See original GitHub issueDescription: BottomSheetDialog
has rounded corers only if it’s not expanded. Corners are rounded as it’s specified in the ShapeAppearance
during swipe or in collapsed state. Once BottomSheetDialog
becomes expanded, rounded corners are animated to sharp corners.
Expected behavior: Rounded corners should not change in expanded state if expanded state is not full screen. It would be great to have ability to disable this behavior at least.
Source code:
<style name="ThemeOverlay.App.BottomSheetDialog"parent="ThemeOverlay.MaterialComponents.Dialog">
<item name="android:windowIsFloating">false</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowAnimationStyle">@style/Animation.MyTheme.BottomSheet.Modal</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="bottomSheetStyle">@style/Widget.App.BottomSheet.Modal</item>
<item name="android:navigationBarColor">?colorSurface</item>
<item name="android:navigationBarDividerColor" tools:ignore="NewApi">@android:color/transparent</item>
<item name="android:windowLightStatusBar" tools:ignore="NewApi">false</item>
</style>
<style name="Widget.App.BottomSheet.Modal" parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="shapeAppearanceOverlay">@style/ShapeAppearance.App.BottomSheet</item>
</style>
<style name="ShapeAppearance.App.BottomSheet" parent="ShapeAppearance.MaterialComponents.LargeComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopLeft">16dp</item>
<item name="cornerSizeTopRight">16dp</item>
<item name="cornerSizeBottomLeft">0dp</item>
<item name="cornerSizeBottomRight">0dp</item>
</style>
Android API version: 29
Material Library version: 1.2.0-alpha06
Device: Pixel 3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:32
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Round corner for BottomSheetDialogFragment - Stack Overflow
This will change all the BottomSheetDialogs of your app. ... In the expanded state the BottomSheet has flat corners .
Read more >Customizing your bottom sheet's corners - Bryan Herbst
Here's a guide to getting your bottom sheets shaped properly! Bottom sheet with cut corner Bottom sheet with rounded corners.
Read more >Bottom sheet dialog with Rounded corners ... - YouTube
Hello Dosto. In this tutorial, we will see how to create a bottom sheet dialog in android studio.and we will implement Model bottomsheet...
Read more >Show rounded corners for BottomSheetDialogFragment
“Show rounded corners for BottomSheetDialogFragment” is published by Travis Kim. ... Create round shape of the BottomSheetDialog as shape_rounded_dialog.xml ...
Read more >BottomSheetBehavior - Android Developers
Gets the friction coefficient to hide the bottom sheet, or set it to the next closest expanded state. int, getMaxHeight().
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can try this:
in bottom sheet layout
drawable/rounded_top_corners_background :
in activity/application theme
@Fishfield Can you share a more complete example? I’ve tried setting
shapeAppearance
andshapeAppearanceOverlay
and neither seems to apply when the sheet is expanded like you said.