Fixed
Status Update
Comments
ni...@google.com <ni...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
since these are in public API (:/) we need to do this in 1.2
il...@google.com <il...@google.com> #3
since it is already marked as deprecated, we can probably do it by now.
Description
Android Studio Build: 2020.3.1 Patch 2
Kotlin version: 1.5.21
Issue:
Expected behaviour would be that each ViewModel instance should stay the same when selecting the bottomBar tabs.
In practice - the ViewModel instances change, if switching is happening very fast.
I'm not totally sure whether this is compose issue, compose-navigation issue, or Dagger Hilt issue since they all are related here.
An important note - setup in the reproducible sample is supporting multiple back stacks.
Steps to Reproduce:
1. start the project where the issue can be reproduced
2. it contains a function imitateFastNavigation(), which will simulate fast switching bottomBar destinations. Same can be done by commenting it out and fast tapping manually.
3. Open the logcat, and ensure that the viewModels are actually changing, instead of being the same.