public class TableHeaderCollapseOnScrollListener extends java.lang.Object implements OnScrollListener
OnScrollListener that will collapse/show the header of a TableView on scroll.OnScrollListener.ScrollState| Constructor and Description |
|---|
TableHeaderCollapseOnScrollListener(TableView tableView)
Creates a new
TableHeaderCollapseOnScrollListener for the given TableView. |
| Modifier and Type | Method and Description |
|---|---|
void |
onScroll(android.widget.ListView tableDataView,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount)
Callback method to be invoked when the list or grid has been scrolled.
|
void |
onScrollStateChanged(android.widget.ListView tableDateView,
OnScrollListener.ScrollState scrollState)
Callback method to be invoked while the table data view is being scrolled.
|
void |
setAnimationDuration(int animationDuration)
Sets the animation duration for the collapsing/showing of the header.
|
void |
setRowOffset(int rowOffset)
Sets the scroll offset of rows after which the header shall be collapsed/shown.
|
public TableHeaderCollapseOnScrollListener(TableView tableView)
TableHeaderCollapseOnScrollListener for the given TableView.tableView - The TableView that contains the header that shall be collapsed/shown on scroll.public void setAnimationDuration(int animationDuration)
animationDuration - The animation duration for the collapsing/showing the header. To disable the animation
just set this param to 0.public void setRowOffset(int rowOffset)
rowOffset - The scroll offset of rows after which the header shall be collapsed/shown.public void onScroll(android.widget.ListView tableDataView,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount)
OnScrollListeneronScroll in interface OnScrollListenertableDataView - The view whose scroll state is being reported.firstVisibleItem - The index of the first visible row (ignore if visibleItemCount == 0).visibleItemCount - The number of visible rows.totalItemCount - The number of items in the TableDataAdapter.public void onScrollStateChanged(android.widget.ListView tableDateView,
OnScrollListener.ScrollState scrollState)
OnScrollListeneronScrollStateChanged in interface OnScrollListenertableDateView - The view whose scroll state is being reported.scrollState - he current scroll state. One of OnScrollListener.ScrollState.TOUCH_SCROLL or OnScrollListener.ScrollState.IDLE.