use of com.android.inputmethod.keyboard.MoreKeysPanel in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class SuggestionStripView method showMoreSuggestions.
boolean showMoreSuggestions() {
final Keyboard parentKeyboard = mMainKeyboardView.getKeyboard();
if (parentKeyboard == null) {
return false;
}
final SuggestionStripLayoutHelper layoutHelper = mLayoutHelper;
if (mSuggestedWords.size() <= mStartIndexOfMoreSuggestions) {
return false;
}
final int stripWidth = getWidth();
final View container = mMoreSuggestionsContainer;
final int maxWidth = stripWidth - container.getPaddingLeft() - container.getPaddingRight();
final MoreSuggestions.Builder builder = mMoreSuggestionsBuilder;
builder.layout(mSuggestedWords, mStartIndexOfMoreSuggestions, maxWidth, (int) (maxWidth * layoutHelper.mMinMoreSuggestionsWidth), layoutHelper.getMaxMoreSuggestionsRow(), parentKeyboard);
mMoreSuggestionsView.setKeyboard(builder.build());
container.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
final MoreKeysPanel moreKeysPanel = mMoreSuggestionsView;
final int pointX = stripWidth / 2;
final int pointY = -layoutHelper.mMoreSuggestionsBottomGap;
moreKeysPanel.showMoreKeysPanel(this, mMoreSuggestionsController, pointX, pointY, mMoreSuggestionsListener);
mOriginX = mLastX;
mOriginY = mLastY;
for (int i = 0; i < mStartIndexOfMoreSuggestions; i++) {
mWordViews.get(i).setPressed(false);
}
return true;
}
Aggregations