Created
June 8, 2019 02:16
-
-
Save senamit2708/1e2381f2df5117e31bc488c0eb56fbb6 to your computer and use it in GitHub Desktop.
Horizontal Recyclerview to scroll behavior like viewpager...one page and after sliding its showing next page
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 void bindView(View view) { | |
recyclerView = view.findViewById(R.id.recyclerview); | |
mLayoutManager = new LinearLayoutManager(context); | |
((LinearLayoutManager) mLayoutManager).setOrientation(LinearLayoutManager.HORIZONTAL); | |
mAdapter = new QuizQuestionAdap(context, this); | |
SnapHelper snapHelper = new PagerSnapHelper(); | |
snapHelper.attachToRecyclerView(recyclerView); | |
recyclerView.setLayoutManager(mLayoutManager); | |
recyclerView.setAdapter(mAdapter); | |
} |
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
https://stackoverflow.com/questions/29134094/recyclerview-horizontal-scroll-snap-in-center |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment