android.view.ViewGroup#FOCUS_BLOCK_DESCENDANTS源码实例Demo

下面列出了android.view.ViewGroup#FOCUS_BLOCK_DESCENDANTS 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: LaunchEnr   文件: Workspace.java
@Override
public int getDescendantFocusability() {
    if (workspaceInModalState()) {
        return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
    }
    return super.getDescendantFocusability();
}
 
源代码2 项目: WhatsappWebToGo   文件: WebviewActivity.java
private void setKeyboardEnabled(final boolean enable) {
    mKeyboardEnabled = enable;
    InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
    if (enable && mMainView.getDescendantFocusability() == ViewGroup.FOCUS_BLOCK_DESCENDANTS) {
        mMainView.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
        showSnackbar("Unblocking keyboard...");
        //inputMethodManager.showSoftInputFromInputMethod(activity.getCurrentFocus().getWindowToken(), 0);
    } else if (!enable) {
        mMainView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
        mWebView.getRootView().requestFocus();
        showSnackbar("Blocking keyboard...");
        inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
    }
    mSharedPrefs.edit().putBoolean("keyboardEnabled", enable).apply();
}
 
源代码3 项目: Trebuchet   文件: Workspace.java
@Override
public int getDescendantFocusability() {
    if (workspaceInModalState()) {
        return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
    }
    return super.getDescendantFocusability();
}
 
源代码4 项目: TurboLauncher   文件: AppsCustomizeLayout.java
/**
 * Disable focus on anything under this view in the hierarchy if we are not visible.
 */
@Override
public int getDescendantFocusability() {
    if (getVisibility() != View.VISIBLE) {
        return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
    }
    return super.getDescendantFocusability();
}
 
源代码5 项目: TurboLauncher   文件: Workspace.java
@Override
public int getDescendantFocusability() {
    if (isSmall()) {
        return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
    }
    return super.getDescendantFocusability();
}
 
源代码6 项目: LB-Launcher   文件: AppsCustomizeTabHost.java
/**
 * Disable focus on anything under this view in the hierarchy if we are not visible.
 */
@Override
public int getDescendantFocusability() {
    if (getVisibility() != View.VISIBLE) {
        return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
    }
    return super.getDescendantFocusability();
}
 
源代码7 项目: cube-sdk   文件: BlockListView.java
public void onDataListChange() {

        removeAllViews();

        int len = mBlockListAdapter.getCount();
        int w = mBlockListAdapter.getBlockWidth();
        int h = mBlockListAdapter.getBlockHeight();
        int columnNum = mBlockListAdapter.getCloumnNum();

        int horizontalSpacing = mBlockListAdapter.getHorizontalSpacing();
        int verticalSpacing = mBlockListAdapter.getVerticalSpacing();

        boolean blockDescendant = getDescendantFocusability() == ViewGroup.FOCUS_BLOCK_DESCENDANTS;

        for (int i = 0; i < len; i++) {

            RelativeLayout.LayoutParams lyp = new RelativeLayout.LayoutParams(w, h);
            int row = i / columnNum;
            int clo = i % columnNum;
            int left = 0;
            int top = 0;

            if (clo > 0) {
                left = (horizontalSpacing + w) * clo;
            }
            if (row > 0) {
                top = (verticalSpacing + h) * row;
            }
            lyp.setMargins(left, top, 0, 0);
            View view = mBlockListAdapter.getView(mLayoutInflater, i);
            if (!blockDescendant) {
                view.setOnClickListener(mOnClickListener);
            }
            view.setTag(INDEX_TAG, i);
            addView(view, lyp);
        }
        requestLayout();
    }
 
源代码8 项目: LaunchEnr   文件: LauncherAppWidgetHostView.java
@Override
public int getDescendantFocusability() {
    return mChildrenFocused ? ViewGroup.FOCUS_BEFORE_DESCENDANTS
            : ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码9 项目: HgLauncher   文件: LauncherAppWidgetHostView.java
@Override public int getDescendantFocusability() {
    return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码10 项目: HgLauncher   文件: LauncherAppWidgetHostView.java
@Override public int getDescendantFocusability() {
    return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码11 项目: Trebuchet   文件: LauncherAppWidgetHostView.java
@Override
public int getDescendantFocusability() {
    return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码12 项目: TurboLauncher   文件: LauncherAppWidgetHostView.java
@Override
public int getDescendantFocusability() {
    return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码13 项目: LB-Launcher   文件: LauncherAppWidgetHostView.java
@Override
public int getDescendantFocusability() {
    return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码14 项目: DistroHopper   文件: WidgetHostView.java
@Override
public int getDescendantFocusability ()
{
	return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
源代码15 项目: AcDisplay   文件: MyAppWidgetHostView.java
@Override
public int getDescendantFocusability() {
    return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
}
 
 方法所在类