Can you put a ViewPager in a fragment?
Steps for implementing viewpager: Adding the ViewPager widget to the XML layout (usually the main_layout). Creating an Adapter by extending the FragmentPagerAdapter or FragmentStatePagerAdapter class.
Can I use ViewPager with views not with fragments?
In ViewPager2 you do not need to use Fragments at all. Just create an Adapter as you would a RecyclerView Adapter. and set it to ViewPager2. One thing to keep in mind however is layout height of the view you want to inflate should be match_parent and not wrap_content as you would for a recyclerView.