[Android] TV : Use new big folder icon

Alexandre Perraud git at videolan.org
Fri Mar 18 18:46:37 CET 2016


vlc-android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Mar 18 18:45:42 2016 +0100| [54880db7f79acbeb698e3a6d179998fb88e48909] | committer: Alexandre Perraud

TV : Use new big folder icon

> https://code.videolan.org/videolan/vlc-android/commit/54880db7f79acbeb698e3a6d179998fb88e48909
---

 vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java        | 8 ++++++--
 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java       | 2 +-
 .../src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java     | 5 ++++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
index 444bdd2..cb4492f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
@@ -236,8 +236,12 @@ public class CardPresenter extends Presenter {
                 picture = BitmapUtil.getPicture(mediaWrapper);
                 if (picture == null)
                     picture = BitmapFactory.decodeResource(res, R.drawable.ic_browser_video_big_normal);
-            } else if (mediaWrapper.getType() == mediaWrapper.TYPE_DIR)
-                picture = BitmapFactory.decodeResource(res, R.drawable.ic_menu_network_big);
+            } else if (mediaWrapper.getType() == mediaWrapper.TYPE_DIR) {
+                if (TextUtils.equals(mediaWrapper.getUri().getScheme(),"file"))
+                    picture = BitmapFactory.decodeResource(res, R.drawable.ic_menu_folder_big);
+                else
+                    picture = BitmapFactory.decodeResource(res, R.drawable.ic_menu_network_big);
+            }
             else
                 picture = BitmapFactory.decodeResource(res, R.drawable.ic_browser_unknown_big_normal);
             return picture;
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index fb6e4a3..0e46c31 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -506,7 +506,7 @@ public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnI
         if (!AndroidDevices.showInternalStorage())
             directories.remove(0);
         for (MediaWrapper directory : directories)
-            mBrowserAdapter.add(new CardPresenter.SimpleCard(HEADER_DIRECTORIES, directory.getTitle(), R.drawable.ic_menu_network_big, directory.getUri()));
+            mBrowserAdapter.add(new CardPresenter.SimpleCard(HEADER_DIRECTORIES, directory.getTitle(), R.drawable.ic_menu_folder_big, directory.getUri()));
 
         if (AndroidDevices.hasLANConnection()) {
             final ArrayList<MediaWrapper> favs = MediaDatabase.getInstance().getAllNetworkFav();
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
index 5585936..e1c0fe1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
@@ -36,6 +36,7 @@ import android.support.v17.leanback.widget.FullWidthDetailsOverviewRowPresenter;
 import android.support.v17.leanback.widget.ListRow;
 import android.support.v17.leanback.widget.ListRowPresenter;
 import android.support.v17.leanback.widget.OnActionClickedListener;
+import android.text.TextUtils;
 import android.widget.Toast;
 
 import org.videolan.libvlc.util.AndroidUtil;
@@ -144,7 +145,9 @@ public class MediaItemDetailsFragment extends DetailsFragment implements Playbac
 
         if (media.getType() == MediaWrapper.TYPE_DIR) {
             mDb = MediaDatabase.getInstance();
-            detailsOverview.setImageDrawable(getResources().getDrawable(R.drawable.ic_menu_network_big));
+            detailsOverview.setImageDrawable(getResources().getDrawable(TextUtils.equals(media.getUri().getScheme(),"file")
+                    ? R.drawable.ic_menu_folder_big
+                    : R.drawable.ic_menu_network_big));
             detailsOverview.setImageScaleUpAllowed(true);
             detailsOverview.addAction(new Action(ID_BROWSE, "Browse folder"));
             if (mDb.networkFavExists(Uri.parse(mMedia.getLocation())))



More information about the Android mailing list