public static TouchEvent obtain( int viewTag, long timestampMs, TouchEventType touchEventType, MotionEvent motionEventToCopy) { TouchEvent event = EVENTS_POOL.acquire(); if (event == null) { event = new TouchEvent(); } event.init(viewTag, timestampMs, touchEventType, motionEventToCopy); return event; }
@Override public void onDispose() { Assertions.assertNotNull(mMotionEvent).recycle(); mMotionEvent = null; EVENTS_POOL.release(this); }