My question is, can We call RecyclerView
's onScrolled()
Method from onScrollStateChanged()
method. The reason is I want to check two conditions. If SCROLL_STATE_SETTLING
is true only then check if the user has scrolled down. Is there any other way to check Both of them?
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == RecyclerView.SCROLL_STATE_SETTLING) {
// Now I have to check if the user has scrolled down or up.
}
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
});