Code example for MotionEvent

Methods: getRawXgetX

0
     
    /** 
     * MotionEvent has no getRawX(int) method; simulate it pending future API approval.  
     */ 
    private static float getRawX(MotionEvent event, int pointerIndex) {
        float offset = event.getX() - event.getRawX();
        return event.getX(pointerIndex) + offset;
    } 
     
    /** 
     * MotionEvent has no getRawY(int) method; simulate it pending future API approval.  
     */ 
    private static float getRawY(MotionEvent event, int pointerIndex) {
        float offset = event.getY() - event.getRawY();
        return event.getY(pointerIndex) + offset;
    } 
 
    private void setContext(MotionEvent curr) {
        if (mCurrEvent != null) {
            mCurrEvent.recycle();
        }