Java Code Examples for org.chromium.ui.UiUtils#isKeyboardShowing()

The following examples show how to use org.chromium.ui.UiUtils#isKeyboardShowing() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActivityWindowAndroid.java    From 365browser with Apache License 2.0 7 votes vote down vote up
@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);
}
 
Example 2
Source File: InfoBarContainer.java    From delion with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 3
Source File: InfoBarContainer.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 4
Source File: InfoBarContainer.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 5
Source File: ToolbarControlContainer.java    From delion with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 6
Source File: ToolbarControlContainer.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 7
Source File: ToolbarControlContainer.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 8
Source File: InfoBarContainer.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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);
}
 
Example 9
Source File: InfoBarContainer.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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);
}
 
Example 10
Source File: CompositorViewHolder.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    mIsKeyboardShowing = UiUtils.isKeyboardShowing(getContext(), this);
}
 
Example 11
Source File: ReaderModeManager.java    From delion with Apache License 2.0 4 votes vote down vote up
/**
 * @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));
}
 
Example 12
Source File: CompositorViewHolder.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    mIsKeyboardShowing = UiUtils.isKeyboardShowing(getContext(), this);
}
 
Example 13
Source File: ReaderModeManager.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**
 * @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));
}
 
Example 14
Source File: CompositorViewHolder.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    mIsKeyboardShowing = UiUtils.isKeyboardShowing(getContext(), this);
}
 
Example 15
Source File: ReaderModeManager.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 * @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));
}