use of com.unnamed.b.atv.model.TreeNode in project AndroidTreeView by bmelnychuk.
the class SelectableTreeFragment method fillFolder.
private void fillFolder(TreeNode folder) {
TreeNode file1 = new TreeNode("File1").setViewHolder(new SelectableItemHolder(getActivity()));
TreeNode file2 = new TreeNode("File2").setViewHolder(new SelectableItemHolder(getActivity()));
TreeNode file3 = new TreeNode("File3").setViewHolder(new SelectableItemHolder(getActivity()));
folder.addChildren(file1, file2, file3);
}
use of com.unnamed.b.atv.model.TreeNode in project AndroidTreeView by bmelnychuk.
the class TwoDScrollingArrowExpandFragment method fillFolder.
private void fillFolder(TreeNode folder) {
TreeNode currentNode = folder;
for (int i = 0; i < 4; i++) {
TreeNode file = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, NAME + " " + i));
currentNode.addChild(file);
currentNode = file;
}
}
use of com.unnamed.b.atv.model.TreeNode 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;
}
use of com.unnamed.b.atv.model.TreeNode in project AndroidTreeView by bmelnychuk.
the class TwoDScrollingFragment method fillFolder.
private void fillFolder(TreeNode folder) {
TreeNode currentNode = folder;
for (int i = 0; i < 10; i++) {
TreeNode file = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, NAME)).setViewHolder(new SelectableHeaderHolder(getActivity()));
currentNode.addChild(file);
currentNode = file;
}
}
use of com.unnamed.b.atv.model.TreeNode in project AndroidTreeView by bmelnychuk.
the class TwoDScrollingFragment 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 SelectableHeaderHolder(getActivity()));
TreeNode s2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Another folder with very long name")).setViewHolder(new SelectableHeaderHolder(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);
containerView.addView(tView.getView());
tView.expandAll();
if (savedInstanceState != null) {
String state = savedInstanceState.getString("tState");
if (!TextUtils.isEmpty(state)) {
tView.restoreState(state);
}
}
return rootView;
}
Aggregations