AndroidX releases, Android Studio 3.6 and 4.0 previews, Kotlin typealias, building a Kotlin extensions library, and two Android podcast episodes
When I first drafted this AndroidX section, earlier this week, there weren’t many library updates. I figured it made sense: people were just getting back from the long holiday, probably learning how to type again, and not a lot had changed since December.
Boy, was I wrong.
January 22nd hit, and a ton of libraries were released. Check out the details on the AndroidX releases site, but here are some of the highlights.
First, many libraries went stable, including:
- Fragment 1.2.0 introduces FragmentContainerView as the recommended container for fragments, integrates in Lifecycle ViewModel SavedState, and fixes timing issues with
onDestroyView()when using animations/transitions.
- Lifecycle 2.2.0 has the new
lifecycle-runtime-ktxartifact with Kotlin coroutine integration, plus greater integration into the existing
lifecycle-livedata-ktxartifact for coroutines.
- Lifecycle-Viewmodel-Savedstate 1.0.0 is the first release of this library. ViewModels can now participate in
onSaveInstanceState()via the new SavedStateHandle class without the boilerplate of overriding and handling saved state manually in your Activity/Fragment. See the docs for more information on this new library.
- Navigation 2.2.0 provides navigation graph-scoped Lifecycles and SavedState with the new
NavBackStackEntry, query parameter support for deep links, and improved animation support.
- WorkManager 2.3.0 has new
setForeground()APIs, which allow you to communicate progress as your Worker runs, as well as allowing a Worker to run in a foreground service when necessary.
Various AndroidX libraries also hit alpha, including these two which just reached their first alpha milestone:
- Browser 1.3.0-alpha01: Features include passing free-form commands to a trusted web activity via TrustedWebActivityServiceConnection#extraCommand and nullability for CustomTabsSession#mayLaunchUrl.
- Heifwriter 1.1.0-alpha01 This library offers the ability to write High Efficiency Image Format (HEIF) files from one or more input images. The 1.1 release offers minor improvements and fixes.