From 2793f38d19834c3c0e79b7ab835d2a768909768e Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 4 Jun 2023 13:11:18 +0200 Subject: [PATCH] Move store name below card image --- .../card_locker/LoyaltyCardCursorAdapter.java | 57 ++++++++++++------- .../card_locker/LoyaltyCardViewActivity.java | 3 +- .../main/java/protect/card_locker/Utils.java | 23 +++----- .../main/res/layout/loyalty_card_layout.xml | 21 ++++++- app/src/main/res/values/strings.xml | 8 +-- 5 files changed, 68 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardCursorAdapter.java b/app/src/main/java/protect/card_locker/LoyaltyCardCursorAdapter.java index 86b42a457..d1da27ef8 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardCursorAdapter.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardCursorAdapter.java @@ -4,6 +4,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.database.Cursor; +import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.util.SparseBooleanArray; @@ -41,7 +42,7 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter { - if (i == 0) { - alwaysShowName(b); - } else if (i == 1) { - showNote(b); - } else if (i == 2) { - showBalance(b); - } else if (i == 3) { - showValidity(b); - } else { - throw new IndexOutOfBoundsException("No such index exists in LoyaltyCardCursorAdapter show details view"); + switch (i) { + case 0: showNameBelowThumbnail(b); break; + case 1: showNote(b); break; + case 2: showBalance(b); break; + case 3: showValidity(b); break; + default: throw new IndexOutOfBoundsException("No such index exists in LoyaltyCardCursorAdapter show details view"); } } ); @@ -182,6 +179,13 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter @@ -129,6 +129,23 @@ + + pref_locale System Select color - Set icon + Set thumbnail pref_theme_color Theme color Catima @@ -312,13 +312,13 @@ Open back image in gallery app Set barcode height Donate - Long press to edit icon - Always show name + Long press to edit thumbnail + Show name below image thumbnail Show note Show balance Show validity - sharedpreference_card_details_always_show_name sharedpreference_card_details_show_note sharedpreference_card_details_show_balance sharedpreference_card_details_show_validity + sharedpreference_card_details_show_name_below_thumbnail