lightbulb_outline Please take our October 2018 developer survey. Start survey

belongs to Maven artifact androidx.car:car:1.0.0-alpha5

PagedListView.ItemCap

public static interface PagedListView.ItemCap

androidx.car.widget.PagedListView.ItemCap


Interface for a RecyclerView.Adapter to cap the number of items.

NOTE: it is still up to the adapter to use maxItems in RecyclerView.Adapter.getItemCount().

the recommended way would be with:

{@literal@}Override
 public int getItemCount() {
   return Math.min(super.getItemCount(), mMaxItems);
 }
 

Summary

Constants

int UNLIMITED

A value to pass to setMaxItems(int) that indicates there should be no limit.

Public methods

abstract void setMaxItems(int maxItems)

Sets the maximum number of items available in the adapter.

Constants

UNLIMITED

public static final int UNLIMITED

A value to pass to setMaxItems(int) that indicates there should be no limit.

Constant Value: -1 (0xffffffff)

Public methods

setMaxItems

public abstract void setMaxItems (int maxItems)

Sets the maximum number of items available in the adapter. A value less than '0' means the list should not be capped.

Parameters
maxItems int