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 were a lot of other releases this week including NavigationEvent 1.0.0-beta01 (API stability!), SavedState 1.4.0-beta01, and Ink 1.0.0-alpha07 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
Navigation3 1.0.0-alpha11 makes a significant number of API changes: onBack no longer takes a count, Scene's have their own metadata to allow their own defaults/overrides of the NavEntry metadata, plus changes to the Scene and Decorator APIs.
developer.android.com/jetpack/andr...
navigation3  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Compose Material3 Adaptive 1.3.0-alpha01 is out with improvements around edge-to-edge. This release is also the first main release to include the adaptive-navigation3 artifact (which previously only had separate 1.0.0 alpha releases).
developer.android.com/jetpack/andr...
Compose Material 3 Adaptive  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Compose 1.10.0-alpha05 is out with two very welcome changes:
- The Shared Element APIs are now stable! developer.android.com/jetpack/andr...
- PaddingValues now support addition and subtraction! developer.android.com/jetpack/andr...
Compose Animation  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
Metrics 1.0.0 is now stable! Its JankStats APIs are all about measuring UI 'jank' and allowing you to add context to what is going on in your app, making it possible to correlate jank with specific problems areas in your app.
developer.android.com/jetpack/andr...
Metrics  |  Jetpack  |  Android Developers
developer.android.com
ianlake.bsky.social
This week's #JetpackReleaseNotes include Metrics (aka 'JankStats') 1.0.0, Heifwriter 1.1.0, Health Connect 1.1.0, bug fixes in Camera 1.5.1, Compose 1.9.3, Room 2.8.2, and Wear Compose 1.5.3 plus lots of changes in Navigation3 1.0.0-alpha11.
developer.android.com/jetpack/andr...
Recent Release Notes  |  Android Developers
developer.android.com
ianlake.bsky.social
That, along with synthetic back stacks and different handling whether you are on your own task stack or another apps' task stack (which is the only time when back and up differ), is going to be the next PR after this first one.
Reposted by Ian Lake
liutikas.net
Would you like to work on Compose at Google (Mountain View CA office)?

Apply here and let's work together www.google.com/about/career...
Senior Software Engineer, Jetpack Compose — Google Careers
www.google.com
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