Skip to content

Commit 4cf6ece

Browse files
melaniegoetzdsn5ft
authored andcommitted
Automated g4 rollback of changelist 225064028
PiperOrigin-RevId: 225088658
1 parent 2204562 commit 4cf6ece

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

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

748748
private void updateDrawableOnStateChange(@State int state) {
749749
if (materialShapeDrawable != null) {
750-
if (state == STATE_EXPANDED) {
750+
if (state == STATE_EXPANDED && (parentHeight <= viewRef.get().getHeight())) {
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-
ShapeAppearanceModel shapeAppearanceModelExpanded =
755-
new ShapeAppearanceModel(shapeAppearanceModelDefault);
756-
shapeAppearanceModelExpanded.setCornerRadius(0);
757-
materialShapeDrawable.setShapeAppearanceModel(shapeAppearanceModelExpanded);
754+
materialShapeDrawable.getShapeAppearanceModel().setCornerRadius(0);
755+
materialShapeDrawable.invalidateSelf();
758756
}
759757
if (state == STATE_COLLAPSED || state == STATE_DRAGGING) {
760758
materialShapeDrawable.setShapeAppearanceModel(shapeAppearanceModelDefault);

0 commit comments

Comments
 (0)