[Android] Restore correct playlist on back press

Geoffrey Métais git at videolan.org
Tue Jan 5 16:49:11 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan  5 16:48:25 2016 +0100| [dc6504434bc0382b273f274bc734b698d05125db] | committer: Geoffrey Métais

Restore correct playlist on back press

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

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java      | 2 +-
 vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index ffad79a..202eb1a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -415,7 +415,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Search
         }
 
         /* Close playlist search if open or Slide down the audio player if it is shown entirely. */
-        if (mAudioPlayer.hideSearchField() || slideDownAudioPlayer())
+        if (mAudioPlayer.clearSearch() || slideDownAudioPlayer())
             return;
 
         // If it's the directory view, a "backpressed" action shows a parent.
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 c46693a..da1f36d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -641,6 +641,11 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
     @Override
     public void beforeTextChanged(CharSequence charSequence, int start, int before, int count) {}
 
+    public boolean clearSearch() {
+        mPlaylistAdapter.restoreList();
+        return hideSearchField();
+    }
+
     public boolean hideSearchField() {
         if (mPlaylistSearchText.getVisibility() != View.VISIBLE)
             return false;



More information about the Android mailing list