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

Commit a902a5bd authored by Doris Ling's avatar Doris Ling Committed by android-build-merger
Browse files

Ensure that the gesture animation video is paused properly. am: 4245ad47 am: 5e4fce04

am: 12ffd7aa

Change-Id: I5c063fc4c1644a9d7e5360e91c1d79375f92986a
parents 054b2d5c 12ffd7aa
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -150,6 +150,10 @@ public final class GesturePreference extends SwitchPreference {
                        playButton.setVisibility(View.VISIBLE);
                    }
                }
                if (mMediaPlayer != null && !mMediaPlayer.isPlaying() &&
                        playButton.getVisibility() != View.VISIBLE) {
                    playButton.setVisibility(View.VISIBLE);
                }
            }
        });

@@ -175,4 +179,10 @@ public final class GesturePreference extends SwitchPreference {
        }
    }

    void onViewInvisible() {
        if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
            mMediaPlayer.pause();
        }
    }

}
+8 −0
Original line number Diff line number Diff line
@@ -144,6 +144,14 @@ public class GestureSettings extends SettingsPreferenceFragment implements
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        for (GesturePreference preference : mPreferences) {
            preference.onViewInvisible();
        }
    }

    @Override
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        boolean enabled = (boolean) newValue;