From 4cd2812130da3e40c472d325172baf6d528e1c5c Mon Sep 17 00:00:00 2001 From: davidoskky Date: Thu, 26 Jan 2023 17:52:19 +0100 Subject: [PATCH] Hide the favourite button in card items when accessing a public instance --- .../android/adapters/ItemCardAdapter.kt | 4 ++ androidApp/src/main/res/layout/card_item.xml | 40 +++++++------------ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/ItemCardAdapter.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/ItemCardAdapter.kt index d9b5f55..f21bd77 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/ItemCardAdapter.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/ItemCardAdapter.kt @@ -56,6 +56,10 @@ class ItemCardAdapter( val itm = items[position] binding.favButton.isSelected = itm.starred + if (appSettingsService.getPublicAccess()) { + binding.favButton.visibility = View.GONE + } + binding.title.text = itm.title.getHtmlDecoded() binding.title.setOnTouchListener(LinkOnTouchListener()) diff --git a/androidApp/src/main/res/layout/card_item.xml b/androidApp/src/main/res/layout/card_item.xml index 023be37..42e2b6e 100644 --- a/androidApp/src/main/res/layout/card_item.xml +++ b/androidApp/src/main/res/layout/card_item.xml @@ -47,7 +47,6 @@ android:id="@+id/sourceImage" android:layout_width="40dp" android:layout_height="40dp" - android:layout_marginLeft="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintLeft_toLeftOf="parent" @@ -85,41 +84,32 @@ app:layout_constraintTop_toBottomOf="@+id/title" tools:text="Google Actualité Il y a 5h" /> - + app:srcCompat="@drawable/ic_open_in_browser_black_24dp" + app:tint="?android:attr/textColorPrimary" /> + app:srcCompat="@drawable/ic_menu_heart_60dp" + app:tint="@color/ic_menu_heart_color" /> - + + +