BottomSheetDialogFragment の角を丸くする必要があったため、背景としてカスタム ドローアブルを適用しました。しかし、カスタム背景を適用した後、BottomSheet のボタンはカスタム背景を受け入れません。白い背景を表示するだけです。backgroundTint は正常に機能し、ボタンの色を変更します。
themes.xml :
<style name="AppBottomSheetDialogTheme"
parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppModalStyle</item>
</style>
<style name="AppModalStyle"
parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/add_new_bg</item>
</style>
add_new_bg.xml :
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@color/background"/>
<corners
android:topLeftRadius="40dp"
android:topRightRadius="40dp"/>
</shape>
BottomSheetDialogFragment コード:
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.AppBottomSheetDialogTheme);
}