Zhuinden / simple-stack

[ACTIVE] Simple Stack, a backstack library / navigation framework for simpler navigation and state management (for fragments, views, or whatevers).
Apache License 2.0
1.37k stars 74 forks source link

Figure out if `List<String>` in ScopeKey.Child should have been `List<ScopeKey>` all along #130

Closed Zhuinden closed 5 years ago

Zhuinden commented 5 years ago

The trick is that in that case, parcellation of the ScopeKeys should also happen via KeyParceler, instead of parcelling it along with the key as a field like any other.

It also seems a bit... trickier to set up scopes if you need to also customize parents.

This question comes up primarily if you need to pass in parameters into the parent scope, like an ID, and now you have to bundle it into a string, then at identification you'd need to construct it with said ID, and then you think of http://www.thecodelesscode.com/case/167

Zhuinden commented 5 years ago

Can you even use @Parcelize data class if you do that? I wouldn't want to lose its convenience.

Zhuinden commented 5 years ago

Technically that can work only if you can pass in your ScopeKey & Parcelable type as a generic argument instead of just regular ScopeKey.

So like,

interface ScopeKey.Child<T extends ScopeKey> {
    List<T> getParentScopes();
}

as this way you can setup a List<Parcelable & ScopeKey>. Tacky!

Zhuinden commented 5 years ago

I think we'll just have to live with this one for now.