Skip to content

Commit

Permalink
[Adaptive] [Side Sheet] Renamed SheetEdge#RIGHT to SheetEdge#EDGE_RIGHT.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 493093973
  • Loading branch information
afohrman authored and leticiarossi committed Dec 6, 2022
1 parent 14fa66a commit 2ab5430
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class RightSheetDelegate extends SheetDelegate {
@SheetEdge
@Override
int getSheetEdge() {
return SideSheetBehavior.RIGHT;
return SideSheetBehavior.EDGE_RIGHT;
}

/** Returns the sheet's offset in pixels from the origin edge when hidden. */
Expand Down
9 changes: 6 additions & 3 deletions lib/java/com/google/android/material/sidesheet/Sheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,19 @@ interface Sheet {
@Retention(RetentionPolicy.SOURCE)
@interface StableSheetState {}

/** The sheet is based on the right edge; it slides from the right edge towards the left. */
int RIGHT = 0;
/**
* The sheet is based on the right edge of the screen; it slides from the right edge towards the
* left.
*/
int EDGE_RIGHT = 0;

/**
* The edge of the screen that a sheet slides out of.
*
* @hide
*/
@RestrictTo(LIBRARY_GROUP)
@IntDef({RIGHT})
@IntDef({EDGE_RIGHT})
@Retention(RetentionPolicy.SOURCE)
@interface SheetEdge {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,19 @@ public SideSheetBehavior(@NonNull Context context, @Nullable AttributeSet attrs)
private void setSheetEdge(@SheetEdge int sheetEdge) {
if (sheetDelegate == null || sheetDelegate.getSheetEdge() != sheetEdge) {

if (sheetEdge == RIGHT) {
if (sheetEdge == EDGE_RIGHT) {
this.sheetDelegate = new RightSheetDelegate(this);
return;
}

throw new IllegalArgumentException(
"Invalid sheet edge position value: " + sheetEdge + ". Must be " + RIGHT);
"Invalid sheet edge position value: " + sheetEdge + ". Must be " + EDGE_RIGHT);
}
}

@SheetEdge
private int getDefaultSheetEdge() {
return RIGHT;
return EDGE_RIGHT;
}

/**
Expand Down

0 comments on commit 2ab5430

Please sign in to comment.