Class DynamicSimpleBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>

Type Parameters:
VB - The type of the dynamic recycler view binder.
Direct Known Subclasses:
DynamicItemsAdapter, SimpleDataBinderAdapter

public abstract class DynamicSimpleBinderAdapter<VB extends DynamicRecyclerViewBinder<?>> extends DynamicBinderAdapter<VB>
A simple recycler view adapter to implement the DynamicBinderAdapter and DynamicRecyclerViewBinder.
  • Constructor Details

    • DynamicSimpleBinderAdapter

      public DynamicSimpleBinderAdapter()
  • Method Details

    • getItemCount

      public int getItemCount()
      Specified by:
      getItemCount in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
    • getItemViewType

      public int getItemViewType(int position)
      Specified by:
      getItemViewType in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
    • getDataBinder

      public VB getDataBinder(int viewType)
      Description copied from class: DynamicBinderAdapter
      Get data binder according to the view type.
      Specified by:
      getDataBinder in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      viewType - The view type constant to get the data binder.
      Returns:
      The data binder associated with this view type.
      See Also:
    • getPosition

      public int getPosition(@NonNull VB binder, int position)
      Description copied from class: DynamicBinderAdapter
      Get the position of a data binder item inside the recycler view.
      Specified by:
      getPosition in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      binder - The data binder inside the recycler view.
      position - The position of the data binder item.
      Returns:
      The position of the data binder item inside the recycler view.
    • getBinderPosition

      public int getBinderPosition(int position)
      Description copied from class: DynamicBinderAdapter
      Get the position of a data binder inside the recycler view.
      Specified by:
      getBinderPosition in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      position - The position of the data binder.
      Returns:
      The position of the data binder inside the recycler view.
    • notifyBinderItemRangeChanged

      public void notifyBinderItemRangeChanged(@NonNull VB binder, int position, int itemCount)
      Description copied from class: DynamicBinderAdapter
      This method will be called when the item range of a data binder has been changed.
      Specified by:
      notifyBinderItemRangeChanged in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      binder - The data binder inside the recycler view.
      position - The position at which the first item has been changed.
      itemCount - Total no. of items have been changed.
    • notifyBinderItemRangeInserted

      public void notifyBinderItemRangeInserted(@NonNull VB binder, int position, int itemCount)
      Description copied from class: DynamicBinderAdapter
      This method will be called when a set of items have been inserted in a data binder.
      Specified by:
      notifyBinderItemRangeInserted in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      binder - The data binder inside the recycler view.
      position - The position at which the first item has been inserted.
      itemCount - Total no. of items have been inserted.
    • notifyBinderItemRangeRemoved

      public void notifyBinderItemRangeRemoved(@NonNull VB binder, int position, int itemCount)
      Description copied from class: DynamicBinderAdapter
      This method will be called when a set of items have been removed in a data binder.
      Specified by:
      notifyBinderItemRangeRemoved in class DynamicBinderAdapter<VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      binder - The data binder inside the recycler view.
      position - The position at which the first item has been removed.
      itemCount - Total no. of items have been removed.
    • getBinderList

      public List<VB> getBinderList()
      Get the list of data binders displayed by this adapter.
      Returns:
      The list of data binders displayed by this adapter.
    • addDataBinder

      public void addDataBinder(@NonNull VB binder)
      Add data binder to display in this adapter.
      Parameters:
      binder - The data binder to be added in this adapter
    • addDataBinders

      public void addDataBinders(@NonNull Collection<VB> binders)
      Add data binders to display in this adapter.
      Parameters:
      binders - The array of dynamic data binders to be added in this adapter.
    • addDataBinders

      @SafeVarargs public final void addDataBinders(@NonNull VB... binders)
      Add data binders to display in this adapter.
      Parameters:
      binders - The array of dynamic data binders to be added in this adapter.