[Android] Display nicer name for root directory

Geoffrey Métais git at videolan.org
Mon May 4 16:43:06 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May  4 16:12:15 2015 +0200| [6bbfdc1ad66ddf956a24346b8491b47d85de6dd2] | committer: Geoffrey Métais

Display nicer name for root directory

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

 .../videolan/vlc/gui/browser/FileBrowserFragment.java |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
index f4a603b..d5a228c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
@@ -34,6 +34,7 @@ import android.support.v4.app.Fragment;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.AppCompatEditText;
 import android.text.InputType;
+import android.text.TextUtils;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -44,6 +45,7 @@ import org.videolan.vlc.MediaDatabase;
 import org.videolan.vlc.R;
 import org.videolan.vlc.util.AndroidDevices;
 import org.videolan.vlc.util.CustomDirectories;
+import org.videolan.vlc.util.Strings;
 
 import java.io.File;
 
@@ -67,6 +69,21 @@ public class FileBrowserFragment extends BaseBrowserFragment {
         return new FileBrowserFragment();
     }
 
+    public String getTitle(){
+        if (mRoot)
+            return getCategoryTitle();
+        else {
+            String title = mMrl;
+            if (mCurrentMedia != null) {
+                if (TextUtils.equals(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY, mMrl))
+                    title = getString(R.string.internal_memory);
+                else
+                    title = mCurrentMedia.getTitle();
+            }
+            return title;
+        }
+    }
+
     @Override
     protected String getCategoryTitle() {
         return getString(R.string.directories);



More information about the Android mailing list