blinkTask.cancel(); if (focused) Timer.schedule(blinkTask, blinkTime, blinkTime);
public void drag (InputEvent event, float x, float y, int pointer) { event.getListenerActor().localToActorCoordinates(scroll, tmpCoords.set(x, y)); if (tmpCoords.y >= scroll.getHeight()) { scrollDown.cancel(); if (!scrollUp.isScheduled()) { startTime = System.currentTimeMillis(); Timer.schedule(scrollUp, tickSecs, tickSecs); } return; } else if (tmpCoords.y < 0) { scrollUp.cancel(); if (!scrollDown.isScheduled()) { startTime = System.currentTimeMillis(); Timer.schedule(scrollDown, tickSecs, tickSecs); } return; } scrollUp.cancel(); scrollDown.cancel(); }
blinkTask.cancel(); if (focused) Timer.schedule(blinkTask, blinkTime, blinkTime);
if (focused != this.focused) { this.focused = focused; blinkTask.cancel(); cursorOn = focused; if (focused)
String msg = "The game have custom actions that can not be loaded. Probably the game needs to be compiled. Trying 'gradlew compile'..."; Message.showMsg(stage, msg, true); Timer.post(new Task() { @Override public void run() {
panning = false; longPressTask.cancel(); if (longPressFired) return false;
initialPointer1.set(pointer1); initialPointer2.set(pointer2); longPressTask.cancel(); } else { tapRectangleCenterX = x; tapRectangleCenterY = y; if (!longPressTask.isScheduled()) Timer.schedule(longPressTask, longPressSeconds); initialPointer1.set(pointer1); initialPointer2.set(pointer2); longPressTask.cancel();
protected void onInitialized() { initialized = true; connectionPending = false; // if Google API has initialized, check if user session is active displayName = ""; boolean sessionActive = isSessionActive(); if (updateEventsTask != null) updateEventsTask.cancel(); if (sessionActive) { oAuthToken = getOAuthToken(); sendNowPlayingEvent(); refreshDisplayname(); updateEventsTask = Timer.schedule(new Timer.Task() { @Override public void run() { recordEvents(); } }, GPGS_CHECKEVENTS_INTERVAL, GPGS_CHECKEVENTS_INTERVAL); } if (gsListener != null) { if (sessionActive) gsListener.gsOnSessionActive(); else gsListener.gsOnSessionInactive(); } }
public boolean touchDragged (float x, float y, int pointer) { if (pointer > 1) return false; if (longPressFired) return false; if (pointer == 0) pointer1.set(x, y); else pointer2.set(x, y); // handle pinch zoom if (pinching) { if (listener != null) { boolean result = listener.pinch(initialPointer1, initialPointer2, pointer1, pointer2); return listener.zoom(initialPointer1.dst(initialPointer2), pointer1.dst(pointer2)) || result; } return false; } // update tracker tracker.update(x, y, Gdx.input.getCurrentEventTime()); // check if we are still tapping. if (inTapRectangle && !isWithinTapRectangle(x, y, tapRectangleCenterX, tapRectangleCenterY)) { longPressTask.cancel(); inTapRectangle = false; } // if we have left the tap square, we are panning if (!inTapRectangle) { panning = true; return listener.pan(x, y, tracker.deltaX, tracker.deltaY); } return false; }
public void drag (InputEvent event, float x, float y, int pointer) { event.getListenerActor().localToActorCoordinates(scroll, tmpCoords.set(x, y)); if (tmpCoords.x >= 0 && tmpCoords.x < scroll.getWidth()) { if (tmpCoords.y >= scroll.getHeight()) { scrollDown.cancel(); if (!scrollUp.isScheduled()) { startTime = System.currentTimeMillis(); Timer.schedule(scrollUp, tickSecs, tickSecs); } return; } else if (tmpCoords.y < 0) { scrollUp.cancel(); if (!scrollDown.isScheduled()) { startTime = System.currentTimeMillis(); Timer.schedule(scrollDown, tickSecs, tickSecs); } return; } } scrollUp.cancel(); scrollDown.cancel(); }
public void run () { if (showTooltip == null || showTooltip.targetActor == null) return; Stage stage = showTooltip.targetActor.getStage(); if (stage == null) return; stage.addActor(showTooltip.container); showTooltip.container.toFront(); shown.add(showTooltip); showTooltip.container.clearActions(); showAction(showTooltip); if (!showTooltip.instant) { time = subsequentTime; resetTask.cancel(); } } };
/** * Removes toast from screen. * @return true when toast was removed, false otherwise */ public boolean remove (Toast toast) { boolean removed = toasts.removeValue(toast, true); if (removed) { toast.getMainTable().remove(); Timer.Task timerTask = timersTasks.remove(toast); if (timerTask != null) timerTask.cancel(); updateToastsPositions(); } return removed; }
/** * Removes toast from screen. * @return true when toast was removed, false otherwise */ public boolean remove (Toast toast) { boolean removed = toasts.removeValue(toast, true); if (removed) { toast.getMainTable().remove(); Timer.Task timerTask = timersTasks.remove(toast); if (timerTask != null) timerTask.cancel(); updateToastsPositions(); } return removed; }
@Override public void pauseSession() { if (pingTask != null) pingTask.cancel(); sendCloseSessionEvent(); connected = false; if (gsListener != null) gsListener.gsOnSessionInactive(); }
public void play(String fileName) { stop(); this.fileName = fileName; if (fileName != null) { // Load and play the voice file in background to avoid // blocking the UI loadAssets(); backgroundLoadingTask.cancel(); Timer.schedule(backgroundLoadingTask, 0, 0); } }
private void loadTask() { loadAssets(); backgroundLoadingTask.cancel(); Timer.schedule(backgroundLoadingTask, 0, 0); }
private void scheduleCurrentRepeatingKeyTask() { if (currentRepeatingKeyTask != null && !currentRepeatingKeyTask.isScheduled()) { keyRepeatTimer.scheduleTask( currentRepeatingKeyTask, keyRepeatStartDelays.get(currentRepeatingGdxKeyCode, DEFAULT_KEY_REPEAT_START_DELAY_SECONDS), keyRepeatRates.get(currentRepeatingGdxKeyCode, DEFAULT_KEY_REPEAT_RATE_SECONDS)); } }
private void scheduleCurrentRepeatingKeyTask() { if (currentRepeatingKeyTask != null && !currentRepeatingKeyTask.isScheduled()) { keyRepeatTimer.scheduleTask( currentRepeatingKeyTask, keyRepeatStartDelays.get(currentRepeatingGdxKeyCode, DEFAULT_KEY_REPEAT_START_DELAY_SECONDS), keyRepeatRates.get(currentRepeatingGdxKeyCode, DEFAULT_KEY_REPEAT_RATE_SECONDS)); } }
public void clear () { for (Toast toast : toasts) { toast.getMainTable().remove(); } toasts.clear(); for (Timer.Task task : timersTasks.values()) { task.cancel(); } timersTasks.clear(); updateToastsPositions(); }
private void cancelCurrentRepeatingKeyTask() { if (currentRepeatingKeyTask != null && currentRepeatingKeyTask.isScheduled()) { currentRepeatingKeyTask.cancel(); } }