@MainThread public void endAnimation() { lazyCompositionTasks.clear(); animator.endAnimation(); }
/** * Called on the main thread before DiffUtil dispatches the result */ @MainThread void onDispatchResult(@NonNull Collection<? extends Group> newGroups); }
@MainThread protected void removeFrameCallback() { this.removeFrameCallback(true); }
@MainThread public void pauseAnimation() { removeFrameCallback(); }
@MainThread @Override public void start() { playAnimation(); }
@MainThread @Override public void stop() { endAnimation(); }
/** * Plays the animation from the beginning. If speed is < 0, it will start at the end * and play towards the beginning */ @MainThread public void playAnimation() { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { playAnimation(); } }); return; } animator.playAnimation(); }
/** * Continues playing the animation from its current position. If speed < 0, it will play backwards * from the current position. */ @MainThread public void resumeAnimation() { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { resumeAnimation(); } }); return; } animator.resumeAnimation(); }
/** * Plays the animation from the beginning. If speed is < 0, it will start at the end * and play towards the beginning */ @MainThread public void playAnimation() { lottieDrawable.playAnimation(); enableOrDisableHardwareLayer(); }
@MainThread public void cancelAnimation() { lottieDrawable.cancelAnimation(); enableOrDisableHardwareLayer(); }
@MainThread @Override public void cancel() { notifyCancel(); removeFrameCallback(); }
@MainThread protected void removeFrameCallback(boolean stopRunning) { Choreographer.getInstance().removeFrameCallback(this); if (stopRunning) { running = false; } }
/** * Continues playing the animation from its current position. If speed < 0, it will play backwards * from the current position. */ @MainThread public void resumeAnimation() { lottieDrawable.resumeAnimation(); enableOrDisableHardwareLayer(); }
@MainThread public void pauseAnimation() { lottieDrawable.pauseAnimation(); enableOrDisableHardwareLayer(); }
@MainThread public void endAnimation() { removeFrameCallback(); notifyEnd(isReversed()); }
/** * A Handler class that uses a separate background thread dedicated to Epoxy. Additionally, * this handler calls {@link Message#setAsynchronous(boolean)} for * each {@link Message} that is sent to it or {@link Runnable} that is posted to it */ @MainThread public static Handler getAsyncBackgroundHandler() { // This is initialized lazily so we don't create the thread unless it will be used. // It isn't synchronized so it should only be accessed on the main thread. if (asyncBackgroundHandler == null) { asyncBackgroundHandler = createHandler(buildBackgroundLooper("epoxy"), true); } return asyncBackgroundHandler; }
@MainThread public void playAnimation() { running = true; notifyStart(isReversed()); setFrame((int) (isReversed() ? getMaxFrame() : getMinFrame())); lastFrameTimeNs = System.nanoTime(); repeatCount = 0; postFrameCallback(); }
@MainThread public void resumeAnimation() { running = true; postFrameCallback(); lastFrameTimeNs = System.nanoTime(); if (isReversed() && getFrame() == getMinFrame()) { frame = getMaxFrame(); } else if (!isReversed() && getFrame() == getMaxFrame()) { frame = getMinFrame(); } }
/** * @param out the result of the job. */ @MainThread void onResult(Result out); }
@MainThread public static void showErrorDialogIfErrorsPresent() { if (diskIoExceptionsCountShown == diskIoExceptionsCount ) return; diskIoExceptionsCountShown = diskIoExceptionsCount; DialogFactory.dismissSafely(diskIoDialog); final String text = String.format(MyContextHolder.get().context().getText(R.string.database_disk_io_error).toString(), diskIoExceptionsCount); diskIoDialog = DialogFactory.showOkAlertDialog(ExceptionsCounter.class, MyContextHolder.get().context(), R.string.app_name, text); } }