public class HandleUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HandleUtil.Position |
| Modifier and Type | Field and Description |
|---|---|
Handle |
BOTTOM |
Handle |
BOTTOM_LEFT |
Handle |
BOTTOM_RIGHT |
Handle |
CENTER |
Handle |
LEFT |
Handle |
RIGHT |
Handle |
TOP |
Handle |
TOP_LEFT |
Handle |
TOP_RIGHT |
| Constructor and Description |
|---|
HandleUtil(CropRect cropRect) |
| Modifier and Type | Method and Description |
|---|---|
static android.util.Pair<java.lang.Float,java.lang.Float> |
getOffset(Handle handle,
float x,
float y,
float left,
float top,
float right,
float bottom)
Calculates the offset of the touch point from the precise location of the
specified handle.
|
Handle |
getPressedHandle(float x,
float y,
float left,
float top,
float right,
float bottom,
float targetRadius)
Determines which, if any, of the handles are pressed given the touch
coordinates, the bounding box, and the touch radius.
|
static float |
getTargetRadius(android.content.Context context)
Gets the default target radius (in pixels).
|
boolean |
showGuidelines()
Indicates whether the crop window is small enough that the guidelines
should be shown.
|
public Handle TOP
public Handle LEFT
public Handle RIGHT
public Handle BOTTOM
public Handle CENTER
public Handle TOP_LEFT
public Handle TOP_RIGHT
public Handle BOTTOM_LEFT
public Handle BOTTOM_RIGHT
public HandleUtil(CropRect cropRect)
public static float getTargetRadius(@NonNull
android.content.Context context)
context - the Context@Nullable public Handle getPressedHandle(float x, float y, float left, float top, float right, float bottom, float targetRadius)
x - the x-coordinate of the touch pointy - the y-coordinate of the touch pointleft - the x-coordinate of the left boundtop - the y-coordinate of the top boundright - the x-coordinate of the right boundbottom - the y-coordinate of the bottom boundtargetRadius - the target radius in pixelspublic boolean showGuidelines()
@Nullable
public static android.util.Pair<java.lang.Float,java.lang.Float> getOffset(@Nullable
Handle handle,
float x,
float y,
float left,
float top,
float right,
float bottom)