[Android] Video Playback Speed : Fix icon color if enabled

Alexandre Perraud git at videolan.org
Wed Apr 6 16:30:20 CEST 2016


vlc-android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Wed Apr  6 16:29:03 2016 +0200| [b7f781d7c1b14b3fc14b7514ddc33d6954a50921] | committer: Alexandre Perraud

Video Playback Speed : Fix icon color if enabled

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

 .../src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java    | 11 +++++------
 1 file changed, 5 insertions(+), 6 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 f13f17d..730315c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -259,6 +259,11 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
     }
 
     public void initPlaybackSpeed () {
+        if (!mService.isSeekable()) {
+            mPlaybackSpeed.setEnabled(false);
+            mPlaybackSpeed.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.ic_speed_disable, 0, 0);
+            return;
+        }
         if (mService.getRate() == 1.0f) {
             mPlaybackSpeed.setText(null);
             mPlaybackSpeed.setCompoundDrawablesWithIntrinsicBounds(0,
@@ -268,12 +273,6 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
             mPlaybackSpeed.setText(Strings.formatRateString(mService.getRate()));
             mPlaybackSpeed.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_speed_on, 0, 0);
         }
-        mPlaybackSpeed.setEnabled(mService.isSeekable());
-        mPlaybackSpeed.setCompoundDrawablesWithIntrinsicBounds(0,
-                mService.isSeekable()
-                        ? UiTools.getResourceFromAttribute(mActivity, R.attr.ic_speed_normal_style)
-                        : R.drawable.ic_speed_disable,
-                0, 0);
     }
 
     public void initSleep () {



More information about the Android mailing list