I have application with ViewPager2. All pages in it are instances of same type fragmet. All pages are displaying some lists in a recyclerview, of different data types. Data are populated from some API endpoint, using Retrofit calls.
I'm using dagger 2 to inject viewmodels.
Everything is working fine with one page. Now I want to create other pages, and I'm asking is there any method/pattern to implements other pages without creating different fragment classes, but only to use different viewModel type?
Maybe some generic viewModel or something.