Hard coded string in GitAsyncTask replaced with resources

This commit is contained in:
Adam Smith 2014-10-31 14:13:17 +00:00
parent ef51bb9231
commit 7219fedf45
2 changed files with 9 additions and 4 deletions

View file

@ -30,7 +30,7 @@ public class GitAsyncTask extends AsyncTask<GitCommand, Integer, String> {
} }
protected void onPreExecute() { protected void onPreExecute() {
this.dialog.setMessage("Running command..."); this.dialog.setMessage(activity.getResources().getString(R.string.running_dialog_text));
this.dialog.setCancelable(false); this.dialog.setCancelable(false);
this.dialog.show(); this.dialog.show();
} }
@ -54,9 +54,9 @@ public class GitAsyncTask extends AsyncTask<GitCommand, Integer, String> {
if (!result.isEmpty()) { if (!result.isEmpty()) {
new AlertDialog.Builder(activity). new AlertDialog.Builder(activity).
setTitle("Internal exception occurred"). setTitle(activity.getResources().getString(R.string.jgit_error_dialog_title)).
setMessage("Message from jgit:\n" + result). setMessage(activity.getResources().getString(R.string.jgit_error_dialog_text) + result).
setPositiveButton("OK", new DialogInterface.OnClickListener() { setPositiveButton(activity.getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
if (operation.equals(CloneCommand.class)) { if (operation.equals(CloneCommand.class)) {

View file

@ -38,6 +38,11 @@
<string name="file_toast_text">Please provide a file name</string> <string name="file_toast_text">Please provide a file name</string>
<string name="empty_toast_text">You cannot use an empty password or empty extra content</string> <string name="empty_toast_text">You cannot use an empty password or empty extra content</string>
<!-- Git Async Task -->
<string name="running_dialog_text">Running command...</string>
<string name="jgit_error_dialog_title">Internal exception occurred</string>
<string name="jgit_error_dialog_text">Message from jgit: /n</string>
<!-- Clone fragment --> <!-- Clone fragment -->
<string name="clone_fragment_text">Welcome to Password Store\n\n In this screen you can either create a new repository or clone your git repository onto your device.</string> <string name="clone_fragment_text">Welcome to Password Store\n\n In this screen you can either create a new repository or clone your git repository onto your device.</string>
<string name="clone">Clone existing</string> <string name="clone">Clone existing</string>