Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d1bec47 authored by ztenghui's avatar ztenghui
Browse files

Setup the animation callback for AnimatedVectorDrawable

b/21341096

Change-Id: Id8e334c541b69edb643b5b45682de6285fbf08e4
parent 0ad408e6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -17,14 +17,15 @@
package com.android.settings.fingerprint;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Animatable2;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
@@ -82,7 +83,7 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase
        mProgressBar = (ProgressBar) findViewById(R.id.fingerprint_progress_bar);
        mFingerprintAnimator = (ImageView) findViewById(R.id.fingerprint_animator);
        mIconAnimationDrawable = (AnimatedVectorDrawable) mFingerprintAnimator.getDrawable();
        mIconAnimationDrawable.addListener(mIconAnimationListener);
        mIconAnimationDrawable.registerAnimationCallback(mIconAnimationCallback);
        mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(
                this, android.R.interpolator.fast_out_slow_in);
        mFingerprintAnimator.setOnTouchListener(new View.OnTouchListener() {
@@ -248,9 +249,10 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase
        }
    };

    private final Animator.AnimatorListener mIconAnimationListener = new AnimatorListenerAdapter() {
    private final Animatable2.AnimationCallback mIconAnimationCallback =
            new Animatable2.AnimationCallback() {
        @Override
        public void onAnimationEnd(Animator animation) {
        public void onAnimationEnd(Drawable d) {
            if (mAnimationCancelled) {
                return;
            }