Package 

Class DiffCallback

  • All Implemented Interfaces:

    
    public abstract class DiffCallback<Value extends Object>
    
                        

    Callback that informs ArrayAnyAdapter how to compute list updates when using android.support.v7.util.DiffUtil in ArrayAnyAdapter.setItems method.

    The ArrayAnyAdapter.setItems method will pass items from different lists to this callback in order to implement the android.support.v7.util.DiffUtil.Callback it uses to compute differences between lists.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      DiffCallback()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Boolean areItemsTheSame(Value oldItem, Value newItem) Called to decide whether two objects represent the same item.
      abstract Boolean areContentsTheSame(Value oldItem, Value newItem) Called to decide whether two items have the same data.
      Object getChangePayload(Value oldItem, Value newItem) Called to get a change payload between an old and new version of an item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DiffCallback

        DiffCallback()
    • Method Detail

      • areItemsTheSame

         abstract Boolean areItemsTheSame(Value oldItem, Value newItem)

        Called to decide whether two objects represent the same item.

        Parameters:
        oldItem - The item in the old list.
        newItem - The item in the new list.
      • areContentsTheSame

         abstract Boolean areContentsTheSame(Value oldItem, Value newItem)

        Called to decide whether two items have the same data. This information is used to detect if the contents of an item have changed.

        Parameters:
        oldItem - The item in the old list.
        newItem - The item in the new list.