diff options
author | 2012-10-01 14:26:38 +0900 | |
---|---|---|
committer | 2012-10-01 14:55:18 +0900 | |
commit | 7339a62a1368b632c0cedaf1d876a0e8590a47ed (patch) | |
tree | 85fdc03267ce4fb3c1b921b1a49012df100afb04 /java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java | |
parent | c3a7d483caa6d547618fc579e1439c0b274198a2 (diff) | |
download | latinime-7339a62a1368b632c0cedaf1d876a0e8590a47ed.tar.gz latinime-7339a62a1368b632c0cedaf1d876a0e8590a47ed.tar.xz latinime-7339a62a1368b632c0cedaf1d876a0e8590a47ed.zip |
Fix NPE observed only by monkey test
Bug: 7258660
Change-Id: I286c704b32efeada8505d953438f2595166f7e8f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java index e9bf0fac4..4ad82abdd 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java +++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java @@ -22,7 +22,6 @@ import android.graphics.drawable.Drawable; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; -import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.internal.KeyboardBuilder; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardParams; @@ -175,11 +174,11 @@ public final class MoreSuggestions extends Keyboard { } public Builder layout(final SuggestedWords suggestions, final int fromPos, - final int maxWidth, final int minWidth, final int maxRow) { - final Keyboard keyboard = KeyboardSwitcher.getInstance().getKeyboard(); + final int maxWidth, final int minWidth, final int maxRow, + final Keyboard parentKeyboard) { final int xmlId = R.xml.kbd_suggestions_pane_template; - load(xmlId, keyboard.mId); - mParams.mVerticalGap = mParams.mTopPadding = keyboard.mVerticalGap / 2; + load(xmlId, parentKeyboard.mId); + mParams.mVerticalGap = mParams.mTopPadding = parentKeyboard.mVerticalGap / 2; final int count = mParams.layout(suggestions, fromPos, maxWidth, minWidth, maxRow, mPaneView); |