Ian Lake
@ianlake.bsky.social
800 followers 140 following 250 posts
Android Toolkit Developer and Runner Also at: - https://androiddev.social/@ianlake - https://twitter.com/ianhlake
Posts Media Videos Starter Packs
ianlake.bsky.social
There are no Hilt specific APIs on that page.
ianlake.bsky.social
You'll have to be more specific on what your setup is. Navigation2? With Fragments? With Compose?

The ViewModel Scoping API does cover how to scope ViewModels to Nav2 entries: developer.android.com/topic/librar...
ViewModel Scoping APIs  |  App architecture  |  Android Developers
ViewModel lets you manage your UI's data in a lifecycle-aware fashion.
developer.android.com
ianlake.bsky.social
Thanks, that's really helpful. We'll take a look!
ianlake.bsky.social
Did you file an issue on the issue tracker with a sample project that reproduces your issue? I can make sure it gets sent to the right people if you reply with a link to it here.
issuetracker.google.com/issues/new?c...
Sign in - Google Accounts
issuetracker.google.com
ianlake.bsky.social
There's a lot of other releases this week including Metrics (JankState) reaching 1.0.0-rc01, WorkManager 2.11.0-beta01, plus a lot of Wear and XR releases.

Make sure to read through all of the release notes for the details!
developer.android.com/jetpack/andr...
Recent Release Notes  |  Android Developers
developer.android.com
ianlake.bsky.social
Navigation3 1.0.0-alpha10 improves rememberNavBackStack's KMP support, breaks Scene APIs into its own package, & we've broken two layers out of NavDisplay in rememberDecoratedNavEntries (for multiple back stacks) and rememberSceneState (for owning system back).
developer.android.com/jetpack/andr...
navigation3  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
NavigationEvent 1.0.0-alpha09 makes some pretty sweeping changes to the API surface.
- Dispatcher now focuses on global state with the new history and transitionState properties
- Handler has local state
- Compose users get a NavigationEventState for hoisting

developer.android.com/jetpack/andr...
navigationevent  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Navigation 2.9.5 is out with an update to the Safe Args Gradle Plugin to ensure it works well with AGP 9.0's support for built-in Kotlin.
developer.android.com/jetpack/andr...
Navigation  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Compose Material3 1.4.0 includes 11 months worth of new features and bug fixes. New carousel, SecureTextField, autoSize and TextFieldState support, TimePickerDialog, and more.

Note the removal of the material-icons-core dependency - add it manually now!
developer.android.com/jetpack/andr...
Compose Material 3  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
This week's #JetpackReleaseNotes includes Window 1.5.0, Compose Material3 1.4.0 plus bug fixes in Compose 1.9.2, Navigation 2.9.5, Room 2.8.1, Sqlite 2.6.1, Wear Compose 1.5.2, and WorkManager 2.10.5.
developer.android.com/jetpack/andr...
Recent Release Notes  |  Android Developers
developer.android.com
ianlake.bsky.social
It is my daughter's birthday, so we celebrate it every year! Still a great song
ianlake.bsky.social
tl/Dr: yes.

The state of each screen is completely separate from the actual objects in the back stack.

That's because all state is actually associated with a NavEntryDecorator. E.g., Compose State is saved by adding a SavedStateNavEntryDecorator.

Each decorator's state uses the entry's contentKey
ianlake.bsky.social
Glad you're enjoying Nav3! Let us know if you're running into any issues or if there's specific APIs we should take a second look at.

(I'm actually pretty excited about this next week's release as we've been working through exposing some additional layers between the back stack and NavDisplay)
ianlake.bsky.social
Happy to chat about Nav3 anytime if you'd like to learn more or chat about which layer any sort of integration would make sense.
ianlake.bsky.social
Also, you most certainly don't want to be passing a backstack of just indices to NavDisplay, since those keys that make up the back stack are what Nav3 maps each screen's saved state. Replacing screen #3 with a totally different screen #3 shouldn't reuse the state from the initial instance.
ianlake.bsky.social
I'm not sure where you got the idea that Nav3 pushes navigation logic into the Compose UI layer?

As seen in your example, hoisting the back stack out of the UI is supported and recommended. We do it ourselves in our modular sample: github.com/android/nav3...
nav3-recipes/app/src/main/java/com/example/nav3recipes/modular/hilt at main · android/nav3-recipes
Implement common use cases with Jetpack Navigation 3 - android/nav3-recipes
github.com
ianlake.bsky.social
There were a lot of other releases today including Benchmark 1.4.1, Wear Input 1.2.0, Wear Ongoing 1.1.0, and WorkManager 2.10.4 so make sure to read through all of the release notes for the details.
developer.android.com/jetpack/andr...
Recent Release Notes  |  Android Developers
developer.android.com
ianlake.bsky.social
If you've been following along with the NavigationEvent API for handling system back (and system forward 👀), today's 1.0.0-alpha08 continues to iterate on many of the APIs including fully separating out the Compose progress APIs from the Handler itself.
developer.android.com/jetpack/andr...
navigationevent  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Navigation3 1.0.0-alpha09 now correctly moves each entry to the correct Lifecycle state (fixing the known issue from alpha08), makes NavBackStack more flexible, and ensures that NavDisplay works well with the NavigationEventDisplayerOwner composable.
developer.android.com/jetpack/andr...
navigation3  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Navigation 2.9.4 fixes the library's top crash issue: the infamous IndexOutOfBoundsException.

Turns out: Navigation was hitting a race condition in Compose itself 😬 The linked bug has some more details if you're interested.
developer.android.com/jetpack/andr...
Navigation  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Hilt 1.3.0 decouples the hiltViewModel() API from Navigation2 entirely by moving it to its own hilt-lifecycle-viewmodel-compose artifact, thus ensuring that it is the one true API you should be using for Hilt+Compose no matter what navigation system you use.
developer.android.com/jetpack/andr...
Hilt  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Room 2.8.0 adds the new room-sqlite-wrapper artifact which enables incremental migration to the SQLiteDriver APIs by providing an escape hatch for anything still requiring the Android specific SupportSQLiteDatabase APIs.
developer.android.com/jetpack/andr...
Room  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Besides a bunch of improvements in Camera 1.5.0, today's release also includes the first stable version of Camera ViewFinder in its 1.5.0 version including support for both Views and Compose.
developer.android.com/jetpack/andr...
camera viewfinder  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Today's #JetpackReleaseNotes includes Camera and Camera ViewFinder 1.5.0, Room 2.8.0, Hilt 1.3.0, plus bug fixes in Compose 1.9.1, Navigation 2.9.4, and Navigation3 1.0.0-alpha09.
developer.android.com/jetpack/andr...
Recent Release Notes  |  Android Developers
developer.android.com