From a4b43ffb102b5e04a687199486e4092c02e1d3d2 Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Sun, 24 Nov 2024 09:46:39 +0100 Subject: [PATCH] Alternate colorized rows in list --- .../lunatracker/adapters/LunaEventRecyclerAdapter.kt | 6 +++++- app/src/main/res/layout/row_luna_event.xml | 5 ++++- app/src/main/res/values/colors.xml | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/it/danieleverducci/lunatracker/adapters/LunaEventRecyclerAdapter.kt b/app/src/main/java/it/danieleverducci/lunatracker/adapters/LunaEventRecyclerAdapter.kt index 65ce6ec..4058fd3 100644 --- a/app/src/main/java/it/danieleverducci/lunatracker/adapters/LunaEventRecyclerAdapter.kt +++ b/app/src/main/java/it/danieleverducci/lunatracker/adapters/LunaEventRecyclerAdapter.kt @@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView import it.danieleverducci.lunatracker.entities.LunaEvent import it.danieleverducci.lunatracker.R import java.util.Date -import java.util.Locale class LunaEventRecyclerAdapter: RecyclerView.Adapter { private val context: Context @@ -58,6 +57,9 @@ class LunaEventRecyclerAdapter: RecyclerView.Adapter item.notes @@ -121,12 +123,14 @@ class LunaEventRecyclerAdapter: RecyclerView.Adapter(R.id.type) description = v.findViewById(R.id.description) quantity = v.findViewById(R.id.quantity) diff --git a/app/src/main/res/layout/row_luna_event.xml b/app/src/main/res/layout/row_luna_event.xml index 207b4c0..77daf46 100644 --- a/app/src/main/res/layout/row_luna_event.xml +++ b/app/src/main/res/layout/row_luna_event.xml @@ -3,12 +3,15 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingTop="10dp" + android:paddingBottom="10dp" android:gravity="center_vertical"> #c000 #0000 #ccc + #423B25 + @color/transparent \ No newline at end of file