Search in sources :

Example 76 with PointF

use of android.graphics.PointF in project weex-example by KalicyZhou.

the class WXGesture method createJSONObject.

/**
   * Create a touchObject for a pointer at a certain moment.
   * @param motionEvent motionEvent, which contains all pointers event in a period of time
   * @param pos index used to retrieve a certain moment in a period of time.
   * @param pointerIndex pointerIndex
   * @return JSONObject represent a touch event
   * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Touch">touch</a>
   */
private JSONObject createJSONObject(MotionEvent motionEvent, int pos, int pointerIndex) {
    PointF screenXY, pageXY;
    if (pos == CUR_EVENT) {
        pageXY = getEventLocInPageCoordinate(motionEvent, pointerIndex);
        screenXY = getEventLocInScreenCoordinate(motionEvent, pointerIndex);
    } else {
        pageXY = getEventLocInPageCoordinate(motionEvent, pointerIndex, pos);
        screenXY = getEventLocInScreenCoordinate(motionEvent, pointerIndex, pos);
    }
    return createJSONObject(screenXY, pageXY, (float) motionEvent.getPointerId(pointerIndex));
}
Also used : PointF(android.graphics.PointF)

Example 77 with PointF

use of android.graphics.PointF in project weex-example by KalicyZhou.

the class BottomLeftCorner method getSharpCornerStart.

@NonNull
@Override
protected PointF getSharpCornerStart() {
    PointF pointF = getSharpCornerVertex();
    pointF.y = getBorderBox().height();
    return pointF;
}
Also used : PointF(android.graphics.PointF) NonNull(android.support.annotation.NonNull)

Example 78 with PointF

use of android.graphics.PointF in project weex-example by KalicyZhou.

the class BottomRightCorner method getSharpCornerStart.

@NonNull
@Override
protected PointF getSharpCornerStart() {
    PointF pointF = getSharpCornerVertex();
    pointF.x = getBorderBox().right;
    return pointF;
}
Also used : PointF(android.graphics.PointF) NonNull(android.support.annotation.NonNull)

Example 79 with PointF

use of android.graphics.PointF in project weex-example by KalicyZhou.

the class TopLeftCorner method getSharpCornerStart.

@NonNull
@Override
protected PointF getSharpCornerStart() {
    PointF pointF = getSharpCornerVertex();
    pointF.x = 0;
    return pointF;
}
Also used : PointF(android.graphics.PointF) NonNull(android.support.annotation.NonNull)

Example 80 with PointF

use of android.graphics.PointF in project weex-example by KalicyZhou.

the class TopLeftCorner method getSharpCornerEnd.

@NonNull
@Override
protected PointF getSharpCornerEnd() {
    PointF pointF = getSharpCornerVertex();
    pointF.y = 0;
    return pointF;
}
Also used : PointF(android.graphics.PointF) NonNull(android.support.annotation.NonNull)

Aggregations

PointF (android.graphics.PointF)686 Paint (android.graphics.Paint)132 Point (android.graphics.Point)53 RectF (android.graphics.RectF)53 Matrix (android.graphics.Matrix)43 Test (org.junit.Test)40 Path (android.graphics.Path)29 View (android.view.View)28 Drawable (android.graphics.drawable.Drawable)23 ArrayList (java.util.ArrayList)23 MotionEvent (android.view.MotionEvent)22 NonNull (android.support.annotation.NonNull)21 Rect (android.graphics.Rect)18 ValueAnimator (android.animation.ValueAnimator)14 ViewGroup (android.view.ViewGroup)11 List (java.util.List)11 Animator (android.animation.Animator)10 Bitmap (android.graphics.Bitmap)10 GestureDetector (android.view.GestureDetector)10 LinearSmoothScroller (android.support.v7.widget.LinearSmoothScroller)9