Beispiel #1
0
 private void postLongClickRunnable() {
   myLongClickPerformed = false;
   myPendingPress = false;
   if (myPendingLongClickRunnable == null) {
     myPendingLongClickRunnable = new LongClickRunnable();
   }
   postDelayed(myPendingLongClickRunnable, 2 * ViewConfiguration.getLongPressTimeout());
 }
Beispiel #2
0
 @Override
 public boolean onKeyUp(int keyCode, KeyEvent event) {
   if (myKeyUnderTracking != -1) {
     if (myKeyUnderTracking == keyCode) {
       final boolean longPress =
           System.currentTimeMillis()
               > myTrackingStartTime + ViewConfiguration.getLongPressTimeout();
       ZLApplication.Instance().runActionByKey(keyCode, longPress);
     }
     myKeyUnderTracking = -1;
     return true;
   } else {
     final ZLKeyBindings bindings = ZLApplication.Instance().keyBindings();
     return bindings.hasBinding(keyCode, false) || bindings.hasBinding(keyCode, true);
   }
 }