tmytのらくがき

個人の日記レベルです

BottomSheetDialogFragmentの角を丸くする

backgroundつけても反映されないのでshapeApperanceOverlayを設定するのがいいらしい。

<style name="MyBottomSheetDialogTheme" parent="@style/ThemeOverlay.MaterialComponents.DayNight.BottomSheetDialog">
    <item name="bottomSheetStyle">@style/MyModalStyle</item>
</style>
<style name="MyModalStyle" parent="Widget.MaterialComponents.BottomSheet.Modal">
    <item name="shapeAppearanceOverlay">@style/BottomSheet.CornerRadius</item>
</style>
<style name="BottomSheet.CornerRadius" parent="">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSize">2dp</item>
</style>