use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class ArrowExpandSelectableHeaderHolder method createNodeView.
@Override
public View createNodeView(final TreeNode node, IconTreeItemHolder.IconTreeItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_selectable_header, 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);
arrowView.setPadding(20, 10, 10, 10);
if (node.isLeaf()) {
arrowView.setVisibility(View.GONE);
}
arrowView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
tView.toggleNode(node);
}
});
nodeSelector = (CheckBox) view.findViewById(R.id.node_selector);
nodeSelector.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
node.setSelected(isChecked);
for (TreeNode n : node.getChildren()) {
getTreeView().selectNode(n, isChecked);
}
}
});
nodeSelector.setChecked(node.isSelected());
return view;
}
use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class HeaderHolder 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_header_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));
arrowView = (PrintView) view.findViewById(R.id.arrow_icon);
if (node.isLeaf()) {
arrowView.setVisibility(View.INVISIBLE);
}
return view;
}
use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class SelectableHeaderHolder method createNodeView.
@Override
public View createNodeView(final TreeNode node, IconTreeItemHolder.IconTreeItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_selectable_header, 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);
if (node.isLeaf()) {
arrowView.setVisibility(View.GONE);
}
nodeSelector = (CheckBox) view.findViewById(R.id.node_selector);
nodeSelector.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
node.setSelected(isChecked);
for (TreeNode n : node.getChildren()) {
getTreeView().selectNode(n, isChecked);
}
}
});
nodeSelector.setChecked(node.isSelected());
return view;
}
use of com.github.johnkil.print.PrintView in project AndroidTreeView by bmelnychuk.
the class SocialViewHolder method createNodeView.
@Override
public View createNodeView(TreeNode node, SocialItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_social_node, null, false);
final PrintView iconView = (PrintView) view.findViewById(R.id.icon);
iconView.setIconText(context.getResources().getString(value.icon));
TextView connectionsLabel = (TextView) view.findViewById(R.id.connections);
Random r = new Random();
connectionsLabel.setText(r.nextInt(150) + " connections");
TextView userNameLabel = (TextView) view.findViewById(R.id.username);
userNameLabel.setText(NAMES[r.nextInt(4)]);
TextView sizeText = (TextView) view.findViewById(R.id.size);
sizeText.setText(r.nextInt(10) + " items");
return view;
}
use of com.github.johnkil.print.PrintView in project Print by johnkil.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final PrintView iconView = (PrintView) findViewById(R.id.icon);
final TextView sizeValue = (TextView) findViewById(R.id.size_value);
SeekBar sizeBar = (SeekBar) findViewById(R.id.size_bar);
sizeBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
sizeValue.setText(getString(R.string.size_format, progress));
iconView.setIconSizeDp(progress);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
sizeBar.setProgress(320);
// enable states for icon.
iconView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// on click process
}
});
}
Aggregations