According to your description, ViewPager should be used.
Very similar to RecyclerView, an Adapter is used to adapt it. The simplest example is in the Add a ViewPager chapter of Android Developer - Using ViewPager for Screen Slides. I think it has been made very clear. It uses Adapter as an internal class. Of course, you can also take out Adapter and make it another class.
In addition, it seems that the effect you want can refer to the following example:
MapViewPager
If you have any questions, please leave a comment. :-)
Add the following four lines of code in addOnItemSelectionListener or setOnItemClickListener at the same time to achieve the effect of sliding items one by one. recyclerView.setLayoutFrozen(true); recyclerView.setLayoutFrozen(false);#🎜 🎜#adapter.notifyItemChanged(adapterPosition); adapter.notifyDataSetChanged();
According to your description, ViewPager should be used.
Very similar to RecyclerView, an Adapter is used to adapt it. The simplest example is in the Add a ViewPager chapter of Android Developer - Using ViewPager for Screen Slides. I think it has been made very clear. It uses Adapter as an internal class. Of course, you can also take out Adapter and make it another class.
In addition, it seems that the effect you want can refer to the following example:
MapViewPager
If you have any questions, please leave a comment. :-)
Add the following four lines of code in addOnItemSelectionListener or setOnItemClickListener at the same time to achieve the effect of sliding items one by one.
recyclerView.setLayoutFrozen(true);
recyclerView.setLayoutFrozen(false);#🎜 🎜#adapter.notifyItemChanged(adapterPosition);
adapter.notifyDataSetChanged();
After various searches, I discovered the recyclerviewpager library, which can solve the problem of single page sliding.