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
    Constructor
    Description
    TreeViewHolder(View itemView)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Bind method that provide padding and bind TreeNode to the view list item
    int
    Return the current TreeNode padding value
    void
    setNodePadding(int padding)
    Modify the current node padding value

    Methods inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder

    getAbsoluteAdapterPosition, getAdapterPosition, getBindingAdapter, getBindingAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TreeViewHolder

      public TreeViewHolder(@NonNull View itemView)
  • Method Details

    • bindTreeNode

      public void bindTreeNode(TreeNode node)
      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