Last active
July 26, 2017 11:57
-
-
Save tejpratap46/fa6ee172e8a0630de10425bddf1b4d5f to your computer and use it in GitHub Desktop.
Make RecyclerView smooth scroll in a NestedScrollView
This file contains hidden or 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
public class CustomLinearLayoutManager extends LinearLayoutManager { | |
public CustomLinearLayoutManager(Context context, int orientation, boolean reverseLayout) { | |
super(context, orientation, reverseLayout); | |
} | |
// It will always pass false to RecyclerView when calling "canScrollVertically()" method. | |
@Override | |
public boolean canScrollVertically() { | |
return false; | |
} | |
} |
This file contains hidden or 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
CustomLinearLayoutManager customLayoutManager | |
= new CustomLinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); | |
mRecyclerView.setLayoutManager(customLayoutManager); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment