本文整理匯總了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;
}