How can I hide fab button when scrolling listView?
I'm using this code at the moment, but it hides FAB button whenever I'm touching screen and scrolling, I need it to hide FAB button when scrolling down and when scrolling a bit up it has to be shown again
current code:
mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if(scrollState == SCROLL_STATE_TOUCH_SCROLL){
floatingActionButton.hide();
}else{
floatingActionButton.show();
}
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
});