Package 

Class AsyncListUtil.DataCallback

    • Method Summary

      Modifier and Type Method Description
      abstract int refreshData() Refresh the data set and return the new data item count.
      abstract void fillData(@NonNull() Array<T> data, int startPosition, int itemCount) Fill the given tile.
      void recycleData(@NonNull() Array<T> data, int itemCount) Recycle the objects created in fillData if necessary.
      int getMaxCachedTiles() Returns tile cache size limit (in tiles).
      • Methods inherited from class java.lang.Object

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

      • fillData

        @WorkerThread() abstract void fillData(@NonNull() Array<T> data, int startPosition, int itemCount)

        Fill the given tile.

        The provided tile might be a recycled tile, in which case it will already have objects.It is suggested to re-use these objects if possible in your use case.

        Parameters:
        data - The data item array to fill into.
        startPosition - The start position in the list.
        itemCount - The data item count.
      • getMaxCachedTiles

        @WorkerThread() int getMaxCachedTiles()

        Returns tile cache size limit (in tiles).

        The actual number of cached tiles will be the maximum of this value and the number oftiles that is required to cover the range returned by extendRangeInto.

        For example, if this method returns 10, and the mostrecent call to extendRangeInto returned {100, 179}, and the tile size is 5, then the maximum number of cached tiles will be 16.

        However, if the tile size is 20, then the maximum number of cached tiles will be 10.

        The default implementation returns 10.