當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。