Last active
June 16, 2017 13:51
-
-
Save developer-shivam/c2a90435711be4b08f548b6a35be146d to your computer and use it in GitHub Desktop.
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
addOnScrollListener(new OnScrollListener() { | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
super.onScrolled(recyclerView, dx, dy); | |
if (getLayoutManager() instanceof LinearLayoutManager) { | |
LinearLayoutManager layoutManager = (LinearLayoutManager) getLayoutManager(); | |
if (layoutManager.getOrientation() == LinearLayoutManager.VERTICAL) { | |
totalItemsInView = layoutManager.getItemCount(); | |
changeHeightAccordingToScroll(recyclerView); | |
} | |
} | |
} | |
@Override | |
public void onScrollStateChanged(RecyclerView recyclerView, int newState) { | |
super.onScrollStateChanged(recyclerView, newState); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment