Compare commits

..

24 Commits
v0.1 ... v0.3

Author SHA1 Message Date
Branden Archer
5bc992f7f8 Merge pull request #15 from brarcher/readme
mention barcode types in README.md
2016-02-11 06:32:17 -05:00
Branden Archer
a2ab434d01 Merge branch 'master' into readme 2016-02-11 01:36:03 -05:00
Branden Archer
9593b94a2b Merge pull request #16 from brarcher/pre-v0.3
update version for next release
2016-02-11 01:35:56 -05:00
Branden Archer
075a440e4f update version for next release 2016-02-11 01:30:12 -05:00
Branden Archer
c6967f6a3f mention barcode types in README.md 2016-02-11 01:29:30 -05:00
Branden Archer
a8ca5470c7 Merge pull request #14 from brarcher/update-zxing-android-embedded
update zxing-android-embedded to latest release
2016-02-11 01:22:41 -05:00
Branden Archer
4d277eff51 update zxing-android-embedded to latest release
there was an issue with requesting camera permission
for Android 6 which was resolved in release 3.2.0.
2016-02-11 01:00:02 -05:00
Branden Archer
c51531e367 Merge pull request #13 from brarcher/all-barcodes
All barcodes
2016-02-10 21:49:21 -05:00
Branden Archer
5e57d66daa Do not bring up keyboard in view activity
Typically one will open the view activity to bring up a
barcode, and the keyboard is not expected. Disable the
keyboard until an editable field is selected.
2016-02-10 21:42:57 -05:00
Branden Archer
73aff4aeb8 Support all barcodes zxing can generate 2016-02-10 21:42:57 -05:00
Branden Archer
e6241b5a47 Update to using latest zxing library release, 3.2.1 2016-02-10 21:42:57 -05:00
Branden Archer
dd0bb18234 Merge pull request #9 from brarcher/pre-v0.2
Update version information for release
2016-02-07 22:00:49 -05:00
Branden Archer
35c778eadc Update version information for release 2016-02-07 21:56:02 -05:00
Branden Archer
63e0356ddd Merge pull request #8 from brarcher/camera-permission
Camera permission
2016-02-07 15:51:10 -05:00
Branden Archer
9820bca315 declare usage of the auto focus feature for the camera
The zxing library will attempt to use auto focus on the camera,
if available.
2016-02-07 15:38:07 -05:00
Branden Archer
2e457dc06e Add permission for using camera
The zxing library will need this permission to work
correctly.
2016-02-07 15:37:40 -05:00
Branden Archer
8bfd0f1215 Use multiple lines to declare features and permissions
This is for readability.
2016-02-07 15:37:15 -05:00
Branden Archer
cdbbf9222a Merge pull request #7 from brarcher/1d-barcodes
Support scanning all types of 1D barcodes
2016-02-03 15:16:47 -05:00
Branden Archer
96c665a539 Support scanning all types of 1D barcodes
There are loyalty cards which are not product codes but are 1D
barcodes. Enabling support for all types of 1D barcodes to
enable more types of loyalty cards.
2016-02-03 15:09:54 -05:00
Branden Archer
c0e8a33605 Merge pull request #6 from brarcher/readme
Add F-Droid icon and fix grammer in README.md
2016-02-02 22:51:48 -05:00
Branden Archer
fb96dfc8ac Add F-Droid icon and fix grammer in README.md 2016-02-02 22:27:20 -05:00
Branden Archer
41590706b5 Merge pull request #2 from Airon90/patch-1
Create strings.xml for Italian translation
2016-01-31 14:24:15 -05:00
Michael Moroni
59a7976ad5 Update strings.xml
fix
2016-01-31 14:35:16 +01:00
Michael Moroni
281fc30418 Create strings.xml
Added Italian translation
2016-01-31 14:09:37 +01:00
6 changed files with 89 additions and 11 deletions

View File

@@ -1,10 +1,25 @@
# Loyalty Card Locker
[![Build Status](https://travis-ci.org/brarcher/loyalty-card-locker.svg?branch=master)](https://travis-ci.org/brarcher/loyalty-card-locker)
Stores all of your store loyalty cards on your phone, removing the need to carry them around.
[![F-Droid](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/Get_it_on_F-Droid.svg/160px-Get_it_on_F-Droid.svg.png)](https://f-droid.org/repository/browse/?fdid=protect.card_locker "Loyalty Card Locker on F-Droid")
Stores all of your store loyalty cards on your phone, removing the need to carry them around. Currently the following barcode types are supported:
- AZTEC
- CODABAR
- CODE_39
- CODE_128
- DATA_MATRIX
- EAN_8
- EAN_13
- ITF
- PDF_417
- QR_CODE
- UPC_A
If there is any interest in improving this project, kindly submit a pull request with
proposed changed.
proposed changes.
# Thanks

View File

@@ -8,8 +8,8 @@ android {
applicationId "protect.card_locker"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "0.1"
versionCode 3
versionName "0.3"
}
buildTypes {
release {
@@ -31,8 +31,8 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.journeyapps:zxing-android-embedded:3.0.1@aar'
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.zxing:core:3.2.1'
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.0"
}

View File

@@ -2,8 +2,18 @@
<manifest package="protect.card_locker"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature android:required="true" android:name="android.hardware.camera"/>
<uses-permission android:maxSdkVersion="18" android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.CAMERA"/>
<uses-permission
android:maxSdkVersion="18"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<application
android:allowBackup="false"
@@ -25,6 +35,7 @@
android:name=".LoyaltyCardViewActivity"
android:theme="@style/AppTheme.NoActionBar"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateHidden"
android:parentActivityName="protect.card_locker.MainActivity"/>
</application>

View File

@@ -23,11 +23,32 @@ import com.google.zxing.common.BitMatrix;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
public class LoyaltyCardViewActivity extends AppCompatActivity
{
private static final String TAG = "CardLocker";
// These are all the barcode types that the zxing library
// is able to generate a barcode for, and thus should be
// the only barcodes which we should attempt to scan.
Collection<String> supportedBarcodeTypes = Collections.unmodifiableList(Arrays.asList(
BarcodeFormat.AZTEC.name(),
BarcodeFormat.CODE_39.name(),
BarcodeFormat.CODE_128.name(),
BarcodeFormat.CODABAR.name(),
BarcodeFormat.DATA_MATRIX.name(),
BarcodeFormat.EAN_8.name(),
BarcodeFormat.EAN_13.name(),
BarcodeFormat.ITF.name(),
BarcodeFormat.PDF_417.name(),
BarcodeFormat.QR_CODE.name(),
BarcodeFormat.UPC_A.name()
));
@Override
protected void onCreate(Bundle savedInstanceState)
{
@@ -126,11 +147,14 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
throw new IllegalArgumentException("Unrecognized barcode format: " + formatString);
}
int generateWidth = 100;
int generateHeight = 100;
String cardIdString = cardIdField.getText().toString();
Log.i(TAG, "Card: " + cardIdString);
result = writer.encode(cardIdString, format, 1500, 400, null);
result = writer.encode(cardIdString, format, generateWidth, generateHeight, null);
final int WHITE = 0xFFFFFFFF;
final int BLACK = 0xFF000000;
@@ -170,7 +194,7 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
public void onClick(View v)
{
IntentIntegrator integrator = new IntentIntegrator(LoyaltyCardViewActivity.this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.PRODUCT_CODE_TYPES);
integrator.setDesiredBarcodeFormats(supportedBarcodeTypes);
String prompt = getResources().getString(R.string.scanCardBarcode);
integrator.setPrompt(prompt);

View File

@@ -0,0 +1,28 @@
<resources>
<string name="app_name">Carte fedeltà</string>
<string name="action_add">Aggiungi</string>
<string name="noGiftCards">Non hai ancora alcuna tessera fedeltà al momento. Premi sul bottone "+" (più) in alto per incominciare.\n\nL\'app ti permette di portare con te le tue tessere fedeltà, così da averle sempre a disposizione.</string>
<string name="storeName">Negozio</string>
<string name="cardId">Codice</string>
<string name="barcodeType">Tipo codice a barre</string>
<string name="cancel">Annulla</string>
<string name="save">Salva</string>
<string name="capture">Salva tessera</string>
<string name="edit">Modifica</string>
<string name="delete">Elimina</string>
<string name="editCardTitle">Modifica carta</string>
<string name="addCardTitle">Aggiungi carta</string>
<string name="viewCardTitle">Mostra carta</string>
<string name="scanCardBarcode">Scansiona codice carta</string>
<string name="barcodeImageDescription">Immagine del codice a barre della carta</string>
<string name="noStoreError">Nessun negozio inserito</string>
<string name="noCardIdError">Nessun codice carta inserito</string>
<string name="cardIdFormat">%1$s: %2$s</string>
</resources>

View File

@@ -6,5 +6,5 @@
<dimen name="no_data_textSize">16sp</dimen>
<dimen name="no_data_padding">22dp</dimen>
<dimen name="barcode_disp_height">50dp</dimen>
<dimen name="barcode_disp_height">200dp</dimen>
</resources>