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

Commit 22b9e6dc authored by Udam Saini's avatar Udam Saini Committed by Android (Google) Code Review
Browse files

Merge "Fixes animation video from not playing after onStop"

parents acb25a1d 8298b47f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -59,6 +59,12 @@ public class FingerprintEnrollFindSensor extends FingerprintEnrollBase {
    @Override
    protected void onStop() {
        super.onStop();
        mAnimation.pauseAnimation();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mAnimation.stopAnimation();
    }

+5 −0
Original line number Diff line number Diff line
@@ -32,4 +32,9 @@ public interface FingerprintFindSensorAnimation {
     */
    void stopAnimation();

    /**
     * Pause the animation
     */
    void pauseAnimation();

}
+8 −1
Original line number Diff line number Diff line
@@ -117,11 +117,18 @@ public class FingerprintLocationAnimationVideoView extends TextureView

    @Override
    public void stopAnimation() {
        if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
        if (mMediaPlayer != null) {
            mMediaPlayer.stop();
            mMediaPlayer.release();
            mMediaPlayer = null;
        }
    }

    @Override
    public void pauseAnimation() {
        if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
            mMediaPlayer.pause();
        }
    }

}
+5 −0
Original line number Diff line number Diff line
@@ -112,6 +112,11 @@ public class FingerprintLocationAnimationView extends View implements
        }
    }

    @Override
    public void pauseAnimation() {
        stopAnimation();
    }

    private void startPhase() {
        startRadiusAnimation();
        startAlphaAnimation();