Package com.amrdeveloper.treeview
Class TreeViewHolder
java.lang.Object
androidx.recyclerview.widget.RecyclerView.ViewHolder
com.amrdeveloper.treeview.TreeViewHolder
public class TreeViewHolder
extends androidx.recyclerview.widget.RecyclerView.ViewHolder
Default RecyclerView.ViewHolder for the TreeView the default behaviour is to manage the padding,
user should create custom one for each different layout and override bindTreeNode
-
Field Summary
Fields inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder
itemView -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindTreeNode(TreeNode node) Bind method that provide padding and bind TreeNode to the view list itemintReturn the current TreeNode padding valuevoidsetNodePadding(int padding) Modify the current node padding valueMethods inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder
getAbsoluteAdapterPosition, getAdapterPosition, getBindingAdapter, getBindingAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString
-
Constructor Details
-
TreeViewHolder
-
-
Method Details
-
bindTreeNode
Bind method that provide padding and bind TreeNode to the view list item- Parameters:
node- the current TreeNode
-
setNodePadding
public void setNodePadding(int padding) Modify the current node padding value- Parameters:
padding- the new padding value
-
getNodePadding
public int getNodePadding()Return the current TreeNode padding value- Returns:
- The current padding value
-