Skip to content

Instantly share code, notes, and snippets.

@sujithkanna
Last active June 11, 2017 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sujithkanna/f52432d7a79c73f6f34cfef2d2cae106 to your computer and use it in GitHub Desktop.
Save sujithkanna/f52432d7a79c73f6f34cfef2d2cae106 to your computer and use it in GitHub Desktop.
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
int count = mRecyclerView.getChildCount();
for (int i = 0; i < count; i++) {
MenuAdapter.MenuViewHolder holder = (MenuAdapter.MenuViewHolder)
mRecyclerView.getChildViewHolder(mRecyclerView.getChildAt(i));
// Pass the viewHolderss to the method we created for slide animation
mMenuAdapter.invalidateSlider(holder);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment