diff --git a/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java b/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java index 4976c48a686..97e82f4ce69 100644 --- a/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java +++ b/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java @@ -1364,6 +1364,26 @@ public boolean isGestureInsetBottomIgnored() { return gestureInsetBottomIgnored; } + /** + * Sets whether the bottom sheet should remove its corners when it reaches the expanded state. + * + *

If false, the bottom sheet will only remove its corners if it is expanded and reaches the + * top of the screen. + */ + public void setShouldRemoveExpandedCorners(boolean shouldRemoveExpandedCorners) { + if (this.shouldRemoveExpandedCorners != shouldRemoveExpandedCorners) { + this.shouldRemoveExpandedCorners = shouldRemoveExpandedCorners; + updateDrawableForTargetState(getState(), /* animate= */ true); + } + } + + /** + * Returns whether the bottom sheet will remove its corners when it reaches the expanded state. + */ + public boolean isShouldRemoveExpandedCorners() { + return shouldRemoveExpandedCorners; + } + /** * Gets the current state of the bottom sheet. *