mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2025-12-25 08:07:56 -05:00
Compare commits
67 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bf6f6cd5f | ||
|
|
1872bea0c3 | ||
|
|
665ef5f712 | ||
|
|
9fbcb23465 | ||
|
|
25c35acd6d | ||
|
|
35747b7d9f | ||
|
|
eea5cdfdd0 | ||
|
|
e0c28830ab | ||
|
|
e714d98ae6 | ||
|
|
bbfba92de0 | ||
|
|
efda8f9f10 | ||
|
|
041472b44b | ||
|
|
92f79e9d3e | ||
|
|
f932d8f6e4 | ||
|
|
5e3399cd32 | ||
|
|
b736f31dc2 | ||
|
|
ff285430c0 | ||
|
|
504c1ac516 | ||
|
|
c4746fe2b9 | ||
|
|
99383d4fc6 | ||
|
|
71cd16caac | ||
|
|
6a04077cec | ||
|
|
5664ff5631 | ||
|
|
48764e266e | ||
|
|
435cfd2839 | ||
|
|
34639f2a2e | ||
|
|
ce9c3bffe6 | ||
|
|
d0d15393f6 | ||
|
|
e9eaf51e40 | ||
|
|
de8a843414 | ||
|
|
0ad4c683b7 | ||
|
|
fdbff0f942 | ||
|
|
a02d9fd995 | ||
|
|
d7f43f8a2b | ||
|
|
3cbd69c6c7 | ||
|
|
1cff0e29e4 | ||
|
|
e718ffb77d | ||
|
|
c2d711650f | ||
|
|
f205045916 | ||
|
|
6ed6e683b5 | ||
|
|
1612bed309 | ||
|
|
ac8a2c445c | ||
|
|
f98203fc5d | ||
|
|
82298d0d50 | ||
|
|
916515f8b2 | ||
|
|
b5e6d40857 | ||
|
|
efef397870 | ||
|
|
377438b6ae | ||
|
|
27443db945 | ||
|
|
420886bc3f | ||
|
|
86a01d36db | ||
|
|
329293fa7c | ||
|
|
26bbea7377 | ||
|
|
50385c6e0e | ||
|
|
43c45c9c0c | ||
|
|
17cdc58b19 | ||
|
|
4960b77ca3 | ||
|
|
a7c6ac695e | ||
|
|
63dfe27b25 | ||
|
|
2ec44046a8 | ||
|
|
0363bc67e4 | ||
|
|
affa434679 | ||
|
|
ded151830e | ||
|
|
e1b604c1d2 | ||
|
|
45d9353b54 | ||
|
|
ceceda560a | ||
|
|
088c25dbad |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,5 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
## v2.16.3 - 107 (2022-04-15)
|
||||
|
||||
- Stocard import fixes
|
||||
|
||||
## v2.16.2 - 106 (2022-03-31)
|
||||
|
||||
- Fix some character sequences being shown as a single character
|
||||
|
||||
## v2.16.1 - 105 (2022-03-25)
|
||||
|
||||
- Fix gray block appearing on invalid value for barcode
|
||||
- Stocard import fixes
|
||||
|
||||
## v2.16.0 - 104 (2022-03-09)
|
||||
|
||||
- Save card detail expansion state
|
||||
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
applicationId "me.hackerchick.catima"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
versionCode 104
|
||||
versionName "2.16.0"
|
||||
versionCode 107
|
||||
versionName "2.16.3"
|
||||
|
||||
vectorDrawables.useSupportLibrary true
|
||||
multiDexEnabled true
|
||||
@@ -90,7 +90,7 @@ dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||
|
||||
// Splash Screen
|
||||
implementation 'androidx.core:core-splashscreen:1.0.0-beta01'
|
||||
implementation 'androidx.core:core-splashscreen:1.0.0-beta02'
|
||||
|
||||
// Third-party
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
|
||||
|
||||
@@ -73,9 +73,10 @@ class LetterBitmap {
|
||||
String firstChar = displayName.substring(0, 1).toUpperCase();
|
||||
int firstCharEnd = 2;
|
||||
while (firstCharEnd <= displayName.length()) {
|
||||
// test for the longest render-able string
|
||||
// Test for the longest render-able string
|
||||
// But ignore containing only a-Z0-9 to not render things like ffi as a single character
|
||||
String test = displayName.substring(0, firstCharEnd);
|
||||
if (PaintCompat.hasGlyph(paint, test)) {
|
||||
if (!isAlphabetical(test) && PaintCompat.hasGlyph(paint, test)) {
|
||||
firstChar = test;
|
||||
}
|
||||
firstCharEnd++;
|
||||
@@ -124,6 +125,10 @@ class LetterBitmap {
|
||||
return colors.getColor(color, Color.BLACK);
|
||||
}
|
||||
|
||||
private static boolean isAlphabetical(String string) {
|
||||
return string.matches("[a-zA-Z0-9]*");
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the color which the letter tile will use if no default
|
||||
* color is provided.
|
||||
|
||||
@@ -855,10 +855,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
// Generate random header color
|
||||
if (tempLoyaltyCard.headerColor == null) {
|
||||
// Select a random color to start out with.
|
||||
TypedArray colors = getResources().obtainTypedArray(R.array.letter_tile_colors);
|
||||
final int color = (int) (Math.random() * colors.length());
|
||||
updateTempState(LoyaltyCardField.headerColor, colors.getColor(color, Color.BLACK));
|
||||
colors.recycle();
|
||||
updateTempState(LoyaltyCardField.headerColor, Utils.getRandomHeaderColor(this));
|
||||
}
|
||||
|
||||
// It can't be null because we set it in updateTempState but SpotBugs insists it can be
|
||||
@@ -919,7 +916,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity {
|
||||
protected void setColorFromIcon() {
|
||||
Object icon = thumbnail.getTag();
|
||||
if (icon != null && (icon instanceof Bitmap)) {
|
||||
updateTempState(LoyaltyCardField.headerColor, new Palette.Builder((Bitmap) icon).generate().getDominantColor(tempLoyaltyCard.headerColor != null ? tempLoyaltyCard.headerColor : R.attr.colorPrimary));
|
||||
updateTempState(LoyaltyCardField.headerColor, Utils.getHeaderColorFromImage((Bitmap) icon, tempLoyaltyCard.headerColor != null ? tempLoyaltyCard.headerColor : R.attr.colorPrimary));
|
||||
} else {
|
||||
Log.d("setColorFromIcon", "attempting header color change from icon but icon does not exist");
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
private final int HEADER_FILTER_ALPHA = 127;
|
||||
|
||||
final private TaskHandler mTasks = new TaskHandler();
|
||||
Runnable barcodeImageGenerationFinishedCallback;
|
||||
|
||||
@Override
|
||||
public boolean onDown(MotionEvent e) {
|
||||
@@ -286,6 +287,19 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
iconImage = findViewById(R.id.icon_image);
|
||||
landscapeToolbar = findViewById(R.id.toolbar_landscape);
|
||||
|
||||
barcodeImageGenerationFinishedCallback = () -> {
|
||||
if (!(boolean) mainImage.getTag()) {
|
||||
mainImage.setVisibility(View.GONE);
|
||||
imageTypes.remove(ImageType.BARCODE);
|
||||
|
||||
// Redraw UI
|
||||
setDotIndicator(Utils.isDarkModeEnabled(LoyaltyCardViewActivity.this));
|
||||
setFullscreen(isFullscreen);
|
||||
|
||||
Toast.makeText(LoyaltyCardViewActivity.this, getString(R.string.wrongValueForBarcodeType), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
};
|
||||
|
||||
centerGuideline = findViewById(R.id.centerGuideline);
|
||||
barcodeScaler = findViewById(R.id.barcodeScaler);
|
||||
barcodeScaler.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@@ -649,22 +663,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
imageTypes.add(ImageType.IMAGE_BACK);
|
||||
}
|
||||
|
||||
dotIndicator.removeAllViews();
|
||||
if (imageTypes.size() >= 2) {
|
||||
dots = new ImageView[imageTypes.size()];
|
||||
|
||||
for (int i = 0; i < imageTypes.size(); i++) {
|
||||
dots[i] = new ImageView(this);
|
||||
dots[i].setImageDrawable(getDotIcon(false, darkMode));
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
params.setMargins(8, 0, 8, 0);
|
||||
|
||||
dotIndicator.addView(dots[i], params);
|
||||
}
|
||||
|
||||
dotIndicator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
setDotIndicator(darkMode);
|
||||
|
||||
setFullscreen(isFullscreen);
|
||||
|
||||
@@ -818,7 +817,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
format,
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
barcodeImageGenerationFinishedCallback,
|
||||
addPadding);
|
||||
mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter);
|
||||
}
|
||||
@@ -900,6 +899,25 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
|
||||
drawMainImage(newIndex, false, isFullscreen);
|
||||
}
|
||||
|
||||
private void setDotIndicator(boolean darkMode) {
|
||||
dotIndicator.removeAllViews();
|
||||
if (imageTypes.size() >= 2) {
|
||||
dots = new ImageView[imageTypes.size()];
|
||||
|
||||
for (int i = 0; i < imageTypes.size(); i++) {
|
||||
dots[i] = new ImageView(this);
|
||||
dots[i].setImageDrawable(getDotIcon(false, darkMode));
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
params.setMargins(8, 0, 8, 0);
|
||||
|
||||
dotIndicator.addView(dots[i], params);
|
||||
}
|
||||
|
||||
dotIndicator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When enabled, hides the status bar and moves the barcode to the top of the screen.
|
||||
* <p>
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
@@ -48,6 +49,7 @@ import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
|
||||
import androidx.palette.graphics.Palette;
|
||||
import protect.card_locker.preferences.Settings;
|
||||
|
||||
public class Utils {
|
||||
@@ -518,4 +520,18 @@ public class Utils {
|
||||
item.setTitle(R.string.action_show_details);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getHeaderColorFromImage(Bitmap image, int fallback) {
|
||||
if (image == null) {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return new Palette.Builder(image).generate().getDominantColor(R.attr.colorPrimary);
|
||||
}
|
||||
|
||||
public static int getRandomHeaderColor(Context context) {
|
||||
TypedArray colors = context.getResources().obtainTypedArray(R.array.letter_tile_colors);
|
||||
final int color = (int) (Math.random() * colors.length());
|
||||
return colors.getColor(color, Color.BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.text.ParseException;
|
||||
import protect.card_locker.CatimaBarcode;
|
||||
import protect.card_locker.DBHelper;
|
||||
import protect.card_locker.FormatException;
|
||||
import protect.card_locker.Utils;
|
||||
|
||||
/**
|
||||
* Class for importing a database from CSV (Comma Separate Values)
|
||||
@@ -56,7 +57,7 @@ public class FidmeImporter implements Importer {
|
||||
|
||||
try {
|
||||
for (CSVRecord record : fidmeParser) {
|
||||
importLoyaltyCard(database, record);
|
||||
importLoyaltyCard(context, database, record);
|
||||
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new InterruptedException();
|
||||
@@ -75,7 +76,7 @@ public class FidmeImporter implements Importer {
|
||||
* Import a single loyalty card into the database using the given
|
||||
* session.
|
||||
*/
|
||||
private void importLoyaltyCard(SQLiteDatabase database, CSVRecord record)
|
||||
private void importLoyaltyCard(Context context, SQLiteDatabase database, CSVRecord record)
|
||||
throws FormatException {
|
||||
// A loyalty card export from Fidme contains the following fields:
|
||||
// Retailer (store name)
|
||||
@@ -117,11 +118,12 @@ public class FidmeImporter implements Importer {
|
||||
// TODO: Hook this into our own loyalty card DB if we ever get one
|
||||
CatimaBarcode barcodeType = null;
|
||||
|
||||
// No favourite data in the export either
|
||||
// No favourite data or colour in the export either
|
||||
int starStatus = 0;
|
||||
int headerColor = Utils.getRandomHeaderColor(context);
|
||||
|
||||
// TODO: Front and back image
|
||||
|
||||
DBHelper.insertLoyaltyCard(database, store, note, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, null, starStatus, null);
|
||||
DBHelper.insertLoyaltyCard(database, store, note, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, starStatus, null);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class MultiFormatImporter {
|
||||
return new ImportExportResult(ImportExportResultType.Success);
|
||||
} catch (ZipException e) {
|
||||
return new ImportExportResult(ImportExportResultType.BadPassword);
|
||||
} catch (IOException | FormatException | InterruptedException | JSONException | ParseException | NullPointerException e) {
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to import data", e);
|
||||
error = e.toString();
|
||||
} finally {
|
||||
|
||||
@@ -3,6 +3,7 @@ package protect.card_locker.importexport;
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
|
||||
@@ -39,15 +40,17 @@ import protect.card_locker.ZipUtils;
|
||||
* A header is expected for the each table showing the names of the columns.
|
||||
*/
|
||||
public class StocardImporter implements Importer {
|
||||
private static final String TAG = "Catima";
|
||||
|
||||
public void importData(Context context, SQLiteDatabase database, InputStream input, char[] password) throws IOException, FormatException, JSONException, ParseException {
|
||||
HashMap<String, HashMap<String, Object>> loyaltyCardHashMap = new HashMap<>();
|
||||
HashMap<String, HashMap<String, String>> providers = new HashMap<>();
|
||||
HashMap<String, HashMap<String, Object>> providers = new HashMap<>();
|
||||
|
||||
final CSVParser parser = new CSVParser(new InputStreamReader(context.getResources().openRawResource(R.raw.stocard_stores), StandardCharsets.UTF_8), CSVFormat.RFC4180.builder().setHeader().build());
|
||||
|
||||
try {
|
||||
for (CSVRecord record : parser) {
|
||||
HashMap<String, String> recordData = new HashMap<>();
|
||||
HashMap<String, Object> recordData = new HashMap<>();
|
||||
recordData.put("name", record.get("name"));
|
||||
recordData.put("barcodeFormat", record.get("barcodeFormat"));
|
||||
|
||||
@@ -62,6 +65,8 @@ public class StocardImporter implements Importer {
|
||||
ZipInputStream zipInputStream = new ZipInputStream(input, password);
|
||||
|
||||
String[] providersFileName = null;
|
||||
String[] customProvidersBaseName = null;
|
||||
String customProviderId = "";
|
||||
String[] cardBaseName = null;
|
||||
String cardName = "";
|
||||
LocalFileHeader localFileHeader;
|
||||
@@ -78,6 +83,14 @@ public class StocardImporter implements Importer {
|
||||
nameParts[0],
|
||||
"analytics-properties.json"
|
||||
};
|
||||
customProvidersBaseName = new String[]{
|
||||
nameParts[0],
|
||||
"sync",
|
||||
"data",
|
||||
"users",
|
||||
nameParts[0],
|
||||
"loyalty-card-custom-providers"
|
||||
};
|
||||
cardBaseName = new String[]{
|
||||
nameParts[0],
|
||||
"sync",
|
||||
@@ -88,6 +101,33 @@ public class StocardImporter implements Importer {
|
||||
};
|
||||
}
|
||||
|
||||
if (startsWith(nameParts, customProvidersBaseName, 1)) {
|
||||
// Extract providerId
|
||||
customProviderId = nameParts[customProvidersBaseName.length].split("\\.", 2)[0];
|
||||
|
||||
// Name file
|
||||
if (nameParts.length == customProvidersBaseName.length + 1) {
|
||||
// Ignore the .txt file
|
||||
if (fileName.endsWith(".json")) {
|
||||
JSONObject jsonObject = ZipUtils.readJSON(zipInputStream);
|
||||
|
||||
providers = appendToHashMap(
|
||||
providers,
|
||||
customProviderId,
|
||||
"name",
|
||||
jsonObject.getString("name")
|
||||
);
|
||||
}
|
||||
} else if (fileName.endsWith("logo.png")) {
|
||||
providers = appendToHashMap(
|
||||
providers,
|
||||
customProviderId,
|
||||
"logo",
|
||||
ZipUtils.readImage(zipInputStream)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (startsWith(nameParts, cardBaseName, 1)) {
|
||||
// Extract cardName
|
||||
cardName = nameParts[cardBaseName.length].split("\\.", 2)[0];
|
||||
@@ -98,24 +138,33 @@ public class StocardImporter implements Importer {
|
||||
if (fileName.endsWith(".json")) {
|
||||
JSONObject jsonObject = ZipUtils.readJSON(zipInputStream);
|
||||
|
||||
loyaltyCardHashMap = appendToLoyaltyCardHashMap(
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"cardId",
|
||||
jsonObject.getString("input_id")
|
||||
);
|
||||
loyaltyCardHashMap = appendToLoyaltyCardHashMap(
|
||||
|
||||
// Provider ID can be either custom or not, extract whatever version is relevant
|
||||
String customProviderPrefix = "/users/" + nameParts[0] + "/loyalty-card-custom-providers/";
|
||||
String providerId = jsonObject
|
||||
.getJSONObject("input_provider_reference")
|
||||
.getString("identifier");
|
||||
if (providerId.startsWith(customProviderPrefix)) {
|
||||
providerId = providerId.substring(customProviderPrefix.length());
|
||||
} else {
|
||||
providerId = providerId.substring("/loyalty-card-providers/".length());
|
||||
}
|
||||
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"_providerId",
|
||||
jsonObject
|
||||
.getJSONObject("input_provider_reference")
|
||||
.getString("identifier")
|
||||
.substring("/loyalty-card-providers/".length())
|
||||
providerId
|
||||
);
|
||||
|
||||
if (jsonObject.has("input_barcode_format")) {
|
||||
loyaltyCardHashMap = appendToLoyaltyCardHashMap(
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"barcodeType",
|
||||
@@ -124,7 +173,7 @@ public class StocardImporter implements Importer {
|
||||
}
|
||||
}
|
||||
} else if (fileName.endsWith("notes/default.json")) {
|
||||
loyaltyCardHashMap = appendToLoyaltyCardHashMap(
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"note",
|
||||
@@ -132,14 +181,14 @@ public class StocardImporter implements Importer {
|
||||
.getString("content")
|
||||
);
|
||||
} else if (fileName.endsWith("/images/front.png")) {
|
||||
loyaltyCardHashMap = appendToLoyaltyCardHashMap(
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"frontImage",
|
||||
ZipUtils.readImage(zipInputStream)
|
||||
);
|
||||
} else if (fileName.endsWith("/images/back.png")) {
|
||||
loyaltyCardHashMap = appendToLoyaltyCardHashMap(
|
||||
loyaltyCardHashMap = appendToHashMap(
|
||||
loyaltyCardHashMap,
|
||||
cardName,
|
||||
"backImage",
|
||||
@@ -155,22 +204,41 @@ public class StocardImporter implements Importer {
|
||||
|
||||
for (HashMap<String, Object> loyaltyCardData : loyaltyCardHashMap.values()) {
|
||||
String providerId = (String) loyaltyCardData.get("_providerId");
|
||||
HashMap<String, String> providerData = providers.get(providerId);
|
||||
|
||||
String store = providerData != null ? providerData.get("name") : providerId;
|
||||
if (providerId == null) {
|
||||
Log.d(TAG, "Missing providerId for card " + loyaltyCardData + ", ignoring...");
|
||||
continue;
|
||||
}
|
||||
|
||||
HashMap<String, Object> providerData = providers.get(providerId);
|
||||
|
||||
String store = providerData != null ? providerData.get("name").toString() : providerId;
|
||||
String note = (String) Utils.mapGetOrDefault(loyaltyCardData, "note", "");
|
||||
String cardId = (String) loyaltyCardData.get("cardId");
|
||||
String barcodeTypeString = (String) Utils.mapGetOrDefault(loyaltyCardData, "barcodeType", providerData != null ? providerData.get("barcodeFormat") : null);
|
||||
CatimaBarcode barcodeType = null;
|
||||
if (barcodeTypeString != null) {
|
||||
if (barcodeTypeString != null && !barcodeTypeString.isEmpty()) {
|
||||
if (barcodeTypeString.equals("RSS_DATABAR_EXPANDED")) {
|
||||
barcodeType = CatimaBarcode.fromBarcode(BarcodeFormat.RSS_EXPANDED);
|
||||
} else if (barcodeTypeString.equals("GS1_128")) {
|
||||
barcodeType = CatimaBarcode.fromBarcode(BarcodeFormat.CODE_128);
|
||||
} else {
|
||||
barcodeType = CatimaBarcode.fromName(barcodeTypeString);
|
||||
}
|
||||
}
|
||||
|
||||
long loyaltyCardInternalId = DBHelper.insertLoyaltyCard(database, store, note, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, null, 0, null);
|
||||
int headerColor = Utils.getRandomHeaderColor(context);
|
||||
Bitmap cardIcon = null;
|
||||
if (providerData != null && providerData.containsKey("logo")) {
|
||||
cardIcon = (Bitmap) providerData.get("logo");
|
||||
headerColor = Utils.getHeaderColorFromImage(cardIcon, headerColor);
|
||||
}
|
||||
|
||||
long loyaltyCardInternalId = DBHelper.insertLoyaltyCard(database, store, note, null, BigDecimal.valueOf(0), null, cardId, null, barcodeType, headerColor, 0, null);
|
||||
|
||||
if (cardIcon != null) {
|
||||
Utils.saveCardImage(context, cardIcon, (int) loyaltyCardInternalId, ImageLocationType.icon);
|
||||
}
|
||||
|
||||
if (loyaltyCardData.containsKey("frontImage")) {
|
||||
Utils.saveCardImage(context, (Bitmap) loyaltyCardData.get("frontImage"), (int) loyaltyCardInternalId, ImageLocationType.front);
|
||||
@@ -197,7 +265,7 @@ public class StocardImporter implements Importer {
|
||||
return true;
|
||||
}
|
||||
|
||||
private HashMap<String, HashMap<String, Object>> appendToLoyaltyCardHashMap(HashMap<String, HashMap<String, Object>> loyaltyCardHashMap, String cardID, String key, Object value) {
|
||||
private HashMap<String, HashMap<String, Object>> appendToHashMap(HashMap<String, HashMap<String, Object>> loyaltyCardHashMap, String cardID, String key, Object value) {
|
||||
HashMap<String, Object> loyaltyCardData = loyaltyCardHashMap.get(cardID);
|
||||
if (loyaltyCardData == null) {
|
||||
loyaltyCardData = new HashMap<>();
|
||||
|
||||
@@ -7,11 +7,11 @@ solokot
|
||||
Katharine Chui
|
||||
mondstern
|
||||
Oğuz Ersen
|
||||
IllusiveMan196
|
||||
Altonss
|
||||
IllusiveMan196
|
||||
StoyanDimitrov
|
||||
Petr Novák
|
||||
Joel A
|
||||
StoyanDimitrov
|
||||
Taco
|
||||
Gediminas Murauskas
|
||||
Nyatsuki
|
||||
@@ -20,19 +20,20 @@ Samantaz Fox
|
||||
arno-github
|
||||
Ankit Tiwari
|
||||
Sergio Paredes
|
||||
laralem
|
||||
huuhaa
|
||||
laralem
|
||||
arshbeerSingh
|
||||
Quentin PAGÈS
|
||||
Miha Frangež
|
||||
sr093906
|
||||
mdvhimself
|
||||
Maciej Błędkowski
|
||||
Olivia (Zoe)
|
||||
Quentin PAGÈS
|
||||
betsythefc
|
||||
Silvério Santos
|
||||
waffshappen
|
||||
ati3
|
||||
Jane Kong
|
||||
K. Herbert
|
||||
Still Hsu
|
||||
String E. Fighter
|
||||
@@ -45,7 +46,6 @@ KovalevArtem
|
||||
Clonewayx
|
||||
D. Domig
|
||||
Diego
|
||||
Jane Kong
|
||||
Lukas Grassauer
|
||||
Marnick L'Eau
|
||||
Michalis
|
||||
@@ -83,10 +83,11 @@ Ronak Upadhyay
|
||||
Rose Liverman
|
||||
Simone Dotto
|
||||
Subhashish Anand
|
||||
darkodo
|
||||
Tymofii Lytvynenko
|
||||
Tjipke van der Heide
|
||||
Yevgeny M
|
||||
avikkundu
|
||||
Avik Kundu
|
||||
opsik
|
||||
psa-jforestier
|
||||
Robin
|
||||
|
||||
@@ -440,7 +440,7 @@ _id,name,barcodeFormat
|
||||
450,CAD,EAN_13
|
||||
451,Camomilla,EAN_13
|
||||
452,"Carpisa Yamamay",EAN_13
|
||||
453,Carrefour,EAN_13
|
||||
453,Carrefour,CODE_128
|
||||
454,"Cisalfa Sport",EAN_13
|
||||
455,Coin,ITF
|
||||
456,Comet,EAN_13
|
||||
|
||||
|
@@ -64,7 +64,7 @@
|
||||
<string name="share">Compartir</string>
|
||||
<string name="barcodeNoBarcode">Esta tarjeta no tiene código de barras</string>
|
||||
<string name="barcodeType">Tipo de código de barras</string>
|
||||
<string name="noMatchingGiftCards">No se ha encontrado nada. Pruebe a modificar su búsqueda.</string>
|
||||
<string name="noMatchingGiftCards">Sin resultados. Pruebe modificando su búsqueda.</string>
|
||||
<string name="action_search">Buscar</string>
|
||||
<string name="app_revision_fmt">Información de la revisión: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="noGroups">Primero pulse en el botón «+» para añadir grupos de categorización.</string>
|
||||
|
||||
@@ -229,6 +229,6 @@
|
||||
<item quantity="one"><xliff:g>%s</xliff:g> point</item>
|
||||
<item quantity="other"><xliff:g>%s</xliff:g> points</item>
|
||||
</plurals>
|
||||
<string name="settings_oled_dark">Fond noir pur pour le thème sombre</string>
|
||||
<string name="settings_oled_dark">Fond noir pour le thème sombre</string>
|
||||
<string name="include_if_asking_support">Si vous voulez demander de l\'aide, incluez les informations suivantes :</string>
|
||||
</resources>
|
||||
@@ -66,4 +66,6 @@
|
||||
<string name="groups">Grops</string>
|
||||
<string name="groupsList">Grops : <xliff:g>%s</xliff:g></string>
|
||||
<string name="settings_max_font_size_scale">Talha max. de la poliça</string>
|
||||
<string name="settings_theme_color">Color del tèma</string>
|
||||
<string name="settings_locale">Lenga</string>
|
||||
</resources>
|
||||
@@ -207,5 +207,5 @@
|
||||
<string name="no">Nie</string>
|
||||
<string name="passwordRequired">Zadajte prosím heslo</string>
|
||||
<string name="parsingBalanceFailed"><xliff:g>%s</xliff:g> sa nezdá byť platným zostatkom.</string>
|
||||
<string name="noGiftCardsGroup">Vytvorte niekoľko kariet a potom ich priraďte k tejto skupine.</string>
|
||||
</resources>
|
||||
<string name="noGiftCardsGroup">Zatiaľ nemáte žiadne vernostné karty. Keď nejaké pridáte, môžete ich priradiť ku skupine tu.</string>
|
||||
</resources>
|
||||
@@ -175,4 +175,47 @@
|
||||
<plurals name="balancePoints">
|
||||
<item quantity="other"><xliff:g>%s</xliff:g> 点</item>
|
||||
</plurals>
|
||||
<string name="settings_locale">语言</string>
|
||||
<string name="setIcon">设置图标</string>
|
||||
<string name="settings_pink_theme">粉色</string>
|
||||
<string name="settings_oled_dark">纯黑色背景的深色主题</string>
|
||||
<string name="hideMoreInfo">隐藏信息</string>
|
||||
<string name="translate_platform">在Weblate上</string>
|
||||
<string name="settings_sky_blue_theme">天蓝</string>
|
||||
<string name="showMoreInfo">显示信息</string>
|
||||
<string name="options">选项</string>
|
||||
<string name="source_repository">源码库</string>
|
||||
<string name="include_if_asking_support">请求帮助时,请填写下列信息:</string>
|
||||
<string name="exportPasswordHint">输入密码</string>
|
||||
<string name="settings_grey_theme">灰色</string>
|
||||
<string name="sort">排序</string>
|
||||
<string name="version_history">历史版本</string>
|
||||
<string name="rate_this_app">给这个应用评分</string>
|
||||
<string name="on_google_play">在Google Play上</string>
|
||||
<string name="report_error">报告错误</string>
|
||||
<string name="shortcutSelectCard">选择一张卡片</string>
|
||||
<string name="group_name_already_in_use">组名已在使用中</string>
|
||||
<string name="group_name_is_empty">组名不可为空</string>
|
||||
<string name="settings_brown_theme">棕色</string>
|
||||
<string name="settings_green_theme">绿色</string>
|
||||
<string name="sort_by_most_recently_used">最近使用</string>
|
||||
<string name="sort_by_name">名称</string>
|
||||
<string name="help_translate_this_app">帮助翻译此应用</string>
|
||||
<string name="sort_by_balance">余额</string>
|
||||
<string name="swipeToSwitchImages">滑动或长按来切换图片</string>
|
||||
<string name="reverse">倒序</string>
|
||||
<string name="sort_by">排序方式</string>
|
||||
<string name="selectColor">选择颜色</string>
|
||||
<string name="settings_theme_color">主题色</string>
|
||||
<string name="settings_blue_theme">蓝色</string>
|
||||
<string name="sort_by_expiry">到期日</string>
|
||||
<string name="settings_catima_theme">Catima</string>
|
||||
<string name="noGroupCards">该组是空的</string>
|
||||
<string name="on_github">在GitHub上</string>
|
||||
<string name="group_updated">群组已更新</string>
|
||||
<string name="editGroup">编辑组:<xliff:g>%s</xliff:g></string>
|
||||
<string name="settings_system_locale">系统</string>
|
||||
<string name="exportPassword">设置密码来保护导出的内容(可选)</string>
|
||||
<string name="settings_magenta_theme">紫红</string>
|
||||
<string name="settings_violet_theme">紫色</string>
|
||||
</resources>
|
||||
@@ -64,9 +64,6 @@ import static org.robolectric.Shadows.shadowOf;
|
||||
public class ImportExportTest {
|
||||
private Activity activity;
|
||||
private SQLiteDatabase mDatabase;
|
||||
private long nowMs;
|
||||
private long lastYearMs;
|
||||
private final int MONTHS_PER_YEAR = 12;
|
||||
|
||||
private final String BARCODE_DATA = "428311627547";
|
||||
private final CatimaBarcode BARCODE_TYPE = CatimaBarcode.fromBarcode(BarcodeFormat.UPC_A);
|
||||
@@ -77,11 +74,6 @@ public class ImportExportTest {
|
||||
|
||||
activity = Robolectric.setupActivity(MainActivity.class);
|
||||
mDatabase = TestHelpers.getEmptyDb(activity).getWritableDatabase();
|
||||
nowMs = System.currentTimeMillis();
|
||||
|
||||
Calendar lastYear = Calendar.getInstance();
|
||||
lastYear.set(Calendar.YEAR, lastYear.get(Calendar.YEAR) - 1);
|
||||
lastYearMs = lastYear.getTimeInMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1
fastlane/metadata/android/bg/changelogs/99.txt
Normal file
1
fastlane/metadata/android/bg/changelogs/99.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Нов дизайн с Material You
|
||||
@@ -1 +1 @@
|
||||
За щрихкодове, членства, програми за лоялност, талони и билети.
|
||||
За щрихкодове, карти за членства и лоялност, талони и билети.
|
||||
|
||||
@@ -1 +1 @@
|
||||
Catima
|
||||
Catima – портфейл за карти
|
||||
|
||||
2
fastlane/metadata/android/de-DE/changelogs/105.txt
Normal file
2
fastlane/metadata/android/de-DE/changelogs/105.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Grauer Block bei ungültigem Wert für Barcode behoben
|
||||
- Korrekturen beim Stocard-Import
|
||||
2
fastlane/metadata/android/en-US/changelogs/105.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/105.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Fix gray block appearing on invalid value for barcode
|
||||
- Stocard import fixes
|
||||
1
fastlane/metadata/android/en-US/changelogs/106.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/106.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Fix some character sequences being shown as a single character
|
||||
1
fastlane/metadata/android/en-US/changelogs/107.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/107.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Stocard import fixes
|
||||
@@ -1,9 +1,9 @@
|
||||
Lopeta muovisten bonuskorttien etsiminen kaupan tai verkkokaupan kassalla.
|
||||
<b>Skannaa viivakoodit laitteeseesi sen kameran avulla, unohda kortit.</b>
|
||||
|
||||
Unohda lompakko tai pidä se ultrakevyesti arvoesineitä varten.
|
||||
Unohda lompakko tai pidä se ultrakevyenä arvoesineitä varten.
|
||||
|
||||
Tämän välttämättömän jokapäiväisen kantamisen (EDC) välineen avulla voit korvata turhan muovin käteisellä.
|
||||
Tämän päivittäiseen käyttöön suunnitellun sovelluksen avulla voit korvata turhan muovin käteisellä.
|
||||
|
||||
- Vältä vakoilu hyvin vähillä luvilla. Ei Internet-yhteyttä eikä mainoksia.
|
||||
- Lisää kortteja tai koodeja nimillä ja muokattavilla väreillä.
|
||||
@@ -14,7 +14,7 @@ Tämän välttämättömän jokapäiväisen kantamisen (EDC) välineen avulla vo
|
||||
- Tumma teema ja saavutettavuusvaihtoehdot näkövammaisille käyttäjille.
|
||||
- Libre-ohjelmistoyhteisön kaikille tekemä.
|
||||
- Lokalisoidut käsintehdyt käännökset yli 20 kielelle.
|
||||
- Gratis, yhteisön panoksilla tuettu.
|
||||
- Ilmainen, yhteisön panoksilla tuettu.
|
||||
- Käytä, tutki, muuta ja jaa sitä haluamallasi tavalla; <i>kaikkien</i> kanssa.
|
||||
- Ei vain vapaat ohjelmistot / avoin lähdekoodi. <i>Copylefted</i> libre-ohjelmisto (GPLv3+) kortinhallinta.
|
||||
|
||||
|
||||
2
fastlane/metadata/android/fr-FR/changelogs/102.txt
Normal file
2
fastlane/metadata/android/fr-FR/changelogs/102.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Plusieurs corrections mineures
|
||||
- Correction des plantages en langue norvégienne
|
||||
2
fastlane/metadata/android/fr-FR/changelogs/104.txt
Normal file
2
fastlane/metadata/android/fr-FR/changelogs/104.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Sauvegarde de l'état d'expansion du détail de carte
|
||||
- Corrections mineures de l'interface utilisateur
|
||||
2
fastlane/metadata/android/fr-FR/changelogs/105.txt
Normal file
2
fastlane/metadata/android/fr-FR/changelogs/105.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Correction du bloc gris apparaissant sur une valeur invalide pour un code-barres
|
||||
- Corrections pour l'importation de Stocard
|
||||
14
fastlane/metadata/android/fr-FR/changelogs/3.txt
Normal file
14
fastlane/metadata/android/fr-FR/changelogs/3.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
- Est désormais officiellement compatible avec les codes-barres à une et deux dimensions suivants :
|
||||
- AZTEC
|
||||
- CODABAR
|
||||
- CODE_39
|
||||
- CODE_128
|
||||
- DATA_MATRIX
|
||||
- EAN_8
|
||||
- EAN_13
|
||||
- ITF
|
||||
- PDF_417
|
||||
- QR_CODE
|
||||
- UPC_A
|
||||
|
||||
- Les codes-barres sont maintenant affichés plus grand, afin d'en faciliter la lecture
|
||||
2
fastlane/metadata/android/it-IT/changelogs/102.txt
Normal file
2
fastlane/metadata/android/it-IT/changelogs/102.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Vari errori minori sistemati
|
||||
- Sistemata la chiusura inaspettata dell'app quando si usa la lingua norvegese
|
||||
2
fastlane/metadata/android/it-IT/changelogs/103.txt
Normal file
2
fastlane/metadata/android/it-IT/changelogs/103.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Sistemata la selezione manuale della lingua che non veniva applicata dappertutto
|
||||
- Sistemata la chiusura inaspettata dell'app quando si facevano delle modifiche con una lingua priva di differenze regionali
|
||||
1
fastlane/metadata/android/sk/short_description.txt
Normal file
1
fastlane/metadata/android/sk/short_description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Pre vaše čiarové kódy, členstvá, vernostné programy, kupóny a vstupenky.
|
||||
1
fastlane/metadata/android/sk/title.txt
Normal file
1
fastlane/metadata/android/sk/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
Catima - Vernostné karty
|
||||
@@ -1 +1 @@
|
||||
Catima
|
||||
Catima — Kundklubbsplånboken
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
- Kart ayrıntısı genişletme durumunu kaydet
|
||||
- Küçük kullanıcı arayüzü düzeltmeleri
|
||||
|
||||
2
fastlane/metadata/android/tr-TR/changelogs/105.txt
Normal file
2
fastlane/metadata/android/tr-TR/changelogs/105.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
- Barkod için geçersiz değerde görünen gri blok düzeltildi
|
||||
- Stocard içe aktarma düzeltmeleri
|
||||
1
fastlane/metadata/android/tr-TR/changelogs/106.txt
Normal file
1
fastlane/metadata/android/tr-TR/changelogs/106.txt
Normal file
@@ -0,0 +1 @@
|
||||
- Bazı karakter dizilerinin tek karakter olarak gösterilmesi düzeltildi
|
||||
Reference in New Issue
Block a user