Class LottieTask<T>

    • Field Detail

      • EXECUTOR

        public static Executor EXECUTOR
        Set this to change the executor that LottieTasks are run on. This will be the executor that composition parsing and url fetching happens on.

        You may change this to run deserialization synchronously for testing.

    • Method Detail

      • addListener

        public LottieTask<T> addListener​(LottieListener<T> listener)
        Add a task listener. If the task has completed, the listener will be called synchronously.
        Returns:
        the task for call chaining.
      • removeListener

        public LottieTask<T> removeListener​(LottieListener<T> listener)
        Remove a given task listener. The task will continue to execute so you can re-add a listener if necessary.
        Returns:
        the task for call chaining.
      • addFailureListener

        public LottieTask<T> addFailureListener​(LottieListener<Throwable> listener)
        Add a task failure listener. This will only be called in the even that an exception occurs. If an exception has already occurred, the listener will be called immediately.
        Returns:
        the task for call chaining.
      • removeFailureListener

        public LottieTask<T> removeFailureListener​(LottieListener<Throwable> listener)
        Remove a given task failure listener. The task will continue to execute so you can re-add a listener if necessary.
        Returns:
        the task for call chaining.