Package 

Class AsyncListUtil.ViewCallback

    • Method Summary

      Modifier and Type Method Description
      abstract void getItemRangeInto(@NonNull() Array<int> outRange) Compute the range of visible item positions.
      void extendRangeInto(@NonNull() Array<int> range, @NonNull() Array<int> outRange, int scrollHint) Compute a wider range of items that will be loaded for smoother scrolling.
      abstract void onDataRefresh() Called when the entire data set has changed.
      abstract void onItemLoaded(int position) Called when an item at the given position is loaded.
      • Methods inherited from class java.lang.Object

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

      • getItemRangeInto

        @UiThread() abstract void getItemRangeInto(@NonNull() Array<int> outRange)

        Compute the range of visible item positions.

        outRange[0] is the position of the first visible item (in the order of the backingstorage).

        outRange[1] is the position of the last visible item (in the order of the backingstorage).

        Negative positions and positions greater or equal to getItemCount are invalid.If the returned range contains invalid positions it is ignored (no item will be loaded).

        Parameters:
        outRange - The visible item range.
      • extendRangeInto

        @UiThread() void extendRangeInto(@NonNull() Array<int> range, @NonNull() Array<int> outRange, int scrollHint)

        Compute a wider range of items that will be loaded for smoother scrolling.

        If there is no scroll hint, the default implementation extends the visible range by halfits length in both directions. If there is a scroll hint, the range is extended byits full length in the scroll direction, and by half in the other direction.

        For example, if range is {100, 200} and scrollHintis HINT_SCROLL_ASC, then outRange will be {50, 300}.

        However, if scrollHint is HINT_SCROLL_NONE, thenoutRange will be {50, 250}

        Parameters:
        range - Visible item range.
        outRange - Extended range.
        scrollHint - The scroll direction hint.
      • onItemLoaded

        @UiThread() abstract void onItemLoaded(int position)

        Called when an item at the given position is loaded.

        Parameters:
        position - Item position.