Skip to content

Commit c8a0d47

Browse files
dsn5ftdrchen
authored andcommitted
[Bottom Sheet] Add method to allow programmatically changing shouldRemoveExpandedCorners behavior
PiperOrigin-RevId: 525155162
1 parent e56e9b1 commit c8a0d47

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,26 @@ public boolean isGestureInsetBottomIgnored() {
13641364
return gestureInsetBottomIgnored;
13651365
}
13661366

1367+
/**
1368+
* Sets whether the bottom sheet should remove its corners when it reaches the expanded state.
1369+
*
1370+
* <p>If false, the bottom sheet will only remove its corners if it is expanded and reaches the
1371+
* top of the screen.
1372+
*/
1373+
public void setShouldRemoveExpandedCorners(boolean shouldRemoveExpandedCorners) {
1374+
if (this.shouldRemoveExpandedCorners != shouldRemoveExpandedCorners) {
1375+
this.shouldRemoveExpandedCorners = shouldRemoveExpandedCorners;
1376+
updateDrawableForTargetState(getState(), /* animate= */ true);
1377+
}
1378+
}
1379+
1380+
/**
1381+
* Returns whether the bottom sheet will remove its corners when it reaches the expanded state.
1382+
*/
1383+
public boolean isShouldRemoveExpandedCorners() {
1384+
return shouldRemoveExpandedCorners;
1385+
}
1386+
13671387
/**
13681388
* Gets the current state of the bottom sheet.
13691389
*

0 commit comments

Comments
 (0)