wealthfront / magellan

The simplest navigation library for Android.
Apache License 2.0
677 stars 70 forks source link

Fix double back press #268

Closed Kritarie closed 1 year ago

Kritarie commented 1 year ago

Fixes back press being propagated twice to active children of NavigationDelegate.

NavigationDelegate is a LifecycleAwareComponent. All LifecycleAwareComponents forward back presses to active children (active means lifecycle state >= Shown). NavigationDelegate was then calling back press on its currentNavigable, which is also a lifecycle aware child. The result is that currentNavigable would receive back press twice: once from LifecycleAwareComponent code and once from NavigationDelegate code.