public static interface RepositoryPresenterCompilerStates.RPMain<T> extends RepositoryPresenterCompilerStates.RPItemCompile<T>, RepositoryPresenterCompilerStates.RPDiff<T,RepositoryPresenterCompilerStates.RPMain<T>>
Repository item to the view inflated by the
layout.| Modifier and Type | Method and Description |
|---|---|
<TCol> RepositoryPresenterCompilerStates.RPTypedCollectionCompile<T,TCol> |
bindCollectionWith(com.google.android.agera.Binder<TCol,android.view.View> collectionBinder)
Specifies a
Binder to bind the whole collection (the repository value) to an inflated
item view. |
RepositoryPresenterCompilerStates.RPMain<T> |
bindWith(com.google.android.agera.Binder<T,android.view.View> viewBinder)
Specifies a
Binder to bind a single item in the Repository to an inflated
View. |
<TCol> RepositoryPresenter<TCol> |
forCollection(com.google.android.agera.Function<TCol,java.util.List<T>> converter)
Creates a
RepositoryPresenter for a Repository of a type that can be
converted to a List of items using the converter. |
RepositoryPresenter<java.util.List<T>> |
forList()
Creates a
RepositoryPresenter for a Repository of a List where each
item in the List will be bound to the RecyclerView. |
RepositoryPresenter<com.google.android.agera.Result<java.util.List<T>>> |
forResultList()
Creates a
RepositoryPresenter for a Repository of a Result containing
a List where each item in the List will be bound to the RecyclerView. |
RepositoryPresenterCompilerStates.RPMain<T> |
recycleWith(com.google.android.agera.Receiver<android.view.View> recycler)
Specifies a
Receiver to recycle the View. |
RepositoryPresenterCompilerStates.RPItemCompile<T> |
stableId(long stableId)
Specifies a
stableId for the given item. |
RepositoryPresenterCompilerStates.RPMain<T> |
stableIdForItem(com.google.android.agera.Function<? super T,java.lang.Long> stableIdForItem)
Specifies a
Function providing a stable id for the given item. |
diff, forItem, forResultdiffWith@NonNull RepositoryPresenterCompilerStates.RPMain<T> bindWith(@NonNull com.google.android.agera.Binder<T,android.view.View> viewBinder)
Binder to bind a single item in the Repository to an inflated
View.@NonNull RepositoryPresenterCompilerStates.RPMain<T> recycleWith(@NonNull com.google.android.agera.Receiver<android.view.View> recycler)
Receiver to recycle the View.@NonNull RepositoryPresenterCompilerStates.RPMain<T> stableIdForItem(@NonNull com.google.android.agera.Function<? super T,java.lang.Long> stableIdForItem)
Function providing a stable id for the given item. Called only if stable
IDs are enabled with RecyclerView.Adapter.setHasStableIds(boolean), and therefore this method is
optional with a default implementation of returning RecyclerView.NO_ID. If stable IDs
are enabled, the returned ID and the layout returned by
RepositoryPresenterCompilerStates.RPLayout.layoutForItem(Function) or RepositoryPresenterCompilerStates.RPLayout.layout(int) for the given item
should together uniquely identify this item in the whole RecyclerView throughout all
changes.@NonNull RepositoryPresenterCompilerStates.RPItemCompile<T> stableId(long stableId)
stableId for the given item. Called only if stable IDs are enabled with
RecyclerView.Adapter.setHasStableIds(boolean), and therefore this method is optional with a
default implementation of returning RecyclerView.NO_ID. If stable IDs are enabled,
the returned ID and the layout returned by RepositoryPresenterCompilerStates.RPLayout.layoutForItem(Function) or
RepositoryPresenterCompilerStates.RPLayout.layout(int) for the given item should together uniquely identify this item
in the whole RecyclerView throughout all changes.@NonNull <TCol> RepositoryPresenterCompilerStates.RPTypedCollectionCompile<T,TCol> bindCollectionWith(@NonNull com.google.android.agera.Binder<TCol,android.view.View> collectionBinder)
Binder to bind the whole collection (the repository value) to an inflated
item view. This binder will be called before the item binder specified with
bindWith(com.google.android.agera.Binder<T, android.view.View>), and called for each item view. This is useful for cases where the
collection object contains useful information for binding items, which is not copied to the
individual item objects.@NonNull RepositoryPresenter<java.util.List<T>> forList()
RepositoryPresenter for a Repository of a List where each
item in the List will be bound to the RecyclerView.@NonNull RepositoryPresenter<com.google.android.agera.Result<java.util.List<T>>> forResultList()
RepositoryPresenter for a Repository of a Result containing
a List where each item in the List will be bound to the RecyclerView.@NonNull <TCol> RepositoryPresenter<TCol> forCollection(@NonNull com.google.android.agera.Function<TCol,java.util.List<T>> converter)
RepositoryPresenter for a Repository of a type that can be
converted to a List of items using the converter.