Skip to content
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

Introduces BackStackScreen.name #1220

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Introduces BackStackScreen.name #1220

merged 2 commits into from
Sep 13, 2024

Conversation

rjrjr
Copy link
Contributor

@rjrjr rjrjr commented Sep 13, 2024

BackStackScreen now implements Compatible and has a name: String field, just like BodyAndOverlaysScreen. This is in support of having multiple instances under a single SavedStateRegistry at a time. Our old trick of wrapping instances via NamedScreen doesn't work the the BackStackScreen creates the first classic View instance in Compose context, because the NamedScreen will be handled by Compose code. The old hack in BackStackContainer relies on View.screen holdling NamedScreen(BackStackScreen), but in the Compose-eats-NamedScreen case it will just be BackStackScreen.

@rjrjr rjrjr requested review from zach-klippenstein and a team as code owners September 13, 2024 00:30
`BackStackScreen` now implements `Compatible` and has a `name: String` field, just like `BodyAndOverlaysScreen`. This is in support of having multiple instances under a single `SavedStateRegistry` at a time. Our old trick of wrapping instances via `NamedScreen` doesn't work the the `BackStackScreen` creates the first classic `View` instance in Compose context, because the `NamedScreen` will be handled by Compose code. The old hack in `BackStackContainer` relies on `View.screen` holdling `NamedScreen(BackStackScreen)`, but in the Compose-eats-NamedScreen case it will just be `BackStackScreen`.
@rjrjr rjrjr force-pushed the ray/name-backstackscreen branch from 450def1 to fad5aa5 Compare September 13, 2024 00:49
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@rjrjr rjrjr requested a review from tcmulcahy September 13, 2024 15:55
@rjrjr rjrjr merged commit a7c1b38 into main Sep 13, 2024
31 checks passed
@rjrjr rjrjr deleted the ray/name-backstackscreen branch September 13, 2024 16:32
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.

3 participants