mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
[Adaptive] [Side Sheet] Renamed SheetEdge#RIGHT to SheetEdge#EDGE_RIGHT.
PiperOrigin-RevId: 493093973
This commit is contained in:
parent
14fa66a2a9
commit
2ab5430fed
@ -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. */
|
||||
|
||||
@ -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 {}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user