-
Notifications
You must be signed in to change notification settings - Fork 101
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
Replaces Showing
and InOverlay
with View
tags.
#845
Conversation
f9ebc90
to
7b5d2f5
Compare
2120968
to
ba43dab
Compare
e57f231
to
f6c0181
Compare
@WorkflowUiExperimentalApi | ||
public var View.screen: Screen | ||
get() = checkNotNull(screenOrNull) { | ||
"Expected to find a Screen in tag workflow_screen (${R.id.workflow_screen})" |
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.
${R.id.workflow_screen}
will render to some integer that won't make sense to users.
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.
Yeah, I guess it won't be useful. I was figuring that by providing the name as well I was giving a hint that they could look for the magic number on other views or something.
@WorkflowUiExperimentalApi | ||
public var Dialog.overlay: Overlay | ||
get() = checkNotNull(overlayOrNull) { | ||
"Expected to find an Overlay in tag workflow_overlay (${R.id.workflow_overlay}) " + |
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.
The same thing about integer value of the tag.
Using the `ViewEnvironment` to hold the current `Screen` and `Overlay` was conceptually very clean, but was bad for performance in Compose, which would recompose too often when a new `ViewEnvironment` was not equal to the previous one -- all due to `Showing` being updated. We now store the canonical `Screen` rendering for each `View` in a tag, and the `Overlay` for each `Dialog` in a tag on its decorView. Fixes #844
f6c0181
to
98ebcbd
Compare
|
||
/** | ||
* Returns the most recent [Overlay] rendering [shown][OverlayDialogHolder.show] in this [Dialog], | ||
* or throws a [NullPointerException] ` if the receiver was not created via |
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.
* or throws a [NullPointerException] ` if the receiver was not created via | |
* or throws a [NullPointerException] if the receiver was not created via |
Using the
ViewEnvironment
to hold the currentScreen
andOverlay
was conceptually very clean, but was bad for performance in Compose, which would recompose too often when a newViewEnvironment
was not equal to the previous one -- all due toShowing
being updated. We now store the canonicalScreen
rendering for eachView
in a tag, and theOverlay
for eachDialog
in a tag on its decorView.Fixes #844