当前位置: 首页>>代码示例>>Java>>正文


Java HandleUtil.getOffset方法代码示例

本文整理汇总了Java中com.edmodo.cropper.util.HandleUtil.getOffset方法的典型用法代码示例。如果您正苦于以下问题:Java HandleUtil.getOffset方法的具体用法?Java HandleUtil.getOffset怎么用?Java HandleUtil.getOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.edmodo.cropper.util.HandleUtil的用法示例。


在下文中一共展示了HandleUtil.getOffset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:26,代码来源:CropOverlayView.java

示例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();
}
 
开发者ID:wangeason,项目名称:PhotoViewCropper,代码行数:26,代码来源:CropOverlayView.java

示例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;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:18,代码来源:CropOverlayView.java

示例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();
    }
}
 
开发者ID:edmodo,项目名称:cropper,代码行数:23,代码来源:CropImageView.java


注:本文中的com.edmodo.cropper.util.HandleUtil.getOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。