[Android] Fix card more item margins + standardization

Nicolas Pomepuy git at videolan.org
Thu May 14 15:04:05 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue May 12 11:32:28 2020 +0200| [b72061baa7bca9f351e10e8af15bceb7090c5a2d] | committer: Nicolas Pomepuy

Fix card more item margins + standardization

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

 .../res/layout/audio_browser_card_item.xml            | 19 ++++++++-----------
 .../vlc-android/res/layout/card_browser_item.xml      |  3 ++-
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/application/vlc-android/res/layout/audio_browser_card_item.xml b/application/vlc-android/res/layout/audio_browser_card_item.xml
index dee7f7bf9..2cd6321e9 100644
--- a/application/vlc-android/res/layout/audio_browser_card_item.xml
+++ b/application/vlc-android/res/layout/audio_browser_card_item.xml
@@ -40,7 +40,7 @@
 
     <com.google.android.material.card.MaterialCardView
             android:id="@+id/container"
-            style="@style/Widget.MaterialComponents.CardView"
+            style="@style/VLCCardView"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:clickable="true"
@@ -48,12 +48,7 @@
             android:foreground="?android:attr/selectableItemBackground"
             android:longClickable="true"
             android:onClick="@{holder::onClick}"
-            android:onLongClick="@{holder::onLongClick}"
-            vlc:cardCornerRadius="8dp"
-            vlc:cardElevation="0dp"
-            vlc:strokeColor="?attr/card_border"
-            android:background="?attr/card_background"
-            vlc:strokeWidth="1dp">
+            android:onLongClick="@{holder::onLongClick}">
 
         <androidx.constraintlayout.widget.ConstraintLayout
                 android:layout_width="match_parent"
@@ -157,14 +152,16 @@
                     android:id="@+id/item_more"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
+                    android:layout_marginEnd="4dp"
+                    android:layout_marginBottom="4dp"
+                    android:background="?attr/selectableItemBackgroundBorderless"
                     android:contentDescription="@string/more_actions"
                     android:onClick="@{holder::onMoreClick}"
                     android:scaleType="center"
-                    vlc:srcCompat="@drawable/ic_more"
-                    android:background="?attr/selectableItemBackgroundBorderless"
-                    vlc:layout_constraintBottom_toBottomOf="@+id/subtitle"
+                    vlc:layout_constraintBottom_toBottomOf="parent"
                     vlc:layout_constraintEnd_toEndOf="parent"
-                    vlc:layout_constraintTop_toTopOf="@+id/title" />
+                    vlc:layout_constraintTop_toTopOf="@+id/title"
+                    vlc:srcCompat="@drawable/ic_more" />
         </androidx.constraintlayout.widget.ConstraintLayout>
     </com.google.android.material.card.MaterialCardView>
 </layout>
\ No newline at end of file
diff --git a/application/vlc-android/res/layout/card_browser_item.xml b/application/vlc-android/res/layout/card_browser_item.xml
index c0826fca6..54a7f4881 100644
--- a/application/vlc-android/res/layout/card_browser_item.xml
+++ b/application/vlc-android/res/layout/card_browser_item.xml
@@ -168,13 +168,14 @@
                     android:id="@+id/item_more"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    app:srcCompat="@drawable/ic_more"
+                    android:layout_marginBottom="4dp"
                     android:background="?attr/selectableItemBackgroundBorderless"
                     android:clickable="@{hasContextMenu}"
                     android:onClick="@{holder::onMoreClick}"
                     android:visibility="@{hasContextMenu ? View.VISIBLE : View.GONE, default=gone}"
                     app:layout_constraintBottom_toBottomOf="parent"
                     app:layout_constraintEnd_toEndOf="parent"
+                    app:srcCompat="@drawable/ic_more"
                     tools:visibility="visible" />
         </androidx.constraintlayout.widget.ConstraintLayout>
     </com.google.android.material.card.MaterialCardView>



More information about the Android mailing list