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


Java TreeNode.setViewHolder方法代码示例

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


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

示例1: addGpxFile

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void addGpxFile(File file, MapsManager manager) {
    try {
        TreeNode gpxRoot = GpxUtils.gpxFile2TreeNode(file);
        gpxRoot.setViewHolder(new GpxHolder(mContext, manager));

        treeView.addNode(root, gpxRoot);

        for (TreeNode node : gpxRoot.getChildren()) {
            node.setViewHolder(new GpxHolder(mContext, manager));
            for (TreeNode n : node.getChildren()) {
                n.setViewHolder(new GpxHolder(mContext, manager));
            }
        }

    } catch (Exception e) {
        Log.d(TAG, "Fail to load GPX file " + file.getName());
    }
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:19,代码来源:GpxManager.java

示例2: addKmlFile

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void addKmlFile(File file, MapsManager manager) {
    try {
        // TODO temporary method to deal with kml file
        GpxHolder.GpxTreeItem.Builder kml_builder = new GpxHolder.GpxTreeItem.Builder();
        InputStream kmlStream = new FileInputStream(file);
        TreeNode kmlRoot = new TreeNode(kml_builder
                .setType(GpxHolder.ITEM_TYPE_KML)
                .setIcon(GpxHolder.ITEM_ICON_GPX)
                .setName(file.getName())
                .setPath(file.getPath())
                .setKmllayer(new KmlLayer(manager.getCurrentMap(), kmlStream, mContext))
                .build());
        kmlRoot.setViewHolder(new GpxHolder(mContext, manager));

        treeView.addNode(root, kmlRoot);

    } catch (Exception e) {
        Log.d(TAG, "Fail to load GPX file " + file.getName());
    }
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:21,代码来源:GpxManager.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: 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

示例5: 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;
}
 
开发者ID:AlbinoDrought,项目名称:party-reader,代码行数:16,代码来源:CommentTreeNodeAdapter.java

示例6: fromSubmission

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public TreeNode fromSubmission(Submission submission)
{
    TreeNode rootNode = new TreeNode(null);

    TreeNode postNode = new TreeNode(submission);

    postNode.setViewHolder(new SubmissionNodeViewHolder(this.context));

    rootNode.addChild(postNode);

    List<CommentNode> comments = submission.getComments().getChildren();

    for (CommentNode comment : comments) {
        rootNode.addChild(this.commentTreeNodeAdapter.fromCommentNode(comment));
    }

    return rootNode;
}
 
开发者ID:AlbinoDrought,项目名称:party-reader,代码行数:19,代码来源:SubmissionTreeNodeAdapter.java


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