Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e1dbf905a | ||
|
|
63de6f50ed | ||
|
|
6b24f56c79 | ||
|
|
e601d1a659 | ||
|
|
1641631bdc | ||
|
|
91c2efbdfc | ||
|
|
462f77e26f | ||
|
|
0aa1f8b7dd | ||
|
|
0f9509c0e5 | ||
|
|
95d497c7bd | ||
|
|
d760fbd3cb | ||
|
|
ad82492f63 | ||
|
|
e84a23c58e | ||
|
|
67cbb34425 | ||
|
|
0c4fed5c50 | ||
|
|
e1a72a948d | ||
|
|
50d9205aef | ||
|
|
9093c88e23 | ||
|
|
3c793fe54f | ||
|
|
a8960eb506 | ||
|
|
7913e95abf | ||
|
|
fac7b76798 | ||
|
|
aa9c4b81b4 | ||
|
|
5b3fc845f9 | ||
|
|
c8c7498dc9 | ||
|
|
712763969c | ||
|
|
d3f1e0d80b | ||
|
|
e8ab92d8c1 | ||
|
|
e0e4ba0012 | ||
|
|
cb4cede2da | ||
|
|
7bfdb3a8c3 | ||
|
|
c4210da1a5 | ||
|
|
e082f45333 | ||
|
|
d10c8668b6 | ||
|
|
a766a25f6a | ||
|
|
daa2f4137c |
14
CHANGELOG.md
@@ -1,4 +1,16 @@
|
||||
## Unreleased
|
||||
## v1.1.0 (2020-11-11)
|
||||
|
||||
Changes:
|
||||
- Improved edit UI
|
||||
- Removed header text colour option (now automatically generated based on brightness)
|
||||
- Updated translations
|
||||
|
||||
## v1.0.1 (2020-11-07)
|
||||
|
||||
Changes:
|
||||
- Fix crash in search with no groups
|
||||
|
||||
## v1.0 (2020-11-06)
|
||||
|
||||
Changes:
|
||||
- Added rounded edges to card icons on main overview
|
||||
|
||||
@@ -13,8 +13,8 @@ android {
|
||||
applicationId "me.hackerchick.catima"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionCode 41
|
||||
versionName "1.0"
|
||||
versionCode 43
|
||||
versionName "1.1.0"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
||||
BIN
app/release/app-release.apk
Normal file
1
app/release/output.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":41,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
|
||||
@@ -51,7 +51,6 @@ public class CsvDatabaseExporter implements DatabaseExporter
|
||||
DBHelper.LoyaltyCardDbIds.NOTE,
|
||||
DBHelper.LoyaltyCardDbIds.CARD_ID,
|
||||
DBHelper.LoyaltyCardDbIds.HEADER_COLOR,
|
||||
DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR,
|
||||
DBHelper.LoyaltyCardDbIds.BARCODE_TYPE,
|
||||
DBHelper.LoyaltyCardDbIds.STAR_STATUS);
|
||||
|
||||
@@ -66,7 +65,6 @@ public class CsvDatabaseExporter implements DatabaseExporter
|
||||
card.note,
|
||||
card.cardId,
|
||||
card.headerColor,
|
||||
card.headerTextColor,
|
||||
card.barcodeType,
|
||||
card.starStatus);
|
||||
|
||||
|
||||
@@ -274,13 +274,10 @@ public class CsvDatabaseImporter implements DatabaseImporter
|
||||
String barcodeType = extractString(DBHelper.LoyaltyCardDbIds.BARCODE_TYPE, record, "");
|
||||
|
||||
Integer headerColor = null;
|
||||
Integer headerTextColor = null;
|
||||
|
||||
if(record.isMapped(DBHelper.LoyaltyCardDbIds.HEADER_COLOR) &&
|
||||
record.isMapped(DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR))
|
||||
if(record.isMapped(DBHelper.LoyaltyCardDbIds.HEADER_COLOR))
|
||||
{
|
||||
headerColor = extractInt(DBHelper.LoyaltyCardDbIds.HEADER_COLOR, record, true);
|
||||
headerTextColor = extractInt(DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR, record, true);
|
||||
}
|
||||
|
||||
int starStatus = 0;
|
||||
@@ -291,7 +288,7 @@ public class CsvDatabaseImporter implements DatabaseImporter
|
||||
// We catch this exception so we can still import old backups
|
||||
}
|
||||
if (starStatus != 1) starStatus = 0;
|
||||
helper.insertLoyaltyCard(database, id, store, note, cardId, barcodeType, headerColor, headerTextColor, starStatus);
|
||||
helper.insertLoyaltyCard(database, id, store, note, cardId, barcodeType, headerColor, starStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.graphics.Color;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -112,7 +113,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
|
||||
public long insertLoyaltyCard(final String store, final String note, final String cardId,
|
||||
final String barcodeType, final Integer headerColor,
|
||||
final Integer headerTextColor, final int starStatus)
|
||||
final int starStatus)
|
||||
{
|
||||
SQLiteDatabase db = getWritableDatabase();
|
||||
ContentValues contentValues = new ContentValues();
|
||||
@@ -121,7 +122,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
contentValues.put(LoyaltyCardDbIds.CARD_ID, cardId);
|
||||
contentValues.put(LoyaltyCardDbIds.BARCODE_TYPE, barcodeType);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_COLOR, headerColor);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_TEXT_COLOR, headerTextColor);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_TEXT_COLOR, Color.WHITE);
|
||||
contentValues.put(LoyaltyCardDbIds.STAR_STATUS, starStatus);
|
||||
final long newId = db.insert(LoyaltyCardDbIds.TABLE, null, contentValues);
|
||||
return newId;
|
||||
@@ -130,7 +131,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
public boolean insertLoyaltyCard(final SQLiteDatabase db, final int id, final String store,
|
||||
final String note, final String cardId,
|
||||
final String barcodeType, final Integer headerColor,
|
||||
final Integer headerTextColor, final int starStatus)
|
||||
final int starStatus)
|
||||
{
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(LoyaltyCardDbIds.ID, id);
|
||||
@@ -139,7 +140,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
contentValues.put(LoyaltyCardDbIds.CARD_ID, cardId);
|
||||
contentValues.put(LoyaltyCardDbIds.BARCODE_TYPE, barcodeType);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_COLOR, headerColor);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_TEXT_COLOR, headerTextColor);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_TEXT_COLOR, Color.WHITE);
|
||||
contentValues.put(LoyaltyCardDbIds.STAR_STATUS,starStatus);
|
||||
final long newId = db.insert(LoyaltyCardDbIds.TABLE, null, contentValues);
|
||||
return (newId != -1);
|
||||
@@ -147,7 +148,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
|
||||
public boolean updateLoyaltyCard(final int id, final String store, final String note,
|
||||
final String cardId, final String barcodeType,
|
||||
final Integer headerColor, final Integer headerTextColor)
|
||||
final Integer headerColor)
|
||||
{
|
||||
SQLiteDatabase db = getWritableDatabase();
|
||||
ContentValues contentValues = new ContentValues();
|
||||
@@ -156,7 +157,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
contentValues.put(LoyaltyCardDbIds.CARD_ID, cardId);
|
||||
contentValues.put(LoyaltyCardDbIds.BARCODE_TYPE, barcodeType);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_COLOR, headerColor);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_TEXT_COLOR, headerTextColor);
|
||||
contentValues.put(LoyaltyCardDbIds.HEADER_TEXT_COLOR, Color.WHITE);
|
||||
int rowsUpdated = db.update(LoyaltyCardDbIds.TABLE, contentValues,
|
||||
LoyaltyCardDbIds.ID + "=?",
|
||||
new String[]{Integer.toString(id)});
|
||||
|
||||
@@ -12,9 +12,6 @@ public class ImportURIHelper {
|
||||
private static final String BARCODE_TYPE = DBHelper.LoyaltyCardDbIds.BARCODE_TYPE;
|
||||
|
||||
private static final String HEADER_COLOR = DBHelper.LoyaltyCardDbIds.HEADER_COLOR;
|
||||
private static final String HEADER_TEXT_COLOR = DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR;
|
||||
|
||||
|
||||
|
||||
private final Context context;
|
||||
private final String host;
|
||||
@@ -57,11 +54,6 @@ public class ImportURIHelper {
|
||||
{
|
||||
headerColor = Integer.parseInt(unparsedHeaderColor);
|
||||
}
|
||||
String unparsedHeaderTextColor = uri.getQueryParameter(HEADER_TEXT_COLOR);
|
||||
if(unparsedHeaderTextColor != null)
|
||||
{
|
||||
headerTextColor = Integer.parseInt(unparsedHeaderTextColor);
|
||||
}
|
||||
|
||||
return new LoyaltyCard(-1, store, note, cardId, barcodeType, headerColor, headerTextColor, 0);
|
||||
} catch (NullPointerException | NumberFormatException ex) {
|
||||
@@ -83,10 +75,6 @@ public class ImportURIHelper {
|
||||
{
|
||||
uriBuilder.appendQueryParameter(HEADER_COLOR, loyaltyCard.headerColor.toString());
|
||||
}
|
||||
if(loyaltyCard.headerTextColor != null)
|
||||
{
|
||||
uriBuilder.appendQueryParameter(HEADER_TEXT_COLOR, loyaltyCard.headerTextColor.toString());
|
||||
}
|
||||
//StarStatus will not be exported
|
||||
return uriBuilder.build();
|
||||
}
|
||||
|
||||
@@ -71,13 +71,6 @@ class LoyaltyCardCursorAdapter extends CursorAdapter
|
||||
if (loyaltyCard.starStatus!=0) star.setVisibility(View.VISIBLE);
|
||||
else star.setVisibility(View.GONE);
|
||||
|
||||
int tileLetterFontSize = context.getResources().getDimensionPixelSize(R.dimen.tileLetterFontSize);
|
||||
int pixelSize = context.getResources().getDimensionPixelSize(R.dimen.cardThumbnailSize);
|
||||
|
||||
Integer letterBackgroundColor = loyaltyCard.headerColor;
|
||||
Integer letterTextColor = loyaltyCard.headerTextColor;
|
||||
LetterBitmap letterBitmap = new LetterBitmap(context, loyaltyCard.store, loyaltyCard.store,
|
||||
tileLetterFontSize, pixelSize, pixelSize, letterBackgroundColor, letterTextColor);
|
||||
thumbnail.setImageBitmap(letterBitmap.getLetterTile());
|
||||
thumbnail.setImageBitmap(Utils.generateIcon(context, loyaltyCard.store, loyaltyCard.headerColor).getLetterTile());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,17 @@ import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
@@ -41,21 +47,17 @@ import java.util.List;
|
||||
public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
{
|
||||
private static final String TAG = "Catima";
|
||||
protected static final String NO_BARCODE = "_NO_BARCODE_";
|
||||
|
||||
protected static final int SELECT_BARCODE_REQUEST = 1;
|
||||
|
||||
ImageView thumbnail;
|
||||
EditText storeFieldEdit;
|
||||
EditText noteFieldEdit;
|
||||
ChipGroup groupsChips;
|
||||
ImageView headingColorSample;
|
||||
Button headingColorSelectButton;
|
||||
ImageView headingStoreTextColorSample;
|
||||
Button headingStoreTextColorSelectButton;
|
||||
View cardAndBarcodeLayout;
|
||||
TextView cardIdFieldView;
|
||||
View cardIdDivider;
|
||||
View cardIdTableRow;
|
||||
TextView barcodeTypeField;
|
||||
View barcodeTypeView;
|
||||
AutoCompleteTextView barcodeTypeField;
|
||||
ImageView barcodeImage;
|
||||
View barcodeImageLayout;
|
||||
View barcodeCaptureLayout;
|
||||
@@ -67,7 +69,6 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
boolean updateLoyaltyCard;
|
||||
Uri importLoyaltyCardUri = null;
|
||||
Integer headingColorValue = null;
|
||||
Integer headingStoreTextColorValue = null;
|
||||
|
||||
DBHelper db;
|
||||
ImportURIHelper importUriHelper;
|
||||
@@ -102,23 +103,73 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
db = new DBHelper(this);
|
||||
importUriHelper = new ImportURIHelper(this);
|
||||
|
||||
thumbnail = findViewById(R.id.thumbnail);
|
||||
storeFieldEdit = findViewById(R.id.storeNameEdit);
|
||||
noteFieldEdit = findViewById(R.id.noteEdit);
|
||||
groupsChips = findViewById(R.id.groupChips);
|
||||
headingColorSample = findViewById(R.id.headingColorSample);
|
||||
headingColorSelectButton = findViewById(R.id.headingColorSelectButton);
|
||||
headingStoreTextColorSample = findViewById(R.id.headingStoreTextColorSample);
|
||||
headingStoreTextColorSelectButton = findViewById(R.id.headingStoreTextColorSelectButton);
|
||||
cardAndBarcodeLayout = findViewById(R.id.cardAndBarcodeLayout);
|
||||
cardIdFieldView = findViewById(R.id.cardIdView);
|
||||
cardIdDivider = findViewById(R.id.cardIdDivider);
|
||||
cardIdTableRow = findViewById(R.id.cardIdTableRow);
|
||||
barcodeTypeField = findViewById(R.id.barcodeTypeView);
|
||||
barcodeTypeView = findViewById(R.id.barcodeTypeView);
|
||||
barcodeTypeField = findViewById(R.id.barcodeTypeField);
|
||||
barcodeImage = findViewById(R.id.barcode);
|
||||
barcodeImageLayout = findViewById(R.id.barcodeLayout);
|
||||
barcodeCaptureLayout = findViewById(R.id.barcodeCaptureLayout);
|
||||
|
||||
captureButton = findViewById(R.id.captureButton);
|
||||
enterButton = findViewById(R.id.enterButton);
|
||||
|
||||
storeFieldEdit.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
generateIcon(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) { }
|
||||
});
|
||||
|
||||
cardIdFieldView.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
String formatString = barcodeTypeField.getText().toString();
|
||||
|
||||
if (!formatString.isEmpty()) {
|
||||
if (formatString.equals(getString(R.string.noBarcode))) {
|
||||
hideBarcode();
|
||||
} else {
|
||||
generateBarcode(s.toString(), BarcodeFormat.valueOf(formatString));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) { }
|
||||
});
|
||||
|
||||
barcodeTypeField.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (!s.toString().isEmpty()) {
|
||||
if (s.toString().equals(getString(R.string.noBarcode))) {
|
||||
hideBarcode();
|
||||
} else {
|
||||
generateBarcode(cardIdFieldView.getText().toString(), BarcodeFormat.valueOf(s.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) { }
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,7 +222,7 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
|
||||
if(barcodeTypeField.getText().length() == 0)
|
||||
{
|
||||
barcodeTypeField.setText(loyaltyCard.barcodeType.isEmpty() ? LoyaltyCardEditActivity.NO_BARCODE : loyaltyCard.barcodeType);
|
||||
barcodeTypeField.setText(loyaltyCard.barcodeType.isEmpty() ? getString(R.string.noBarcode) : loyaltyCard.barcodeType);
|
||||
}
|
||||
|
||||
if(headingColorValue == null)
|
||||
@@ -183,15 +234,6 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
if(headingStoreTextColorValue == null)
|
||||
{
|
||||
headingStoreTextColorValue = loyaltyCard.headerTextColor;
|
||||
if(headingStoreTextColorValue == null)
|
||||
{
|
||||
headingStoreTextColorValue = Color.WHITE;
|
||||
}
|
||||
}
|
||||
|
||||
setTitle(R.string.editCardTitle);
|
||||
}
|
||||
else if(importLoyaltyCardUri != null)
|
||||
@@ -211,7 +253,6 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
cardIdFieldView.setText(importCard.cardId);
|
||||
barcodeTypeField.setText(importCard.barcodeType);
|
||||
headingColorValue = importCard.headerColor;
|
||||
headingStoreTextColorValue = importCard.headerTextColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -225,15 +266,10 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
|
||||
List<Group> loyaltyCardGroups = db.getLoyaltyCardGroups(loyaltyCardId);
|
||||
|
||||
View groupsView = findViewById(R.id.groupsView);
|
||||
View groupsTableRow = findViewById(R.id.groupsTableRow);
|
||||
|
||||
if (existingGroups.isEmpty()) {
|
||||
groupsView.setVisibility(View.GONE);
|
||||
groupsTableRow.setVisibility(View.GONE);
|
||||
groupsChips.setVisibility(View.GONE);
|
||||
} else {
|
||||
groupsView.setVisibility(View.VISIBLE);
|
||||
groupsTableRow.setVisibility(View.VISIBLE);
|
||||
groupsChips.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
for (Group group : db.getGroups()) {
|
||||
@@ -262,59 +298,22 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
colors.recycle();
|
||||
}
|
||||
|
||||
if(headingStoreTextColorValue == null) {
|
||||
headingStoreTextColorValue = Color.WHITE;
|
||||
}
|
||||
|
||||
headingColorSample.setBackgroundColor(headingColorValue);
|
||||
headingStoreTextColorSample.setBackgroundColor(headingStoreTextColorValue);
|
||||
headingColorSelectButton.setOnClickListener(new ColorSelectListener(headingColorValue, true));
|
||||
headingStoreTextColorSelectButton.setOnClickListener(new ColorSelectListener(headingStoreTextColorValue, false));
|
||||
thumbnail.setOnClickListener(new ColorSelectListener(headingColorValue));
|
||||
|
||||
if(cardIdFieldView.getText().length() > 0 && barcodeTypeField.getText().length() > 0)
|
||||
{
|
||||
if(barcodeTypeField.getText().toString().equals(NO_BARCODE))
|
||||
String formatString = barcodeTypeField.getText().toString();
|
||||
|
||||
if(formatString.isEmpty() || formatString.equals(getString(R.string.noBarcode)))
|
||||
{
|
||||
hideBarcode();
|
||||
}
|
||||
else
|
||||
{
|
||||
String formatString = barcodeTypeField.getText().toString();
|
||||
final BarcodeFormat format = BarcodeFormat.valueOf(formatString);
|
||||
final String cardIdString = cardIdFieldView.getText().toString();
|
||||
|
||||
if(barcodeImage.getHeight() == 0)
|
||||
{
|
||||
Log.d(TAG, "ImageView size is not known known at start, waiting for load");
|
||||
// The size of the ImageView is not yet available as it has not
|
||||
// yet been drawn. Wait for it to be drawn so the size is available.
|
||||
barcodeImage.getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
new ViewTreeObserver.OnGlobalLayoutListener()
|
||||
{
|
||||
@Override
|
||||
public void onGlobalLayout()
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < 16)
|
||||
{
|
||||
barcodeImage.getViewTreeObserver().removeGlobalOnLayoutListener(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
barcodeImage.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
}
|
||||
|
||||
Log.d(TAG, "ImageView size now known");
|
||||
new BarcodeImageWriterTask(barcodeImage, cardIdString, format).execute();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.d(TAG, "ImageView size known known, creating barcode");
|
||||
new BarcodeImageWriterTask(barcodeImage, cardIdString, format).execute();
|
||||
}
|
||||
|
||||
showBarcode();
|
||||
generateBarcode(cardIdString, format);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,38 +334,25 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
|
||||
captureButton.setOnClickListener(captureCallback);
|
||||
|
||||
enterButton.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent i = new Intent(getApplicationContext(), BarcodeSelectorActivity.class);
|
||||
|
||||
String cardId = cardIdFieldView.getText().toString();
|
||||
if(cardId.length() > 0)
|
||||
{
|
||||
final Bundle b = new Bundle();
|
||||
b.putString("initialCardId", cardId);
|
||||
i.putExtras(b);
|
||||
}
|
||||
|
||||
startActivityForResult(i, SELECT_BARCODE_REQUEST);
|
||||
}
|
||||
});
|
||||
enterButton.setOnClickListener(new EditCardIdAndBarcode());
|
||||
barcodeImage.setOnClickListener(new EditCardIdAndBarcode());
|
||||
|
||||
if(cardIdFieldView.getText().length() > 0)
|
||||
{
|
||||
cardIdDivider.setVisibility(View.VISIBLE);
|
||||
cardIdTableRow.setVisibility(View.VISIBLE);
|
||||
cardAndBarcodeLayout.setVisibility(View.VISIBLE);
|
||||
enterButton.setText(R.string.editCard);
|
||||
}
|
||||
else
|
||||
{
|
||||
cardIdDivider.setVisibility(View.GONE);
|
||||
cardIdTableRow.setVisibility(View.GONE);
|
||||
cardAndBarcodeLayout.setVisibility(View.GONE);
|
||||
enterButton.setText(R.string.enterCard);
|
||||
}
|
||||
|
||||
ArrayList<String> barcodeList = new ArrayList<>(BarcodeSelectorActivity.SUPPORTED_BARCODE_TYPES);
|
||||
barcodeList.add(0, getString(R.string.noBarcode));
|
||||
ArrayAdapter<String> barcodeAdapter = new ArrayAdapter<>(this, android.R.layout.select_dialog_item, barcodeList);
|
||||
barcodeTypeField.setAdapter(barcodeAdapter);
|
||||
|
||||
FloatingActionButton saveButton = findViewById(R.id.fabSave);
|
||||
saveButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -374,17 +360,36 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
doSave();
|
||||
}
|
||||
});
|
||||
|
||||
generateIcon(storeFieldEdit.getText().toString());
|
||||
}
|
||||
|
||||
class EditCardIdAndBarcode implements View.OnClickListener
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
Intent i = new Intent(getApplicationContext(), BarcodeSelectorActivity.class);
|
||||
|
||||
String cardId = cardIdFieldView.getText().toString();
|
||||
if(cardId.length() > 0)
|
||||
{
|
||||
final Bundle b = new Bundle();
|
||||
b.putString("initialCardId", cardId);
|
||||
i.putExtras(b);
|
||||
}
|
||||
|
||||
startActivityForResult(i, SELECT_BARCODE_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
class ColorSelectListener implements View.OnClickListener
|
||||
{
|
||||
final int defaultColor;
|
||||
final boolean isBackgroundColor;
|
||||
|
||||
ColorSelectListener(int defaultColor, boolean isBackgroundColor)
|
||||
ColorSelectListener(int defaultColor)
|
||||
{
|
||||
this.defaultColor = defaultColor;
|
||||
this.isBackgroundColor = isBackgroundColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -396,16 +401,9 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
@Override
|
||||
public void onColorSelected(int dialogId, int color)
|
||||
{
|
||||
if(isBackgroundColor)
|
||||
{
|
||||
headingColorSample.setBackgroundColor(color);
|
||||
headingColorValue = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
headingStoreTextColorSample.setBackgroundColor(color);
|
||||
headingStoreTextColorValue = color;
|
||||
}
|
||||
headingColorValue = color;
|
||||
|
||||
generateIcon(storeFieldEdit.getText().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -427,7 +425,7 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
|
||||
// We do not want to save the no barcode string to the database
|
||||
// it is simply an empty there for no barcode
|
||||
if(barcodeType.equals(NO_BARCODE))
|
||||
if(barcodeType.equals(getString(R.string.noBarcode)))
|
||||
{
|
||||
barcodeType = "";
|
||||
}
|
||||
@@ -453,12 +451,12 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
|
||||
if(updateLoyaltyCard)
|
||||
{ //update of "starStatus" not necessary, since it cannot be changed in this activity (only in ViewActivity)
|
||||
db.updateLoyaltyCard(loyaltyCardId, store, note, cardId, barcodeType, headingColorValue, headingStoreTextColorValue);
|
||||
db.updateLoyaltyCard(loyaltyCardId, store, note, cardId, barcodeType, headingColorValue);
|
||||
Log.i(TAG, "Updated " + loyaltyCardId + " to " + cardId);
|
||||
}
|
||||
else
|
||||
{
|
||||
loyaltyCardId = (int)db.insertLoyaltyCard(store, note, cardId, barcodeType, headingColorValue, headingStoreTextColorValue, 0);
|
||||
loyaltyCardId = (int)db.insertLoyaltyCard(store, note, cardId, barcodeType, headingColorValue, 0);
|
||||
}
|
||||
|
||||
db.setLoyaltyCardGroups(loyaltyCardId, selectedGroups);
|
||||
@@ -564,20 +562,61 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
cardIdView.setText(contents);
|
||||
|
||||
// Set special NO_BARCODE value to prevent onResume from overwriting it
|
||||
barcodeTypeField.setText(format.isEmpty() ? LoyaltyCardEditActivity.NO_BARCODE : format);
|
||||
barcodeTypeField.setText(format.isEmpty() ? getString(R.string.noBarcode) : format);
|
||||
onResume();
|
||||
}
|
||||
}
|
||||
|
||||
private void showBarcode() {
|
||||
barcodeImageLayout.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.barcodeTypeDivider).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.barcodeTypeTableRow).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void hideBarcode() {
|
||||
barcodeImageLayout.setVisibility(View.GONE);
|
||||
findViewById(R.id.barcodeTypeDivider).setVisibility(View.GONE);
|
||||
findViewById(R.id.barcodeTypeTableRow).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void generateBarcode(final String cardId, final BarcodeFormat barcodeFormat) {
|
||||
if (barcodeImage.getHeight() == 0) {
|
||||
Log.d(TAG, "ImageView size is not known known at start, waiting for load");
|
||||
// The size of the ImageView is not yet available as it has not
|
||||
// yet been drawn. Wait for it to be drawn so the size is available.
|
||||
barcodeImage.getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
if (Build.VERSION.SDK_INT < 16) {
|
||||
barcodeImage.getViewTreeObserver().removeGlobalOnLayoutListener(this);
|
||||
} else {
|
||||
barcodeImage.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
}
|
||||
|
||||
Log.d(TAG, "ImageView size now known");
|
||||
new BarcodeImageWriterTask(barcodeImage, cardId, barcodeFormat).execute();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.d(TAG, "ImageView size known known, creating barcode");
|
||||
new BarcodeImageWriterTask(barcodeImage, cardId, barcodeFormat).execute();
|
||||
}
|
||||
|
||||
showBarcode();
|
||||
}
|
||||
|
||||
private void generateIcon(String store) {
|
||||
if (headingColorValue == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
thumbnail.setBackgroundColor(headingColorValue);
|
||||
|
||||
LetterBitmap letterBitmap = Utils.generateIcon(this, store, headingColorValue);
|
||||
|
||||
if (letterBitmap != null) {
|
||||
thumbnail.setImageBitmap(letterBitmap.getLetterTile());
|
||||
} else {
|
||||
thumbnail.setImageBitmap(null);
|
||||
}
|
||||
|
||||
thumbnail.setMinimumWidth(thumbnail.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
@@ -36,7 +35,6 @@ import protect.card_locker.preferences.Settings;
|
||||
public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
{
|
||||
private static final String TAG = "Catima";
|
||||
private static final double LUMINANCE_MIDPOINT = 0.5;
|
||||
|
||||
TextView cardIdFieldView;
|
||||
TextView noteView;
|
||||
@@ -199,17 +197,6 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
storeName.setText(loyaltyCard.store);
|
||||
storeName.setTextSize(settings.getCardTitleFontSize());
|
||||
|
||||
int textColor;
|
||||
if(loyaltyCard.headerTextColor != null)
|
||||
{
|
||||
textColor = loyaltyCard.headerTextColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
textColor = Color.WHITE;
|
||||
}
|
||||
storeName.setTextColor(textColor);
|
||||
|
||||
int backgroundHeaderColor;
|
||||
if(loyaltyCard.headerColor != null)
|
||||
{
|
||||
@@ -222,8 +209,19 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
|
||||
collapsingToolbarLayout.setBackgroundColor(backgroundHeaderColor);
|
||||
|
||||
int textColor;
|
||||
if(Utils.needsDarkForeground(backgroundHeaderColor))
|
||||
{
|
||||
textColor = Color.BLACK;
|
||||
}
|
||||
else
|
||||
{
|
||||
textColor = Color.WHITE;
|
||||
}
|
||||
storeName.setTextColor(textColor);
|
||||
|
||||
// If the background is very bright, we should use dark icons
|
||||
backgroundNeedsDarkIcons = (ColorUtils.calculateLuminance(backgroundHeaderColor) > LUMINANCE_MIDPOINT);
|
||||
backgroundNeedsDarkIcons = Utils.needsDarkForeground(backgroundHeaderColor);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if(actionBar != null)
|
||||
{
|
||||
|
||||
@@ -340,7 +340,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
TabLayout groupsTabLayout = findViewById(R.id.groups);
|
||||
|
||||
updateLoyaltyCardList(newText, groupsTabLayout.getTabAt(groupsTabLayout.getSelectedTabPosition()).getTag());
|
||||
updateLoyaltyCardList(newText, groupsTabLayout.getTabCount() > 0 ? groupsTabLayout.getTabAt(groupsTabLayout.getSelectedTabPosition()).getTag() : null);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -486,5 +486,4 @@ public class MainActivity extends AppCompatActivity
|
||||
int currentNightMode = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
return (currentNightMode == Configuration.UI_MODE_NIGHT_YES);
|
||||
}
|
||||
|
||||
}
|
||||
26
app/src/main/java/protect/card_locker/Utils.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
public class Utils {
|
||||
static final double LUMINANCE_MIDPOINT = 0.5;
|
||||
|
||||
static public LetterBitmap generateIcon(Context context, String store, Integer backgroundColor) {
|
||||
if (store.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int tileLetterFontSize = context.getResources().getDimensionPixelSize(R.dimen.tileLetterFontSize);
|
||||
int pixelSize = context.getResources().getDimensionPixelSize(R.dimen.cardThumbnailSize);
|
||||
|
||||
return new LetterBitmap(context, store, store,
|
||||
tileLetterFontSize, pixelSize, pixelSize, backgroundColor, needsDarkForeground(backgroundColor) ? Color.BLACK : Color.WHITE);
|
||||
}
|
||||
|
||||
static public boolean needsDarkForeground(Integer backgroundColor) {
|
||||
return ColorUtils.calculateLuminance(backgroundColor) > LUMINANCE_MIDPOINT;
|
||||
}
|
||||
}
|
||||
@@ -32,478 +32,191 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/inputContrastBackground"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
<LinearLayout
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TableLayout android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:shrinkColumns="1"
|
||||
android:background="@color/inputContrastBackground">
|
||||
|
||||
<!-- Store Name -->
|
||||
<View
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
<TableRow
|
||||
android:background="@color/inputBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
<!-- Store -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/inputPadding"
|
||||
android:paddingTop="@dimen/inputPadding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:paddingHorizontal="@dimen/inputPadding"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/storeNameField"
|
||||
android:text="@string/storeName"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"/>
|
||||
<ImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="@dimen/cardThumbnailSize"
|
||||
android:layout_height="@dimen/cardThumbnailSize"
|
||||
android:contentDescription="@string/thumbnailDescription"
|
||||
android:src="@mipmap/ic_launcher"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/storeNameEdit"
|
||||
android:inputType="textCapWords"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:layout_toEndOf="@id/storeNameField"
|
||||
android:layout_toRightOf="@id/storeNameField"
|
||||
/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Note -->
|
||||
<View
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
<TableRow
|
||||
android:background="@color/inputBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noteField"
|
||||
android:text="@string/note"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/noteEdit"
|
||||
android:inputType="textMultiLine"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:layout_toEndOf="@id/noteField"
|
||||
android:layout_toRightOf="@id/noteField"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Groups -->
|
||||
<View
|
||||
android:id="@+id/groupsView"
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder"
|
||||
android:visibility="gone"/>
|
||||
<TableRow
|
||||
android:id="@+id/groupsTableRow"
|
||||
android:background="@color/inputBackground"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/storeNameField"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
android:hint="@string/storeName">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_weight="1"
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/storeNameEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/groupsField"
|
||||
android:text="@string/groups"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/groupChips"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:layout_toEndOf="@id/groupsField"
|
||||
android:layout_toRightOf="@id/groupsField"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
<!-- Note -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/inputPadding"
|
||||
android:paddingTop="@dimen/inputPadding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
|
||||
<!-- Store Header Background Color -->
|
||||
<View
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/noteField"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
<TableRow
|
||||
android:background="@color/inputBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/note">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_weight="1"
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/noteEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/headingField"
|
||||
android:text="@string/storeTextBackgroundColorTitle"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/headingColorSampleBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/colorSamplePadding"
|
||||
app:layout_constraintStart_toEndOf="@id/headingField"
|
||||
app:layout_constraintEnd_toStartOf="@+id/headingColorSelectButton"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@android:color/black">
|
||||
<ImageView
|
||||
android:id="@+id/headingColorSample"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="1dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@android:color/white"
|
||||
android:contentDescription="@string/storeNameBackgroundColorDescription"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!-- Group -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/inputPadding"
|
||||
android:paddingTop="@dimen/inputPadding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/headingColorSelectButton"
|
||||
android:text="@string/change"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toEndOf="@id/headingColorSampleBorder"
|
||||
android:layout_toRightOf="@id/headingColorSampleBorder"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Store Text Color -->
|
||||
<View
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/groupChips"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
<TableRow
|
||||
android:background="@color/inputBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:textSize="@dimen/inputSize" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/storeTextField"
|
||||
android:text="@string/storeTextColorTitle"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/headingStoreTextColorSampleBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/colorSamplePadding"
|
||||
app:layout_constraintStart_toEndOf="@id/storeTextField"
|
||||
app:layout_constraintEnd_toStartOf="@+id/headingStoreTextColorSelectButton"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@android:color/black">
|
||||
<ImageView
|
||||
android:id="@+id/headingStoreTextColorSample"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="1dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@android:color/white"
|
||||
android:contentDescription="@string/storeNameColorDescription"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/headingStoreTextColorSelectButton"
|
||||
android:text="@string/change"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toEndOf="@id/headingStoreTextColorSampleBorder"
|
||||
android:layout_toRightOf="@id/headingStoreTextColorSampleBorder"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Card ID -->
|
||||
<View
|
||||
android:id="@+id/cardIdDivider"
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
<TableRow
|
||||
android:id="@+id/cardIdTableRow"
|
||||
android:background="@color/inputBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
|
||||
<RelativeLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cardIdField"
|
||||
android:text="@string/cardId"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cardIdView"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_toEndOf="@id/cardIdField"
|
||||
android:layout_toRightOf="@id/cardIdField"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Barcode Type -->
|
||||
<View
|
||||
android:id="@+id/barcodeTypeDivider"
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
<TableRow
|
||||
android:id="@+id/barcodeTypeTableRow"
|
||||
android:background="@color/inputBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:gravity="start"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
|
||||
<RelativeLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/inputPadding"
|
||||
android:paddingEnd="@dimen/inputPadding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/barcodeTypeField"
|
||||
android:text="@string/barcodeType"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/barcodeTypeView"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/inputPadding"
|
||||
android:textSize="@dimen/inputSize"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_toEndOf="@id/barcodeTypeField"
|
||||
android:layout_toRightOf="@id/barcodeTypeField"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:gravity="end"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/inputBorderThickness"
|
||||
android:background="@color/inputBorder" />
|
||||
</TableRow>
|
||||
|
||||
<View
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/inputBorder" />
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:padding="10.0dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/barcodeLayout">
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/barcode_disp_height"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="10.0dp"
|
||||
android:background="#ffffff"
|
||||
android:id="@+id/barcode"
|
||||
android:contentDescription="@string/barcodeImageDescription"
|
||||
android:layout_weight="1.0"/>
|
||||
</LinearLayout>
|
||||
<!-- Buttons -->
|
||||
<TableLayout android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:shrinkColumns="1"
|
||||
android:background="@color/inputContrastBackground">
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/inputBackground">
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/inputBackground">
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:padding="10.0dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/barcodeCaptureLayout">
|
||||
android:padding="10.0dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/barcodeCaptureLayout">
|
||||
<Button android:id="@+id/captureButton"
|
||||
android:layout_margin="@dimen/inputMargin"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/capture"
|
||||
android:layout_weight="1.0"/>
|
||||
android:layout_margin="@dimen/inputMargin"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/capture"
|
||||
android:layout_weight="1.0"/>
|
||||
<Button android:id="@+id/enterButton"
|
||||
android:layout_margin="@dimen/inputMargin"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/enterCard"
|
||||
android:layout_weight="1.0"/>
|
||||
android:layout_margin="@dimen/inputMargin"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/enterCard"
|
||||
android:layout_weight="1.0"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Card ID and Barcode type -->
|
||||
<LinearLayout
|
||||
android:id="@+id/cardAndBarcodeLayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/inputPadding"
|
||||
android:paddingTop="@dimen/inputPadding"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- Card ID -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/cardIdField"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:hint="@string/cardId">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/cardIdView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Barcode type -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/barcodeTypeView"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
android:hint="@string/barcodeType">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/barcodeTypeField"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Barcode -->
|
||||
<View
|
||||
android:layout_height="@dimen/inputBorderThickness"
|
||||
android:layout_width="match_parent" />
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:padding="10.0dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/barcodeLayout">
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/barcode_disp_height"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="10.0dp"
|
||||
android:background="#ffffff"
|
||||
android:id="@+id/barcode"
|
||||
android:contentDescription="@string/barcodeImageDescription"
|
||||
android:layout_weight="1.0"/>
|
||||
</LinearLayout>
|
||||
</TableLayout>
|
||||
</ScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<string name="action_search">Suche</string>
|
||||
<string name="action_add">Neu</string>
|
||||
<string name="noGiftCards">Sie haben noch keine Kundenkarte angelegt. Über den \"+\"-Button oben rechts können welche angelegt werden.\n\nDiese App ermöglicht es, Kundenkarten immer mit zu führen.</string>
|
||||
<string name="noMatchingGiftCards">Es passen keine Kundenkarten zum Suchfilter. Bitte probiere verschiedene Begriffe aus.</string>
|
||||
<string name="noMatchingGiftCards">Es passen keine Kundenkarten zum Filter. Bitte probiere verschiedene Begriffe aus.</string>
|
||||
<string name="storeName">Geschäft</string>
|
||||
<string name="note">Notiz</string>
|
||||
<string name="cardId">Kartennummer</string>
|
||||
@@ -49,7 +49,7 @@
|
||||
<string name="importOptionFilesystemTitle">Importiere aus Dateisystem</string>
|
||||
<string name="importOptionFilesystemExplanation">Wähle eine Datei aus dem Speicher aus.</string>
|
||||
<string name="importOptionFilesystemButton">Aus Dateisystem</string>
|
||||
<string name="importOptionApplicationTitle">Externe App verwenden</string>
|
||||
<string name="importOptionApplicationTitle">Externe Anwendung verwenden</string>
|
||||
<string name="importOptionApplicationExplanation">Wählen Sie eine Datei aus einer App wie Dropbox, Google Drive, oder Ihrem bevorzugten Dateisystem aus.</string>
|
||||
<string name="importOptionApplicationButton">Nutze eine externe App</string>
|
||||
<string name="about">Über</string>
|
||||
@@ -91,4 +91,13 @@
|
||||
<string name="share">Teilen</string>
|
||||
<string name="barcodeNoBarcode">Diese Karte hat keinen Strichcode</string>
|
||||
<string name="barcodeType">Strichcode-Typ</string>
|
||||
<string name="starImage">Favoritenstern</string>
|
||||
<string name="deleteConfirmationGroup">Bitte bestätigen Sie, dass Sie diese Gruppe löschen möchten</string>
|
||||
<string name="all">Alle</string>
|
||||
<string name="groupCardCount"><xliff:g xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">%d</xliff:g> Karten</string>
|
||||
<string name="noGroups">Sie haben im Moment keine Gruppen. Klicken Sie auf die Schaltfläche + (Plus), um loszulegen.
|
||||
\n
|
||||
\nKarten können Gruppen zugewiesen werden, um sie leichter zu finden.</string>
|
||||
<string name="groups">Gruppen</string>
|
||||
<string name="enter_group_name">Geben Sie den Gruppennamen ein</string>
|
||||
</resources>
|
||||
@@ -45,7 +45,7 @@
|
||||
<string name="importOptionFilesystemTitle">Importer depuis le système de fichiers</string>
|
||||
<string name="importOptionFilesystemExplanation">Choisissez le fichier à importer.</string>
|
||||
<string name="importOptionFilesystemButton">Système de fichiers</string>
|
||||
<string name="importOptionApplicationTitle">Application externe</string>
|
||||
<string name="importOptionApplicationTitle">Utiliser une application externe</string>
|
||||
<string name="importOptionApplicationExplanation">Utilisez une application externe comme Dropbox, Google Drive, ou votre gestionnaire de fichiers favori pour ouvrir un fichier.</string>
|
||||
<string name="importOptionApplicationButton">Application externe</string>
|
||||
<string name="about">À propos</string>
|
||||
@@ -87,8 +87,17 @@
|
||||
<string name="share">Partager</string>
|
||||
<string name="barcodeNoBarcode">Cette carte n\'a pas de code-barres</string>
|
||||
<string name="barcodeType">Type de code-barres</string>
|
||||
<string name="noMatchingGiftCards">Aucune carte ne correspond au filtre de recherche. Veuillez essayer d\'autres termes.</string>
|
||||
<string name="noMatchingGiftCards">Aucune carte ne correspond au filtre. Veuillez essayer d\'autres termes.</string>
|
||||
<string name="action_search">Rechercher</string>
|
||||
<string name="unstar">Retirer des favoris</string>
|
||||
<string name="star">Ajouter aux favoris</string>
|
||||
<string name="starImage">Étoile favorite</string>
|
||||
<string name="deleteConfirmationGroup">Confirmez que vous voulez supprimer cette carte</string>
|
||||
<string name="all">Tous</string>
|
||||
<string name="groupCardCount"><xliff:g xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">%d</xliff:g> cartes</string>
|
||||
<string name="noGroups">Vous n\'avez aucun groupe pour le moment. Cliquez sur le bouton + (plus) pour commencer.
|
||||
\n
|
||||
\nLes cartes peuvent être attribuées à des groupes pour les rendre plus faciles à trouver.</string>
|
||||
<string name="groups">Groupes</string>
|
||||
<string name="enter_group_name">Entrez le nom du groupe</string>
|
||||
</resources>
|
||||
@@ -91,4 +91,13 @@
|
||||
<string name="barcodeType">Tipo di codice a barre</string>
|
||||
<string name="unstar">Rimuovi dai preferiti</string>
|
||||
<string name="star">Aggiungi ai preferiti</string>
|
||||
<string name="starImage">Stella preferita</string>
|
||||
<string name="deleteConfirmationGroup">Conferma di voler eliminare questo gruppo</string>
|
||||
<string name="all">Tutti</string>
|
||||
<string name="groupCardCount"><xliff:g xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">%d</xliff:g> carte</string>
|
||||
<string name="noGroups">Al momento non hai gruppi. Fai clic sul pulsante + (più) per iniziare.
|
||||
\n
|
||||
\nLe carte possono essere assegnate a gruppi per renderle più facili da trovare.</string>
|
||||
<string name="groups">Gruppi</string>
|
||||
<string name="enter_group_name">Inserisci il nome del gruppo</string>
|
||||
</resources>
|
||||
@@ -48,7 +48,7 @@
|
||||
<string name="importOptionFilesystemTitle">Importer fra filsystem</string>
|
||||
<string name="importOptionFilesystemExplanation">Velg spesifikk fil fra filsystemet.</string>
|
||||
<string name="importOptionFilesystemButton">Fra filsystem</string>
|
||||
<string name="importOptionApplicationTitle">Brukt eksternt program</string>
|
||||
<string name="importOptionApplicationTitle">Bruk eksternt program</string>
|
||||
<string name="importOptionApplicationExplanation">Bruk eksternt program som Nextcloud, eller din favorittfilbehandler til å åpne ei fil.</string>
|
||||
<string name="importOptionApplicationButton">Bruk eksternt program</string>
|
||||
<string name="about">Om</string>
|
||||
@@ -58,12 +58,8 @@
|
||||
<string name="debug_version_fmt">Versjon: <xliff:g id="version">%s</xliff:g>
|
||||
</string>
|
||||
<string name="app_revision_fmt">Utgivelsesinfo: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="app_libraries">
|
||||
<xliff:g id="app_name">%s</xliff:g> brukfer følgende tredjepartsbibliotek: <xliff:g id="app_libraries_list">%s</xliff:g>
|
||||
</string>
|
||||
<string name="app_resources">
|
||||
<xliff:g id="app_name">%s</xliff:g> bruker følgende tredjepartsressurser: <xliff:g id="app_resources_list">%s</xliff:g>
|
||||
</string>
|
||||
<string name="app_libraries"><xliff:g id="app_name">%s</xliff:g> brukfer følgende tredjepartsbibliotek: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="app_resources"><xliff:g id="app_name">%s</xliff:g> bruker følgende tredjepartsressurser: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
<string name="selectBarcodeTitle">Velg strekkode</string>
|
||||
<string name="enterBarcodeInstructions">Skriv inn strekkodeverdien og velg så bildet som representerer strekkoden du ønsker å bruke.</string>
|
||||
<string name="copy_to_clipboard_toast">Kort-ID kopiert til utklippstavle</string>
|
||||
@@ -89,7 +85,7 @@
|
||||
<string name="settings_light_theme">Lys</string>
|
||||
<string name="settings_system_theme">Systemdrakt</string>
|
||||
<string name="settings_theme">Drakt</string>
|
||||
<string name="app_copyright_old">Basert på Kundekortknippe, opphavsrett 2016-2020 Branden Archer.</string>
|
||||
<string name="app_copyright_old">Basert på Kundekortknippe, opphavsrett 2016–2020 Branden Archer.</string>
|
||||
<string name="failedParsingImportUriError">Kunne ikke tolke importerings-URI</string>
|
||||
<string name="share">Del</string>
|
||||
<string name="barcodeNoBarcode">Dette kortet har ingen strekkode</string>
|
||||
@@ -98,4 +94,12 @@
|
||||
<string name="starImage">Favorittstjerne</string>
|
||||
<string name="unstar">Fjern fra favoritter</string>
|
||||
<string name="star">Legg til i favoritter</string>
|
||||
<string name="groupCardCount"><xliff:g xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">%d</xliff:g> kort</string>
|
||||
<string name="noGroups">Du har ikke noen grupper for øyeblikket. Klikk «+»-tegnet for å begynne.
|
||||
\n
|
||||
\nKort kan tildeles grupper for å gjøre dem enklere å finne.</string>
|
||||
<string name="deleteConfirmationGroup">Bekreft at du ønsker å slette denne gruppen</string>
|
||||
<string name="all">Alle</string>
|
||||
<string name="groups">Grupper</string>
|
||||
<string name="enter_group_name">Skriv inn gruppenavn</string>
|
||||
</resources>
|
||||
@@ -1,18 +1,14 @@
|
||||
<resources
|
||||
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="action_search">Zoeken</string>
|
||||
<string name="action_add">Toevoegen</string>
|
||||
|
||||
<string name="noGiftCards">Je hebt nog geen klantenkaarten toegevoegd. Druk op de knop \'+\' (plus) om te beginnen.\n\nMet Klantenkaartkluis beheer je je klantenkaarten op je smartphone of tablet zodat ze altijd binnen handbereik zijn.</string>
|
||||
<string name="noMatchingGiftCards">Er zijn geen kaarten die overeenkomen met je zoekopdracht. Probeer het opnieuw.</string>
|
||||
|
||||
<string name="noMatchingGiftCards">Geen kaarten komen overeen met het filter. Probeer alsjeblieft wat andere termen.</string>
|
||||
<string name="storeName">Winkel</string>
|
||||
<string name="note">Aantekening</string>
|
||||
<string name="cardId">Kaartnummer</string>
|
||||
<string name="barcodeType">Soort barcode</string>
|
||||
<string name="barcodeNoBarcode">Deze kaart heeft geen barcode</string>
|
||||
|
||||
<string name="cancel">Annuleren</string>
|
||||
<string name="save">Opslaan</string>
|
||||
<string name="capture">Scan een kaart</string>
|
||||
@@ -28,16 +24,14 @@
|
||||
<string name="ok">Oké</string>
|
||||
<string name="copy_to_clipboard">Kaartnummer kopiëren naar klembord</string>
|
||||
<string name="share">Delen</string>
|
||||
<string name="sendLabel">Versturen…</string>
|
||||
<string name="sendLabel">Versturen…</string>
|
||||
<string name="addedShortcut">Snelkoppeling is toegevoegd</string>
|
||||
<string name="editCardTitle">Klantenkaart bewerken</string>
|
||||
<string name="addCardTitle">Klantenkaart toevoegen</string>
|
||||
<string name="scanCardBarcode">Scan de barcode van de kaart</string>
|
||||
<string name="cardShortcut">Kaartsnelkoppeling</string>
|
||||
<string name="noCardsMessage">Je hebt nog geen kaarten toegevoegd.</string>
|
||||
|
||||
<string name="barcodeImageDescription">Afbeelding van barcode</string>
|
||||
|
||||
<string name="noStoreError">Geen winkelnaam ingevoerd</string>
|
||||
<string name="noCardIdError">Geen kaartnummer ingevoerd</string>
|
||||
<string name="noCardExistsError">De klantenkaart kan niet worden opgevraagd</string>
|
||||
@@ -52,17 +46,16 @@
|
||||
<string name="exportSuccessfulTitle">Exporteren voltooid</string>
|
||||
<string name="exportFailedTitle">Exporteren mislukt</string>
|
||||
<string name="exportFailed">Het exporteren is mislukt</string>
|
||||
<string name="importing">Bezig met importeren…...</string>
|
||||
<string name="exporting">Bezig met exporteren…...</string>
|
||||
<string name="importing">Bezig met importeren…...</string>
|
||||
<string name="exporting">Bezig met exporteren…...</string>
|
||||
<string name="noExternalStoragePermissionError">Het importeren of exporteren van kaarten is niet mogelijk zonder de machtiging \'externe opslag\'.</string>
|
||||
<string name="exportOptionExplanation">De gegevens worden weggeschreven op een locatie naar keuze.</string>
|
||||
<string name="importOptionFilesystemTitle">Importeren uit bestandssysteem</string>
|
||||
<string name="importOptionFilesystemExplanation">Kies een specifiek bestand uit het bestandssysteem.</string>
|
||||
<string name="importOptionFilesystemButton">Uit bestandssysteem</string>
|
||||
<string name="importOptionApplicationTitle">Externe app gebruiken</string>
|
||||
<string name="importOptionApplicationTitle">Externe toepassing gebruiken</string>
|
||||
<string name="importOptionApplicationExplanation">Open een bestand middels een externe app, zoals Dropbox, Google Drive of je favoriete bestandsbeheerder.</string>
|
||||
<string name="importOptionApplicationButton">Externe app gebruiken</string>
|
||||
|
||||
<string name="about">Over</string>
|
||||
<string name="app_license">Uitgebracht onder de GPLv3-licentie.</string>
|
||||
<string name="about_title_fmt">Over <xliff:g id="app_name">%s</xliff:g></string>
|
||||
@@ -70,20 +63,15 @@
|
||||
<string name="app_revision_fmt">Versie-informatie: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="app_libraries"><xliff:g id="app_name">%s</xliff:g> gebruikt de volgende bibliotheken van externe partijen: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="app_resources"><xliff:g id="app_name">%s</xliff:g> gebruikt de volgende bronnen van externe partijen: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
|
||||
<string name="selectBarcodeTitle">Barcode toevoegen</string>
|
||||
<string name="enterBarcodeInstructions">Voer de barcode in en kies daarna de afbeelding van de barcode die je wilt gebruiken., of druk op “Deze kaart heeft geen barcode” om geen barcode te gebruiken.</string>
|
||||
|
||||
<string name="enterBarcodeInstructions">Voer de barcode in en kies daarna de afbeelding van de barcode die je wilt gebruiken., of druk op “Deze kaart heeft geen barcode” om geen barcode te gebruiken.</string>
|
||||
<string name="copy_to_clipboard_toast">Kaartnummer is gekopieerd naar het klembord</string>
|
||||
|
||||
<string name="thumbnailDescription">Miniatuurvoorbeeld van kaart</string>
|
||||
|
||||
<string name="change">Aanpassen</string>
|
||||
<string name="storeTextColorTitle">Tekstkleur van winkelnaam</string>
|
||||
<string name="storeTextBackgroundColorTitle">Kopkleur</string>
|
||||
<string name="storeNameBackgroundColorDescription">Achtergrondkleur van winkeltekst</string>
|
||||
<string name="storeNameColorDescription">Kleur van winkeltekst</string>
|
||||
|
||||
<string name="settings">Instellingen</string>
|
||||
<string name="settings_category_title_ui">Uiterlijk en bediening</string>
|
||||
<string name="settings_theme">Thema</string>
|
||||
@@ -98,4 +86,18 @@
|
||||
<string name="settings_display_barcode_max_brightness">Scherm helderder maken bij tonen van barcode</string>
|
||||
<string name="settings_lock_barcode_orientation">Barcode-oriëntatie vergrendelen</string>
|
||||
<string name="intent_import_card_from_url_share_text">Ik wil een klantenkaart met je delen</string>
|
||||
</resources>
|
||||
<string name="all">Alles</string>
|
||||
<string name="importSuccessful">De import van klantenkaartgegevens was succesvol</string>
|
||||
<string name="deleteConfirmationGroup">Bevestig dat u deze groep wilt verwijderen</string>
|
||||
<string name="groupCardCount"><xliff:g xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">%d</xliff:g> kaart</string>
|
||||
<string name="noGroups">Je hebt geen groepen op dit moment. Klik op de + (plus) knop om te beginnen.
|
||||
\n
|
||||
\nKaarten kunnen worden toegewezen aan groepen om ze gemakkelijker te vinden.</string>
|
||||
<string name="exportSuccessful">De export van klantenkaartgegevens was succesvol</string>
|
||||
<string name="groups">Groep</string>
|
||||
<string name="enter_group_name">Voer groepsnaam in</string>
|
||||
<string name="starImage">Favoriete ster</string>
|
||||
<string name="app_copyright_old">Gebaseerd op Loyalty Card Keychain, copyright 2016-2020 Branden Archer.</string>
|
||||
<string name="unstar">Verwijder uit favorieten</string>
|
||||
<string name="star">Toevoegen aan favorieten</string>
|
||||
</resources>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dimen name="inputBorderThickness">2dip</dimen>
|
||||
<dimen name="inputBorderDividerThickness">4dip</dimen>
|
||||
<dimen name="inputMargin">2dip</dimen>
|
||||
<dimen name="inputPadding">20dip</dimen>
|
||||
<dimen name="inputPadding">10dip</dimen>
|
||||
<dimen name="colorSamplePadding">10dip</dimen>
|
||||
<dimen name="inputSize">18sp</dimen>
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
<string name="action_search">Search</string>
|
||||
<string name="action_add">Add</string>
|
||||
|
||||
<string name="noGiftCards">You don\'t have any cards at the moment. Click the "+" (plus) button to get started.\n\nCatima lets you carry your cards on your phone, so they are always within reach.</string>
|
||||
<string name="noMatchingGiftCards">No cards match the filter. Please try some different terms.</string>
|
||||
<string name="noGiftCards">Click the "+" (plus) button to add a card first.\n\nCatima carries your cards on the device, so they are always within reach.</string>
|
||||
<string name="noMatchingGiftCards">Didn\'t find anything. Try changing your search.</string>
|
||||
|
||||
<string name="storeName">Store</string>
|
||||
<string name="note">Note</string>
|
||||
<string name="cardId">Card ID</string>
|
||||
<string name="barcodeType">Barcode type</string>
|
||||
<string name="barcodeNoBarcode">This card has no barcode</string>
|
||||
<string name="noBarcode">No barcode</string>
|
||||
|
||||
<string name="star">Add to favorites</string>
|
||||
<string name="unstar">Remove from favorites</string>
|
||||
@@ -28,7 +29,7 @@
|
||||
<string name="lockScreen">Block Rotation</string>
|
||||
<string name="unlockScreen">Unblock Rotation</string>
|
||||
<string name="deleteTitle">Remove Card</string>
|
||||
<string name="deleteConfirmation">Please confirm that you want to delete this card.</string>
|
||||
<string name="deleteConfirmation">Please confirm you want to delete this card.</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="copy_to_clipboard">Copy ID to clipboard</string>
|
||||
<string name="share">Share</string>
|
||||
@@ -36,44 +37,44 @@
|
||||
<string name="addedShortcut">Added shortcut</string>
|
||||
<string name="editCardTitle">Edit Card</string>
|
||||
<string name="addCardTitle">Add Card</string>
|
||||
<string name="scanCardBarcode">Scan Card\'s Barcode</string>
|
||||
<string name="scanCardBarcode">Scan Card Barcode</string>
|
||||
<string name="cardShortcut">Card Shortcut</string>
|
||||
<string name="noCardsMessage">There are no cards, add one first</string>
|
||||
<string name="noCardsMessage">Add a card first</string>
|
||||
|
||||
<string name="barcodeImageDescription">Image of card\'s barcode</string>
|
||||
<string name="barcodeImageDescription">Image of card barcode</string>
|
||||
|
||||
<string name="noStoreError">No Store entered</string>
|
||||
<string name="noCardIdError">No Card ID entered</string>
|
||||
<string name="noCardExistsError">Could not lookup loyalty card</string>
|
||||
<string name="noStoreError">No store entered</string>
|
||||
<string name="noCardIdError">No card ID entered</string>
|
||||
<string name="noCardExistsError">Could not find card</string>
|
||||
<string name="failedParsingImportUriError">Could not parse the import URI</string>
|
||||
<string name="cardIdFormat">%1$s: %2$s</string>
|
||||
<string name="importExport">Import/Export</string>
|
||||
<string name="exportName">Export</string>
|
||||
<string name="importExportHelp">Backed up data can allow you to move your cards to another device.</string>
|
||||
<string name="importSuccessfulTitle">Import successful</string>
|
||||
<string name="importExportHelp">Backing up your cards allows you to move them to another device.</string>
|
||||
<string name="importSuccessfulTitle">Imported</string>
|
||||
<string name="importFailedTitle">Import failed</string>
|
||||
<string name="importFailed">Failed to import</string>
|
||||
<string name="exportSuccessfulTitle">Export successful</string>
|
||||
<string name="importFailed">Could not import cards</string>
|
||||
<string name="exportSuccessfulTitle">Exported</string>
|
||||
<string name="exportFailedTitle">Export failed</string>
|
||||
<string name="exportFailed">Failed to export</string>
|
||||
<string name="exportFailed">Could not export cards</string>
|
||||
<string name="importing">Importing…</string>
|
||||
<string name="exporting">Exporting…</string>
|
||||
<string name="noExternalStoragePermissionError">Unable to import or export cards without the external storage permission</string>
|
||||
<string name="exportOptionExplanation">Data will be written to a location of your choice.</string>
|
||||
<string name="noExternalStoragePermissionError">Grant external storage permission to import or export cards first</string>
|
||||
<string name="exportOptionExplanation">The data will be written to a location of your choice.</string>
|
||||
<string name="importOptionFilesystemTitle">Import from filesystem</string>
|
||||
<string name="importOptionFilesystemExplanation">Choose a specific file from the filesystem.</string>
|
||||
<string name="importOptionFilesystemButton">From filesystem</string>
|
||||
<string name="importOptionApplicationTitle">Use external application</string>
|
||||
<string name="importOptionApplicationExplanation">Use an external application like Dropbox, Google Drive, or your favorite file manager to open a file.</string>
|
||||
<string name="importOptionApplicationButton">Use external application</string>
|
||||
<string name="importOptionApplicationTitle">Use external app</string>
|
||||
<string name="importOptionApplicationExplanation">Use any app or your favorite file manager to open a file.</string>
|
||||
<string name="importOptionApplicationButton">Use external app</string>
|
||||
|
||||
<string name="about">About</string>
|
||||
<string name="app_copyright_fmt" translatable="false">Copyright 2019-<xliff:g>%d</xliff:g> Sylvia van Os.</string>
|
||||
<string name="app_copyright_old">Based on Loyalty Card Keychain, copyright 2016-2020 Branden Archer.</string>
|
||||
<string name="app_license">Licensed under the GPLv3.</string>
|
||||
<string name="app_copyright_fmt" translatable="false">Copyright 2019–<xliff:g>%d</xliff:g> Sylvia van Os.</string>
|
||||
<string name="app_copyright_old">Based on Loyalty Card Keychain, copyright 2016–2020 Branden Archer.</string>
|
||||
<string name="app_license">Copylefted libre software, licensed GPLv3+.</string>
|
||||
<string name="about_title_fmt">About <xliff:g id="app_name">%s</xliff:g></string>
|
||||
<string name="debug_version_fmt">Version: <xliff:g id="version">%s</xliff:g></string>
|
||||
<string name="app_revision_fmt">Revision Information: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="app_revision_fmt">Revision Info: <xliff:g id="app_revision_url">%s</xliff:g></string>
|
||||
<string name="app_libraries"><xliff:g id="app_name">%s</xliff:g> uses the following third-party libraries: <xliff:g id="app_libraries_list">%s</xliff:g></string>
|
||||
<string name="app_resources"><xliff:g id="app_name">%s</xliff:g> uses the following third-party resources: <xliff:g id="app_resources_list">%s</xliff:g></string>
|
||||
|
||||
@@ -95,15 +96,15 @@
|
||||
<string name="settings_category_title_ui">User interface</string>
|
||||
<string name="settings_theme">Theme</string>
|
||||
<string name="settings_key_theme" translatable="false">pref_theme</string>
|
||||
<string name="settings_system_theme">System theme</string>
|
||||
<string name="settings_system_theme">System</string>
|
||||
<string name="settings_key_system_theme" translatable="false">system</string>
|
||||
<string name="settings_light_theme">Light theme</string>
|
||||
<string name="settings_light_theme">Light</string>
|
||||
<string name="settings_key_light_theme" translatable="false">light</string>
|
||||
<string name="settings_dark_theme">Dark theme</string>
|
||||
<string name="settings_dark_theme">Dark</string>
|
||||
<string name="settings_key_dark_theme" translatable="false">dark</string>
|
||||
<string name="settings_card_title_list_font_size">Card title list font size</string>
|
||||
<string name="settings_card_title_list_font_size">Font size for card titles</string>
|
||||
<string name="settings_key_card_title_list_font_size" translatable="false">pref_card_title_list_font_size_sp</string>
|
||||
<string name="settings_card_note_list_font_size">Card note list font size</string>
|
||||
<string name="settings_card_note_list_font_size">Font size for card note list </string>
|
||||
<string name="settings_key_card_note_list_font_size" translatable="false">pref_card_note_list_font_size_sp</string>
|
||||
<string name="settings_card_title_font_size">Card title font size</string>
|
||||
<string name="settings_key_card_title_font_size" translatable="false">pref_card_title_font_size_sp</string>
|
||||
@@ -121,12 +122,12 @@
|
||||
<string name="intent_import_card_from_url_path_prefix" translatable="false">/Catima/share</string>
|
||||
<string name="intent_import_card_from_url_host_old" translatable="false">brarcher.github.io</string>
|
||||
<string name="intent_import_card_from_url_path_prefix_old" translatable="false">/loyalty-card-locker/share</string>
|
||||
<string name="importSuccessful">Successfully imported loyalty card data</string>
|
||||
<string name="exportSuccessful">Successfully exported loyalty card data</string>
|
||||
<string name="importSuccessful">Card data imported</string>
|
||||
<string name="exportSuccessful">Card data exported</string>
|
||||
|
||||
<string name="enter_group_name">Enter group name</string>
|
||||
<string name="groups">Groups</string>
|
||||
<string name="noGroups">You don\'t have any groups at the moment. Click the "+" (plus) button to get started.\n\nCards can be assigned to groups to make them easier to find.</string>
|
||||
<string name="noGroups">Click the "+" (plus) button to add groups first.\n\nGroups make things easier to find.</string>
|
||||
<string name="groupCardCount"><xliff:g>%d</xliff:g> cards</string>
|
||||
<string name="all">All</string>
|
||||
<string name="deleteConfirmationGroup">Please confirm you want to delete this group</string>
|
||||
|
||||
@@ -44,7 +44,7 @@ public class DatabaseTest
|
||||
public void addRemoveOneGiftCard()
|
||||
{
|
||||
assertEquals(0, db.getLoyaltyCardCount());
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, DEFAULT_HEADER_TEXT_COLOR, 0);
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
assertEquals(1, db.getLoyaltyCardCount());
|
||||
@@ -66,12 +66,12 @@ public class DatabaseTest
|
||||
@Test
|
||||
public void updateGiftCard()
|
||||
{
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, DEFAULT_HEADER_TEXT_COLOR,0);
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
assertEquals(1, db.getLoyaltyCardCount());
|
||||
|
||||
result = db.updateLoyaltyCard(1, "store1", "note1", "cardId1", BarcodeFormat.AZTEC.toString(), DEFAULT_HEADER_COLOR, DEFAULT_HEADER_TEXT_COLOR);
|
||||
result = db.updateLoyaltyCard(1, "store1", "note1", "cardId1", BarcodeFormat.AZTEC.toString(), DEFAULT_HEADER_COLOR);
|
||||
assertTrue(result);
|
||||
assertEquals(1, db.getLoyaltyCardCount());
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DatabaseTest
|
||||
@Test
|
||||
public void updateGiftCardOnlyStar()
|
||||
{
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, DEFAULT_HEADER_TEXT_COLOR,0);
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
assertEquals(1, db.getLoyaltyCardCount());
|
||||
@@ -111,7 +111,7 @@ public class DatabaseTest
|
||||
assertEquals(0, db.getLoyaltyCardCount());
|
||||
|
||||
boolean result = db.updateLoyaltyCard(1, "store1", "note1", "cardId1",
|
||||
BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, DEFAULT_HEADER_TEXT_COLOR);
|
||||
BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR);
|
||||
assertEquals(false, result);
|
||||
assertEquals(0, db.getLoyaltyCardCount());
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class DatabaseTest
|
||||
@Test
|
||||
public void emptyGiftCardValues()
|
||||
{
|
||||
long id = db.insertLoyaltyCard("", "", "", "", null, null, 0);
|
||||
long id = db.insertLoyaltyCard("", "", "", "", null, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
assertEquals(1, db.getLoyaltyCardCount());
|
||||
@@ -142,7 +142,7 @@ public class DatabaseTest
|
||||
for(int index = CARDS_TO_ADD-1; index >= 0; index--)
|
||||
{
|
||||
long id = db.insertLoyaltyCard("store" + index, "note" + index, "cardId" + index,
|
||||
BarcodeFormat.UPC_A.toString(), index, index*2, 0);
|
||||
BarcodeFormat.UPC_A.toString(), index, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
}
|
||||
@@ -165,7 +165,6 @@ public class DatabaseTest
|
||||
assertEquals(BarcodeFormat.UPC_A.toString(), cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.BARCODE_TYPE)));
|
||||
assertEquals(0, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.STAR_STATUS)));
|
||||
assertEquals(index, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.HEADER_COLOR)));
|
||||
assertEquals(index*2, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR)));
|
||||
|
||||
cursor.moveToNext();
|
||||
}
|
||||
@@ -184,12 +183,12 @@ public class DatabaseTest
|
||||
{
|
||||
if (index == CARDS_TO_ADD-1) {
|
||||
id = db.insertLoyaltyCard("store" + index, "note" + index, "cardId" + index,
|
||||
BarcodeFormat.UPC_A.toString(), index, index*2, 1);
|
||||
BarcodeFormat.UPC_A.toString(), index, 1);
|
||||
}
|
||||
|
||||
else {
|
||||
id = db.insertLoyaltyCard("store" + index, "note" + index, "cardId" + index,
|
||||
BarcodeFormat.UPC_A.toString(), index, index*2, 0);
|
||||
BarcodeFormat.UPC_A.toString(), index, 0);
|
||||
}
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
@@ -211,7 +210,6 @@ public class DatabaseTest
|
||||
assertEquals(BarcodeFormat.UPC_A.toString(), cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.BARCODE_TYPE)));
|
||||
assertEquals(1, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.STAR_STATUS)));
|
||||
assertEquals(index, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.HEADER_COLOR)));
|
||||
assertEquals(index*2, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR)));
|
||||
|
||||
cursor.moveToNext();
|
||||
|
||||
@@ -224,7 +222,6 @@ public class DatabaseTest
|
||||
assertEquals(BarcodeFormat.UPC_A.toString(), cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.BARCODE_TYPE)));
|
||||
assertEquals(0, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.STAR_STATUS)));
|
||||
assertEquals(index, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.HEADER_COLOR)));
|
||||
assertEquals(index*2, cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.HEADER_TEXT_COLOR)));
|
||||
|
||||
cursor.moveToNext();
|
||||
}
|
||||
@@ -236,6 +233,8 @@ public class DatabaseTest
|
||||
{
|
||||
// Delete the tables as they exist now
|
||||
database.execSQL("drop table " + DBHelper.LoyaltyCardDbIds.TABLE);
|
||||
database.execSQL("drop table " + DBHelper.LoyaltyCardDbGroups.TABLE);
|
||||
database.execSQL("drop table " + DBHelper.LoyaltyCardDbIdsGroups.TABLE);
|
||||
|
||||
// Create the table as it existed in revision 1
|
||||
database.execSQL("create table " + DBHelper.LoyaltyCardDbIds.TABLE + "(" +
|
||||
@@ -371,7 +370,7 @@ public class DatabaseTest
|
||||
{
|
||||
// Create card
|
||||
assertEquals(0, db.getLoyaltyCardCount());
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, DEFAULT_HEADER_TEXT_COLOR, 0);
|
||||
long id = db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), DEFAULT_HEADER_COLOR, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
assertEquals(1, db.getLoyaltyCardCount());
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ImportExportTest
|
||||
{
|
||||
String storeName = String.format("store, \"%4d", index);
|
||||
String note = String.format("note, \"%4d", index);
|
||||
long id = db.insertLoyaltyCard(storeName, note, BARCODE_DATA, BARCODE_TYPE, index, index*2, 0);
|
||||
long id = db.insertLoyaltyCard(storeName, note, BARCODE_DATA, BARCODE_TYPE, index, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class ImportExportTest
|
||||
{
|
||||
String storeName = String.format("store, \"%4d", index);
|
||||
String note = String.format("note, \"%4d", index);
|
||||
long id = db.insertLoyaltyCard(storeName, note, BARCODE_DATA, BARCODE_TYPE, index, index*2, 1);
|
||||
long id = db.insertLoyaltyCard(storeName, note, BARCODE_DATA, BARCODE_TYPE, index, 1);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class ImportExportTest
|
||||
String storeName = String.format("store, \"%4d", index);
|
||||
String note = String.format("note, \"%4d", index);
|
||||
//if index is even
|
||||
long id = db.insertLoyaltyCard(storeName, note, BARCODE_DATA, BARCODE_TYPE, index, index*2, 0);
|
||||
long id = db.insertLoyaltyCard(storeName, note, BARCODE_DATA, BARCODE_TYPE, index, 0);
|
||||
boolean result = (id != -1);
|
||||
assertTrue(result);
|
||||
}
|
||||
@@ -138,7 +138,6 @@ public class ImportExportTest
|
||||
assertEquals(BARCODE_DATA, card.cardId);
|
||||
assertEquals(BARCODE_TYPE, card.barcodeType);
|
||||
assertEquals(Integer.valueOf(index), card.headerColor);
|
||||
assertEquals(Integer.valueOf(index*2), card.headerTextColor);
|
||||
assertEquals(0, card.starStatus);
|
||||
|
||||
index++;
|
||||
@@ -169,7 +168,6 @@ public class ImportExportTest
|
||||
assertEquals(BARCODE_DATA, card.cardId);
|
||||
assertEquals(BARCODE_TYPE, card.barcodeType);
|
||||
assertEquals(Integer.valueOf(index), card.headerColor);
|
||||
assertEquals(Integer.valueOf(index*2), card.headerTextColor);
|
||||
assertEquals(1, card.starStatus);
|
||||
|
||||
index++;
|
||||
@@ -188,7 +186,6 @@ public class ImportExportTest
|
||||
assertEquals(BARCODE_DATA, card.cardId);
|
||||
assertEquals(BARCODE_TYPE, card.barcodeType);
|
||||
assertEquals(Integer.valueOf(index), card.headerColor);
|
||||
assertEquals(Integer.valueOf(index*2), card.headerTextColor);
|
||||
assertEquals(0, card.starStatus);
|
||||
|
||||
index++;
|
||||
@@ -552,7 +549,6 @@ public class ImportExportTest
|
||||
assertEquals("type", card.barcodeType);
|
||||
assertEquals(0, card.starStatus);
|
||||
assertNull(card.headerColor);
|
||||
assertNull(card.headerTextColor);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -586,7 +582,6 @@ public class ImportExportTest
|
||||
assertEquals("type", card.barcodeType);
|
||||
assertEquals(0, card.starStatus);
|
||||
assertNull(card.headerColor);
|
||||
assertNull(card.headerTextColor);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -644,7 +639,6 @@ public class ImportExportTest
|
||||
assertEquals("", card.barcodeType);
|
||||
assertEquals(0, card.starStatus);
|
||||
assertEquals(1, (long) card.headerColor);
|
||||
assertEquals(1, (long) card.headerTextColor);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -678,7 +672,6 @@ public class ImportExportTest
|
||||
assertEquals("type", card.barcodeType);
|
||||
assertEquals(1, card.starStatus);
|
||||
assertEquals(1, (long) card.headerColor);
|
||||
assertEquals(1, (long) card.headerTextColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -714,7 +707,6 @@ public class ImportExportTest
|
||||
assertEquals("type", card.barcodeType);
|
||||
assertEquals(0, card.starStatus);
|
||||
assertEquals(1, (long) card.headerColor);
|
||||
assertEquals(1, (long) card.headerTextColor);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -768,6 +760,5 @@ public class ImportExportTest
|
||||
assertEquals("type", card.barcodeType);
|
||||
assertEquals(0, card.starStatus);
|
||||
assertEquals(1, (long) card.headerColor);
|
||||
assertEquals(1, (long) card.headerTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ImportURITest {
|
||||
public void ensureNoDataLoss() throws InvalidObjectException
|
||||
{
|
||||
// Generate card
|
||||
db.insertLoyaltyCard("store", "note", BarcodeFormat.UPC_A.toString(), LoyaltyCardDbIds.BARCODE_TYPE, Color.BLACK, Color.WHITE, 1);
|
||||
db.insertLoyaltyCard("store", "note", BarcodeFormat.UPC_A.toString(), LoyaltyCardDbIds.BARCODE_TYPE, Color.BLACK, 1);
|
||||
|
||||
// Get card
|
||||
LoyaltyCard card = db.getLoyaltyCard(1);
|
||||
@@ -50,7 +50,6 @@ public class ImportURITest {
|
||||
assertEquals(card.barcodeType, parsedCard.barcodeType);
|
||||
assertEquals(card.cardId, parsedCard.cardId);
|
||||
assertEquals(card.headerColor, parsedCard.headerColor);
|
||||
assertEquals(card.headerTextColor, parsedCard.headerTextColor);
|
||||
assertEquals(card.note, parsedCard.note);
|
||||
assertEquals(card.store, parsedCard.store);
|
||||
// No export of starStatus for single cards foreseen therefore 0 will be imported
|
||||
@@ -61,7 +60,7 @@ public class ImportURITest {
|
||||
public void ensureNoCrashOnMissingHeaderFields() throws InvalidObjectException
|
||||
{
|
||||
// Generate card
|
||||
db.insertLoyaltyCard("store", "note", BarcodeFormat.UPC_A.toString(), LoyaltyCardDbIds.BARCODE_TYPE, null, null, 0);
|
||||
db.insertLoyaltyCard("store", "note", BarcodeFormat.UPC_A.toString(), LoyaltyCardDbIds.BARCODE_TYPE, null, 0);
|
||||
|
||||
// Get card
|
||||
LoyaltyCard card = db.getLoyaltyCard(1);
|
||||
@@ -97,7 +96,7 @@ public class ImportURITest {
|
||||
{
|
||||
try {
|
||||
//"stare" instead of store
|
||||
importURIHelper.parse(Uri.parse("https://brarcher.github.io/loyalty-card-locker/share?stare=store¬e=note&cardid=12345&barcodetype=ITF&headercolor=-416706&headertextcolor=-1"));
|
||||
importURIHelper.parse(Uri.parse("https://brarcher.github.io/loyalty-card-locker/share?stare=store¬e=note&cardid=12345&barcodetype=ITF&headercolor=-416706"));
|
||||
assertTrue(false); // Shouldn't get here
|
||||
} catch(InvalidObjectException ex) {
|
||||
// Desired behaviour
|
||||
@@ -120,7 +119,6 @@ public class ImportURITest {
|
||||
assertEquals("note", parsedCard.note);
|
||||
assertEquals("store", parsedCard.store);
|
||||
assertEquals(Integer.valueOf(-416706), parsedCard.headerColor);
|
||||
assertEquals(Integer.valueOf(-1), parsedCard.headerTextColor);
|
||||
assertEquals(0, parsedCard.starStatus);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class LoyaltyCardCursorAdapterTest
|
||||
@Test
|
||||
public void TestCursorAdapterEmptyNote()
|
||||
{
|
||||
db.insertLoyaltyCard("store", "", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
LoyaltyCard card = db.getLoyaltyCard(1);
|
||||
|
||||
Cursor cursor = db.getLoyaltyCardCursor();
|
||||
@@ -98,7 +98,7 @@ public class LoyaltyCardCursorAdapterTest
|
||||
@Test
|
||||
public void TestCursorAdapterWithNote()
|
||||
{
|
||||
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
LoyaltyCard card = db.getLoyaltyCard(1);
|
||||
|
||||
Cursor cursor = db.getLoyaltyCardCursor();
|
||||
@@ -112,7 +112,7 @@ public class LoyaltyCardCursorAdapterTest
|
||||
@Test
|
||||
public void TestCursorAdapterFontSizes()
|
||||
{
|
||||
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
LoyaltyCard card = db.getLoyaltyCard(1);
|
||||
|
||||
Cursor cursor = db.getLoyaltyCardCursor();
|
||||
@@ -130,9 +130,9 @@ public class LoyaltyCardCursorAdapterTest
|
||||
@Test
|
||||
public void TestCursorAdapterStarring()
|
||||
{
|
||||
db.insertLoyaltyCard("storeA", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("storeB", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 1);
|
||||
db.insertLoyaltyCard("storeC", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 1);
|
||||
db.insertLoyaltyCard("storeA", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
db.insertLoyaltyCard("storeB", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 1);
|
||||
db.insertLoyaltyCard("storeC", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 1);
|
||||
|
||||
|
||||
Cursor cursor = db.getLoyaltyCardCursor();
|
||||
|
||||
@@ -5,7 +5,6 @@ import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.robolectric.Shadows.shadowOf;
|
||||
import static protect.card_locker.LoyaltyCardEditActivity.NO_BARCODE;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
@@ -111,7 +110,7 @@ public class LoyaltyCardViewActivityTest
|
||||
final EditText storeField = activity.findViewById(R.id.storeNameEdit);
|
||||
final EditText noteField = activity.findViewById(R.id.noteEdit);
|
||||
final TextView cardIdField = activity.findViewById(R.id.cardIdView);
|
||||
final TextView barcodeTypeField = activity.findViewById(R.id.barcodeTypeView);
|
||||
final TextView barcodeTypeField = activity.findViewById(R.id.barcodeTypeField);
|
||||
|
||||
storeField.setText(store);
|
||||
noteField.setText(note);
|
||||
@@ -130,7 +129,7 @@ public class LoyaltyCardViewActivityTest
|
||||
assertEquals(cardId, card.cardId);
|
||||
|
||||
// The special "No barcode" string shouldn't actually be written to the loyalty card
|
||||
if(barcodeType.equals(NO_BARCODE))
|
||||
if(barcodeType.equals(activity.getApplicationContext().getString(R.string.noBarcode)))
|
||||
{
|
||||
assertEquals("", card.barcodeType);
|
||||
}
|
||||
@@ -238,10 +237,9 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
checkFieldProperties(activity, R.id.storeNameEdit, editVisibility, store);
|
||||
checkFieldProperties(activity, R.id.noteEdit, editVisibility, note);
|
||||
checkFieldProperties(activity, R.id.cardAndBarcodeLayout, cardId.isEmpty() ? View.GONE : View.VISIBLE, null);
|
||||
checkFieldProperties(activity, R.id.cardIdView, View.VISIBLE, cardId);
|
||||
checkFieldProperties(activity, R.id.cardIdDivider, cardId.isEmpty() ? View.GONE : View.VISIBLE, null);
|
||||
checkFieldProperties(activity, R.id.cardIdTableRow, cardId.isEmpty() ? View.GONE : View.VISIBLE, null);
|
||||
checkFieldProperties(activity, R.id.barcodeTypeView, View.VISIBLE, barcodeType);
|
||||
checkFieldProperties(activity, R.id.barcodeTypeField, View.VISIBLE, barcodeType);
|
||||
checkFieldProperties(activity, R.id.captureButton, captureVisibility, null);
|
||||
checkFieldProperties(activity, R.id.barcode, View.VISIBLE, null);
|
||||
}
|
||||
@@ -258,7 +256,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
|
||||
checkAllFields(activity, ViewMode.ADD_CARD, "", "", "", "");
|
||||
assertEquals(View.GONE, activity.findViewById(R.id.barcodeTypeTableRow).getVisibility());
|
||||
assertEquals(View.GONE, activity.findViewById(R.id.cardAndBarcodeLayout).getVisibility());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -400,7 +398,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -416,7 +414,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -432,7 +430,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
|
||||
db.insertLoyaltyCard("store", "note", EAN_BARCODE_DATA, EAN_BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", EAN_BARCODE_DATA, EAN_BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -453,7 +451,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
|
||||
db.insertLoyaltyCard("store", "note", EAN_BARCODE_DATA, EAN_BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", EAN_BARCODE_DATA, EAN_BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -479,7 +477,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -523,7 +521,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -541,7 +539,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, null, null, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, null, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -559,7 +557,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, null, null, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, null, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -576,14 +574,14 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, "", Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, "", Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
activityController.resume();
|
||||
|
||||
// Save and check the loyalty card
|
||||
saveLoyaltyCardWithArguments(activity, "store", "note", BARCODE_DATA, NO_BARCODE, false);
|
||||
saveLoyaltyCardWithArguments(activity, "store", "note", BARCODE_DATA, activity.getApplicationContext().getString(R.string.noBarcode), false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -593,7 +591,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -606,11 +604,11 @@ public class LoyaltyCardViewActivityTest
|
||||
selectBarcodeWithResult(activity, R.id.enterButton, BARCODE_DATA, "", true);
|
||||
|
||||
// Check if the barcode type is NO_BARCODE as expected
|
||||
checkAllFields(activity, ViewMode.UPDATE_CARD, "store", "note", BARCODE_DATA, NO_BARCODE);
|
||||
assertEquals(View.GONE, activity.findViewById(R.id.barcodeTypeTableRow).getVisibility());
|
||||
checkAllFields(activity, ViewMode.UPDATE_CARD, "store", "note", BARCODE_DATA, activity.getApplicationContext().getString(R.string.noBarcode));
|
||||
assertEquals(View.GONE, activity.findViewById(R.id.barcodeLayout).getVisibility());
|
||||
|
||||
// Check if the special NO_BARCODE string doesn't get saved
|
||||
saveLoyaltyCardWithArguments(activity, "store", "note", BARCODE_DATA, NO_BARCODE, false);
|
||||
saveLoyaltyCardWithArguments(activity, "store", "note", BARCODE_DATA, activity.getApplicationContext().getString(R.string.noBarcode), false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -620,7 +618,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
final int STORE_FONT_SIZE = 50;
|
||||
final int CARD_FONT_SIZE = 40;
|
||||
@@ -662,7 +660,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
settings.edit()
|
||||
@@ -697,7 +695,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity) activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE,0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK,0);
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
activityController.resume();
|
||||
@@ -726,7 +724,7 @@ public class LoyaltyCardViewActivityTest
|
||||
|
||||
Activity activity = (Activity)activityController.get();
|
||||
DBHelper db = new DBHelper(activity);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", BARCODE_DATA, BARCODE_TYPE, Color.BLACK, 0);
|
||||
|
||||
activityController.start();
|
||||
activityController.visible();
|
||||
@@ -799,8 +797,7 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
|
||||
checkAllFields(activity, ViewMode.ADD_CARD, "Example Store", "", "123456", "AZTEC");
|
||||
assertEquals(-416706, ((ColorDrawable) activity.findViewById(R.id.headingColorSample).getBackground()).getColor());
|
||||
assertEquals(-1, ((ColorDrawable) activity.findViewById(R.id.headingStoreTextColorSample).getBackground()).getColor());
|
||||
assertEquals(-416706, ((ColorDrawable) activity.findViewById(R.id.thumbnail).getBackground()).getColor());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -820,7 +817,6 @@ public class LoyaltyCardViewActivityTest
|
||||
Activity activity = (Activity)activityController.get();
|
||||
|
||||
checkAllFields(activity, ViewMode.ADD_CARD, "Example Store", "", "123456", "AZTEC");
|
||||
assertEquals(-416706, ((ColorDrawable) activity.findViewById(R.id.headingColorSample).getBackground()).getColor());
|
||||
assertEquals(-1, ((ColorDrawable) activity.findViewById(R.id.headingStoreTextColorSample).getBackground()).getColor());
|
||||
assertEquals(-416706, ((ColorDrawable) activity.findViewById(R.id.thumbnail).getBackground()).getColor());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class MainActivityTest
|
||||
assertEquals(0, list.getCount());
|
||||
|
||||
DBHelper db = new DBHelper(mainActivity);
|
||||
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("store", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
|
||||
assertEquals(View.VISIBLE, helpText.getVisibility());
|
||||
assertEquals(View.GONE, noMatchingCardsText.getVisibility());
|
||||
@@ -132,10 +132,10 @@ public class MainActivityTest
|
||||
assertEquals(0, list.getCount());
|
||||
|
||||
DBHelper db = new DBHelper(mainActivity);
|
||||
db.insertLoyaltyCard("storeB", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("storeA", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("storeD", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 1);
|
||||
db.insertLoyaltyCard("storeC", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 1);
|
||||
db.insertLoyaltyCard("storeB", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
db.insertLoyaltyCard("storeA", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
db.insertLoyaltyCard("storeD", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 1);
|
||||
db.insertLoyaltyCard("storeC", "note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 1);
|
||||
|
||||
assertEquals(View.VISIBLE, helpText.getVisibility());
|
||||
assertEquals(View.GONE, noMatchingCardsText.getVisibility());
|
||||
@@ -229,8 +229,8 @@ public class MainActivityTest
|
||||
TabLayout groupTabs = mainActivity.findViewById(R.id.groups);
|
||||
|
||||
DBHelper db = new DBHelper(mainActivity);
|
||||
db.insertLoyaltyCard("The First Store", "Initial note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("The Second Store", "Secondary note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, Color.WHITE, 0);
|
||||
db.insertLoyaltyCard("The First Store", "Initial note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
db.insertLoyaltyCard("The Second Store", "Secondary note", "cardId", BarcodeFormat.UPC_A.toString(), Color.BLACK, 0);
|
||||
|
||||
db.insertGroup("Group one");
|
||||
List<Group> groups = new ArrayList<>();
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 48 KiB |
7
fastlane/metadata/android/nb-NO/full_description.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Lei av å leite opp stamkundekortet mens du betaler i butikken? Ser du etter en fri løsning som ikke stjeler data?
|
||||
|
||||
Catima er et program som lagrer strekkodebaserte stamkundekort på din enhet. Det er fri programvare, og gjør én ting bra, altså håndtering av kort.
|
||||
|
||||
Nye kort kan legges til raskt. Bruk enten kamera for å scanne inn strekkoden, eller skriv inn nummeret. Når strekkoden er innlastet på butikken kan den skannes med en moderne strekkodeskanner. (Noen butikker bruker eldre strekkodeskannere, som inkrementelle skannere, istedenfor bildeskannere. Disse kan ikke lese skjermen på en smartelefon. Få isteden en ansatt til å skrive inn nummeret manuelt).
|
||||
|
||||
Programmet krever veldig få tilganger, og bruker aldri Internett. Det er et valg om å sikkerhetskopiere kort lokalt. Derfra kan du sende sikkerhetskopien til en trygg plass.
|
||||
1
fastlane/metadata/android/nb-NO/short_description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Håndterer strekkortebaserte kundekort på din enhet
|
||||
1
fastlane/metadata/android/nb-NO/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
Katima - Kundekort og billett
|
||||