Handle Continue clicks in Data Collection tasks, move more of state handling to DataCollectionViewModel
- Store List<AbstractTaskViewModel> in DataCollectionViewModel to track the view models of the Tasks the user has filled out so far
- Track the currentPosition in the DataCollectionViewModel as well and subscribe to this position from the DataCollectionFragment, allowing the ViewModel to drive the active tasks and update the position when the user hits continue on a completed task
- Show an error popup if the user's input is invalid when Continue is clicked
Towards #1146
@JSunde The unit tests are failing. Is it ready to be reviewed?
I think the reason they are failing is because we are using a @Mock DataCollectionViewModel instead of an actual instance. This causes an NPE while instantiating the fragment as mock isn't properly set. That being said, I don't think we should mock the DataCollectionViewModel as that is the class being tested here. Instead, we should test the behavior using exposed live data and repositories
Okay, I think the tests should be working now 👍
If DataCollectionViewModelTest is already covered by the added test, then we can get rid of that class as well.