[Android] Cleaner lists for directories and Musics

Geoffrey Métais git at videolan.org
Fri Nov 7 17:57:47 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Nov  7 17:52:32 2014 +0100| [39c0fc21f9bf0bfeba900ff43faf3abe0605bd72] | committer: Geoffrey Métais

Cleaner lists for directories and Musics

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

 vlc-android/res/layout/audio_browser_item.xml      |   18 ++++++++---------
 vlc-android/res/layout/directory_view.xml          |    2 --
 vlc-android/res/layout/directory_view_item.xml     |   21 ++++++++++----------
 vlc-android/res/values/dimens.xml                  |    3 ++-
 .../src/org/videolan/vlc/gui/DirectoryAdapter.java |    2 +-
 5 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/vlc-android/res/layout/audio_browser_item.xml b/vlc-android/res/layout/audio_browser_item.xml
index 8387020..7050a3b 100644
--- a/vlc-android/res/layout/audio_browser_item.xml
+++ b/vlc-android/res/layout/audio_browser_item.xml
@@ -3,13 +3,13 @@
     android:id="@+id/layout_item"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:paddingTop="10dp"
     android:orientation="vertical" >
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="@dimen/audio_browser_item_size"
-    	android:layout_marginBottom="10dp" >
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="15dp"
+        android:layout_marginTop="15dp" >
 
         <ImageView
             android:id="@+id/cover"
@@ -19,24 +19,23 @@
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:layout_toRightOf="@+id/cover"
             android:layout_toLeftOf="@+id/item_more"
-            android:paddingLeft="10dp"
-            android:gravity="center_vertical"
+            android:paddingLeft="15dp"
+            android:layout_centerVertical="true"
             android:orientation="vertical" >
 
             <TextView
                 android:id="@+id/title"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
                 android:singleLine="true"
                 android:ellipsize="middle"
                 android:maxLines="1"
                 android:text="@string/title"
                 android:textColor="?attr/list_title"
-                android:textSize="20sp" />
+                android:textSize="16sp" />
 
             <TextView
                 android:id="@+id/subtitle"
@@ -46,8 +45,7 @@
                 android:ellipsize="middle"
                 android:maxLines="1"
                 android:text="@string/artist"
-                android:textColor="?attr/list_subtitle"
-                android:textSize="14sp" />
+                android:textColor="?attr/list_subtitle" />
         </LinearLayout>
 
         <ImageView
diff --git a/vlc-android/res/layout/directory_view.xml b/vlc-android/res/layout/directory_view.xml
index 681921e..f798b3d 100644
--- a/vlc-android/res/layout/directory_view.xml
+++ b/vlc-android/res/layout/directory_view.xml
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ListView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@android:id/list"
-    android:paddingLeft="20dp"
-    android:paddingRight="20dp"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:paddingBottom="@dimen/listview_bottom_padding"
diff --git a/vlc-android/res/layout/directory_view_item.xml b/vlc-android/res/layout/directory_view_item.xml
index faf1d3d..24ede05 100644
--- a/vlc-android/res/layout/directory_view_item.xml
+++ b/vlc-android/res/layout/directory_view_item.xml
@@ -4,24 +4,26 @@
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
-    android:paddingTop="5dp"
-    android:paddingBottom="5dp" >
+    android:background="@android:color/white" >
 
     <ImageView
         android:id="@+id/dvi_icon"
-        android:layout_width="@dimen/audio_browser_item_size"
-        android:layout_height="@dimen/audio_browser_item_size"
+        android:layout_width="@dimen/directory_browser_item_size"
+        android:layout_height="@dimen/directory_browser_item_size"
         android:layout_gravity="center"
+		android:layout_marginLeft="15dp"
         android:contentDescription="@string/cover_art"
         android:src="@drawable/icon" />
 
     <LinearLayout
         android:layout_width="0dp"
-        android:layout_height="match_parent"
-        android:gravity="center_vertical"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="15dp"
+        android:layout_marginTop="15dp"
         android:layout_weight="1"
+        android:gravity="center_vertical"
         android:orientation="vertical"
-        android:paddingLeft="10dp" >
+        android:paddingLeft="15dp" >
 
         <TextView
             android:id="@+id/title"
@@ -33,7 +35,7 @@
             android:singleLine="true"
             android:text="@string/title"
             android:textColor="?attr/list_title"
-            android:textSize="20sp" />
+            android:textSize="16sp" />
 
         <TextView
             android:id="@+id/text"
@@ -42,8 +44,7 @@
             android:ellipsize="marquee"
             android:maxLines="1"
             android:text="@string/artist"
-            android:textColor="?attr/list_subtitle"
-            android:textSize="14sp" />
+            android:textColor="?attr/list_subtitle"/>
     </LinearLayout>
 
     <ImageView
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index 6ee2770..1400716 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -1,7 +1,8 @@
 <resources>
     <dimen name="shadow_width">6px</dimen>
     <dimen name="widget_margin">10dp</dimen>
-    <dimen name="audio_browser_item_size">50dp</dimen>
+    <dimen name="audio_browser_item_size">40dp</dimen>
+    <dimen name="directory_browser_item_size">40dp</dimen>
     <dimen name="listview_bottom_padding">50dp</dimen>
     <dimen name="grid_card_width">160dp</dimen>
     <dimen name="grid_card_height">160dp</dimen>
diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
index 5060dd8..0706f6e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
@@ -352,7 +352,7 @@ public class DirectoryAdapter extends BaseAdapter {
                         mediaFileCount);
         }
         if (holderText.isEmpty())
-            holder.text.setVisibility(View.GONE);
+            holder.text.setVisibility(View.INVISIBLE);
         else {
             holder.text.setVisibility(View.VISIBLE);
             holder.text.setText(holderText);



More information about the Android mailing list