Skip to content

[KMP] Migrate ViewPager2 in DataCollectionFragment with a Compose HorizontalPager #3709

@shobhitagarwal1612

Description

@shobhitagarwal1612

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:

  1. 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.
  1. 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.
  1. 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).

Metadata

Metadata

Labels

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions