Two new parameters for methods that will be called when spanning/unspanning
Test scope instances for use in UI tests
Both samples were updated to use the new features in the apps/tests:
Sample: shows a Toast every time you span/unspan
Nav sample: checks which destinations are currently shown and navigates to the correct destinations in the new view (ex: if showing destination 3 in single pane view, will navigate to destination 3/4 in two pane view when spanning)
π€ Motivation and Context
This will make it easier for developers to maintain the desired state when switching between single and two pane mode (ex: if displaying list-detail in two panes, making sure that the single pane view will show the selected detail view when unspanning). This will also make it easier for developers to test any composables that use TwoPaneScope or TwoPaneNavScope.
π§ͺ How Has This Been Tested?
Tested manually on the device, and the new sample tests were run.
βοΈ Does the PR contain new tests or refactored old ones?
It contains both - had to refactor one of the nav_sample tests because we're not using HorizontalSingle mode anymore, and also had to add new tests to show how to use the test scope instances.
π· Screenshots (if appropriate)
π¦ Types of changes
[x] New feature (non-breaking change which adds functionality)
[ ] Enhancement to a current functionality
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Bug fix (non-breaking change which fixes an issue. Please add issue link here too).
β Checklist
[x] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] This PR contains new tests that cover the new code.
[ ] This PR refactor previous tests to cover the new code.
[ ] This PR is part of a set of PRs that build a bigger feature. If so, please, add here links to previously merged or open PRs.
π Description
This PR adds two main features:
Both samples were updated to use the new features in the apps/tests:
π€ Motivation and Context
This will make it easier for developers to maintain the desired state when switching between single and two pane mode (ex: if displaying list-detail in two panes, making sure that the single pane view will show the selected detail view when unspanning). This will also make it easier for developers to test any composables that use
TwoPaneScope
orTwoPaneNavScope
.π§ͺ How Has This Been Tested?
Tested manually on the device, and the new sample tests were run.
βοΈ Does the PR contain new tests or refactored old ones?
It contains both - had to refactor one of the nav_sample tests because we're not using
HorizontalSingle
mode anymore, and also had to add new tests to show how to use the test scope instances.π· Screenshots (if appropriate)
π¦ Types of changes
β Checklist