simple-stack icon indicating copy to clipboard operation
simple-stack copied to clipboard

Up navigation examples are hard to find

Open LeafyLappa opened this issue 2 years ago • 4 comments

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:

https://github.com/Zhuinden/simple-stack/blob/842bfc781fa16568af956c4985c1f8ca02da0a6c/samples/legacy-architecture-samples/simple-stack-example-mvvm-fragments/src/main/java/com/zhuinden/simplestackexamplemvvm/application/BaseKey.java#L65

LeafyLappa avatar Dec 09 '23 17:12 LeafyLappa

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.

Zhuinden avatar Dec 10 '23 03:12 Zhuinden

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.

LeafyLappa avatar Dec 10 '23 08:12 LeafyLappa

Technically it does exist in this sample: https://github.com/Zhuinden/simple-stack/blob/528fb852a7db94f54984bd6946ef7a0296679d09/tutorials/tutorial-sample/src/main/java/com/zhuinden/simplestacktutorials/steps/step_3/Step3Activity.kt#L52 but I'll try to think of a way

Zhuinden avatar Dec 14 '23 09:12 Zhuinden