Search in sources :

Example 1 with SocialViewHolder

use of com.unnamed.b.atv.sample.holder.SocialViewHolder in project AndroidTreeView by bmelnychuk.

the class CustomViewHolderFragment method addProfileData.

private void addProfileData(TreeNode profile) {
    TreeNode socialNetworks = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_people, "Social")).setViewHolder(new HeaderHolder(getActivity()));
    TreeNode places = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_place, "Places")).setViewHolder(new HeaderHolder(getActivity()));
    TreeNode facebook = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_facebook)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode linkedin = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_linkedin)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode google = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_gplus)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode twitter = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_twitter)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode lake = new TreeNode(new PlaceHolderHolder.PlaceItem("A rose garden")).setViewHolder(new PlaceHolderHolder(getActivity()));
    TreeNode mountains = new TreeNode(new PlaceHolderHolder.PlaceItem("The white house")).setViewHolder(new PlaceHolderHolder(getActivity()));
    places.addChildren(lake, mountains);
    socialNetworks.addChildren(facebook, google, twitter, linkedin);
    profile.addChildren(socialNetworks, places);
}
Also used : HeaderHolder(com.unnamed.b.atv.sample.holder.HeaderHolder) TreeNode(com.unnamed.b.atv.model.TreeNode) PlaceHolderHolder(com.unnamed.b.atv.sample.holder.PlaceHolderHolder) SocialViewHolder(com.unnamed.b.atv.sample.holder.SocialViewHolder)

Aggregations

TreeNode (com.unnamed.b.atv.model.TreeNode)1 HeaderHolder (com.unnamed.b.atv.sample.holder.HeaderHolder)1 PlaceHolderHolder (com.unnamed.b.atv.sample.holder.PlaceHolderHolder)1 SocialViewHolder (com.unnamed.b.atv.sample.holder.SocialViewHolder)1