当前位置: 首页>>代码示例>>Java>>正文


Java UiUtils.isKeyboardShowing方法代码示例

本文整理汇总了Java中org.chromium.ui.UiUtils.isKeyboardShowing方法的典型用法代码示例。如果您正苦于以下问题:Java UiUtils.isKeyboardShowing方法的具体用法?Java UiUtils.isKeyboardShowing怎么用?Java UiUtils.isKeyboardShowing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.chromium.ui.UiUtils的用法示例。


在下文中一共展示了UiUtils.isKeyboardShowing方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLayout

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    // Hide the View when the keyboard is showing.
    boolean isShowing = (getVisibility() == View.VISIBLE);
    if (UiUtils.isKeyboardShowing(getContext(), InfoBarContainer.this)) {
        if (isShowing) {
            // Set to invisible (instead of gone) so that onLayout() will be called when the
            // keyboard is dismissed.
            setVisibility(View.INVISIBLE);
        }
    } else {
        if (!isShowing && !mIsObscured) {
            setVisibility(View.VISIBLE);
        }
    }

    super.onLayout(changed, l, t, r, b);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:InfoBarContainer.java

示例2: showPopupAtBottom

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
private void showPopupAtBottom() {
    // When the keyboard is showing, translating the snackbar upwards looks bad because it
    // overlaps the keyboard. In this case, use an alternative animation without translation.
    boolean isKeyboardShowing = UiUtils.isKeyboardShowing(mDecor.getContext(), mDecor);
    mPopup.setAnimationStyle(isKeyboardShowing ? R.style.SnackbarAnimationWithKeyboard
            : R.style.SnackbarAnimation);

    mDecor.getLocationInWindow(mTempDecorPosition);
    mDecor.getWindowVisibleDisplayFrame(mTempVisibleDisplayFrame);
    int decorBottom = mTempDecorPosition[1] + mDecor.getHeight();
    int visibleBottom = Math.min(mTempVisibleDisplayFrame.bottom, decorBottom);
    int margin = mIsTablet ? mDecor.getResources().getDimensionPixelSize(
            R.dimen.snackbar_tablet_margin) : 0;

    mPopup.showAtLocation(mDecor, Gravity.START | Gravity.BOTTOM, margin,
            decorBottom - visibleBottom + margin);
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:18,代码来源:SnackbarManager.java

示例3: shouldRecognizeSwipe

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public boolean shouldRecognizeSwipe(MotionEvent e1, MotionEvent e2) {
    if (isOnTabStrip(e1)) return false;
    if (mToolbar.shouldIgnoreSwipeGesture()) return false;
    if (UiUtils.isKeyboardShowing(getContext(), ToolbarControlContainer.this)) return false;
    return true;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:8,代码来源:ToolbarControlContainer.java

示例4: onLayout

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * See {@link #android.view.ViewGroup.onLayout(boolean, int, int, int, int)}.
 */
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    // Hide the View when the keyboard is showing.
    boolean isShowing = (getVisibility() == View.VISIBLE);
    if (UiUtils.isKeyboardShowing(getContext(), this)) {
        if (isShowing) {
            setVisibility(View.INVISIBLE);
        }
    } else {
        if (!isShowing && !mDoStayInvisible) {
            setVisibility(View.VISIBLE);
        }
    }

    // Update the viewport height when the parent View's height changes (e.g. after rotation).
    int currentParentHeight = getParent() == null ? 0 : ((View) getParent()).getHeight();
    if (mParentHeight != currentParentHeight) {
        mParentHeight = currentParentHeight;
        mGestureState = GESTURE_NONE;
        if (mCurrentAnimation != null) mCurrentAnimation.end();
    }

    // Update the known effective height of the View.
    mTotalHeight = getMeasuredHeight();
    if (getLayoutParams() instanceof MarginLayoutParams) {
        MarginLayoutParams params = (MarginLayoutParams) getLayoutParams();
        mTotalHeight += params.topMargin + params.bottomMargin;
    }

    super.onLayout(changed, l, t, r, b);
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:35,代码来源:SwipableOverlayView.java

示例5: registerKeyboardVisibilityCallbacks

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
protected void registerKeyboardVisibilityCallbacks() {
    Activity activity = getActivity().get();
    if (activity == null) return;
    View content = activity.findViewById(android.R.id.content);
    mIsKeyboardShowing = UiUtils.isKeyboardShowing(getActivity().get(), content);
    content.addOnLayoutChangeListener(this);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:9,代码来源:ActivityWindowAndroid.java

示例6: onLayout

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    // Hide the infobars when the keyboard is showing.
    boolean isShowing = (getVisibility() == View.VISIBLE);
    if (UiUtils.isKeyboardShowing(mActivity, this)) {
        if (isShowing) {
            setVisibility(View.INVISIBLE);
        }
    } else {
        if (!isShowing) {
            setVisibility(View.VISIBLE);
        }
    }
    super.onLayout(changed, l, t, r, b);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:16,代码来源:InfoBarContainer.java

示例7: onMeasure

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    mIsKeyboardShowing = UiUtils.isKeyboardShowing(getContext(), this);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:6,代码来源:CompositorViewHolder.java

示例8: isKeyboardShowing

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * @return True if the keyboard might be showing. This is not 100% accurate; see
 *         UiUtils.isKeyboardShowing(...).
 */
protected boolean isKeyboardShowing() {
    return mChromeActivity != null && UiUtils.isKeyboardShowing(mChromeActivity,
            mChromeActivity.findViewById(android.R.id.content));
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:9,代码来源:ReaderModeManager.java


注:本文中的org.chromium.ui.UiUtils.isKeyboardShowing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。