diff options
author | 2014-02-20 15:47:54 +0900 | |
---|---|---|
committer | 2014-02-20 16:50:34 +0900 | |
commit | 1672ccbbb6167f434842093feaadc2bcd5634eab (patch) | |
tree | dc215cea5bb77d5707f23d6744fd31f3c04579c9 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 78db739cdbc9a92ec836f4dc97c6b97de8535a33 (diff) | |
download | latinime-1672ccbbb6167f434842093feaadc2bcd5634eab.tar.gz latinime-1672ccbbb6167f434842093feaadc2bcd5634eab.tar.xz latinime-1672ccbbb6167f434842093feaadc2bcd5634eab.zip |
Change important notice version preference file
This CL also reset the notice version to 1.
This CL must be checked in together with Iea8d9ff038.
Change-Id: I838f7b5b295388d64d6aba90f50b06654eba16e5
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 5d90e10a0..94e3e7418 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1183,14 +1183,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void showImportantNoticeContents() { final Context context = this; - final OnShowListener onShowListener = new OnShowListener() { - @Override - public void onShow(final DialogInterface dialog) { - ImportantNoticeUtils.updateLastImportantNoticeVersion(context); - onShowImportantNoticeDialog( - ImportantNoticeUtils.getCurrentImportantNoticeVersion(context)); - } - }; + final AlertDialog.Builder builder = + new AlertDialog.Builder(context, AlertDialog.THEME_HOLO_DARK); + builder.setMessage(ImportantNoticeUtils.getNextImportantNoticeContents(context)); + builder.setPositiveButton(android.R.string.ok, null /* listener */); final OnClickListener onClickListener = new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int position) { @@ -1199,34 +1195,23 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } }; - final OnDismissListener onDismissListener = new OnDismissListener() { + builder.setNegativeButton(R.string.go_to_settings, onClickListener); + final AlertDialog importantNoticeDialog = builder.create(); + importantNoticeDialog.setOnShowListener(new OnShowListener() { + @Override + public void onShow(final DialogInterface dialog) { + ImportantNoticeUtils.updateLastImportantNoticeVersion(context); + } + }); + importantNoticeDialog.setOnDismissListener(new OnDismissListener() { @Override - public void onDismiss(DialogInterface dialog) { + public void onDismiss(final DialogInterface dialog) { setNeutralSuggestionStrip(); } - }; - final String importantNoticeContents = ImportantNoticeUtils.getImportantNoticeContents( - context); - final AlertDialog.Builder builder = new AlertDialog.Builder( - context, AlertDialog.THEME_HOLO_DARK); - builder.setMessage(importantNoticeContents) - .setPositiveButton(android.R.string.ok, null /* listener */) - .setNegativeButton(R.string.go_to_settings, onClickListener); - final AlertDialog importantNoticeDialog = builder.create(); - importantNoticeDialog.setOnShowListener(onShowListener); - importantNoticeDialog.setOnDismissListener(onDismissListener); + }); showOptionDialog(importantNoticeDialog); } - private void onShowImportantNoticeDialog(final int importantNoticeVersion) { - if (importantNoticeVersion == - ImportantNoticeUtils.VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS) { - mSettings.writeUsePersonalizationDictionary(true /* enabled */); - loadSettings(); - initSuggest(); - } - } - public void displaySettingsDialog() { if (isShowingOptionDialog()) { return; |