Skip to content

Commit 2204562

Browse files
melaniegoetzdsn5ft
authored andcommitted
Fix expanded state appearance to match spec and ShapeAppearanceModel reference in BottomSheetBehavior
PiperOrigin-RevId: 225064028
1 parent 4039732 commit 2204562

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,14 @@ void setStateInternal(@State int state) {
747747

748748
private void updateDrawableOnStateChange(@State int state) {
749749
if (materialShapeDrawable != null) {
750-
if (state == STATE_EXPANDED && (parentHeight <= viewRef.get().getHeight())) {
750+
if (state == STATE_EXPANDED) {
751751
// If the bottomsheet is fully expanded, change ShapeAppearance to sharp corners to
752752
// indicate the bottomsheet has no more content to scroll.
753753
// Overriding of this style may be performed in the bottomsheet callback.
754-
materialShapeDrawable.getShapeAppearanceModel().setCornerRadius(0);
755-
materialShapeDrawable.invalidateSelf();
754+
ShapeAppearanceModel shapeAppearanceModelExpanded =
755+
new ShapeAppearanceModel(shapeAppearanceModelDefault);
756+
shapeAppearanceModelExpanded.setCornerRadius(0);
757+
materialShapeDrawable.setShapeAppearanceModel(shapeAppearanceModelExpanded);
756758
}
757759
if (state == STATE_COLLAPSED || state == STATE_DRAGGING) {
758760
materialShapeDrawable.setShapeAppearanceModel(shapeAppearanceModelDefault);

0 commit comments

Comments
 (0)