[Android] Remember length/remaining time display choice

Geoffrey Métais git at videolan.org
Mon Jun 27 17:28:32 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jun 27 17:24:55 2016 +0200| [bbd936435d9c43f887619f281bc448fc5d77813e] | committer: Geoffrey Métais

Remember length/remaining time display choice

> https://code.videolan.org/videolan/vlc-android/commit/bbd936435d9c43f887619f281bc448fc5d77813e
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 1edaf2a..f599173 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -244,11 +244,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     private View mObjectFocused;
     private boolean mEnableBrightnessGesture;
     private boolean mEnableCloneMode;
-    private boolean mDisplayRemainingTime = false;
+    private boolean mDisplayRemainingTime;
     private int mScreenOrientation;
     private int mScreenOrientationLock;
     private ImageView mLock;
     private ImageView mSize;
+    private String KEY_REMAINING_TIME_DISPLAY = "remaining_time_display";;
 
     @Override
     public boolean onGenericMotionEvent(MotionEvent event) {
@@ -465,6 +466,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         mHardwareAccelerationError = false;
 
         mAskResume = mSettings.getBoolean("dialog_confirm_resume", false);
+        mDisplayRemainingTime = mSettings.getBoolean(KEY_REMAINING_TIME_DISPLAY, false);
         // Clear the resume time, since it is only used for resumes in external
         // videos.
         SharedPreferences.Editor editor = mSettings.edit();
@@ -2310,6 +2312,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             case R.id.player_overlay_time:
                 mDisplayRemainingTime = !mDisplayRemainingTime;
                 showOverlay();
+                Util.commitPreferences(mSettings.edit().putBoolean(KEY_REMAINING_TIME_DISPLAY, mDisplayRemainingTime));
                 break;
             case R.id.player_delay_minus:
                 if (mPlaybackSetting == DelayState.AUDIO)



More information about the Android mailing list