@Retention(value=RUNTIME) public @interface OnDataBound
SectionTree.Target
of the SectionTree
. In the classic case where the Ui for the Section is represented by a RecyclerView, this
means that by the time OnDataBound is called the RecyclerView has visibility over the data
contained in this section.
For example:
@GroupSectionSpec
public class MyGroupSectionSpec {
OnDataBound
protected void onDataBound(
SectionContext c,
Service service, // If any
@Prop List<? extends Edge>
edges,
@Prop RecyclerCollectionEventsController recyclerController,
@State(canUpdateLazily = true) boolean didScrollOnce) {
if (!didScrollOnce) {
recyclerController.requestScrollToPosition(10, true);
MyGroupSectionSpec.lazyUpdateDidScrollOnce(c, true);
} if (shouldTakeAction(edges)) {
service.doSomething();
}
}
}