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


Java UiUtils.hideKeyboard方法代码示例

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


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

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public void hideKeyboard(Runnable postHideTask) {
    // When this is called we actually want to hide the keyboard whatever owns it.
    // This includes hiding the keyboard, and dropping focus from the URL bar.
    // See http://crbug/236424
    // TODO(aberent) Find a better place to put this, possibly as part of a wider
    // redesign of focus control.
    if (mUrlBar != null) mUrlBar.clearFocus();
    boolean wasVisible = false;
    if (hasFocus()) {
        wasVisible = UiUtils.hideKeyboard(this);
    }
    if (wasVisible) {
        mPostHideKeyboardTask = postHideTask;
    } else {
        postHideTask.run();
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:CompositorViewHolder.java

示例3: revertChanges

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public void revertChanges() {
    if (!mUrlHasFocus) {
        setUrlToPageUrl();
    } else {
        Tab tab = mToolbarDataProvider.getTab();
        if (NativePageFactory.isNativePageUrl(tab.getUrl(), tab.isIncognito())) {
            setUrlBarText("", null);
        } else {
            setUrlBarText(
                    mToolbarDataProvider.getText(), getCurrentTabUrl());
            selectAll();
        }
        hideSuggestions();
        UiUtils.hideKeyboard(mUrlBar);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:18,代码来源:LocationBarLayout.java

示例4: setEmptyContainerState

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
public void setEmptyContainerState(boolean shouldShow) {
    Animator nextAnimator = null;

    if (shouldShow && getVisibility() != View.VISIBLE
            && mCurrentTransitionAnimation != mAnimateInAnimation) {
        nextAnimator = mAnimateInAnimation;
        UiUtils.hideKeyboard(this);
    } else if (!shouldShow && getVisibility() != View.GONE
            && mCurrentTransitionAnimation != mAnimateOutAnimation) {
        nextAnimator = mAnimateOutAnimation;
    }

    if (nextAnimator != null) {
        if (mCurrentTransitionAnimation != null) mCurrentTransitionAnimation.cancel();
        mCurrentTransitionAnimation = nextAnimator;
        mCurrentTransitionAnimation.start();
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:EmptyBackgroundViewTablet.java

示例5: hideKeyboard

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * Hides the the keyboard if it was opened for the ContentView.
 * @param postHideTask A task to run after the keyboard is done hiding and the view's
 *         layout has been updated.  If the keyboard was not shown, the task will run
 *         immediately.
 */
public void hideKeyboard(Runnable postHideTask) {
    // When this is called we actually want to hide the keyboard whatever owns it.
    // This includes hiding the keyboard, and dropping focus from the URL bar.
    // See http://crbug/236424
    // TODO(aberent) Find a better place to put this, possibly as part of a wider
    // redesign of focus control.
    if (mUrlBar != null) mUrlBar.clearFocus();
    boolean wasVisible = false;
    if (hasFocus()) {
        wasVisible = UiUtils.hideKeyboard(this);
    }
    if (wasVisible) {
        mPostHideKeyboardTask = postHideTask;
    } else {
        postHideTask.run();
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:24,代码来源:CompositorViewHolder.java

示例6: deactivate

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/** Call this just before closing the find toolbar. */
public void deactivate() {
    if (!mActive) return;

    if (mObserver != null) mObserver.onFindToolbarHidden();

    setResultsBarVisibility(false);

    mTabModelSelector.removeObserver(mTabModelSelectorObserver);
    for (TabModel model : mTabModelSelector.getModels()) {
        model.removeObserver(mTabModelObserver);
    }

    mCurrentTab.getChromeWebContentsDelegateAndroid().setFindResultListener(null);
    mCurrentTab.getChromeWebContentsDelegateAndroid().setFindMatchRectsListener(null);
    mCurrentTab.removeObserver(mTabObserver);

    UiUtils.hideKeyboard(mFindQuery);
    if (mFindQuery.getText().length() > 0) {
        clearResults();
        mFindInPageBridge.stopFinding();
    }

    mFindInPageBridge.destroy();
    mActive = false;
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:27,代码来源:FindToolbar.java

示例7: 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

示例8: showSelectionView

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
protected void showSelectionView(List<E> selectedItems, boolean wasSelectionEnabled) {
    getMenu().setGroupVisible(mNormalGroupResId, false);
    getMenu().setGroupVisible(mSelectedGroupResId, true);
    if (mHasSearchView) mSearchView.setVisibility(View.GONE);

    setNavigationButton(NAVIGATION_BUTTON_SELECTION_BACK);
    setBackgroundColor(mSelectionBackgroundColor);
    setOverflowIcon(mSelectionMenuButton);

    switchToNumberRollView(selectedItems, wasSelectionEnabled);

    if (mIsSearching) UiUtils.hideKeyboard(mSearchEditText);

    onThemeChanged(false);
    updateDisplayStyleIfNecessary();
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:17,代码来源:SelectableListToolbar.java

示例9: scrollToAndFocus

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public void scrollToAndFocus() {
    updateDisplayedError(!isValid());
    UiUtils.hideKeyboard(mDropdown);
    ViewGroup parent = (ViewGroup) mDropdown.getParent();
    if (parent != null) parent.requestChildFocus(mDropdown, mDropdown);
    mDropdown.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:9,代码来源:EditorDropdownField.java

示例10: onEditorAction

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_SEARCH) {
        UiUtils.hideKeyboard(v);

        // History is saved either when the user clicks search button or a search result is
        // clicked.
        saveSearchHistory();
    }
    return false;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:BookmarkSearchView.java

示例11: onAction

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
@Override
public void onAction(Object actionData) {
    View view = (View) actionData;
    UiUtils.hideKeyboard(view);

    Context context = view.getContext();
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            context, SearchEnginePreference.class.getName());
    context.startActivity(intent);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:GeolocationSnackbarController.java

示例12: 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

示例13: backKeyPressed

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
private void backKeyPressed() {
    hideSuggestions();
    UiUtils.hideKeyboard(mUrlBar);
    // Revert the URL to match the current page.
    setUrlToPageUrl();
    // Focus the page.
    Tab currentTab = getCurrentTab();
    if (currentTab != null) currentTab.requestFocus();
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:10,代码来源:LocationBarLayout.java

示例14: hideKeyboardAndStartFinding

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
private void hideKeyboardAndStartFinding(boolean forward) {
    if (mFindInPageBridge == null) return;

    final String findQuery = mFindQuery.getText().toString();
    if (findQuery.length() == 0) return;

    UiUtils.hideKeyboard(mFindQuery);
    mFindInPageBridge.startFinding(findQuery, forward, false);
    mFindInPageBridge.activateFindInPageResultForAccessibility();
    mAccessibilityDidActivateResult = true;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:FindToolbar.java

示例15: deactivate

import org.chromium.ui.UiUtils; //导入方法依赖的package包/类
/**
 * Call this just before closing the find toolbar.
 * @param clearSelection Whether the selection on the page should be cleared.
 */
public void deactivate(boolean clearSelection) {
    if (!mActive) return;

    if (mObserver != null) mObserver.onFindToolbarHidden();

    setResultsBarVisibility(false);

    mTabModelSelector.removeObserver(mTabModelSelectorObserver);
    for (TabModel model : mTabModelSelector.getModels()) {
        model.removeObserver(mTabModelObserver);
    }

    mCurrentTab.getTabWebContentsDelegateAndroid().setFindResultListener(null);
    mCurrentTab.getTabWebContentsDelegateAndroid().setFindMatchRectsListener(null);
    mCurrentTab.removeObserver(mTabObserver);

    UiUtils.hideKeyboard(mFindQuery);
    if (mFindQuery.getText().length() > 0) {
        clearResults();
        mFindInPageBridge.stopFinding(clearSelection);
    }

    mFindInPageBridge.destroy();
    mFindInPageBridge = null;
    mCurrentTab = null;
    mActive = false;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:32,代码来源:FindToolbar.java


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