fix: [ANDROAPP-6477] surround lateral menu navigation with async call #3885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the navigation and testing functionality in the
MainActivity
and related classes. The most important changes include adding a dispatcher provider toMainNavigator
, refactoring the initialization ofMainNavigator
inMainActivity
, and enhancing theMainRobot
andMainTest
classes for better test reliability.Navigation Improvements:
app/src/main/java/org/dhis2/usescases/main/MainNavigator.kt
: Added a dispatcher provider toMainNavigator
and refactored the transaction handling to use coroutines for better performance and readability. [1] [2] [3] [4]Activity Initialization:
app/src/main/java/org/dhis2/usescases/main/MainActivity.kt
: Refactored the initialization ofMainNavigator
to use a dispatcher provider, improving the setup process and making it more flexible. [1] [2]Testing Enhancements:
app/src/androidTest/java/org/dhis2/usescases/main/MainRobot.kt
: Added a wait condition to ensure the view is not empty before performing assertions, improving test reliability.app/src/androidTest/java/org/dhis2/usescases/main/MainTest.kt
: Added a call towaitForIdle
in thecheckHomeScreenRecyclerviewHasElements
method to ensure the UI is idle before running tests.Description
Please include a summary of the change and include the related jira issue if it exists.
[ jira issue ](https://dhis2.atlassian.net/browse/ANDROAPP-
Solution description
If this PR is a fix include a brief description on how the issue is solved.
Covered unit test cases
Describe the tests that you ran to verify your changes.
Where did you test this issue?
Which Android versions did you test this issue?
Checklist