本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}