Fixes animation video from not playing after onStop
Adds a pause command that doesn't destroy the video surface, and calls onStop when we want to destroy the media player. bug:26516460 Change-Id: If46d26088e81fdca6a73a663a48901bb5245acc8
This commit is contained in:
@@ -59,6 +59,12 @@ public class FingerprintEnrollFindSensor extends FingerprintEnrollBase {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
|
mAnimation.pauseAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
mAnimation.stopAnimation();
|
mAnimation.stopAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,4 +32,9 @@ public interface FingerprintFindSensorAnimation {
|
|||||||
*/
|
*/
|
||||||
void stopAnimation();
|
void stopAnimation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pause the animation
|
||||||
|
*/
|
||||||
|
void pauseAnimation();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -117,11 +117,18 @@ public class FingerprintLocationAnimationVideoView extends TextureView
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopAnimation() {
|
public void stopAnimation() {
|
||||||
if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
|
if (mMediaPlayer != null) {
|
||||||
mMediaPlayer.stop();
|
mMediaPlayer.stop();
|
||||||
mMediaPlayer.release();
|
mMediaPlayer.release();
|
||||||
mMediaPlayer = null;
|
mMediaPlayer = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pauseAnimation() {
|
||||||
|
if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
|
||||||
|
mMediaPlayer.pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -112,6 +112,11 @@ public class FingerprintLocationAnimationView extends View implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pauseAnimation() {
|
||||||
|
stopAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
private void startPhase() {
|
private void startPhase() {
|
||||||
startRadiusAnimation();
|
startRadiusAnimation();
|
||||||
startAlphaAnimation();
|
startAlphaAnimation();
|
||||||
|
Reference in New Issue
Block a user