diff options
author | Jack Yu <jackyu@google.com> | 2017-05-22 14:05:06 -0700 |
---|---|---|
committer | Jack Yu <jackyu@google.com> | 2017-05-22 14:05:06 -0700 |
commit | bfa697d88b1e53e6bd9ebffd05f1d18f88e3d7b6 (patch) | |
tree | 83b854320a68d553139a9ffbec6332165459b05f | |
parent | b1a2ba01d8ca252726f6e8a8158172b82aacaf6a (diff) | |
download | CellBroadcastReceiver-bfa697d88b1e53e6bd9ebffd05f1d18f88e3d7b6.tar.gz |
Fixed the hard-coded dismiss button textoreo-dev
The emergency alert dialog dismiss button uses
hard-coded text "OK" rather than the from the resource
which is well translated to different languages.
Test: Manual
bug: 38504552
Change-Id: Ifb4162f103b373dbe27f3f58741552159ee8157c
-rw-r--r-- | src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java index 415d56368..3d354775d 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java @@ -356,13 +356,15 @@ public class CellBroadcastAlertDialog extends Activity { setTitle(titleId); ((TextView) findViewById(R.id.alertTitle)).setText(titleId); ((TextView) findViewById(R.id.message)).setText(message.getMessageBody()); + + String dismissButtonText = getApplicationContext().getResources() + .getString(R.string.button_dismiss); + if (mMessageList.size() > 1) { - ((TextView) findViewById(R.id.dismissButton)).setText("OK (1/" + - mMessageList.size() + ")"); - } - else if (mMessageList.size() == 1) { - ((TextView) findViewById(R.id.dismissButton)).setText("OK"); + dismissButtonText += " (1/" + mMessageList.size() + ")"; } + + ((TextView) findViewById(R.id.dismissButton)).setText(dismissButtonText); // Set alert reminder depending on user preference CellBroadcastAlertReminder.queueAlertReminder(this, true); } |