Status Update
Comments
il...@google.com <il...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c2365dcfeb9064814282304f30f3eb86be71fdc7
Author: Dan Nizri <dniz@google.com>
Date: Wed Dec 20 16:33:08 2023
Fix Popup back handling on Android T/13+ when android:enableOnBackInvokedCallback="true"
Bug: 313702338
Bug: 318537200
Test: tested with android:enableOnBackInvokedCallback="true"
Change-Id: I7c7cef686ed9fbfd2d144c90040b13528f1675ed
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.android.kt
https://android-review.googlesource.com/2886766
Branch: androidx-main
commit c2365dcfeb9064814282304f30f3eb86be71fdc7
Author: Dan Nizri <dniz@google.com>
Date: Wed Dec 20 16:33:08 2023
Fix Popup back handling on Android T/13+ when android:enableOnBackInvokedCallback="true"
Bug: 313702338
Bug: 318537200
Test: tested with android:enableOnBackInvokedCallback="true"
Change-Id: I7c7cef686ed9fbfd2d144c90040b13528f1675ed
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.android.kt
Description
Version used: 2.2.0-beta01
As advised here :
and here
The recommanded way to test the NavController is to use Mockito.
It worked well until I started to use navGraphViewModels() :
Fragment {
private val viewModel: ActivityViewModel by navGraphViewModels(R.id.activity_detail_graph) { viewModelFactory }
}
Starting with 2.2.0-alpha02, it get backstackentry :
val backStackEntry by lazy {
findNavController().getBackStackEntry(navGraphId)
}
But the NavBackStackEntry is a complex final class that can't be mocked, and is very difficult to instantiate (for test purpose).
What is the recommanded way to keep integration tests while using navigation 2.2.0 and a navGraphViewModels() ?