Choose the suitable template if exists.
Other
Title says it all.

I think this is default behavior 🤔
https://github.com/material-components/material-components-android/pull/437
Should I fix this issue? 😃
I checked with the designer. Since this is a feature of the app, I want to put it in. 🍨
@takahirom
✋
I have two ideas.
Which is best solution?
@Dai1678 Thanks for the idea!!
The first one seems to be good because it can get on the mechanism of the component.
Thank you. I will try this issue.
Thanks! Assigned 👍
すみません。意図を全部英語で正しく伝えきるのが難しいので日本語で失礼します...
use BottomSheetBehavior.addBottomSheetCallback and adjust topLeft radius.
支持頂いたこちらの方法で実装してみているのですが、上手くいかない状況でヘルプを頂きたいです
左上の角のみを調整するのにMaterialShapeDrawableを使って実装してみているのですが、以下の問題点が発生してしまっています
addBottomSheetCallback内ではなくonViewCreatedの直後でレイアウトに対してMaterialShapeDrawableをセットするようにしたが、MaterialShapeDrawableが適用されない (メソッドは呼ばれている)backgroundにmaterialShapeDrawableを設定すると、そのレイアウトに設定されていたstyle(もしくはbackgroundTintのみ?)が無視されるので setTintでR.attr.colorSurfaceを適用したが、ダークモード時の色が以前と変わってしまったWidget.MaterialComponents.BottomSheetのbackgroundTintで定義されている値がcolorSurfaceだったので使用)|ライトモード|ダークモード|
|---|---|
|
|
|
つたない文章で申し訳ありませんがご確認頂けると助かります。
他に良い方法があればご教授頂きたいです。
@Dai1678
How about use MaterialShapeDrawable.createWithElevationOverlay for the second problem?
Like this ↓
val materialShapeDrawable = MaterialShapeDrawable.createWithElevationOverlay(requireActivity(), elevation).apply {
setShapeAppearanceModel(shapeAppearanceModel)
}
@Dai1678
I think the first problem can be solved by setting shapeAppearance to null.
<style name="Widget.DroidKaigi.BottomSheet" parent="Widget.MaterialComponents.BottomSheet">
<item name="shapeAppearance">@null</item>
</style>
materialBackground that BottomSheetBehavior has is not overwritten by setBackground.
@NUmeroAndDev
Thank you for reply!!!
All your suggestions worked correctly.
I will create fix PR.
Most helpful comment
@takahirom
✋
I have two ideas.
https://github.com/material-components/material-components-android/pull/437#issuecomment-536734312
Which is best solution?