Interface BaseChangeEventListener<S,​E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onChildChanged​(ChangeEventType type, S snapshot, int newIndex, int oldIndex)
      A callback for when a child event occurs.
      void onDataChanged()
      Callback triggered after all child events in a particular snapshot have been processed.
      void onError​(E e)
      Callback when an error has been detected in the underlying listener.
    • Method Detail

      • onChildChanged

        void onChildChanged​(@NonNull
                            ChangeEventType type,
                            @NonNull
                            S snapshot,
                            int newIndex,
                            int oldIndex)
        A callback for when a child event occurs.
        Parameters:
        type - The type of the event.
        snapshot - The snapshot of the changed child.
        newIndex - The new index of the element, or -1 of it is no longer present
        oldIndex - The previous index of the element, or -1 if it was not previously tracked.
      • onDataChanged

        void onDataChanged()
        Callback triggered after all child events in a particular snapshot have been processed.

        Useful for batch events, such as removing a loading indicator after initial load or a large update batch.

      • onError

        void onError​(@NonNull
                     E e)
        Callback when an error has been detected in the underlying listener.
        Parameters:
        e - the error that occurred.