diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-04-11 13:02:52 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-04-11 13:34:24 +0100 |
commit | 3f509a3293fb2ed5408c62f1a1dad22db8da6aab (patch) | |
tree | 72297cec28fba11a8f86090bfda5b3baff68e1ac /android/src/com | |
parent | af6f866b0ecd18a797b2a60920ca641892851f9f (diff) | |
download | mupdf-3f509a3293fb2ed5408c62f1a1dad22db8da6aab.tar.xz |
android: Clean up string resources.
Diffstat (limited to 'android/src/com')
4 files changed, 15 insertions, 17 deletions
diff --git a/android/src/com/artifex/mupdfdemo/ChoosePDFActivity.java b/android/src/com/artifex/mupdfdemo/ChoosePDFActivity.java index 06b2fd13..c7b8ef2e 100644 --- a/android/src/com/artifex/mupdfdemo/ChoosePDFActivity.java +++ b/android/src/com/artifex/mupdfdemo/ChoosePDFActivity.java @@ -68,7 +68,7 @@ public class ChoosePDFActivity extends ListActivity { Resources res = getResources(); String appName = res.getString(R.string.app_name); String version = res.getString(R.string.version); - String title = res.getString(R.string.picker_title); + String title = res.getString(R.string.picker_title_App_Ver_Dir); setTitle(String.format(title, appName, version, mDirectory)); mParent = mDirectory.getParentFile(); diff --git a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java index 2c10b248..5fea13e3 100644 --- a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java +++ b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java @@ -154,7 +154,7 @@ public class MuPDFActivity extends Activity mAlertDialog.setButton(AlertDialog.BUTTON2, getString(R.string.cancel), listener); pressed[1] = MuPDFAlert.ButtonPressed.Cancel; case Ok: - mAlertDialog.setButton(AlertDialog.BUTTON1, getString(R.string.ok), listener); + mAlertDialog.setButton(AlertDialog.BUTTON1, getString(R.string.okay), listener); pressed[0] = MuPDFAlert.ButtonPressed.Ok; break; case YesNoCancel: @@ -247,8 +247,8 @@ public class MuPDFActivity extends Activity if (core == null) { core = (MuPDFCore)getLastNonConfigurationInstance(); - if (savedInstanceState != null && savedInstanceState.containsKey(getString(R.string.filename))) { - mFileName = savedInstanceState.getString(getString(R.string.filename)); + if (savedInstanceState != null && savedInstanceState.containsKey("FileName")) { + mFileName = savedInstanceState.getString("FileName"); } } if (core == null) { @@ -263,7 +263,7 @@ public class MuPDFActivity extends Activity Cursor cursor = getContentResolver().query(uri, new String[]{"_data"}, null, null, null); if (cursor.moveToFirst()) { String str = cursor.getString(0); - String failString = null; + String reason = null; if (str == null) { try { InputStream is = getContentResolver().openInputStream(uri); @@ -275,19 +275,17 @@ public class MuPDFActivity extends Activity catch (java.lang.OutOfMemoryError e) { System.out.println("Out of memory during buffer reading"); - failString = e.toString(); + reason = e.toString(); } catch (Exception e) { - failString = e.toString(); + reason = e.toString(); } - if (failString != null) + if (reason != null) { buffer = null; Resources res = getResources(); AlertDialog alert = mAlertBuilder.create(); - String contentFailure = res.getString(R.string.content_failure); - String openFailed = res.getString(R.string.open_failed); - setTitle(String.format(contentFailure, openFailed, failString)); + setTitle(String.format(res.getString(R.string.cannot_open_document_Reason), reason)); alert.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.dismiss), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { @@ -319,7 +317,7 @@ public class MuPDFActivity extends Activity if (core == null) { AlertDialog alert = mAlertBuilder.create(); - alert.setTitle(R.string.open_failed); + alert.setTitle(R.string.cannot_open_document); alert.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.dismiss), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { @@ -341,7 +339,7 @@ public class MuPDFActivity extends Activity AlertDialog alert = mAlertBuilder.create(); alert.setTitle(R.string.enter_password); alert.setView(mPasswordView); - alert.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.ok), + alert.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.okay), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (core.authenticatePassword(mPasswordView.getText().toString())) { @@ -629,7 +627,7 @@ public class MuPDFActivity extends Activity super.onSaveInstanceState(outState); if (mFileName != null && mDocView != null) { - outState.putString(getString(R.string.filename), mFileName); + outState.putString("FileName", mFileName); // Store current page in the prefs against the file name, // so that we can pick it up each time the file is loaded diff --git a/android/src/com/artifex/mupdfdemo/MuPDFCore.java b/android/src/com/artifex/mupdfdemo/MuPDFCore.java index 0d50aacc..bc1fea71 100644 --- a/android/src/com/artifex/mupdfdemo/MuPDFCore.java +++ b/android/src/com/artifex/mupdfdemo/MuPDFCore.java @@ -74,7 +74,7 @@ public class MuPDFCore globals = openFile(filename); if (globals == 0) { - throw new Exception(context.getString(R.string.failed_to_open_)+filename); + throw new Exception(String.format(context.getString(R.string.cannot_open_file_Path), filename)); } file_format = fileFormatInternal(); } @@ -85,7 +85,7 @@ public class MuPDFCore globals = openBuffer(); if (globals == 0) { - throw new Exception(context.getString(R.string.failed_to_open_buffer)); + throw new Exception(context.getString(R.string.cannot_open_buffer)); } file_format = fileFormatInternal(); } diff --git a/android/src/com/artifex/mupdfdemo/SearchTask.java b/android/src/com/artifex/mupdfdemo/SearchTask.java index ae7951af..d3969f10 100644 --- a/android/src/com/artifex/mupdfdemo/SearchTask.java +++ b/android/src/com/artifex/mupdfdemo/SearchTask.java @@ -90,7 +90,7 @@ public abstract class SearchTask { if (result != null) { onTextFound(result); } else { - mAlertBuilder.setTitle(SearchTaskResult.get() == null ? R.string.text_not_found : R.string.no_further_occurences_found); + mAlertBuilder.setTitle(SearchTaskResult.get() == null ? R.string.text_not_found : R.string.no_further_occurrences_found); AlertDialog alert = mAlertBuilder.create(); alert.setButton(AlertDialog.BUTTON_POSITIVE, mContext.getString(R.string.dismiss), (DialogInterface.OnClickListener)null); |