mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2025-12-25 08:07:56 -05:00
Compare commits
1 Commits
create-pul
...
feature/as
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0431803336 |
@@ -1,9 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased - 137
|
||||
|
||||
- Allow long store names in preview to split over multiple lines
|
||||
|
||||
## v2.30.0 - 136 (2024-06-18)
|
||||
|
||||
- Support for creating a card when sharing plain text
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.SparseBooleanArray;
|
||||
import android.util.TypedValue;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
@@ -88,9 +90,29 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
inputHolder.mDivider.setVisibility(View.GONE);
|
||||
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.toLoyaltyCard(inputCursor);
|
||||
Bitmap icon = Utils.retrieveCardImage(mContext, loyaltyCard.id, ImageLocationType.icon);
|
||||
|
||||
if (mLoyaltyCardListDisplayOptions.showingNameBelowThumbnail() && icon != null) {
|
||||
inputHolder.mCardIcon.setContentDescription(loyaltyCard.store);
|
||||
|
||||
// Default header at first, real icon will be retrieved asynchronously if it exists to ensure
|
||||
// smooth scrolling even on slower devices
|
||||
Utils.setIconOrTextWithBackground(mContext, loyaltyCard, null, inputHolder.mCardIcon, inputHolder.mCardText);
|
||||
inputHolder.toggleCardStateIcon(loyaltyCard.starStatus != 0, loyaltyCard.archiveStatus != 0, itemSelected(inputCursor.getPosition()));
|
||||
boolean hasIcon = Utils.retrieveCardImageAsFile(mContext, loyaltyCard.id, ImageLocationType.icon).exists();
|
||||
if (hasIcon) {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bitmap icon = Utils.retrieveCardImage(mContext, loyaltyCard.id, ImageLocationType.icon);
|
||||
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
inputHolder.mIconBackgroundColor = Utils.setIconOrTextWithBackground(mContext, loyaltyCard, icon, inputHolder.mCardIcon, inputHolder.mCardText);
|
||||
inputHolder.toggleCardStateIcon(loyaltyCard.starStatus != 0, loyaltyCard.archiveStatus != 0, itemSelected(inputHolder.getAdapterPosition()));
|
||||
});
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
if (mLoyaltyCardListDisplayOptions.showingNameBelowThumbnail() && hasIcon) {
|
||||
showDivider = true;
|
||||
inputHolder.setStoreField(loyaltyCard.store);
|
||||
} else {
|
||||
@@ -122,11 +144,6 @@ public class LoyaltyCardCursorAdapter extends BaseCursorAdapter<LoyaltyCardCurso
|
||||
inputHolder.setExtraField(inputHolder.mExpiryField, null, null, false);
|
||||
}
|
||||
|
||||
inputHolder.mCardIcon.setContentDescription(loyaltyCard.store);
|
||||
inputHolder.mIconBackgroundColor = Utils.setIconOrTextWithBackground(mContext, loyaltyCard, icon, inputHolder.mCardIcon, inputHolder.mCardText);
|
||||
|
||||
inputHolder.toggleCardStateIcon(loyaltyCard.starStatus != 0, loyaltyCard.archiveStatus != 0, itemSelected(inputCursor.getPosition()));
|
||||
|
||||
inputHolder.itemView.setActivated(mSelectedItems.get(inputCursor.getPosition(), false));
|
||||
applyIconAnimation(inputHolder, inputCursor.getPosition());
|
||||
applyClickEvents(inputHolder, inputCursor.getPosition());
|
||||
|
||||
@@ -39,7 +39,6 @@ import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.os.LocaleListCompat;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.palette.graphics.Palette;
|
||||
|
||||
@@ -942,22 +941,6 @@ public class Utils {
|
||||
if (icon != null) {
|
||||
textWhenNoImage.setVisibility(View.GONE);
|
||||
} else {
|
||||
// Manually calculate how many lines will be needed
|
||||
// This is necessary because Android's auto sizing will split over lines way before reaching the minimum font size and store names split over multiple lines are harder to scan with a quick glance so we should try to prevent it
|
||||
// Because we have to write the text before we can actually know the exact laid out size (trying to delay this causes bugs where the autosize fails) we have to take some... weird shortcuts
|
||||
|
||||
// At this point textWhenNoImage.getWidth() still returns 0, so we cheat by calculating the whole width of the screen and then dividing it by the amount of columns
|
||||
int textviewWidth = Resources.getSystem().getDisplayMetrics().widthPixels / context.getResources().getInteger(R.integer.main_view_card_columns);
|
||||
|
||||
// Calculate how wide a character is and calculate how many characters fit in a line
|
||||
int characterWidth = TextViewCompat.getAutoSizeMinTextSize(textWhenNoImage);
|
||||
int maxWidthPerLine = textviewWidth - textWhenNoImage.getPaddingStart() - textWhenNoImage.getPaddingEnd();
|
||||
|
||||
// Set amount of lines based on what could fit at most
|
||||
int maxLines = ((loyaltyCard.store.length() * characterWidth) / maxWidthPerLine) + 1;
|
||||
textWhenNoImage.setMaxLines(maxLines);
|
||||
|
||||
// Actually set the text and colour
|
||||
textWhenNoImage.setVisibility(View.VISIBLE);
|
||||
textWhenNoImage.setText(loyaltyCard.store);
|
||||
textWhenNoImage.setTextColor(Utils.needsDarkForeground(headerColor) ? Color.BLACK : Color.WHITE);
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/thumbnailDescription"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -42,8 +41,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:textStyle="bold"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="12sp"
|
||||
app:autoSizeMaxTextSize="100sp"
|
||||
app:autoSizeStepGranularity="2sp"
|
||||
android:gravity="center"
|
||||
android:padding="20dp" />
|
||||
android:maxLines="1"
|
||||
android:layout_margin="20dp" />
|
||||
|
||||
<ImageView
|
||||
android:importantForAccessibility="no"
|
||||
|
||||
@@ -7,8 +7,8 @@ Heimen Stoffels
|
||||
Oğuz Ersen
|
||||
FC (Fay) Stegerman
|
||||
Katharine Chui
|
||||
StoyanDimitrov
|
||||
SlavekB
|
||||
StoyanDimitrov
|
||||
mondstern
|
||||
IllusiveMan196
|
||||
Altonss
|
||||
@@ -28,25 +28,25 @@ Scrambled777
|
||||
Giovanni Donisi
|
||||
Jiri Grönroos
|
||||
Samantaz Fox
|
||||
arno-github
|
||||
Cliff Heraldo
|
||||
Sergio Paredes
|
||||
Ankit Tiwari
|
||||
Milo Ivir
|
||||
Milan Šalka
|
||||
arno-github
|
||||
mdvhimself
|
||||
Milan Šalka
|
||||
Milo Ivir
|
||||
Balázs Meskó
|
||||
Skrripy
|
||||
huuhaa
|
||||
Jose Delvani
|
||||
waffshappen
|
||||
ngocanhtve
|
||||
ikanakova
|
||||
Projjal Moitra
|
||||
Quentin PAGÈS
|
||||
ikanakova
|
||||
ngocanhtve
|
||||
waffshappen
|
||||
Ziad OUALHADJ
|
||||
Robin Liu
|
||||
Denis Shilin
|
||||
Jose Delvani
|
||||
Robin Liu
|
||||
Ziad OUALHADJ
|
||||
しいたけ
|
||||
Alexander Ivanov
|
||||
Viet Nguyen Hoang
|
||||
|
||||
@@ -295,5 +295,4 @@
|
||||
<string name="errorReadingFile">Файлът не може да бъде прочетен</string>
|
||||
<string name="failedLaunchingFileManager">Не е намерено приложение за управление на файлове</string>
|
||||
<string name="multipleBarcodesFoundPleaseChooseOne">Кой от намерените щрихкодове желаете да бъде използван?</string>
|
||||
<string name="noCameraFoundGuideText">Изглежда, устройството няма камера. Ако има опитайте да рестартирате. В противен случай използвайте бутона „Още“, за да добавите шрихкод по друг начин.</string>
|
||||
</resources>
|
||||
@@ -98,7 +98,7 @@
|
||||
<string name="setFrontImage">Definir imagem frontal</string>
|
||||
<string name="setBackImage">Definir imagem traseira</string>
|
||||
<string name="removeImage">Remover imagem</string>
|
||||
<string name="takePhoto">Tirar uma foto</string>
|
||||
<string name="takePhoto">Tirar uma photo</string>
|
||||
<string name="updateBarcodeQuestionTitle">Atualizar valor do código de barras?</string>
|
||||
<string name="exportPasswordHint">Insira sua senha</string>
|
||||
<string name="passwordRequired">Por favor, insira a senha</string>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
Copylefted libre software (GPLv3+) card management app.
|
||||
|
||||
[](https://github.com/CatimaLoyalty/Android/releases)
|
||||
[](https://github.com/TheLastProject/Catima/releases)
|
||||
[](https://apt.izzysoft.de/fdroid/index/apk/me.hackerchick.catima)
|
||||
[](https://play.google.com/store/apps/details?id=me.hackerchick.catima)
|
||||
|
||||

|
||||

|
||||
[](https://hosted.weblate.org/engage/catima/)
|
||||
|
||||
[](https://matrix.to/#/%23catima:matrix.org)
|
||||
@@ -17,7 +17,7 @@ Copylefted libre software (GPLv3+) card management app.
|
||||
<a href="https://play.google.com/store/apps/details?id=me.hackerchick.catima" target="_blank">
|
||||
<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="90"/></a>
|
||||
|
||||
[](https://catima.app/)
|
||||
[](https://catima.app/)
|
||||
|
||||
*Logo by [Rose (TangentFoxy)](https://github.com/TangentFoxy), feature graphic by [Ziad OUALHADJ](https://github.com/ziadOUA)*
|
||||
|
||||
@@ -41,14 +41,14 @@ Supported barcodes:
|
||||
|
||||
# Screenshots
|
||||
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-01.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-01.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-02.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-02.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-03.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-03.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-04.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-04.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-05.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-05.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-06.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-06.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-07.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-07.png)
|
||||
[<img src="https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-08.png" width=250>](https://github.com/CatimaLoyalty/Android/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-08.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-01.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-01.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-02.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-02.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-03.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-03.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-04.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-04.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-05.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-05.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-06.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-06.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-07.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-07.png)
|
||||
[<img src="https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-08.png" width=250>](https://github.com/TheLastProject/Catima/raw/main/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-08.png)
|
||||
|
||||
# Moving data from other apps
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
- Allow long store names in preview to split over multiple lines
|
||||
@@ -1 +0,0 @@
|
||||
Para seus códigos de barras, assinaturas, programas de fidelidade, cupons e ingressos.
|
||||
Reference in New Issue
Block a user