State
Contains useful information about the current RecyclerView state like target scroll position or view focus. State object can also keep arbitrary data, identified by resource ids.
Often times, RecyclerView components will need to pass information between each other. To provide a well defined data bus between components, RecyclerView passes the same State object to component callbacks and these components can use it to exchange data.
If you implement custom components, you can use State's put/get/remove methods to pass data between your components without needing to manage their lifecycles.
Functions
Link copied to clipboard
Link copied to clipboard
Returns the total number of items that can be laid out.
Link copied to clipboard
Returns remaining horizontal scroll distance of an ongoing scroll animation(fling/ smoothScrollTo/SmoothScroller) in pixels.
Link copied to clipboard
Returns remaining vertical scroll distance of an ongoing scroll animation(fling/ smoothScrollTo/SmoothScroller) in pixels.
Link copied to clipboard
If scroll is triggered to make a certain item visible, this value will return the adapter index of that item.
Link copied to clipboard
Returns if current scroll has a target position.
Link copied to clipboard
Returns true if the RecyclerView is currently measuring the layout.
Link copied to clipboard
Returns true if the RecyclerView is in the pre-layout step where it is having its LayoutManager layout items where they will be at the beginning of a set of predictive item animations.
Link copied to clipboard
Returns whether RecyclerView will run predictive animations in this layout pass or not.
Link copied to clipboard
Returns whether RecyclerView will run simple animations in this layout pass or not.