Fixed
Status Update
Comments
ni...@google.com <ni...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Oh I forgot to mention that I thought it might be connected to this issue:
il...@google.com <il...@google.com> #3
Please provide a minimal sample project along with the minimal steps to recreate the issue in the project.
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.