spyglass/src/main/java/com/linkedin/android/spyglass/ui/RichEditorView.java
public void displaySuggestions(boolean display) {

        // If nothing to change, return early
        if (display == isDisplayingSuggestions() || mMentionsEditText == null) {
            return;
        }

        // Change view depending on whether suggestions are being shown or not
        if (display) {
            disableSpellingSuggestions(true);
            mTextCounterView.setVisibility(View.GONE);
            mSuggestionsList.setVisibility(View.VISIBLE);
            mPrevEditTextParams = mMentionsEditText.getLayoutParams();
            mPrevEditTextBottomPadding = mMentionsEditText.getPaddingBottom();
            mMentionsEditText.setPadding(mMentionsEditText.getPaddingLeft(), mMentionsEditText.getPaddingTop(), mMentionsEditText.getPaddingRight(), mMentionsEditText.getPaddingTop());
            int height = mMentionsEditText.getPaddingTop() + mMentionsEditText.getLineHeight() + mMentionsEditText.getPaddingBottom();
            mMentionsEditText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, height));
            mMentionsEditText.setVerticalScrollBarEnabled(false);
            int cursorLine = getCurrentCursorLine();
            Layout layout = mMentionsEditText.getLayout();
            if (layout != null) {
                int lineTop = layout.getLineTop(cursorLine);
                mMentionsEditText.scrollTo(0, lineTop);
            }
            // Notify action listener that list was shown
            if (mActionListener != null) {
                mActionListener.onSuggestionsDisplayed();
            }
        } else {
            disableSpellingSuggestions(false);
            mTextCounterView.setVisibility(View.VISIBLE);
            mSuggestionsList.setVisibility(View.GONE);
            mMentionsEditText.setPadding(mMentionsEditText.getPaddingLeft(), mMentionsEditText.getPaddingTop(), mMentionsEditText.getPaddingRight(), mPrevEditTextBottomPadding);
            if (mPrevEditTextParams == null) {
                mPrevEditTextParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
            }
            mMentionsEditText.setLayoutParams(mPrevEditTextParams);
            mMentionsEditText.setVerticalScrollBarEnabled(true);
            // Notify action listener that list was hidden
            if (mActionListener != null) {
                mActionListener.onSuggestionsHidden();
            }
        }

        requestLayout();
        invalidate();
    }
public void displaySuggestions(boolean display) {

        // If nothing to change, return early
        if (display == isDisplayingSuggestions() || mMentionsEditText == null) {
            return;
        }

        // Change view depending on whether suggestions are being shown or not
        if (display) {
            disableSpellingSuggestions(true);
            mTextCounterView.setVisibility(View.GONE);
            mSuggestionsList.setVisibility(View.VISIBLE);
            mPrevEditTextParams = mMentionsEditText.getLayoutParams();
            mPrevEditTextBottomPadding = mMentionsEditText.getPaddingBottom();
            mMentionsEditText.setPadding(mMentionsEditText.getPaddingLeft(), mMentionsEditText.getPaddingTop(), mMentionsEditText.getPaddingRight(), mMentionsEditText.getPaddingTop());
            int height = mMentionsEditText.getPaddingTop() + mMentionsEditText.getLineHeight() + mMentionsEditText.getPaddingBottom();
            mMentionsEditText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, height));
            mMentionsEditText.setVerticalScrollBarEnabled(false);
            int cursorLine = getCurrentCursorLine();
            Layout layout = mMentionsEditText.getLayout();
            if (layout != null) {
                int lineTop = layout.getLineTop(cursorLine);
                mMentionsEditText.scrollTo(0, lineTop);
            }
            // Notify action listener that list was shown
            if (mActionListener != null) {
                mActionListener.onSuggestionsDisplayed();
            }
        } else {
            disableSpellingSuggestions(false);
            mTextCounterView.setVisibility(View.VISIBLE);
            mSuggestionsList.setVisibility(View.GONE);
            mMentionsEditText.setPadding(mMentionsEditText.getPaddingLeft(), mMentionsEditText.getPaddingTop(), mMentionsEditText.getPaddingRight(), mPrevEditTextBottomPadding);
            if (mPrevEditTextParams == null) {
                mPrevEditTextParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
            }
            mMentionsEditText.setLayoutParams(mPrevEditTextParams);
            mMentionsEditText.setVerticalScrollBarEnabled(true);
            // Notify action listener that list was hidden
            if (mActionListener != null) {
                mActionListener.onSuggestionsHidden();
            }
        }

        requestLayout();
        invalidate();
    }
public void displaySuggestions ( boolean display ) { // If nothing to change, return early if ( display == isDisplayingSuggestions ( ) || mMentionsEditText == null ) { return ; } // Change view depending on whether suggestions are being shown or not if ( display ) { disableSpellingSuggestions ( true ) ; mTextCounterView . setVisibility ( View . GONE ) ; mSuggestionsList . setVisibility ( View . VISIBLE ) ; mPrevEditTextParams = mMentionsEditText . getLayoutParams ( ) ; mPrevEditTextBottomPadding = mMentionsEditText . getPaddingBottom ( ) ; mMentionsEditText . setPadding ( mMentionsEditText . getPaddingLeft ( ) , mMentionsEditText . getPaddingTop ( ) , mMentionsEditText . getPaddingRight ( ) , mMentionsEditText . getPaddingTop ( ) ) ; int height = mMentionsEditText . getPaddingTop ( ) + mMentionsEditText . getLineHeight ( ) + mMentionsEditText . getPaddingBottom ( ) ; mMentionsEditText . setLayoutParams ( new LayoutParams ( LayoutParams . MATCH_PARENT , height ) ) ; mMentionsEditText . setVerticalScrollBarEnabled ( false ) ; int cursorLine = getCurrentCursorLine ( ) ; Layout layout = mMentionsEditText . getLayout ( ) ; if ( layout != null ) { int lineTop = layout . getLineTop ( cursorLine ) ; mMentionsEditText . scrollTo ( 0 , lineTop ) ; } // Notify action listener that list was shown if ( mActionListener != null ) { mActionListener . onSuggestionsDisplayed ( ) ; } } else { disableSpellingSuggestions ( false ) ; mTextCounterView . setVisibility ( View . VISIBLE ) ; mSuggestionsList . setVisibility ( View . GONE ) ; mMentionsEditText . setPadding ( mMentionsEditText . getPaddingLeft ( ) , mMentionsEditText . getPaddingTop ( ) , mMentionsEditText . getPaddingRight ( ) , mPrevEditTextBottomPadding ) ; if ( mPrevEditTextParams == null ) { mPrevEditTextParams = new LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ; } mMentionsEditText . setLayoutParams ( mPrevEditTextParams ) ; mMentionsEditText . setVerticalScrollBarEnabled ( true ) ; // Notify action listener that list was hidden if ( mActionListener != null ) { mActionListener . onSuggestionsHidden ( ) ; } } requestLayout ( ) ; invalidate ( ) ; }
{@inheritDoc}
{