Update where we setup BackHandler for Android #470
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
#433 (part of efforts to improve KMP support) renamed
BaseNavigableCircuitContent
toNavigableCircuitContent
, overloading the existing Android-specific method with the same name. The only difference between the two method signatures was an additional param in the android version (related to setting up theBackHandler
).As a result of this change existing uses of
NavigableCircuitContent
on Android started calling the wrong method, bypassing the logic that configured the system back handler.Fix
Rather than change the Android overload in some way, or require that Android callers provide the extra parameter (a friction when 99% of uses will want the default), I opted to move the back handler setup logic into the Android-specific
rememberCircuitNavigator
, and remove the Android overload entirely.