Skip to content

Migrate DropPinTaskFragment to use TaskScreen Component#3670

Open
shobhitagarwal1612 wants to merge 5 commits intomasterfrom
drop-pin-task-compose
Open

Migrate DropPinTaskFragment to use TaskScreen Component#3670
shobhitagarwal1612 wants to merge 5 commits intomasterfrom
drop-pin-task-compose

Conversation

@shobhitagarwal1612
Copy link
Copy Markdown
Member

Towards #3630

  • Introduce DropPinTaskScreen Composable to handle the UI.
  • Update DropPinTaskFragment to use createComposeView and render the new DropPinTaskScreen.
  • Move all state logic to DropPinTaskScreen
  • Replace *TaskFragmentTest with *TaskScreenTest and adds more coverage
  • Adds missing previews for compose screen

Verified for regressions by running the app on emulator and verifying the following scenarios:

  • Opens drop pin task for first time, the instructions dialog is shown. Click dismiss.
  • Opens drop pin task for second time, the instructions dialog is now shown.
  • Place marker on any position, click Next. LoiName dialog is shown.
  • LoiName is persisted across config changes and screen navigation

@andreia-ferreira PTAL?

}

override fun renderFeatures(): LiveData<Set<Feature>> = taskViewModel.features
override fun renderFeatures(): LiveData<Set<Feature>> = taskViewModel.features.asLiveData()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this also be refactored to return a flow instead of LiveData? As far as I see, it's used in onMapReady on AbstractTaskMapFragment which needs to convert it to a flow anyway


@HiltAndroidTest
@RunWith(RobolectricTestRunner::class)
class DropPinTaskViewModelTest : BaseHiltTest() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this test file removed because the test cases are covered elsewhere? It's worth considering keeping this and adding tests for what isn't covered yet like the initialize logic or the logic triggered by dismissing the instructions dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants