use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class PlaceHolderHolder method createNodeView.
@Override
public View createNodeView(TreeNode node, PlaceItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_place_node, null, false);
TextView placeName = (TextView) view.findViewById(R.id.place_name);
placeName.setText(value.name);
Random r = new Random();
boolean like = r.nextBoolean();
PrintView likeView = (PrintView) view.findViewById(R.id.like);
likeView.setIconText(context.getString(like ? R.string.ic_thumbs_up : R.string.ic_thumbs_down));
return view;
}
use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class ProfileHolder method createNodeView.
@Override
public View createNodeView(TreeNode node, IconTreeItemHolder.IconTreeItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_profile_node, null, false);
TextView tvValue = (TextView) view.findViewById(R.id.node_value);
tvValue.setText(value.text);
final PrintView iconView = (PrintView) view.findViewById(R.id.icon);
iconView.setIconText(context.getResources().getString(value.icon));
return view;
}
use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class IconTreeItemHolder method createNodeView.
@Override
public View createNodeView(final TreeNode node, IconTreeItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_icon_node, null, false);
tvValue = (TextView) view.findViewById(R.id.node_value);
tvValue.setText(value.text);
final PrintView iconView = (PrintView) view.findViewById(R.id.icon);
iconView.setIconText(context.getResources().getString(value.icon));
arrowView = (PrintView) view.findViewById(R.id.arrow_icon);
view.findViewById(R.id.btn_addFolder).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TreeNode newFolder = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "New Folder"));
getTreeView().addNode(node, newFolder);
}
});
view.findViewById(R.id.btn_delete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getTreeView().removeNode(node);
}
});
// if My computer
if (node.getLevel() == 1) {
view.findViewById(R.id.btn_delete).setVisibility(View.GONE);
}
return view;
}
Aggregations