-
Notifications
You must be signed in to change notification settings - Fork 112
Nested overlays sample, small bug fixes #967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rjrjr
commented
Mar 11, 2023
...ed-overlays/src/androidTest/java/com/squareup/sample/nestedoverlays/NestedOverlaysAppTest.kt
Outdated
Show resolved
Hide resolved
bbc464c to
ae4b4d3
Compare
And can demonstrate the bug where dialogs are shown out of order: - Click _Cover Everything_ - Click _Cover Body_ The red inner dialog is shown over the outer green dialog, but the green one should always be on top. (#966) Also introduces `name` parameter for `BodyAndOverlaysScreen`, because they're a nightmare to nest without it. See the kdoc for details.
ae4b4d3 to
a8d9a86
Compare
- Replaces `View.getGlobalVisibleRect` calls with new, more robust `View.getScreenRect` extension - `Dialog.setBounds` sets `FLAG_LAYOUT_IN_SCREEN` to ensure `Dialog` is really placed where we want it. Otherwise it may be offset by the height of the toolbar. I think we've missed this up until now because our other samples and prod use all have richer themes than the default codepaths set up. - Default `ScreenOverlayDialogFactory` implementation disables dimming, for least confusing out of box behavior. Note that these tweaks do not address #966, that's a bigger effort.
a8d9a86 to
e8811c6
Compare
Collaborator
Author
|
|
Trying to reduce Espresso flakes by being more careful and conventional about `RootMatcher` use; about targetting back button presses; and by using `recreate()` for configuration changes.
Collaborator
Author
|
Note that I've cherry picked #969 here. No changes have been made to the existing tests or espresso support. |
steve-the-edwards
approved these changes
Mar 16, 2023
Contributor
steve-the-edwards
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note that I've cherry picked #969 here. No changes have been made to the existing tests or espresso support.
Introduces a new sample app, fixes some bugs it revealed, doesn't fix the major bug (#966) it was written to reproduce.
Nested overlays sample uses overlays.
And can demonstrate the bug where dialogs are shown out of order:
The red inner dialog is shown over the outer green dialog,
but the green one should always be on top. (#966)
Also introduces
nameparameter forBodyAndOverlaysScreen, because they'rea nightmare to nest without it. See the kdoc for details.
Fixes some Dialog handling problems revealed by Nested Overlays sample
Replaces
View.getGlobalVisibleRectcalls with new, more robustView.getScreenRectextensionDialog.setBoundssetsFLAG_LAYOUT_IN_SCREENto ensureDialogis really placed where we want it.Otherwise it may be offset by the height of the toolbar. I think we've missed this up until
now because our other samples and prod use all have richer themes than the default codepaths
set up.
Default
ScreenOverlayDialogFactoryimplementation disables dimming, for least confusingout of box behavior.
Note that these tweaks do not address #966, that's a bigger effort.
NestedOverlays.webm