[Android] Video : disable repeat playlist if there is not.

Alexandre Perraud git at videolan.org
Fri Apr 8 18:36:28 CEST 2016


vlc-android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Apr  8 18:34:55 2016 +0200| [2c135b17bea62b79892e0fe33a3f2db14ff49701] | committer: Alexandre Perraud

Video : disable repeat playlist if there is not.

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

 .../src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index ee99dce..de9c8f1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -346,8 +346,15 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
                 mService.setRepeatType(PlaybackService.REPEAT_ONE);
                 break;
             case PlaybackService.REPEAT_ONE:
-                mRepeat.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_repeat_on, 0, 0);
-                mService.setRepeatType(PlaybackService.REPEAT_ALL);
+                if (mService.hasPlaylist()){
+                    mRepeat.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_repeat_on, 0, 0);
+                    mService.setRepeatType(PlaybackService.REPEAT_ALL);
+                } else {
+                    mRepeat.setCompoundDrawablesWithIntrinsicBounds(0,
+                            UiTools.getResourceFromAttribute(mActivity, R.attr.ic_repeat),
+                            0, 0);
+                    mService.setRepeatType(PlaybackService.REPEAT_NONE);
+                }
                 break;
             case PlaybackService.REPEAT_ALL:
                 mRepeat.setCompoundDrawablesWithIntrinsicBounds(0,



More information about the Android mailing list