Search in sources :

Example 6 with PrintView

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;
}
Also used : Random(java.util.Random) PrintView(com.github.johnkil.print.PrintView) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) PrintView(com.github.johnkil.print.PrintView) View(android.view.View)

Example 7 with PrintView

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;
}
Also used : PrintView(com.github.johnkil.print.PrintView) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) PrintView(com.github.johnkil.print.PrintView) View(android.view.View)

Example 8 with PrintView

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;
}
Also used : PrintView(com.github.johnkil.print.PrintView) TreeNode(com.unnamed.b.atv.model.TreeNode) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) PrintView(com.github.johnkil.print.PrintView) View(android.view.View)

Aggregations

View (android.view.View)8 TextView (android.widget.TextView)8 PrintView (com.github.johnkil.print.PrintView)8 LayoutInflater (android.view.LayoutInflater)7 TreeNode (com.unnamed.b.atv.model.TreeNode)3 CompoundButton (android.widget.CompoundButton)2 Random (java.util.Random)2 SeekBar (android.widget.SeekBar)1