[Adaptive] [Side Sheet] Renamed SheetEdge#RIGHT to SheetEdge#EDGE_RIGHT.

PiperOrigin-RevId: 493093973
This commit is contained in:
afohrman 2022-12-05 16:18:05 -05:00 committed by Leticia Santos
parent 14fa66a2a9
commit 2ab5430fed
3 changed files with 10 additions and 7 deletions

View File

@ -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. */

View File

@ -66,8 +66,11 @@ 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.
@ -75,7 +78,7 @@ interface Sheet {
* @hide
*/
@RestrictTo(LIBRARY_GROUP)
@IntDef({RIGHT})
@IntDef({EDGE_RIGHT})
@Retention(RetentionPolicy.SOURCE)
@interface SheetEdge {}

View File

@ -158,19 +158,19 @@ public class SideSheetBehavior<V extends View> extends CoordinatorLayout.Behavio
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;
}
/**