[Android] Exit action mode on any item click

Geoffrey Métais git at videolan.org
Thu Jan 5 10:16:35 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan  5 10:05:43 2017 +0100| [e8297e6b7302867347a17a3f131be59e26ca8392] | committer: Geoffrey Métais

Exit action mode on any item click

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

 vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java             | 3 +--
 vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java      | 3 +--
 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java | 1 +
 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java     | 3 +--
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index 86ec903..5208e53 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -179,6 +179,7 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
 
     @Override
     public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        stopActionMode();
         switch (item.getItemId()) {
             case R.id.action_history_play:
                 MediaUtils.openList(getActivity(), mHistoryAdapter.getSelection(), 0);
@@ -190,10 +191,8 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
                 showInfoDialog(mHistoryAdapter.getSelection().get(0));
                 break;
             default:
-                stopActionMode();
                 return false;
         }
-        stopActionMode();
         return true;
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java b/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
index 9c339d7..6a668e8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
@@ -75,6 +75,7 @@ public abstract class BaseAudioBrowser extends MediaBrowserFragment implements I
 
     @Override
     public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        stopActionMode();
         List<MediaLibraryItem> list = getCurrentAdapter().getSelection();
         ArrayList<MediaWrapper> tracks = new ArrayList<>();
         for (MediaLibraryItem mediaItem : list)
@@ -96,10 +97,8 @@ public abstract class BaseAudioBrowser extends MediaBrowserFragment implements I
                 AudioUtil.setRingtone((MediaWrapper) getCurrentAdapter().getSelection().get(0), getActivity());
                 break;
             default:
-                stopActionMode();
                 return false;
         }
-        stopActionMode();
         return true;
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index c985828..7c260bd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -661,6 +661,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
 
     @Override
     public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        stopActionMode();
         switch (item.getItemId()) {
             case R.id.action_mode_file_play:
                 mService.load(mAdapter.getSelection(), 0);
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 6fd445c..19867fe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -514,6 +514,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
 
     @Override
     public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        stopActionMode();
         switch (item.getItemId()) {
             case R.id.action_video_play:
                 MediaUtils.openList(getActivity(), mVideoAdapter.getSelection(), 0);
@@ -538,10 +539,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
                 MediaUtils.openList(getActivity(), list, 0);
                 break;
             default:
-                stopActionMode();
                 return false;
         }
-        stopActionMode();
         return true;
     }
 



More information about the Android mailing list