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.36k stars 76 forks source link

Add `SimpleStateChanger` to either examples or to the lib #214

Closed Zhuinden closed 4 years ago

Zhuinden commented 4 years ago

If you are just starting out, the

if(stateChange.isTopNewKeyEqualToPrevious) {
    completionCallback.stateChangeComplete()
    return
}

...
completionCallback.stateChangeComplete()

in simpler cases is just not fun to write at all.

For that, it could make sense to add a SimpleStateChanger just like I did in the new https://github.com/Zhuinden/simple-stack-tutorials.

(https://github.com/Zhuinden/simple-stack-tutorials/commit/245f7c7ddac92be3c3eea8e2a2e36fa79f1c0c97)

Zhuinden commented 4 years ago

Added in https://github.com/Zhuinden/simple-stack/commit/efe1dc67217092ad1b4628663ddb9d451a8e51f7