Search in sources :

Example 1 with MoreKeysPanel

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;
}
Also used : MoreKeysPanel(com.android.inputmethod.keyboard.MoreKeysPanel) Keyboard(com.android.inputmethod.keyboard.Keyboard) View(android.view.View) TextView(android.widget.TextView) MainKeyboardView(com.android.inputmethod.keyboard.MainKeyboardView)

Aggregations

View (android.view.View)1 TextView (android.widget.TextView)1 Keyboard (com.android.inputmethod.keyboard.Keyboard)1 MainKeyboardView (com.android.inputmethod.keyboard.MainKeyboardView)1 MoreKeysPanel (com.android.inputmethod.keyboard.MoreKeysPanel)1