Пример #1
0
 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;
 }
Пример #2
0
 @Override
 public void onDispose() {
   Assertions.assertNotNull(mMotionEvent).recycle();
   mMotionEvent = null;
   EVENTS_POOL.release(this);
 }