[Android] Better browse cards

Nicolas Pomepuy git at videolan.org
Thu Apr 16 15:43:19 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Mar 31 15:30:11 2020 +0200| [9bf7f7925934a4e49e1f96d35e9062f0f30901ab] | committer: Nicolas Pomepuy

Better browse cards

> https://code.videolan.org/videolan/vlc-android/commit/9bf7f7925934a4e49e1f96d35e9062f0f30901ab
---

 application/vlc-android/res/layout/browser_entry.xml         |  3 +++
 application/vlc-android/res/layout/card_browser_item.xml     | 12 ++++++------
 .../src/org/videolan/vlc/gui/browser/MainBrowserFragment.kt  |  6 +-----
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/application/vlc-android/res/layout/browser_entry.xml b/application/vlc-android/res/layout/browser_entry.xml
index 1fc44d17a..4e1469f74 100644
--- a/application/vlc-android/res/layout/browser_entry.xml
+++ b/application/vlc-android/res/layout/browser_entry.xml
@@ -40,6 +40,9 @@
     <androidx.recyclerview.widget.RecyclerView
             android:id="@+id/list"
             android:layout_width="0dp"
+            android:clipToPadding="false"
+            android:paddingStart="12dp"
+            android:paddingEnd="12dp"
             android:layout_height="wrap_content"
             android:layout_marginTop="8dp"
             app:layout_constraintEnd_toEndOf="parent"
diff --git a/application/vlc-android/res/layout/card_browser_item.xml b/application/vlc-android/res/layout/card_browser_item.xml
index 3fc8d8f15..6c37efbbe 100644
--- a/application/vlc-android/res/layout/card_browser_item.xml
+++ b/application/vlc-android/res/layout/card_browser_item.xml
@@ -71,9 +71,9 @@
     <androidx.cardview.widget.CardView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="16dp"
+            android:layout_marginStart="4dp"
             android:layout_marginTop="4dp"
-            android:layout_marginEnd="8dp"
+            android:layout_marginEnd="4dp"
             android:layout_marginBottom="4dp">
 
         <androidx.constraintlayout.widget.ConstraintLayout
@@ -83,7 +83,7 @@
                 android:clickable="@{holder != null}"
                 android:focusable="true"
                 android:longClickable="@{hasContextMenu || item.getItemType() == MediaLibraryItem.TYPE_STORAGE}"
-                android:minWidth="150dp"
+                android:minWidth="120dp"
                 android:onClick="@{holder::onClick}"
                 android:onLongClick="@{holder::onLongClick}"
                 android:padding="2dp">
@@ -103,8 +103,8 @@
             <!-- Image downloading is handled by org.videolan.vlc.gui.helpers.ImageLoader.loadImage() -->
             <ImageView
                     android:id="@+id/item_icon"
-                    android:layout_width="72dp"
-                    android:layout_height="72dp"
+                    android:layout_width="64dp"
+                    android:layout_height="64dp"
                     android:layout_marginTop="8dp"
                     android:contentDescription="@string/cover_art"
                     android:onClick="@{holder::onImageClick}"
@@ -143,7 +143,7 @@
                     android:singleLine="true"
                     android:text="@{filename ?? item.title}"
                     android:textColor="?attr/list_title"
-                    android:textSize="16sp"
+                    android:textSize="14sp"
                     app:ellipsizeMode="@{true}"
                     app:layout_constraintBottom_toTopOf="@+id/text"
                     app:layout_constraintEnd_toStartOf="@+id/item_more"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/MainBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/MainBrowserFragment.kt
index 10c0f387f..d581f818f 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/MainBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/MainBrowserFragment.kt
@@ -270,11 +270,7 @@ class MainBrowserFragment : BaseFragment(), View.OnClickListener, CtxActionRecei
         }
 
         override fun onImageClick(v: View, position: Int, item: MediaLibraryItem) {
-            if (actionMode != null) {
-                onClick(v, position, item)
-                return
-            }
-            onLongClick(v, position, item)
+            onClick(v, position, item)
         }
 
         override fun onCtxClick(v: View, position: Int, item: MediaLibraryItem) {



More information about the Android mailing list