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));
}
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;
}
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;
}
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;
}
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;
}
Aggregations