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


Java TreeNode.BaseNodeViewHolder方法代码示例

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


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

示例1: collapseNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void collapseNode(TreeNode node, final boolean includeSubnodes) {
    node.setExpanded(false);
    TreeNode.BaseNodeViewHolder nodeViewHolder = getViewHolderForNode(node);

    if (mUseDefaultAnimation) {
        collapse(nodeViewHolder.getNodeItemsView());
    } else {
        nodeViewHolder.getNodeItemsView().setVisibility(View.GONE);
    }
    nodeViewHolder.toggle(false);
    if (includeSubnodes) {
        for (TreeNode n : node.getChildren()) {
            collapseNode(n, includeSubnodes);
        }
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:17,代码来源:AndroidTreeView.java

示例2: expandNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void expandNode(final TreeNode node, boolean includeSubnodes) {
    node.setExpanded(true);
    final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
    parentViewHolder.getNodeItemsView().removeAllViews();


    parentViewHolder.toggle(true);

    for (final TreeNode n : node.getChildren()) {
        addNode(parentViewHolder.getNodeItemsView(), n);

        if (n.isExpanded() || includeSubnodes) {
            expandNode(n, includeSubnodes);
        }

    }
    if (mUseDefaultAnimation) {
        expand(parentViewHolder.getNodeItemsView());
    } else {
        parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
    }

}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:24,代码来源:AndroidTreeView.java

示例3: getViewHolderForNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private TreeNode.BaseNodeViewHolder getViewHolderForNode(TreeNode node) {
    TreeNode.BaseNodeViewHolder viewHolder = node.getViewHolder();
    if (viewHolder == null) {
        try {
            final Object object = defaultViewHolderClass.getConstructor(Context.class).newInstance(mContext);
            viewHolder = (TreeNode.BaseNodeViewHolder) object;
            node.setViewHolder(viewHolder);
        } catch (Exception e) {
            throw new RuntimeException("Could not instantiate class " + defaultViewHolderClass);
        }
    }
    if (viewHolder.getContainerStyle() <= 0) {
        viewHolder.setContainerStyle(containerStyle);
    }
    if (viewHolder.getTreeView() == null) {
        viewHolder.setTreeViev(this);
    }
    return viewHolder;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:20,代码来源:AndroidTreeView.java

示例4: expandNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandNode(final TreeNode node, boolean includeSubnodes) {
    node.setExpanded(true);
    final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
    parentViewHolder.getNodeItemsView().removeAllViews();


    parentViewHolder.toggle(true);

    for (final TreeNode n : node.getChildren()) {
        addNode(parentViewHolder.getNodeItemsView(), n);

        if (n.isExpanded() || includeSubnodes) {
            expandNode(n, includeSubnodes);
        }

    }
    if (mUseDefaultAnimation) {
        expand(parentViewHolder.getNodeItemsView());
    } else {
        parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
    }

}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:24,代码来源:AndroidTreeView.java

示例5: getViewHolderForNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private TreeNode.BaseNodeViewHolder getViewHolderForNode(TreeNode node) {
    TreeNode.BaseNodeViewHolder viewHolder = node.getViewHolder();
    if (viewHolder == null) {
        try {
            final Object object = defaultViewHolderClass.getConstructor(Context.class).newInstance(new Object[]{mContext});
            viewHolder = (TreeNode.BaseNodeViewHolder) object;
            node.setViewHolder(viewHolder);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    if (viewHolder.getContainerStyle() <= 0) {
        viewHolder.setContainerStyle(containerStyle);
    }
    return viewHolder;
}
 
开发者ID:ErNaveen,项目名称:TreeView_in_Android,代码行数:17,代码来源:AndroidTreeView.java

示例6: addNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void addNode(ViewGroup container, final TreeNode n) {
    final TreeNode.BaseNodeViewHolder viewHolder = getViewHolderForNode(n);
    final View nodeView = viewHolder.getView();
    container.addView(nodeView);
    if (mSelectionModeEnabled) {
        viewHolder.toggleSelectionMode(mSelectionModeEnabled);
    }

    nodeView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (n.getClickListener() != null) {
                n.getClickListener().onClick(n, n.getValue());
            } else if (nodeClickListener != null) {
                nodeClickListener.onClick(n, n.getValue());
            }
            if (enableAutoToggle) {
                toggleNode(n);
            }
        }
    });

    nodeView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View view) {
            if (n.getLongClickListener() != null) {
                return n.getLongClickListener().onLongClick(n, n.getValue());
            } else if (nodeLongClickListener != null) {
                return nodeLongClickListener.onLongClick(n, n.getValue());
            }
            if (enableAutoToggle) {
                toggleNode(n);
            }
            return false;
        }
    });
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:38,代码来源:AndroidTreeView.java

示例7: removeNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void removeNode(TreeNode node) {
    if (node.getParent() != null) {
        TreeNode parent = node.getParent();
        int index = parent.deleteChild(node);
        if (parent.isExpanded() && index >= 0) {
            final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(parent);
            parentViewHolder.getNodeItemsView().removeViewAt(index);
        }
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:11,代码来源:AndroidTreeView.java

示例8: addNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void addNode(ViewGroup container, final TreeNode n) {
    final TreeNode.BaseNodeViewHolder viewHolder = getViewHolderForNode(n);
    final View nodeView = viewHolder.getView();
    container.addView(nodeView);
    if (mSelectionModeEnabled) {
        viewHolder.toggleSelectionMode(mSelectionModeEnabled);
    }

    nodeView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (n.getClickListener() != null) {
                n.getClickListener().onClick(n, n.getValue());
            } else if (nodeClickListener != null) {
                nodeClickListener.onClick(n, n.getValue());
            }
            toggleNode(n);
        }
    });

    nodeView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View view) {
            if (n.getLongClickListener() != null) {
                return n.getLongClickListener().onLongClick(n, n.getValue());
            } else if (nodeLongClickListener != null) {
                return nodeLongClickListener.onLongClick(n, n.getValue());
            }
            return false;
        }
    });
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:33,代码来源:AndroidTreeView.java

示例9: collapseNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void collapseNode(TreeNode node, final boolean includeSubnodes) {
    node.setExpanded(false);
    TreeNode.BaseNodeViewHolder nodeViewHolder = getViewHolderForNode(node);
    nodeViewHolder.getNodeItemsView().setVisibility(View.GONE);
    nodeViewHolder.toggle(false);
    if (includeSubnodes) {
        for (TreeNode n : node.getChildren()) {
            collapseNode(n, includeSubnodes);
        }
    }
}
 
开发者ID:ErNaveen,项目名称:TreeView_in_Android,代码行数:12,代码来源:AndroidTreeView.java

示例10: expandNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandNode(final TreeNode node, boolean includeSubnodes) {
    if (node.size() == 0) {
        return;
    }
    node.setExpanded(true);
    final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
    parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
    parentViewHolder.toggle(true);

    for (final TreeNode n : node.getChildren()) {
        if (!parentViewHolder.childrenInitialized()) {
            final TreeNode.BaseNodeViewHolder viewHolder = getViewHolderForNode(n);
            final View nodeView = viewHolder.getView();
            parentViewHolder.getNodeItemsView().addView(nodeView);
            if (mSelectionModeEnabled) {
                viewHolder.toggleSelectionMode(mSelectionModeEnabled);
            }

            nodeView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    toggleNode(n);
                    if (n.getClickListener() != null) {
                        n.getClickListener().onClick(n, n.getValue());
                    } else if (nodeClickListener != null) {
                        nodeClickListener.onClick(n, n.getValue());
                    }
                }
            });
        }

        if (n.isExpanded() || includeSubnodes) {
            expandNode(n, includeSubnodes);
        }

    }
}
 
开发者ID:ErNaveen,项目名称:TreeView_in_Android,代码行数:38,代码来源:AndroidTreeView.java

示例11: setDefaultViewHolder

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void setDefaultViewHolder(Class<? extends TreeNode.BaseNodeViewHolder> viewHolder) {
    defaultViewHolderClass = viewHolder;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:4,代码来源:AndroidTreeView.java

示例12: toogleSelectionForNode

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void toogleSelectionForNode(TreeNode node, boolean makeSelectable) {
    TreeNode.BaseNodeViewHolder holder = getViewHolderForNode(node);
    if (holder.isInitialized()) {
        getViewHolderForNode(node).toggleSelectionMode(makeSelectable);
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:7,代码来源:AndroidTreeView.java


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