本文整理汇总了Java中com.edmodo.cropper.util.HandleUtil.getPressedHandle方法的典型用法代码示例。如果您正苦于以下问题:Java HandleUtil.getPressedHandle方法的具体用法?Java HandleUtil.getPressedHandle怎么用?Java HandleUtil.getPressedHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.edmodo.cropper.util.HandleUtil
的用法示例。
在下文中一共展示了HandleUtil.getPressedHandle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActionDown
import com.edmodo.cropper.util.HandleUtil; //导入方法依赖的package包/类
/**
* Handles a {@link android.view.MotionEvent#ACTION_DOWN} event.
*
* @param x the x-coordinate of the down action
* @param y the y-coordinate of the down action
*/
private void onActionDown(float x, float y) {
final float left = Edge.LEFT.getCoordinate();
final float top = Edge.TOP.getCoordinate();
final float right = Edge.RIGHT.getCoordinate();
final float bottom = Edge.BOTTOM.getCoordinate();
mPressedHandle = HandleUtil.getPressedHandle(x, y, left, top, right, bottom, mHandleRadius);
if (mPressedHandle == null)
return;
// Calculate the offset of the touch point from the precise location
// of the handle. Save these values in a member variable since we want
// to maintain this offset as we drag the handle.
mTouchOffset = HandleUtil.getOffset(mPressedHandle, x, y, left, top, right, bottom);
invalidate();
}
示例2: onActionDown
import com.edmodo.cropper.util.HandleUtil; //导入方法依赖的package包/类
/**
* Handles a {@link MotionEvent#ACTION_DOWN} event.
*
* @param x the x-coordinate of the down action
* @param y the y-coordinate of the down action
*/
private void onActionDown(float x, float y) {
final float left = Edge.LEFT.getCoordinate();
final float top = Edge.TOP.getCoordinate();
final float right = Edge.RIGHT.getCoordinate();
final float bottom = Edge.BOTTOM.getCoordinate();
mPressedHandle = HandleUtil.getPressedHandle(x, y, left, top, right, bottom, mHandleRadius);
if (mPressedHandle == null)
return;
// Calculate the offset of the touch point from the precise location
// of the handle. Save these values in a member variable since we want
// to maintain this offset as we drag the handle.
mTouchOffset = HandleUtil.getOffset(mPressedHandle, x, y, left, top, right, bottom);
invalidate();
}
示例3: a
import com.edmodo.cropper.util.HandleUtil; //导入方法依赖的package包/类
private void a(float f1, float f2)
{
float f3 = Edge.LEFT.getCoordinate();
float f4 = Edge.TOP.getCoordinate();
float f5 = Edge.RIGHT.getCoordinate();
float f6 = Edge.BOTTOM.getCoordinate();
v = HandleUtil.getPressedHandle(f1, f2, f3, f4, f5, f6, s);
if (v == null)
{
return;
} else
{
u = HandleUtil.getOffset(v, f1, f2, f3, f4, f5, f6);
invalidate();
return;
}
}
示例4: onActionDown
import com.edmodo.cropper.util.HandleUtil; //导入方法依赖的package包/类
/**
* Handles a {@link MotionEvent#ACTION_DOWN} event.
*
* @param x the x-coordinate of the down action
* @param y the y-coordinate of the down action
*/
private void onActionDown(float x, float y) {
final float left = Edge.LEFT.getCoordinate();
final float top = Edge.TOP.getCoordinate();
final float right = Edge.RIGHT.getCoordinate();
final float bottom = Edge.BOTTOM.getCoordinate();
mPressedHandle = HandleUtil.getPressedHandle(x, y, left, top, right, bottom, mHandleRadius);
// Calculate the offset of the touch point from the precise location of the handle.
// Save these values in member variable 'mTouchOffset' so that we can maintain this offset as we drag the handle.
if (mPressedHandle != null) {
HandleUtil.getOffset(mPressedHandle, x, y, left, top, right, bottom, mTouchOffset);
invalidate();
}
}
示例5: isCropperSelection
import com.edmodo.cropper.util.HandleUtil; //导入方法依赖的package包/类
private boolean isCropperSelection(MotionEvent ev){
final float left = Edge.LEFT.getCoordinate();
final float top = Edge.TOP.getCoordinate();
final float right = Edge.RIGHT.getCoordinate();
final float bottom = Edge.BOTTOM.getCoordinate();
if (HandleUtil.getPressedHandle(ev.getX(), ev.getY(), left, top, right, bottom, HandleUtil.getTargetRadius(getContext())) == null) {
return false;
}
return true;
}