Search in sources :

Example 1 with PointerEventListener

use of android.view.WindowManagerPolicy.PointerEventListener in project platform_frameworks_base by android.

the class PointerEventDispatcher method onInputEvent.

@Override
public void onInputEvent(InputEvent event) {
    try {
        if (event instanceof MotionEvent && (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) {
            final MotionEvent motionEvent = (MotionEvent) event;
            PointerEventListener[] listeners;
            synchronized (mListeners) {
                if (mListenersArray == null) {
                    mListenersArray = new PointerEventListener[mListeners.size()];
                    mListeners.toArray(mListenersArray);
                }
                listeners = mListenersArray;
            }
            for (int i = 0; i < listeners.length; ++i) {
                listeners[i].onPointerEvent(motionEvent);
            }
        }
    } finally {
        finishInputEvent(event, false);
    }
}
Also used : PointerEventListener(android.view.WindowManagerPolicy.PointerEventListener) MotionEvent(android.view.MotionEvent)

Example 2 with PointerEventListener

use of android.view.WindowManagerPolicy.PointerEventListener in project android_frameworks_base by DirtyUnicorns.

the class PointerEventDispatcher method onInputEvent.

@Override
public void onInputEvent(InputEvent event) {
    try {
        if (event instanceof MotionEvent && (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) {
            final MotionEvent motionEvent = (MotionEvent) event;
            PointerEventListener[] listeners;
            synchronized (mListeners) {
                if (mListenersArray == null) {
                    mListenersArray = new PointerEventListener[mListeners.size()];
                    mListeners.toArray(mListenersArray);
                }
                listeners = mListenersArray;
            }
            for (int i = 0; i < listeners.length; ++i) {
                listeners[i].onPointerEvent(motionEvent);
            }
        }
    } finally {
        finishInputEvent(event, false);
    }
}
Also used : PointerEventListener(android.view.WindowManagerPolicy.PointerEventListener) MotionEvent(android.view.MotionEvent)

Example 3 with PointerEventListener

use of android.view.WindowManagerPolicy.PointerEventListener in project android_frameworks_base by ResurrectionRemix.

the class PointerEventDispatcher method onInputEvent.

@Override
public void onInputEvent(InputEvent event) {
    try {
        if (event instanceof MotionEvent && (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) {
            final MotionEvent motionEvent = (MotionEvent) event;
            PointerEventListener[] listeners;
            synchronized (mListeners) {
                if (mListenersArray == null) {
                    mListenersArray = new PointerEventListener[mListeners.size()];
                    mListeners.toArray(mListenersArray);
                }
                listeners = mListenersArray;
            }
            for (int i = 0; i < listeners.length; ++i) {
                listeners[i].onPointerEvent(motionEvent);
            }
        }
    } finally {
        finishInputEvent(event, false);
    }
}
Also used : PointerEventListener(android.view.WindowManagerPolicy.PointerEventListener) MotionEvent(android.view.MotionEvent)

Example 4 with PointerEventListener

use of android.view.WindowManagerPolicy.PointerEventListener in project android_frameworks_base by crdroidandroid.

the class PointerEventDispatcher method onInputEvent.

@Override
public void onInputEvent(InputEvent event) {
    try {
        if (event instanceof MotionEvent && (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) {
            final MotionEvent motionEvent = (MotionEvent) event;
            PointerEventListener[] listeners;
            synchronized (mListeners) {
                if (mListenersArray == null) {
                    mListenersArray = new PointerEventListener[mListeners.size()];
                    mListeners.toArray(mListenersArray);
                }
                listeners = mListenersArray;
            }
            for (int i = 0; i < listeners.length; ++i) {
                listeners[i].onPointerEvent(motionEvent);
            }
        }
    } finally {
        finishInputEvent(event, false);
    }
}
Also used : PointerEventListener(android.view.WindowManagerPolicy.PointerEventListener) MotionEvent(android.view.MotionEvent)

Aggregations

MotionEvent (android.view.MotionEvent)4 PointerEventListener (android.view.WindowManagerPolicy.PointerEventListener)4