本文整理匯總了Java中android.view.MotionEvent.ACTION_POINTER_ID_MASK屬性的典型用法代碼示例。如果您正苦於以下問題:Java MotionEvent.ACTION_POINTER_ID_MASK屬性的具體用法?Java MotionEvent.ACTION_POINTER_ID_MASK怎麽用?Java MotionEvent.ACTION_POINTER_ID_MASK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.view.MotionEvent
的用法示例。
在下文中一共展示了MotionEvent.ACTION_POINTER_ID_MASK屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onTouchEvent
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getAction();
final int pointerId = ((event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT);
int xp = (int)event.getX(pointerId);
int yp = (int)event.getY(pointerId);
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN: {
if (OverlayExtra.onExtraButtonPress(pointerId, xp, yp)) return true;
break;
}
case MotionEvent.ACTION_UP: {
if (OverlayExtra.onExtraButtonRelease(pointerId)) return true;
break;
}
}
return false;
}
示例2: getPointerIndexEclair
@SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.ECLAIR)
private static int getPointerIndexEclair(int action) {
return (action & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT;
}
示例3: getPointerId
final protected int getPointerId(MotionEvent e)
{
return (e.getAction() & MotionEvent.ACTION_POINTER_ID_MASK)
>> MotionEvent.ACTION_POINTER_ID_SHIFT;
}
示例4: getPointerIndexEclair
@SuppressWarnings("deprecation")
@TargetApi(VERSION_CODES.ECLAIR)
private static int getPointerIndexEclair(int action) {
return (action & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT;
}