Skip to content

Commit

Permalink
[Bottom Sheet] Add method to allow programmatically changing shouldRe…
Browse files Browse the repository at this point in the history
…moveExpandedCorners behavior

PiperOrigin-RevId: 525155162
  • Loading branch information
dsn5ft authored and drchen committed Apr 19, 2023
1 parent e56e9b1 commit c8a0d47
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,26 @@ public boolean isGestureInsetBottomIgnored() {
return gestureInsetBottomIgnored;
}

/**
* Sets whether the bottom sheet should remove its corners when it reaches the expanded state.
*
* <p>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.
*
Expand Down

0 comments on commit c8a0d47

Please sign in to comment.