From fe0bb7b870fa4fdcef807aa04a10ecfc09fa0d9f Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Tue, 19 Jul 2016 23:47:51 -0400 Subject: [PATCH 1/2] Add a confirmation before deleting card https://github.com/brarcher/loyalty-card-locker/issues/53 --- .../card_locker/LoyaltyCardViewActivity.java | 32 ++++++++++++++++--- app/src/main/res/values-it/strings.xml | 3 ++ app/src/main/res/values-nl/strings.xml | 3 ++ app/src/main/res/values/strings.xml | 5 ++- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java index 2589678f..6877b137 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java @@ -2,11 +2,13 @@ import android.app.Activity; +import android.content.DialogInterface; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v7.app.ActionBar; +import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; @@ -291,11 +293,33 @@ public boolean onOptionsItemSelected(MenuItem item) break; case R.id.action_delete: - Log.e(TAG, "Deleting card: " + loyaltyCardId); + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.deleteTitle); + builder.setMessage(R.string.deleteConfirmation); + builder.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) + { + Log.e(TAG, "Deleting card: " + loyaltyCardId); + + DBHelper db = new DBHelper(LoyaltyCardViewActivity.this); + db.deleteLoyaltyCard(loyaltyCardId); + finish(); + dialog.dismiss(); + } + }); + builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) + { + dialog.dismiss(); + } + }); + AlertDialog dialog = builder.create(); + dialog.show(); - DBHelper db = new DBHelper(this); - db.deleteLoyaltyCard(loyaltyCardId); - finish(); return true; case R.id.action_edit: Intent intent = new Intent(getApplicationContext(), LoyaltyCardViewActivity.class); diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 581afdfa..409a1a5a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -54,4 +54,7 @@ Digita il valore del codice a barre, quindi seleziona l\'immagine che rappresenta il codice a barre che vuoi usare. Copia ID negli appunti ID della carta copiato negli appunti + Conferma + Rimuovi carta fedeltà + Conferma che vuoi eliminare questa carta. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 5722758f..afaa35e0 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -54,4 +54,7 @@ Voer de waarde van de barcode in en kies daarna de afbeelding die de barcode die je wil gebruiken representeert Kopieer het ID naar het klembord Het ID is naar het klembord gekopieerd + Bevestig + Bevestig deze kaart te verwijderen. + Verwijder kaart diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3ba3f387..903740fa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,6 +17,9 @@ Enter Card Edit Delete + Confirm + Remove Loyalty Card + Please confirm that you want to delete this card. OK Copy ID to clipboard @@ -59,4 +62,4 @@ Card ID copied to clipboard - \ No newline at end of file + From 010b88d477283ac9022eadcd60f77171ed3739ab Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Wed, 20 Jul 2016 10:53:20 -0400 Subject: [PATCH 2/2] Attempt to force travis builds on non-container infrastructure There is an issue with running the travis builds. The root cause is unknown. Attempting to use the non-container version of the infrastructure to see if the issue persists. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index faa588d5..ee15dd30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: android +sudo: true android: components: # Uncomment the lines below if you want to