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


Java AndroidTreeView.setUseAutoToggle方法代码示例

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


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

示例1: onCreateView

import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_selectable_nodes, null, false);
    rootView.findViewById(R.id.status).setVisibility(View.GONE);
    ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);

    TreeNode root = TreeNode.root();

    TreeNode s1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Folder with very long name ")).setViewHolder(
        new ArrowExpandSelectableHeaderHolder(getActivity()));
    TreeNode s2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Another folder with very long name")).setViewHolder(
        new ArrowExpandSelectableHeaderHolder(getActivity()));

    fillFolder(s1);
    fillFolder(s2);

    root.addChildren(s1, s2);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultAnimation(true);
    tView.setUse2dScroll(true);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
    tView.setDefaultNodeClickListener(TwoDScrollingArrowExpandFragment.this);
    tView.setDefaultViewHolder(ArrowExpandSelectableHeaderHolder.class);
    containerView.addView(tView.getView());
    tView.setUseAutoToggle(false);

    tView.expandAll();

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }
    return rootView;
}
 
开发者ID:bmelnychuk,项目名称:AndroidTreeView,代码行数:38,代码来源:TwoDScrollingArrowExpandFragment.java

示例2: showAccountsAndClusters

import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public void showAccountsAndClusters(SortedMap<MovirtAccount, List<Cluster>> map) {
    AccountsTreeItem.ActiveSelectionChangedListener changedListener = presenter::onActiveSelectionChanged;
    AccountsTreeItem.LongClickListener longClickListener = presenter::onLongClickListener;

    TreeNode anchor = TreeNode.root();
    AccountsTreeItem rootData = new AccountsTreeItem(null, null, changedListener, longClickListener);
    drawerRoot = new TreeNode(rootData)
            .setViewHolder(new AccountsTreeHolder(this))
            .setExpanded(true);
    anchor.addChild(drawerRoot);

    for (Map.Entry<MovirtAccount, List<Cluster>> entry : map.entrySet()) {
        AccountsTreeItem accountData = new AccountsTreeItem(entry.getKey(), null, changedListener, longClickListener);
        TreeNode accountNode = new TreeNode(accountData)
                .setViewHolder(new AccountsTreeHolder(this))
                .setExpanded(true);
        drawerRoot.addChild(accountNode);

        for (Cluster cluster : entry.getValue()) {
            AccountsTreeItem clusterData = new AccountsTreeItem(entry.getKey(), cluster, changedListener, longClickListener);
            TreeNode newClusterNode = new TreeNode(clusterData)
                    .setViewHolder(new AccountsTreeHolder(this))
                    .setExpanded(true);
            accountNode.addChild(newClusterNode);
        }
    }

    AndroidTreeView atv = new AndroidTreeView(this, anchor);
    atv.setUseAutoToggle(false);
    atv.setSelectionModeEnabled(true);
    atv.setDefaultContainerStyle(R.style.LargePaddingTreeNode);
    selectionDrawer.removeAllViews(); // remove previous tree
    selectionDrawer.addView(atv.getView());
}
 
开发者ID:oVirt,项目名称:moVirt,代码行数:36,代码来源:MainActivity.java

示例3: showCerts

import com.unnamed.b.atv.view.AndroidTreeView; //导入方法依赖的package包/类
@Override
public void showCerts(Cert[] certs) {
    LinearLayout container = certTreeContainer;
    if (certs == null || certs.length == 0) {
        certTreeContainer.removeAllViews(); // remove previous tree
        return;
    }
    TreeNode root = TreeNode.root();
    TreeNode intermediateLeaf = root;
    CertTreeHolder leafHolder = null;
    int visibleCertificates;

    if (certs.length > MAX_VISIBLE_CERTIFICATES) {
        visibleCertificates = MAX_VISIBLE_CERTIFICATES;
    } else {
        visibleCertificates = certs.length;
    }

    CertTreeItem.CertificateSelectedListener listener = (certificate, location) -> {
        txtCertDetails.setText(certificate.toString());
        txtCertUrl.setText(location);
    };

    for (int i = visibleCertificates - 1; i >= 0; i--) { // create tree hierarchy
        CertTreeItem data = new CertTreeItem(certs[i], listener);
        leafHolder = new CertTreeHolder(this);
        TreeNode newNode = new TreeNode(data).setViewHolder(leafHolder);

        intermediateLeaf.addChild(newNode);
        intermediateLeaf.setExpanded(true);
        intermediateLeaf = newNode;
    }

    AndroidTreeView atv = new AndroidTreeView(this, root);
    atv.setUseAutoToggle(false);
    atv.setSelectionModeEnabled(true);
    atv.setDefaultContainerStyle(R.style.SmallPaddingTreeNode);
    container.addView(atv.getView());
    if (leafHolder != null) {
        leafHolder.selectNode(); // select Api certificate
    }
}
 
开发者ID:oVirt,项目名称:moVirt,代码行数:43,代码来源:CertificateManagementActivity.java


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