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

[Proposal] Expose read access for BackStack#elements #34

Closed
friendoye opened this issue Jul 22, 2020 · 3 comments
Closed

[Proposal] Expose read access for BackStack#elements #34

friendoye opened this issue Jul 22, 2020 · 3 comments

Comments

@friendoye
Copy link
Contributor

friendoye commented Jul 22, 2020

I wonder if there is any way to retrieve all elements from BackStack?
It can be useful in the following cases:

  1. We want to render all screens from BackStack on top of each other, so after navigating back we will not re-render some screens.
  2. Integration with compose-backstack (library for rendering animated transitions between backstacks of screens) would be much simpler, because nowadays it requires list of screens as one of args to its Composable. There are some workarounds, such as using Kotlin Reflection or using state/remember for maintaining backstack yourself, but it would be great to have read access directly to BackStack#elements.

@zsoltk WDYT?

@friendoye friendoye changed the title Expose read access for BackStack#elements [Proposal] Expose read access for BackStack#elements Jul 22, 2020
@zsoltk
Copy link
Owner

zsoltk commented Jul 28, 2020

I don't see why not. As a short term fix, it will do. Feel free to submit a PR.

Otherwise an abstraction over the back stack is on the way to address a more general case. That should also allow for keeping more than one element alive, among other things.

@friendoye
Copy link
Contributor Author

Sounds great, will look forward to new abstraction!

@friendoye
Copy link
Contributor Author

Closed by #37.

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

No branches or pull requests

2 participants