[Android] Add directory view through the menu
Edward Wang
git at videolan.org
Fri Jun 22 04:01:01 CEST 2012
android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Jun 21 21:44:00 2012 -0400| [8e41ac5d76564276a3697c1e3e05ce47344e49cc] | committer: Edward Wang
Add directory view through the menu
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=8e41ac5d76564276a3697c1e3e05ce47344e49cc
---
vlc-android/res/menu/media_library.xml | 5 +++++
vlc-android/src/org/videolan/vlc/gui/MainActivity.java | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/vlc-android/res/menu/media_library.xml b/vlc-android/res/menu/media_library.xml
index 4b6a936..4d398bd 100644
--- a/vlc-android/res/menu/media_library.xml
+++ b/vlc-android/res/menu/media_library.xml
@@ -29,6 +29,11 @@
android:title="@string/refresh"
android:showAsAction="ifRoom" />
<item
+ android:id="@+id/ml_menu_browse"
+ android:icon="@drawable/ic_folder"
+ android:title="@string/directories"
+ android:showAsAction="ifRoom" />
+ <item
android:id="@+id/ml_menu_preferences"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/preferences" />
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 99a550c..40b4de2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -252,6 +252,14 @@ public class MainActivity extends SherlockFragmentActivity {
case R.id.ml_menu_refresh:
MediaLibrary.getInstance(this).loadMediaItems(this);
break;
+ // Browse Folders
+ case R.id.ml_menu_browse:
+ FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
+ ft.replace(R.id.fragment_placeholder, new DirectoryViewFragment(this));
+ ft.addToBackStack(null);
+ ft.commit();
+ break;
+ // Open MRL
case R.id.ml_menu_open_mrl:
AlertDialog.Builder b = new AlertDialog.Builder(this);
final EditText input = new EditText(this);
More information about the Android
mailing list