aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java35
1 files changed, 18 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 7b72e8044..1631a200e 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1001,7 +1001,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
applicationSuggestedWords, null /* rawSuggestions */,
false /* typedWordValid */,
false /* willAutoCorrect */,
- false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */,
false /* isPrediction */);
// When in fullscreen mode, show completions generated by the application
@@ -1177,14 +1176,22 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onClick(final DialogInterface di, final int position) {
di.dismiss();
- ImportantNoticeUtils.updateLastImportantNoticeVersion(context);
- setNeutralSuggestionStrip();
+ if (position == DialogInterface.BUTTON_POSITIVE) {
+ ImportantNoticeUtils.updateLastImportantNoticeVersion(context);
+ setNeutralSuggestionStrip();
+ return;
+ }
+ if (position == DialogInterface.BUTTON_NEGATIVE) {
+ launchSettings();
+ return;
+ }
}
};
final AlertDialog.Builder builder =
new AlertDialog.Builder(context, AlertDialog.THEME_HOLO_DARK);
builder.setMessage(R.string.important_notice_contents)
- .setPositiveButton(android.R.string.ok, listener);
+ .setPositiveButton(android.R.string.ok, listener)
+ .setNegativeButton(R.string.go_to_settings, listener);
showOptionDialog(builder.create(), true /* cancelable */);
}
@@ -1320,10 +1327,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return false;
if (mSuggestionStripView.isShowingAddToDictionaryHint())
return true;
- if (ImportantNoticeUtils.hasNewImportantNoticeAndNotInSetupWizard(this))
- return true;
if (null == currentSettings)
return false;
+ if (ImportantNoticeUtils.shouldShowImportantNotice(this, currentSettings.mInputAttributes))
+ return true;
if (!currentSettings.isSuggestionStripVisible())
return false;
if (currentSettings.isApplicationSpecifiedCompletionsOn())
@@ -1352,11 +1359,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void setSuggestedWords(final SuggestedWords suggestedWords, final boolean shouldShow) {
mInputLogic.setSuggestedWords(suggestedWords);
if (mSuggestionStripView != null) {
+ final SettingsValues currentSettings = mSettings.getCurrent();
final boolean showSuggestions;
if (SuggestedWords.EMPTY == suggestedWords
- || suggestedWords.mIsPunctuationSuggestions
- || !mSettings.getCurrent().isSuggestionsRequested()) {
- showSuggestions = !mSuggestionStripView.maybeShowImportantNoticeTitle();
+ || suggestedWords.isPunctuationSuggestions()
+ || !currentSettings.isSuggestionsRequested()) {
+ showSuggestions = !mSuggestionStripView.maybeShowImportantNoticeTitle(
+ currentSettings.mInputAttributes);
} else {
showSuggestions = true;
}
@@ -1433,7 +1442,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return new SuggestedWords(typedWordAndPreviousSuggestions, null /* rawSuggestions */,
false /* typedWordValid */,
false /* hasAutoCorrectionCandidate */,
- false /* isPunctuationSuggestions */,
true /* isObsoleteSuggestions */,
false /* isPrediction */);
}
@@ -1614,13 +1622,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
launchSubActivity(SettingsActivity.class);
}
- public void launchKeyboardedDialogActivity(final Class<? extends Activity> activityClass) {
- // Put the text in the attached EditText into a safe, saved state before switching to a
- // new activity that will also use the soft keyboard.
- mInputLogic.commitTyped(mSettings.getCurrent(), LastComposedWord.NOT_A_SEPARATOR);
- launchSubActivity(activityClass);
- }
-
private void launchSubActivity(final Class<? extends Activity> activityClass) {
Intent intent = new Intent();
intent.setClass(LatinIME.this, activityClass);