screen off.
Re-initialize the animation video if necessary when the preference is
visible to the user.
Fixes:
31023261
Test: manual -
1. Go to Settings -> Moves and verify that the animation video are
displayed correctly on load.
2. Press power button to turn screen off, then on again. Verify when
Moves settings resumes, the animation video is displayed correctly.
3. Repeat #2 above but let display time out instead of turning off
screen by power button.
Change-Id: I0ee21d23a4c402b3a8463dca3b36fce67d651993
(cherry picked from commit
008ba4ec402c6b223ff4126d9a180b3931a049ef)
Loader<Bitmap> loader = manager.initLoader(id, Bundle.EMPTY, this);
}
+ void onViewVisible() {
+ if (mVideoReady && mMediaPlayer != null && !mMediaPlayer.isPlaying()) {
+ mMediaPlayer.seekTo(0);
+ }
+ }
+
private static final class PreviewRetriever extends AsyncLoader<Bitmap> {
private Uri mVideoPath;
}
@Override
+ public void onStart() {
+ super.onStart();
+ for (GesturePreference preference : mPreferences) {
+ preference.onViewVisible();
+ }
+ }
+
+ @Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
boolean enabled = (boolean) newValue;
String key = preference.getKey();