[Android] Fix logic fail for action mode
Geoffrey Métais
git at videolan.org
Mon Jan 30 10:32:31 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 30 09:39:54 2017 +0100| [ad378e809a7dab913db50949a9aa9de10268d9e0] | committer: Geoffrey Métais
Fix logic fail for action mode
> https://code.videolan.org/videolan/vlc-android/commit/ad378e809a7dab913db50949a9aa9de10268d9e0
---
vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java | 2 +-
vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java | 2 +-
vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java | 2 +-
vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index 1aadc3f..0723367 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -173,7 +173,7 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
boolean honeyComb = AndroidUtil.isHoneycombOrLater();
menu.findItem(R.id.action_history_info).setVisible(selectionCount == 1);
menu.findItem(R.id.action_history_play).setVisible(honeyComb || selectionCount == 1);
- menu.findItem(R.id.action_history_append).setVisible(!mService.isPlaying() && honeyComb);
+ menu.findItem(R.id.action_history_append).setVisible(mService.hasMedia() && honeyComb);
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 09f860f..0b0d9ab 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.java
@@ -55,7 +55,6 @@ public abstract class BaseAudioBrowser extends MediaBrowserFragment implements I
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
mode.getMenuInflater().inflate(R.menu.action_mode_audio_browser, menu);
- menu.findItem(R.id.action_mode_audio_append).setVisible(!mService.isPlaying());
if (playlistModeSelected())
menu.findItem(R.id.action_mode_audio_add_playlist).setVisible(false);
return true;
@@ -71,6 +70,7 @@ public abstract class BaseAudioBrowser extends MediaBrowserFragment implements I
boolean isSong = count == 1 && getCurrentAdapter().getSelection().get(0).getItemType() == MediaLibraryItem.TYPE_MEDIA;
menu.findItem(R.id.action_mode_audio_set_song).setVisible(isSong && AndroidDevices.isPhone());
menu.findItem(R.id.action_mode_audio_info).setVisible(isSong);
+ menu.findItem(R.id.action_mode_audio_append).setVisible(mService.hasMedia());
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 c4e92f1..2eaf010 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -645,7 +645,6 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
mode.getMenuInflater().inflate(R.menu.action_mode_browser_file, menu);
- menu.findItem(R.id.action_mode_file_append).setVisible(!mService.isPlaying());
return true;
}
@@ -659,6 +658,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
boolean single = this instanceof FileBrowserFragment && count == 1;
int type = single ? mAdapter.getSelection().get(0).getType() : -1;
menu.findItem(R.id.action_mode_file_info).setVisible(single && (type == MediaWrapper.TYPE_AUDIO || type == MediaWrapper.TYPE_VIDEO));
+ menu.findItem(R.id.action_mode_file_append).setVisible(mService.hasMedia());
return true;
}
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 a41fc1d..e320bc3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -522,7 +522,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
boolean honeyComb = AndroidUtil.isHoneycombOrLater();
menu.findItem(R.id.action_video_info).setVisible(count == 1);
menu.findItem(R.id.action_video_play).setVisible(honeyComb || count == 1);
- menu.findItem(R.id.action_video_append).setVisible(!mService.isPlaying() && honeyComb);
+ menu.findItem(R.id.action_video_append).setVisible(mService.hasMedia() && honeyComb);
return true;
}
More information about the Android
mailing list