[Android] Remove tracks & subs from menu

Geoffrey Métais git at videolan.org
Tue Dec 16 16:23:58 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 16 14:28:10 2014 +0100| [22a2a3edbad4cf75e2e48166a4beea48181dbb21] | committer: Geoffrey Métais

Remove tracks & subs from menu

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=22a2a3edbad4cf75e2e48166a4beea48181dbb21
---

 "qq\033\033\033\033\033\033"                       |   69 ++++++++++++++++++++
 vlc-android/res/menu-v15/video_player.xml          |   15 -----
 vlc-android/res/menu/video_player.xml              |    4 --
 .../vlc/gui/video/VideoPlayerActivity.java         |   17 +----
 4 files changed, 70 insertions(+), 35 deletions(-)

diff --git "a/qq\033\033\033\033\033\033" "b/qq\033\033\033\033\033\033"
new file mode 100644
index 0000000..2bcb85f
--- /dev/null
+++ "b/qq\033\033\033\033\033\033"
@@ -0,0 +1,69 @@
+diff --git a/vlc-android/res/menu-v15/video_player.xml b/vlc-android/res/menu-v15/video_player.xml
+deleted file mode 100644
+index 12e69c8..0000000
+--- a/vlc-android/res/menu-v15/video_player.xml
++++ /dev/null
+@@ -1,15 +0,0 @@
+-<?xml version="1.0" encoding="utf-8"?>
+-<menu xmlns:android="http://schemas.android.com/apk/res/android">
+-    <item
+-        android:id="@+id/pl_menu_audiotrack"
+-        android:icon="@drawable/ic_audio_circle"
+-        android:title="@string/track_audio" />
+-    <item
+-        android:id="@+id/pl_menu_subtitle"
+-        android:icon="@drawable/ic_subtitle_circle"
+-        android:title="@string/subtitles" />
+-    <item
+-        android:id="@+id/pl_menu_nav"
+-        android:icon="@drawable/ic_navmenu_circle"
+-        android:title="@string/navmenu" />
+-</menu>
+diff --git a/vlc-android/res/menu/video_player.xml b/vlc-android/res/menu/video_player.xml
+index 33ebeb8..c02c740 100644
+--- a/vlc-android/res/menu/video_player.xml
++++ b/vlc-android/res/menu/video_player.xml
+@@ -4,8 +4,4 @@
+         android:id="@+id/pl_menu_nav"
+         android:icon="@drawable/ic_navmenu_circle"
+         android:title="@string/navmenu" />
+-    <item
+-        android:id="@+id/pl_menu_adv"
+-        android:icon="@drawable/ic_more"
+-        android:title="@string/advanced" />
+ </menu>
+diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+index 1b5ebf1..5e02118 100644
+--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
++++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+@@ -452,16 +452,7 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
+     }
+ 
+     public boolean onPrepareOptionsMenu(Menu menu){
+-        MenuItem item;
+-        item = menu.findItem(R.id.pl_menu_subtitle);
+-        item.setVisible(mLibVLC.getSpuTracksCount() > 0);
+-        MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
+-
+-        item = menu.findItem(R.id.pl_menu_audiotrack);
+-        item.setVisible(mLibVLC.getAudioTracksCount() > 2);
+-        MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
+-
+-        item = menu.findItem(R.id.pl_menu_nav);
++        MenuItem item = menu.findItem(R.id.pl_menu_nav);
+         item.setVisible(mLibVLC.getChapterCountForTitle(0) > 1 && mLibVLC.getTitleCount() > 1 && mLibVLC.getTitle() != 0);
+         MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
+ 
+@@ -470,12 +461,6 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
+ 
+     public boolean onOptionsItemSelected(MenuItem item){
+         switch (item.getItemId()) {
+-            case R.id.pl_menu_subtitle:
+-                selectSubtitles();
+-                return true;
+-            case R.id.pl_menu_audiotrack:
+-                selectAudioTrack();
+-                return true;
+             case R.id.pl_menu_nav:
+                 showNavMenu();
+                 return true;
diff --git a/vlc-android/res/menu-v15/video_player.xml b/vlc-android/res/menu-v15/video_player.xml
deleted file mode 100644
index 12e69c8..0000000
--- a/vlc-android/res/menu-v15/video_player.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item
-        android:id="@+id/pl_menu_audiotrack"
-        android:icon="@drawable/ic_audio_circle"
-        android:title="@string/track_audio" />
-    <item
-        android:id="@+id/pl_menu_subtitle"
-        android:icon="@drawable/ic_subtitle_circle"
-        android:title="@string/subtitles" />
-    <item
-        android:id="@+id/pl_menu_nav"
-        android:icon="@drawable/ic_navmenu_circle"
-        android:title="@string/navmenu" />
-</menu>
diff --git a/vlc-android/res/menu/video_player.xml b/vlc-android/res/menu/video_player.xml
index 33ebeb8..c02c740 100644
--- a/vlc-android/res/menu/video_player.xml
+++ b/vlc-android/res/menu/video_player.xml
@@ -4,8 +4,4 @@
         android:id="@+id/pl_menu_nav"
         android:icon="@drawable/ic_navmenu_circle"
         android:title="@string/navmenu" />
-    <item
-        android:id="@+id/pl_menu_adv"
-        android:icon="@drawable/ic_more"
-        android:title="@string/advanced" />
 </menu>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index f763ee1..5bd3492 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -447,16 +447,7 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
     }
 
     public boolean onPrepareOptionsMenu(Menu menu){
-        MenuItem item;
-        item = menu.findItem(R.id.pl_menu_subtitle);
-        item.setVisible(mLibVLC.getSpuTracksCount() > 0);
-        MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
-
-        item = menu.findItem(R.id.pl_menu_audiotrack);
-        item.setVisible(mLibVLC.getAudioTracksCount() > 2);
-        MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
-
-        item = menu.findItem(R.id.pl_menu_nav);
+        MenuItem item = menu.findItem(R.id.pl_menu_nav);
         item.setVisible(mLibVLC.getChapterCountForTitle(0) > 1 && mLibVLC.getTitleCount() > 1 && mLibVLC.getTitle() != 0);
         MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
 
@@ -465,12 +456,6 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
 
     public boolean onOptionsItemSelected(MenuItem item){
         switch (item.getItemId()) {
-            case R.id.pl_menu_subtitle:
-                selectSubtitles();
-                return true;
-            case R.id.pl_menu_audiotrack:
-                selectAudioTrack();
-                return true;
             case R.id.pl_menu_nav:
                 showNavMenu();
                 return true;



More information about the Android mailing list