Search in sources :

Example 1 with AnimationRepeatListener

use of org.thoughtcrime.securesms.animation.AnimationRepeatListener in project Signal-Android by WhisperSystems.

the class ConfirmKbsPinFragment method startEndAnimationOnNextProgressRepetition.

private void startEndAnimationOnNextProgressRepetition(@RawRes int lottieAnimationId, @NonNull AnimationCompleteListener listener) {
    LottieAnimationView lottieProgress = getLottieProgress();
    LottieAnimationView lottieEnd = getLottieEnd();
    lottieEnd.setAnimation(lottieAnimationId);
    lottieEnd.removeAllAnimatorListeners();
    lottieEnd.setRepeatCount(0);
    lottieEnd.addAnimatorListener(listener);
    if (lottieProgress.isAnimating()) {
        lottieProgress.addAnimatorListener(new AnimationRepeatListener(animator -> hideProgressAndStartEndAnimation(lottieProgress, lottieEnd)));
    } else {
        hideProgressAndStartEndAnimation(lottieProgress, lottieEnd);
    }
}
Also used : ViewCompat(androidx.core.view.ViewCompat) LottieAnimationView(com.airbnb.lottie.LottieAnimationView) AlertDialog(androidx.appcompat.app.AlertDialog) NonNull(androidx.annotation.NonNull) ApplicationDependencies(org.thoughtcrime.securesms.dependencies.ApplicationDependencies) Megaphones(org.thoughtcrime.securesms.megaphone.Megaphones) SpanUtil(org.thoughtcrime.securesms.util.SpanUtil) Animator(android.animation.Animator) R(org.thoughtcrime.securesms.R) AnimationRepeatListener(org.thoughtcrime.securesms.animation.AnimationRepeatListener) Objects(java.util.Objects) RawRes(androidx.annotation.RawRes) LottieDrawable(com.airbnb.lottie.LottieDrawable) StorageSyncHelper(org.thoughtcrime.securesms.storage.StorageSyncHelper) RegistrationUtil(org.thoughtcrime.securesms.registration.RegistrationUtil) View(android.view.View) ViewModelProviders(androidx.lifecycle.ViewModelProviders) AnimationCompleteListener(org.thoughtcrime.securesms.animation.AnimationCompleteListener) Activity(android.app.Activity) ContextCompat(androidx.core.content.ContextCompat) HintConstants(androidx.autofill.HintConstants) AnimationRepeatListener(org.thoughtcrime.securesms.animation.AnimationRepeatListener) LottieAnimationView(com.airbnb.lottie.LottieAnimationView)

Aggregations

Animator (android.animation.Animator)1 Activity (android.app.Activity)1 View (android.view.View)1 NonNull (androidx.annotation.NonNull)1 RawRes (androidx.annotation.RawRes)1 AlertDialog (androidx.appcompat.app.AlertDialog)1 HintConstants (androidx.autofill.HintConstants)1 ContextCompat (androidx.core.content.ContextCompat)1 ViewCompat (androidx.core.view.ViewCompat)1 ViewModelProviders (androidx.lifecycle.ViewModelProviders)1 LottieAnimationView (com.airbnb.lottie.LottieAnimationView)1 LottieDrawable (com.airbnb.lottie.LottieDrawable)1 Objects (java.util.Objects)1 R (org.thoughtcrime.securesms.R)1 AnimationCompleteListener (org.thoughtcrime.securesms.animation.AnimationCompleteListener)1 AnimationRepeatListener (org.thoughtcrime.securesms.animation.AnimationRepeatListener)1 ApplicationDependencies (org.thoughtcrime.securesms.dependencies.ApplicationDependencies)1 Megaphones (org.thoughtcrime.securesms.megaphone.Megaphones)1 RegistrationUtil (org.thoughtcrime.securesms.registration.RegistrationUtil)1 StorageSyncHelper (org.thoughtcrime.securesms.storage.StorageSyncHelper)1