Replace ViewPager2 with Compose-based TaskScreenContainer for Data Collection#3735
Replace ViewPager2 with Compose-based TaskScreenContainer for Data Collection#3735shobhitagarwal1612 wants to merge 14 commits into
Conversation
…creen and TaskScreenContainer
…onViewModel UI effects
andreia-ferreira
left a comment
There was a problem hiding this comment.
The only issue I found was when restoring a draft where the current task was conditional. Clicking on any of the previous/next buttons makes the app crash. Tested this behavior on master to confirm it's not an existing issue and couldn't reproduce
Screen_recording_20260513_175154.webm
tested on API 24 and 36 and happens on both
|
@andreia-ferreira Thanks for catching the bug! I think it was happening because of using |
|
thanks for looking into it, I tested it again but it seems to still happen unfortunately. You can try to join this survey link which I used in the recording below, to see if you can reproduce it too Screen_recording_20260514_105749.webm |
Fixes #3709
This PR overhauls the data collection flow by migrating it to a Compose-based architecture. It removes the legacy
ViewPager2and fragment-based approach (DataCollectionTaskFragment,DataCollectionViewPagerAdapter) in favor of a newTaskScreenContainer. It also refactors event handling to be more deeply integrated with ViewModels.Key Changes:
ViewPager2and task fragments with Compose-basedTaskScreenContainer.TaskMapFragmentContainerwith the official ComposeAndroidFragment.DataCollectionViewModelby removingMutableSharedFlowand using UI effects.onButtonClickedparameter from task screens and handle clicks via individual ViewModels.OpenSettingsandSetAwaitingPhotoCaptureto useDataCollectionViewModelUI effects.Steps to verify:
@andreia-ferreira PTAL?