[Android] No need for specific update method in AudioPlayer

Geoffrey Métais git at videolan.org
Fri Jan 8 13:33:26 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan  8 11:05:57 2016 +0100| [99b4fd09a82593aa000ac55e5a1bae7c07e137d6] | committer: Geoffrey Métais

No need for specific update method in AudioPlayer

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

 .../src/org/videolan/vlc/gui/audio/AudioPlayer.java       | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 1c310ca..975e40c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -297,12 +297,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
         context.getApplicationContext().sendBroadcast(intent);
     }
 
-    @Override
     public void update() {
-        update(false);
-    }
-
-    public void update(boolean refresh) {
         if (mService == null || getActivity() == null)
             return;
 
@@ -363,7 +358,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
         mShuffle.setVisibility(mediaLocations != null && mediaLocations.size() > 2 ? View.VISIBLE : View.INVISIBLE);
         mTimeline.setOnSeekBarChangeListener(mTimelineListner);
 
-        if (refresh || playlistDiffer())
+        if (playlistDiffer())
             updateList();
         mPlaylist.post(new Runnable() {
             @Override
@@ -464,7 +459,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
 
     public void onTimeLabelClick(View view) {
         mShowRemainingTime = !mShowRemainingTime;
-        update(false);
+        update();
     }
 
     public void onPlayPauseClick(View view) {
@@ -516,13 +511,13 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
                 mService.setRepeatType(PlaybackService.REPEAT_NONE);
                 break;
         }
-        update(false);
+        update();
     }
 
     public void onShuffleClick(View view) {
         if (mService != null)
             mService.shuffle();
-        update(false);
+        update();
     }
 
     public void showAdvancedOptions(View v) {
@@ -689,7 +684,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
         super.onConnected(service);
         mService.addCallback(this);
         mPlaylistAdapter.setService(service);
-        update(true);
+        update();
     }
 
     @Override



More information about the Android mailing list