use of com.unnamed.b.atv.sample.holder.ArrowExpandSelectableHeaderHolder in project AndroidTreeView by bmelnychuk.
the class TwoDScrollingArrowExpandFragment method onCreateView.
@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;
}
Aggregations