本文整理汇总了Java中com.unnamed.b.atv.model.TreeNode.setExpanded方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.setExpanded方法的具体用法?Java TreeNode.setExpanded怎么用?Java TreeNode.setExpanded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.unnamed.b.atv.model.TreeNode
的用法示例。
在下文中一共展示了TreeNode.setExpanded方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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);
}
}
示例3: 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);
}
}
示例4: fromCommentNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public TreeNode fromCommentNode(CommentNode node)
{
TreeNode myNode = new TreeNode(node);
myNode.setExpanded(true);
myNode.setViewHolder(new CommentNodeViewHolder(this.context));
List<CommentNode> children = node.getChildren();
for (CommentNode child : children) {
myNode.addChild(this.fromCommentNode(child));
}
return myNode;
}
示例5: 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);
}
}
}
示例6: 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);
}
}
}
示例7: showCerts
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的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
}
}