From 37c49f63dfe5cd2385d808cd113a3b46603fc5d4 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Mon, 16 Jun 2014 18:30:59 +0900 Subject: [PATCH] Update suggestion strip when the contextual dict is updated. Bug: 14161647 Change-Id: Ic7d53464bd051bffc8c7f8d097325321fe0aaee7 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 +++++++- .../personalization/ContextualDictionaryUpdater.java | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e5e070058..5c55faa93 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -127,7 +127,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private final PersonalizationDictionaryUpdater mPersonalizationDictionaryUpdater = new PersonalizationDictionaryUpdater(this /* context */, mDictionaryFacilitator); private final ContextualDictionaryUpdater mContextualDictionaryUpdater = - new ContextualDictionaryUpdater(this /* context */, mDictionaryFacilitator); + new ContextualDictionaryUpdater(this /* context */, mDictionaryFacilitator, + new Runnable() { + @Override + public void run() { + mHandler.postUpdateSuggestionStrip(); + } + }); private final InputLogic mInputLogic = new InputLogic(this /* LatinIME */, this /* SuggestionStripViewAccessor */, mDictionaryFacilitator); // We expect to have only one decoder in almost all cases, hence the default capacity of 1. diff --git a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java b/java/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java index 2cccf1615..7dc120e06 100644 --- a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java +++ b/java/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java @@ -22,7 +22,8 @@ import com.android.inputmethod.latin.DictionaryFacilitator; public class ContextualDictionaryUpdater { public ContextualDictionaryUpdater(final Context context, - final DictionaryFacilitator dictionaryFacilitator) { + final DictionaryFacilitator dictionaryFacilitator, + final Runnable onUpdateRunnable) { } public void onLoadSettings(final boolean usePersonalizedDicts) {