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


Java UiUtils.showKeyboard方法代码示例

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


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

示例1: onVisibilityChanged

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);
    // This method might be called very early. Null check on bookmark model here.
    if (mBookmarkModel == null) return;

    if (visibility == View.VISIBLE) {
        mBookmarkModel.addObserver(mModelObserver);
        updateHistoryList();
        mSearchText.requestFocus();
        UiUtils.showKeyboard(mSearchText);
    } else {
        UiUtils.hideKeyboard(mSearchText);
        mBookmarkModel.removeObserver(mModelObserver);
        resetUI();
        clearFocus();
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:BookmarkSearchView.java

示例2: showKeyboard

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
private void showKeyboard() {
    if (!mFindQuery.hasWindowFocus()) {
        // HACK: showKeyboard() is normally called from activate() which is
        // triggered by an options menu item. Unfortunately, because the
        // options menu is still focused at this point, that means our
        // window doesn't actually have focus when this first gets called,
        // and hence it isn't the target of the Input Method, and in
        // practice that means the soft keyboard never shows up (whatever
        // flags you pass). So as a workaround we postpone asking for the
        // keyboard to be shown until just after the window gets refocused.
        // See onWindowFocusChanged(boolean hasFocus).
        mShowKeyboardOnceWindowIsFocused = true;
        return;
    }
    UiUtils.showKeyboard(mFindQuery);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:FindToolbar.java

示例3: onVisibilityChanged

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);
    // This method might be called very early. Null check on bookmark model here.
    if (mEnhancedBookmarksModel == null) return;

    if (visibility == View.VISIBLE) {
        mEnhancedBookmarksModel.addObserver(mModelObserver);
        updateHistoryList();
        mSearchText.requestFocus();
        UiUtils.showKeyboard(mSearchText);
    } else {
        UiUtils.hideKeyboard(mSearchText);
        mEnhancedBookmarksModel.removeObserver(mModelObserver);
        resetUI();
        clearFocus();
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:19,代码来源:EnhancedBookmarkSearchView.java

示例4: finishUrlFocusChange

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
private void finishUrlFocusChange(boolean hasFocus) {
    if (hasFocus) {
        if (mSecurityButton.getVisibility() == VISIBLE) mSecurityButton.setVisibility(GONE);
        if (getWindowDelegate().getWindowSoftInputMode()
                != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN) {
            getWindowDelegate().setWindowSoftInputMode(
                    WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
        }
        UiUtils.showKeyboard(mUrlBar);
    } else {
        if (mSecurityButton.getVisibility() == GONE
                && mSecurityButton.getDrawable() != null
                && mSecurityButton.getDrawable().getIntrinsicWidth() > 0
                && mSecurityButton.getDrawable().getIntrinsicHeight() > 0) {
            mSecurityButton.setVisibility(VISIBLE);
        }
        UiUtils.hideKeyboard(mUrlBar);
        Selection.setSelection(mUrlBar.getText(), 0);
        // Convert the keyboard back to resize mode (delay the change for an arbitrary
        // amount of time in hopes the keyboard will be completely hidden before making
        // this change).
        if (getWindowDelegate().getWindowSoftInputMode()
                != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) {
            postDelayed(mKeyboardResizeModeTask, KEYBOARD_MODE_CHANGE_DELAY_MS);
        }
    }
    setUrlFocusChangeInProgress(false);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:29,代码来源:LocationBarTablet.java

示例5: finishUrlFocusChange

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
private void finishUrlFocusChange(boolean hasFocus) {
    if (hasFocus) {
        if (mSecurityButton.getVisibility() == VISIBLE) mSecurityButton.setVisibility(GONE);
        if (getWindowDelegate().getWindowSoftInputMode()
                != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN) {
            getWindowDelegate().setWindowSoftInputMode(
                    WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
        }
        UiUtils.showKeyboard(mUrlBar);
    } else {
        if (mSecurityButton.getVisibility() == GONE
                && mSecurityButton.getDrawable() != null
                && mSecurityButton.getDrawable().getIntrinsicWidth() > 0
                && mSecurityButton.getDrawable().getIntrinsicHeight() > 0) {
            mSecurityButton.setVisibility(VISIBLE);
        }
        UiUtils.hideKeyboard(mUrlBar);
        Selection.setSelection(mUrlBar.getText(), 0);
        // Convert the keyboard back to resize mode (delay the change for an arbitrary
        // amount of time in hopes the keyboard will be completely hidden before making
        // this change).
        if (getWindowDelegate().getWindowSoftInputMode()
                != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) {
            postDelayed(mKeyboardResizeModeTask, KEYBOARD_MODE_CHANGE_DELAY_MS);
        }
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:28,代码来源:LocationBarTablet.java

示例6: showSearchView

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * Shows the search edit text box and related views.
 */
public void showSearchView() {
    assert mHasSearchView;

    mIsSearching = true;
    mSelectionDelegate.clearSelection();

    showSearchViewInternal();

    mSearchEditText.requestFocus();
    UiUtils.showKeyboard(mSearchEditText);
    setTitle(null);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:16,代码来源:SelectableListToolbar.java

示例7: run

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public void run() {
    UiUtils.showKeyboard(mUrlBar);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:5,代码来源:LocationBarLayout.java

示例8: finishUrlFocusChange

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * Handles any actions to be performed after all other actions triggered by the URL focus
 * change.  This will be called after any animations are performed to transition from one
 * focus state to the other.
 * @param hasFocus Whether the URL field has gained focus.
 */
public void finishUrlFocusChange(boolean hasFocus) {
    final WindowDelegate windowDelegate = getWindowDelegate();
    if (!hasFocus) {
        // Remove the selection from the url text.  The ending selection position
        // will determine the scroll position when the url field is restored.  If
        // we do not clear this, it will scroll to the end of the text when you
        // enter/exit the tab stack.
        // We set the selection to 0 instead of removing the selection to avoid a crash that
        // happens if you clear the selection instead.
        //
        // Triggering the bug happens by:
        // 1.) Selecting some portion of the URL (where the two selection handles
        //     appear)
        // 2.) Trigger a text change in the URL bar (i.e. by triggering a new URL load
        //     by a command line intent)
        // 3.) Simultaneously moving one of the selection handles left and right.  This will
        //     occasionally throw an AssertionError on the bounds of the selection.
        Selection.setSelection(mUrlBar.getText(), 0);

        // The animation rendering may not yet be 100% complete and hiding the keyboard makes
        // the animation quite choppy.
        postDelayed(new Runnable() {
            @Override
            public void run() {
                UiUtils.hideKeyboard(mUrlBar);
            }
        }, KEYBOARD_HIDE_DELAY_MS);
        // Convert the keyboard back to resize mode (delay the change for an arbitrary amount
        // of time in hopes the keyboard will be completely hidden before making this change).
        if (mKeyboardResizeModeTask == null
                && windowDelegate.getWindowSoftInputMode()
                        != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) {
            mKeyboardResizeModeTask = new Runnable() {
                @Override
                public void run() {
                    windowDelegate.setWindowSoftInputMode(
                            WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
                    mKeyboardResizeModeTask = null;
                }
            };
            postDelayed(mKeyboardResizeModeTask, KEYBOARD_MODE_CHANGE_DELAY_MS);
        }
        mUrlActionsContainer.setVisibility(GONE);
    } else {
        if (mKeyboardResizeModeTask != null) {
            removeCallbacks(mKeyboardResizeModeTask);
            mKeyboardResizeModeTask = null;
        }
        if (windowDelegate.getWindowSoftInputMode()
                != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN) {
            windowDelegate.setWindowSoftInputMode(
                    WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
        }
        UiUtils.showKeyboard(mUrlBar);
        // As the position of the navigation icon has changed, ensure the suggestions are
        // updated to reflect the new position.
        if (getSuggestionList() != null && getSuggestionList().isShown()) {
            getSuggestionList().invalidateSuggestionViews();
        }
    }
    setUrlFocusChangeInProgress(false);

    NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab();
    if (hasFocus && ntp != null && ntp.isLocationBarShownInNTP()) {
        fadeInOmniboxResultsContainerBackground();
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:74,代码来源:LocationBarPhone.java

示例9: finishUrlFocusChange

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * Handles any actions to be performed after all other actions triggered by the URL focus
 * change.  This will be called after any animations are performed to transition from one
 * focus state to the other.
 * @param hasFocus Whether the URL field has gained focus.
 */
public void finishUrlFocusChange(boolean hasFocus) {
    final WindowDelegate windowDelegate = getWindowDelegate();
    if (!hasFocus) {
        // Remove the selection from the url text.  The ending selection position
        // will determine the scroll position when the url field is restored.  If
        // we do not clear this, it will scroll to the end of the text when you
        // enter/exit the tab stack.
        // We set the selection to 0 instead of removing the selection to avoid a crash that
        // happens if you clear the selection instead.
        //
        // Triggering the bug happens by:
        // 1.) Selecting some portion of the URL (where the two selection handles
        //     appear)
        // 2.) Trigger a text change in the URL bar (i.e. by triggering a new URL load
        //     by a command line intent)
        // 3.) Simultaneously moving one of the selection handles left and right.  This will
        //     occasionally throw an AssertionError on the bounds of the selection.
        Selection.setSelection(mUrlBar.getText(), 0);

        // The animation rendering may not yet be 100% complete and hiding the keyboard makes
        // the animation quite choppy.
        postDelayed(new Runnable() {
            @Override
            public void run() {
                UiUtils.hideKeyboard(mUrlBar);
            }
        }, KEYBOARD_HIDE_DELAY_MS);
        // Convert the keyboard back to resize mode (delay the change for an arbitrary amount
        // of time in hopes the keyboard will be completely hidden before making this change).
        if (mKeyboardResizeModeTask == null
                && windowDelegate.getWindowSoftInputMode()
                        != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) {
            mKeyboardResizeModeTask = new Runnable() {
                @Override
                public void run() {
                    windowDelegate.setWindowSoftInputMode(
                            WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
                    mKeyboardResizeModeTask = null;
                }
            };
            postDelayed(mKeyboardResizeModeTask, KEYBOARD_MODE_CHANGE_DELAY_MS);
        }
        if (!hasVisibleViewsAfterUrlBarWhenUnfocused()) {
            mUrlActionsContainer.setVisibility(GONE);
        }
    } else {
        if (mKeyboardResizeModeTask != null) {
            removeCallbacks(mKeyboardResizeModeTask);
            mKeyboardResizeModeTask = null;
        }
        if (windowDelegate.getWindowSoftInputMode()
                != WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN) {
            windowDelegate.setWindowSoftInputMode(
                    WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
        }
        UiUtils.showKeyboard(mUrlBar);
        // As the position of the navigation icon has changed, ensure the suggestions are
        // updated to reflect the new position.
        if (getSuggestionList() != null && getSuggestionList().isShown()) {
            getSuggestionList().invalidateSuggestionViews();
        }
    }
    mUrlFocusChangeInProgress = false;
    updateDeleteButtonVisibility();

    NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab();
    if (hasFocus && ntp != null && ntp.isLocationBarShownInNTP()) {
        fadeInOmniboxResultsContainerBackground();
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:77,代码来源:LocationBarPhone.java

示例10: finishUrlFocusChange

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * Handles any actions to be performed after all other actions triggered by the URL focus
 * change.  This will be called after any animations are performed to transition from one
 * focus state to the other.
 * @param hasFocus Whether the URL field has gained focus.
 */
public void finishUrlFocusChange(boolean hasFocus) {
    if (!hasFocus) {
        // Remove the selection from the url text.  The ending selection position
        // will determine the scroll position when the url field is restored.  If
        // we do not clear this, it will scroll to the end of the text when you
        // enter/exit the tab stack.
        // We set the selection to 0 instead of removing the selection to avoid a crash that
        // happens if you clear the selection instead.
        //
        // Triggering the bug happens by:
        // 1.) Selecting some portion of the URL (where the two selection handles
        //     appear)
        // 2.) Trigger a text change in the URL bar (i.e. by triggering a new URL load
        //     by a command line intent)
        // 3.) Simultaneously moving one of the selection handles left and right.  This will
        //     occasionally throw an AssertionError on the bounds of the selection.
        if (!mUrlBar.scrollToTLD()) {
            Selection.setSelection(mUrlBar.getText(), 0);
        }

        // The animation rendering may not yet be 100% complete and hiding the keyboard makes
        // the animation quite choppy.
        postDelayed(new Runnable() {
            @Override
            public void run() {
                UiUtils.hideKeyboard(mUrlBar);
            }
        }, KEYBOARD_HIDE_DELAY_MS);
        // Convert the keyboard back to resize mode (delay the change for an arbitrary amount
        // of time in hopes the keyboard will be completely hidden before making this change).
        // If Chrome Home is enabled, it will handle its own mode changes.
        if (mBottomSheet == null) {
            setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE, true);
        }
        mUrlActionsContainer.setVisibility(GONE);
    } else {
        // If Chrome Home is enabled, it will handle its own mode changes.
        if (mBottomSheet == null) {
            setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN, false);
        }
        UiUtils.showKeyboard(mUrlBar);
        // As the position of the navigation icon has changed, ensure the suggestions are
        // updated to reflect the new position.
        if (getSuggestionList() != null && getSuggestionList().isShown()) {
            getSuggestionList().invalidateSuggestionViews();
        }
    }
    setUrlFocusChangeInProgress(false);

    NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab();
    if (hasFocus && ntp != null && ntp.isLocationBarShownInNTP() && mBottomSheet == null) {
        if (mFadingView == null) initFadingOverlayView();
        mFadingView.showFadingOverlay();
    }
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:62,代码来源:LocationBarPhone.java


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