public @interface OnViewportChanged
Section
scrolls to a new position.
See communicating-with-the-ui for details.
Example:
@DiffSectionSpec
public class MyChangeSetSpec {
@OnViewportChanged
protected void onViewportChanged(
SectionContext c,
int firstVisiblePosition,
int lastVisiblePosition,
int totalCount, // the total count of items this ListComponent is displaying in the list
int firstFullyVisibleIndex,
int lastFullyVisibleIndex,
Service service) { // If any
if (something(firstVisiblePosition, lastVisiblePosition, totalCount) {
service.doSomething();
}
}
}
This lifecycle method will only be called if either firstVisiblePosition or lastVisiblePosition have changed in response to a scroll event.
GroupSectionSpec
,
DiffSectionSpec