public class Edge
extends java.lang.Object
implements android.os.Parcelable
| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<Edge> |
CREATOR |
| Modifier | Constructor and Description |
|---|---|
protected |
Edge(android.os.Parcel in) |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustCoordinate(float aspectRatio)
Adjusts this Edge position such that the resulting window will have the
given aspect ratio.
|
void |
adjustCoordinate(float x,
float y,
float imageSnapRadius,
float aspectRatio)
Sets the Edge to the given x-y coordinate but also adjusting for snapping
to the image bounds and parent view border constraints.
|
int |
describeContents() |
float |
getCoordinate()
Gets the coordinate of the Edge
|
boolean |
isNewRectangleOutOfBounds(Edge edge,
float aspectRatio) |
boolean |
isOutsideMargin(android.graphics.Rect rect,
float margin)
Determines if this Edge is outside the inner margins of the given bounding
rectangle.
|
void |
offset(float distance)
Add the given number of pixels to the current coordinate position of this
Edge.
|
void |
setCoordinate(float coordinate)
Sets the coordinate of the Edge.
|
float |
snapOffset()
Returns the potential snap offset of snaptoRect, without changing the coordinate.
|
float |
snapToRect()
Snap this Edge to the given image boundaries.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<Edge> CREATOR
public void setCoordinate(float coordinate)
coordinate - the position of the edgepublic void offset(float distance)
distance - the number of pixels to addpublic float getCoordinate()
public void adjustCoordinate(float x,
float y,
float imageSnapRadius,
float aspectRatio)
x - the x-coordinatey - the y-coordinateimageSnapRadius - the radius (in pixels) at which the edge should
snap to the imagepublic void adjustCoordinate(float aspectRatio)
aspectRatio - the aspect ratio to achievepublic boolean isNewRectangleOutOfBounds(@NonNull
Edge edge,
float aspectRatio)
public float snapToRect()
public float snapOffset()
public boolean isOutsideMargin(@NonNull
android.graphics.Rect rect,
float margin)
public int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelable