Закругленные края в BottomSheetDialogFragment
Как правильно сделать закругленные края в BottomSheetDialogFragment? Применил:
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<ripple android:color="?attr/colorControlHighlight">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/button_buttom_navigation_color_activity"/>
<corners
android:topLeftRadius="25dp"
android:topRightRadius="25dp"/>
</shape>
</item>
</ripple>
</inset>
Но получил слишком темный цвет в пустых закругленных местах.
Ответы (1 шт):
Автор решения: Binary
→ Ссылка
В классе наследуемом от BottomSheetDialogFragment()
override fun getTheme() = R.style.AppBottomSheetDialogTheme
В Theme
<style name="AppBottomSheetDialogTheme" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppModalStyle</item>
<item name="android:windowIsFloating">false</item>
</style>
<style name="AppModalStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/bottom_sheet_background</item>
</style>
bottom_sheet_background
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:topLeftRadius="12dp"
android:topRightRadius="12dp"/>
</shape>
