Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #99 from zeoflow/bottom-sheet-full-corners
Browse files Browse the repository at this point in the history
Fixed `BottomSheet` full corners radius
  • Loading branch information
teogor authored Jun 15, 2021
2 parents 7fd7162 + ff89b35 commit 7756ce2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ public void setHeaderData(@Nullable View headerRoot, int headerSize) {

public void setSubmenuCorners(int submenuCorners) {
if (marginSubHeader == 0) {
subContainerBackground.setCornerSize(0);
subContainerBackground.setTopCornerSize(0);
return;
}
subContainerBackground.setCornerSize(submenuCorners);
subContainerBackground.setTopCornerSize(submenuCorners);
}

public void addRootView(@NonNull View rootView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,13 @@ public void setCornerSize(float cornerSize) {
setShapeAppearanceModel(drawableState.shapeAppearanceModel.withCornerSize(cornerSize));
}

/**
* Updates the corners for the given {@link CornerSize}.
*/
public void setTopCornerSize(float cornerSize) {
setShapeAppearanceModel(drawableState.shapeAppearanceModel.withTopCornerSize(cornerSize));
}

/**
* Updates the corners for the given {@link CornerSize}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ public ShapeAppearanceModel withCornerSize(float cornerSize)
return toBuilder().setAllCornerSizes(cornerSize).build();
}

@NonNull
public ShapeAppearanceModel withTopCornerSize(float cornerSize)
{
return toBuilder().setTopLeftCornerSize(cornerSize).setTopRightCornerSize(cornerSize).build();
}

@NonNull
public ShapeAppearanceModel withCornerSize(@NonNull CornerSize cornerSize)
{
Expand Down

0 comments on commit 7756ce2

Please sign in to comment.