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

Up navigation examples are hard to find #283

Open
LeafyLappa opened this issue Dec 9, 2023 · 3 comments
Open

Up navigation examples are hard to find #283

LeafyLappa opened this issue Dec 9, 2023 · 3 comments

Comments

@LeafyLappa
Copy link

It seems that all examples for "up" back arrow navigation are in the "legacy-architecture-samples". A bit hard to find especially as they are "legacy" and written in java.

By up navigation I mean this:

@Zhuinden
Copy link
Owner

Heyo, it's primarily because the icon being "back" is typically encoded in either the screen itself, or can be evaluated with shouldBeUpArrow = stateChange.getNewKeys().size > 1 in the SimpleStateChanger.

But I haven't worked on app with a design that actually shares the toolbar across the entire app in a very long time, which is why you only saw that in the legacy example.

The title scared me for half a sec because goUp() and goUpChain() really aren't really used anywhere in any samples, even if the support is there.

@LeafyLappa
Copy link
Author

Ahh, I see. I'm so used to Jetpack Navigation where up arrow seems to be handled via magic (once you call something like setupActionBarWithNavController) I did not realize I should simply put a toolbar in my fragments or main activity and define the navigation behavior myself, wew

shouldBeUpArrow = stateChange.getNewKeys().size > 1

It would be nice however to have something like a TLDR or recipes page for things like this.

@Zhuinden
Copy link
Owner

Technically it does exist in this sample:

binding.step3TitleButtonBack.showIf { newKeys.size > 1 } // show up if can go back
but I'll try to think of a way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants