Skip to content

Instantly share code, notes, and snippets.

@GeoffreyMetais
Created February 14, 2017 08:04
Show Gist options
  • Save GeoffreyMetais/4d9a92f670d10e9e201e165d6c7f7c07 to your computer and use it in GitHub Desktop.
Save GeoffreyMetais/4d9a92f670d10e9e201e165d6c7f7c07 to your computer and use it in GitHub Desktop.
RecyclerView.OnScrollListener for Glide
private class ChannelListScrollListener extends RecyclerView.OnScrollListener {
RequestManager glide = ((ListAdapter) mBinding.channelList.getAdapter()).getGlideRequestManager();
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_SETTLING)
glide.pauseRequests();
else
glide.resumeRequests();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment