From 9b4e8db959439ca57ec8b70980b4b17180325df4 Mon Sep 17 00:00:00 2001 From: Alexander Wilde Date: Sat, 24 Feb 2018 09:36:50 +0000 Subject: [PATCH] Fix pressing complete scenario when focus hasn't changed from xp/gold. Fix yes/no/cancel button for save changes warning --- .../north101/android/ghplayertracker/CharacterFragment.java | 6 +++--- .../android/ghplayertracker/CharacterTrackerFragment.java | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/north101/android/ghplayertracker/CharacterFragment.java b/app/src/main/java/net/north101/android/ghplayertracker/CharacterFragment.java index 1ddfe42..e83e735 100644 --- a/app/src/main/java/net/north101/android/ghplayertracker/CharacterFragment.java +++ b/app/src/main/java/net/north101/android/ghplayertracker/CharacterFragment.java @@ -143,7 +143,7 @@ public boolean onBackPressed() { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Would you like to save your changes?") - .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { saveCharacter(new Runnable() { @Override @@ -153,12 +153,12 @@ public void run() { }); } }) - .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { + .setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { getFragmentManager().popBackStack(); } }) - .setNeutralButton(android.R.string.cancel, new DialogInterface.OnClickListener() { + .setNeutralButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } diff --git a/app/src/main/java/net/north101/android/ghplayertracker/CharacterTrackerFragment.java b/app/src/main/java/net/north101/android/ghplayertracker/CharacterTrackerFragment.java index 29c1f6f..a670e54 100644 --- a/app/src/main/java/net/north101/android/ghplayertracker/CharacterTrackerFragment.java +++ b/app/src/main/java/net/north101/android/ghplayertracker/CharacterTrackerFragment.java @@ -249,6 +249,9 @@ public void onPause() { @OptionsItem(R.id.complete) void onCompleteClick() { + parseXPText(); + parseGoldText(); + Intent intent = new Intent(); intent.putExtra("xp", characterTracker.getXp()); intent.putExtra("gold", characterTracker.getGold());