[Android] Subtitles context menu option in file browser
Geoffrey Métais
git at videolan.org
Mon Apr 18 10:00:55 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr 15 15:11:49 2016 +0200| [96d3c33c9116dd0a4eb0db1227c0738f534cc387] | committer: Geoffrey Métais
Subtitles context menu option in file browser
> https://code.videolan.org/videolan/vlc-android/commit/96d3c33c9116dd0a4eb0db1227c0738f534cc387
---
vlc-android/res/menu/directory_view_file.xml | 3 +++
vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/vlc-android/res/menu/directory_view_file.xml b/vlc-android/res/menu/directory_view_file.xml
index b2ca4f1..4e236ff 100644
--- a/vlc-android/res/menu/directory_view_file.xml
+++ b/vlc-android/res/menu/directory_view_file.xml
@@ -18,4 +18,7 @@
<item
android:id="@+id/directory_view_add_playlist"
android:title="@string/add_to_playlist" />
+ <item
+ android:id="@+id/directory_subtitles_download"
+ android:title="@string/download_subtitles" />
</menu>
\ No newline at end of file
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 dd2a4aa..ce8ab51 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -440,6 +440,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
menu.findItem(R.id.directory_view_info).setVisible(type == MediaWrapper.TYPE_VIDEO || type == MediaWrapper.TYPE_AUDIO);
menu.findItem(R.id.directory_view_play_audio).setVisible(type != MediaWrapper.TYPE_AUDIO);
menu.findItem(R.id.directory_view_add_playlist).setVisible(type == MediaWrapper.TYPE_AUDIO);
+ menu.findItem(R.id.directory_subtitles_download).setVisible(type == MediaWrapper.TYPE_VIDEO && canWrite);
}
}
@@ -517,6 +518,9 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
savePlaylistDialog.setArguments(args);
savePlaylistDialog.show(fm, "fragment_add_to_playlist");
return true;
+ case R.id.directory_subtitles_download:
+ MediaUtils.getSubs(getActivity(), mw);
+ return true;
// case R.id.directory_view_hide_media:
// try {
// if (new File(mw.getLocation()+"/.nomedia").createNewFile())
More information about the Android
mailing list