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


Java View.setDuplicateParentStateEnabled方法代码示例

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


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

示例1: changeAdapter

import android.view.View; //导入方法依赖的package包/类
private void changeAdapter() {
    removeAllViews();
    TagAdapter adapter = this.mTagAdapter;
    HashSet preCheckedList = this.mTagAdapter.getPreCheckedList();
    for (int i = 0; i < adapter.getCount(); i++) {
        View tagView = adapter.getView(this, i, adapter.getItem(i));
        TagView tagViewContainer = new TagView(getContext());
        tagView.setDuplicateParentStateEnabled(true);
        tagViewContainer.setLayoutParams(tagView.getLayoutParams());
        tagViewContainer.addView(tagView);
        addView(tagViewContainer);
        if (preCheckedList.contains(Integer.valueOf(i))) {
            tagViewContainer.setChecked(true);
        }
    }
    this.mSelectedView.addAll(preCheckedList);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:TagFlowLayout.java

示例2: dispatchChildren

import android.view.View; //导入方法依赖的package包/类
/**
 * 设置子视图与父控件perssed 等状态保持一致
 *
 * @param view 各级子控件
 */
private void dispatchChildren(View view) {
    // 子视图与父控件perssed 等状态保持一致
    view.setDuplicateParentStateEnabled(true);
    if (view instanceof ViewGroup && ((ViewGroup) view).getChildCount() > 0) {
        for (int i = 0; i < getChildCount(); i++) {
            dispatchChildren(((ViewGroup) view).getChildAt(i));
        }
    }
}
 
开发者ID:yhyzgn,项目名称:Widgets,代码行数:15,代码来源:CheckedFrameLayout.java

示例3: changeAdapter

import android.view.View; //导入方法依赖的package包/类
private void changeAdapter() {
    removeAllViews();
    TagAdapter adapter = mTagAdapter;
    TagView tagViewContainer = null;
    HashSet preCheckedList = mTagAdapter.getPreCheckedList();
    for (int i = 0; i < adapter.getCount(); i++) {
        View tagView = adapter.getView(this, i, adapter.getItem(i));

        tagViewContainer = new TagView(getContext());
        tagView.setDuplicateParentStateEnabled(true);
        if (tagView.getLayoutParams() != null) {
            tagViewContainer.setLayoutParams(tagView.getLayoutParams());
        } else {
            ViewGroup.MarginLayoutParams lp = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            lp.setMargins(dip2px(getContext(), 5),
                    dip2px(getContext(), 5),
                    dip2px(getContext(), 5),
                    dip2px(getContext(), 5));
            tagViewContainer.setLayoutParams(lp);
        }
        tagViewContainer.addView(tagView);
        addView(tagViewContainer);


        if (preCheckedList.contains(i)) {
            tagViewContainer.setChecked(true);
        }

        if (mTagAdapter.setSelected(i, adapter.getItem(i))) {
            mSelectedView.add(i);
            tagViewContainer.setChecked(true);
        }
    }
    mSelectedView.addAll(preCheckedList);

}
 
开发者ID:outliner,项目名称:propsshow,代码行数:37,代码来源:TagFlowLayout.java

示例4: changeAdapter

import android.view.View; //导入方法依赖的package包/类
private void changeAdapter() {
        removeAllViews();
        TagAdapter adapter = mTagAdapter;
        TagView tagViewContainer = null;
        HashSet preCheckedList = mTagAdapter.getPreCheckedList();
        for (int i = 0; i < adapter.getCount(); i++) {
            View tagView = adapter.getView(this, i, adapter.getItem(i));

            tagViewContainer = new TagView(getContext());
//            ViewGroup.MarginLayoutParams clp = (ViewGroup.MarginLayoutParams) tagView.getLayoutParams();
//            ViewGroup.MarginLayoutParams lp = new ViewGroup.MarginLayoutParams(clp);
//            lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
//            lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
//            lp.topMargin = clp.topMargin;
//            lp.bottomMargin = clp.bottomMargin;
//            lp.leftMargin = clp.leftMargin;
//            lp.rightMargin = clp.rightMargin;
            tagView.setDuplicateParentStateEnabled(true);
            if (tagView.getLayoutParams() != null) {
                tagViewContainer.setLayoutParams(tagView.getLayoutParams());
            } else {
                MarginLayoutParams lp = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                lp.setMargins(dip2px(getContext(), 5),
                        dip2px(getContext(), 5),
                        dip2px(getContext(), 5),
                        dip2px(getContext(), 5));
                tagViewContainer.setLayoutParams(lp);
            }
            tagViewContainer.addView(tagView);
            addView(tagViewContainer);


            if (preCheckedList.contains(i)) {
                tagViewContainer.setChecked(true);
            }

            if (mTagAdapter.setSelected(i, adapter.getItem(i))) {
                mSelectedView.add(i);
                tagViewContainer.setChecked(true);
            }
        }
        mSelectedView.addAll(preCheckedList);

    }
 
开发者ID:xieyangxuejun,项目名称:SearchLayout,代码行数:45,代码来源:TagFlowLayout.java

示例5: changeAdapter

import android.view.View; //导入方法依赖的package包/类
private void changeAdapter()
    {
        removeAllViews();
        TagAdapter adapter = mTagAdapter;
        TagView tagViewContainer = null;
        HashSet preCheckedList = mTagAdapter.getPreCheckedList();
        for (int i = 0; i < adapter.getCount(); i++)
        {
            View tagView = adapter.getView(this, i, adapter.getItem(i));

            tagViewContainer = new TagView(getContext());
//            ViewGroup.MarginLayoutParams clp = (ViewGroup.MarginLayoutParams) tagView.getLayoutParams();
//            ViewGroup.MarginLayoutParams lp = new ViewGroup.MarginLayoutParams(clp);
//            lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
//            lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
//            lp.topMargin = clp.topMargin;
//            lp.bottomMargin = clp.bottomMargin;
//            lp.leftMargin = clp.leftMargin;
//            lp.rightMargin = clp.rightMargin;
            tagView.setDuplicateParentStateEnabled(true);
            if (tagView.getLayoutParams() != null)
            {
                tagViewContainer.setLayoutParams(tagView.getLayoutParams());
            } else
            {
                MarginLayoutParams lp = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                lp.setMargins(dip2px(getContext(), 5),
                        dip2px(getContext(), 5),
                        dip2px(getContext(), 5),
                        dip2px(getContext(), 5));
                tagViewContainer.setLayoutParams(lp);
            }
            tagViewContainer.addView(tagView);
            addView(tagViewContainer);


            if (preCheckedList.contains(i))
            {
                tagViewContainer.setChecked(true);
            }

            if (mTagAdapter.setSelected(i, adapter.getItem(i)))
            {
                mSelectedView.add(i);
                tagViewContainer.setChecked(true);
            }
        }
        mSelectedView.addAll(preCheckedList);

    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:51,代码来源:TagFlowLayout.java


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