We can now eliminate AbstractTaskFragment and its 10 subclasses by replacing the ViewPager2 with a Compose-based HorizontalPager. This is feasible because the current fragments are thin wrappers that simply delegate logic to ViewModels and Compose screens.
This will be done in following phases:
- Consolidation into a single Generic Fragment
- Eliminate all 11 fragment classes (AbstractTaskFragment + 10 subclasses) and replace them with a single DataCollectionTaskFragment.
- Update the DataCollectionViewPagerAdapter to use only this fragment.
- Compose Host Migration
- Migrate the host DataCollectionFragment to Jetpack Compose.
- Convert the XML layout (data_collection_frag.xml) to a Compose screen.
- Wrap the existing ViewPager2 inside an AndroidView within this new Compose host.
- Pure Compose Paging (KMP compatible)
- Remove the ViewPager2 and the FragmentStateAdapter.
- Switch to HorizontalPager in the shared UI layer.
- The map components will now be hosted directly in slots via AndroidView (on Android).
We can now eliminate
AbstractTaskFragmentand its 10 subclasses by replacing theViewPager2with a Compose-basedHorizontalPager. This is feasible because the current fragments are thin wrappers that simply delegate logic to ViewModels and Compose screens.This will be done in following phases: