本文整理汇总了Java中android.view.MotionEvent.PointerCoords方法的典型用法代码示例。如果您正苦于以下问题:Java MotionEvent.PointerCoords方法的具体用法?Java MotionEvent.PointerCoords怎么用?Java MotionEvent.PointerCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.MotionEvent
的用法示例。
在下文中一共展示了MotionEvent.PointerCoords方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: obtainMotionEvent
import android.view.MotionEvent; //导入方法依赖的package包/类
public static MotionEvent obtainMotionEvent(
long downTime,
long eventTime,
int action,
int id1,
float x1,
float y1,
int id2,
float x2,
float y2) {
int[] ids = new int[] {id1, id2};
MotionEvent.PointerCoords[] coords = new MotionEvent.PointerCoords[] {
createCoords(x1, y1),
createCoords(x2, y2)};
return MotionEvent
.obtain(downTime, eventTime, action, 2, ids, coords, 0, 1.0f, 1.0f, 0, 0, 0, 0);
}
示例2: dispatchEvent
import android.view.MotionEvent; //导入方法依赖的package包/类
private void dispatchEvent(
final int action,
final long start,
final long when,
final int pointerCount,
final MotionEvent.PointerProperties[] pointerProps,
final MotionEvent.PointerCoords[] pointerCoords) {
getRootView().post(
new Runnable() {
@Override
public void run() {
MotionEvent event =
MotionEvent.obtain(start, when, action, pointerCount, pointerProps, pointerCoords, 0, 0, 1.0f, 1.0f, 0, 0, 0, 0);
getRootView().dispatchTouchEvent(event);
event.recycle();
}
});
getInstrumentation().waitForIdleSync();
}
示例3: toPointerCoords
import android.view.MotionEvent; //导入方法依赖的package包/类
public MotionEvent.PointerCoords toPointerCoords() {
final MotionEvent.PointerCoords pc = new MotionEvent.PointerCoords();
pc.x = x;
pc.y = y;
pc.size = size;
pc.pressure = pressure;
return pc;
}
示例4: createCoords
import android.view.MotionEvent; //导入方法依赖的package包/类
public static MotionEvent.PointerCoords createCoords(float x, float y) {
MotionEvent.PointerCoords pointerCoords = new MotionEvent.PointerCoords();
pointerCoords.x = x;
pointerCoords.y = y;
return pointerCoords;
}
示例5: add
import android.view.MotionEvent; //导入方法依赖的package包/类
public void add(MotionEvent.PointerCoords c, long time) {
addNoCopy(new Spot(c, time));
}
示例6: Spot
import android.view.MotionEvent; //导入方法依赖的package包/类
public Spot(MotionEvent.PointerCoords _pc) {
this(_pc, SystemClock.currentThreadTimeMillis());
}
示例7: createPointerCoords
import android.view.MotionEvent; //导入方法依赖的package包/类
private MotionEvent.PointerCoords createPointerCoords(float x, float y) {
MotionEvent.PointerCoords pointerCoords = new MotionEvent.PointerCoords();
pointerCoords.x = x;
pointerCoords.y = y;
return pointerCoords;
}