Created
February 14, 2017 08:04
-
-
Save GeoffreyMetais/4d9a92f670d10e9e201e165d6c7f7c07 to your computer and use it in GitHub Desktop.
RecyclerView.OnScrollListener for Glide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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