In Elements, the adapter is final and can’t be extended, as you would typically do with other list management library. The adapter acts as an orchestrator of the different, modular components that will be involved in displaying the list items.
Describing what the adapter does will be helpful to introduce these components and for you to understand what the library can do. The adapter responsibilities are:
Presenter
s: for example, dispatches elements to the correct presenter [docs]Source
s: for example, creates a dependency tree among them, throwing in case of circular dependencies [docs]Page
s: for example, if pageSizeHint
is specified, the adapter will automatically open a new page when the pageSizeHint
-th element has been requested for the current page [docs]Element
s: for example, finds the correct presenter, and orders them based on the source behavior.DiffUtil
, like the Paging library does.As a side feature, the adapter will install an Animator
as default item animator for your RecyclerView
.
See Animations for more informations.