android.widget.PopupWindow#INPUT_METHOD_NOT_NEEDED源码实例Demo

下面列出了android.widget.PopupWindow#INPUT_METHOD_NOT_NEEDED 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: CSipSimple   文件: IcsListPopupWindow.java
private boolean isInputMethodNotNeeded() {
    return mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
}
 
源代码2 项目: Autocomplete   文件: AutocompletePopup.java
/**
 * @return {@code true} if this popup is configured to assume the user does not need
 * to interact with the IME while it is showing, {@code false} otherwise.
 */
@SuppressWarnings("WeakerAccess")
boolean isInputMethodNotNeeded() {
    return mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
}
 
源代码3 项目: Autocomplete   文件: AutocompletePopup.java
/**
 * <p>Builds the popup window's content and returns the height the popup
 * should have. Returns -1 when the content already exists.</p>
 *
 * @return the content's wrap content height or -1 if content already exists
 */
private int buildDropDown() {
    int otherHeights = 0;

    // getMaxAvailableHeight() subtracts the padding, so we put it back
    // to get the available height for the whole window.
    final int paddingVert;
    final int paddingHoriz;
    final Drawable background = mPopup.getBackground();
    if (background != null) {
        background.getPadding(mTempRect);
        paddingVert = mTempRect.top + mTempRect.bottom;
        paddingHoriz = mTempRect.left + mTempRect.right;

        // If we don't have an explicit vertical offset, determine one from
        // the window background so that content will line up.
        if (!mVerticalOffsetSet) {
            mVerticalOffset = -mTempRect.top;
        }
    } else {
        mTempRect.setEmpty();
        paddingVert = 0;
        paddingHoriz = 0;
    }

    // Redefine dimensions taking into account maxWidth and maxHeight.
    final boolean ignoreBottomDecorations = mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
    final int maxContentHeight = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ?
            mPopup.getMaxAvailableHeight(getAnchorView(), mVerticalOffset, ignoreBottomDecorations) :
            mPopup.getMaxAvailableHeight(getAnchorView(), mVerticalOffset);
    final int maxContentWidth = mContext.getResources().getDisplayMetrics().widthPixels - paddingHoriz;

    mMaxHeight = Math.min(maxContentHeight + paddingVert, mUserMaxHeight);
    mMaxWidth = Math.min(maxContentWidth + paddingHoriz, mUserMaxWidth);
    // if (mHeight > 0) mHeight = Math.min(mHeight, maxContentHeight);
    // if (mWidth > 0) mWidth = Math.min(mWidth, maxContentWidth);

    if (mAlwaysVisible || mHeight == ViewGroup.LayoutParams.MATCH_PARENT) {
        return mMaxHeight;
    }

    final int childWidthSpec;
    switch (mWidth) {
        case ViewGroup.LayoutParams.WRAP_CONTENT:
            childWidthSpec = View.MeasureSpec.makeMeasureSpec(maxContentWidth, View.MeasureSpec.AT_MOST); break;
        case ViewGroup.LayoutParams.MATCH_PARENT:
            childWidthSpec = View.MeasureSpec.makeMeasureSpec(maxContentWidth, View.MeasureSpec.EXACTLY); break;
        default:
            //noinspection Range
            childWidthSpec = View.MeasureSpec.makeMeasureSpec(mWidth, View.MeasureSpec.EXACTLY); break;
    }

    // Add padding only if the list has items in it, that way we don't show
    // the popup if it is not needed. For this reason, we measure as wrap_content.
    mView.measure(childWidthSpec, View.MeasureSpec.makeMeasureSpec(maxContentHeight, View.MeasureSpec.AT_MOST));
    final int viewHeight = mView.getMeasuredHeight();
    if (viewHeight > 0) {
        otherHeights += paddingVert + mView.getPaddingTop() + mView.getPaddingBottom();
    }

    return Math.min(viewHeight + otherHeights, mMaxHeight);
}
 
源代码4 项目: android-apps   文件: IcsListPopupWindow.java
private boolean isInputMethodNotNeeded() {
    return mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
}
 
源代码5 项目: zen4android   文件: IcsListPopupWindow.java
private boolean isInputMethodNotNeeded() {
    return mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
}
 
源代码6 项目: zhangshangwuda   文件: IcsListPopupWindow.java
private boolean isInputMethodNotNeeded() {
    return mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
}
 
private boolean isInputMethodNotNeeded() {
    return mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED;
}