• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HandleUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



HandleUtil类属于com.edmodo.cropper.util包,在下文中一共展示了HandleUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例5: init

import com.edmodo.cropper.util.HandleUtil; //导入依赖的package包/类
private void init(Context context) {

        DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();

        mHandleRadius = HandleUtil.getTargetRadius(context);

        mSnapRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                SNAP_RADIUS_DP,
                displayMetrics);

        mBorderPaint = PaintUtil.newBorderPaint(context);
        mGuidelinePaint = PaintUtil.newGuidelinePaint();
        mBackgroundPaint = PaintUtil.newBackgroundPaint(context);
        mCornerPaint = PaintUtil.newCornerPaint(context);

        // Sets the values for the corner sizes
        mCornerOffset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                DEFAULT_CORNER_OFFSET_DP,
                displayMetrics);
        mCornerExtension = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                DEFAULT_CORNER_EXTENSION_DP,
                displayMetrics);
        mCornerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                DEFAULT_CORNER_LENGTH_DP,
                displayMetrics);

        // Sets guidelines to default until specified otherwise
        mGuidelines = CropImageView.DEFAULT_GUIDELINES;
    }
 
开发者ID:g82,项目名称:open-mygirl-android-gradle,代码行数:30,代码来源:CropOverlayView.java


示例6: init

import com.edmodo.cropper.util.HandleUtil; //导入依赖的package包/类
private void init(Context context) {

        DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();

        mHandleRadius = HandleUtil.getTargetRadius(context);

        mSnapRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                                                SNAP_RADIUS_DP,
                                                displayMetrics);

        mBorderPaint = PaintUtil.newBorderPaint(context);
        mGuidelinePaint = PaintUtil.newGuidelinePaint();
        mBackgroundPaint = PaintUtil.newBackgroundPaint(context);
        mCornerPaint = PaintUtil.newCornerPaint(context);

        // Sets the values for the corner sizes
        mCornerOffset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                                                  DEFAULT_CORNER_OFFSET_DP,
                                                  displayMetrics);
        mCornerExtension = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                                                     DEFAULT_CORNER_EXTENSION_DP,
                                                     displayMetrics);
        mCornerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                                                  DEFAULT_CORNER_LENGTH_DP,
                                                  displayMetrics);

        // Sets guidelines to default until specified otherwise
        mGuidelines = CropImageView.DEFAULT_GUIDELINES;
    }
 
开发者ID:wangeason,项目名称:PhotoViewCropper,代码行数:30,代码来源:CropOverlayView.java


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JISystem类代码示例发布时间:2022-05-23
下一篇:
Java CaseInsensitiveHeaders类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap