Important changes since 1.11.0:
- The
Androidx Activitylibrary is now dependent on the newNavigationEventlibrary. This includes support for theNavigationEventDispatcherinComponentActivityandComponentDialog. TheOnBackPressedAPIs have also been rewritten on top of theNavigationEventAPIs to ensure it is backward compatible with the previous library.
API Changes
- Support deprecating
AppFunctionI39229 b/454661174
Bug Fixes
- Fix issue with non-null required top-level parameters Ic60fc b/456717542
New Features
ARCorefor Jetpack XR now supports devices where Google Play Services for AR is available.- Added Geospatial APIs for VPS Availability and pose conversion I144dc
New Features
- Added an Image to Rows, which enables new list use cases.
- Add
SectionedItemTemplate#alphabeticalIndexingStrategyto allow different alphabetic indexing for list accelerators.
API Changes
- Added an
endImageTypeforendImagesin Rows I8865b - Add
SectionedItemTemplate#alphabeticalIndexingStrategy. This is a replacement to#isAlphabeticalIndexingAllowedand gives developers more options for alphabetical indexing. Ia164d b/410092683 - Add support for an end Image to a car app Row. If93f0
- Added
CarIcon MediaPlaybackto simplify use of standard actionMediaPlayback. Ib6cb7
Bug Fixes
- Moving the default
minSdkfrom API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
API Changes
unveilInandveilOutoptions are now available forEnterExitTransitions. This allows to animate an overlay layer in front of the entering or exiting content. If26fe
Bug Fixes
Bug Fixes
- Disabled
isCacheWindowForPagerEnabledflag. Iffdec b/458193632
New Features
- Adding expressive menu updates. This includes a new toggleable menu item, selectable menu item, menu groups, and menu popup. It also includes new expressive menu default values in
MenuDefaults. I5cdd4 b/417731597 b/448646125 b/448646896 b/448646891 - The
Modifier.minimumInteractiveComponentSizenow provides two new publicAlignmentLines: MinimumInteractiveTopAlignmentLineandMinimumInteractiveLeftAlignmentLine. These lines mark the visual edges of a component before extra space is added to meet minimum touch target requirements. I7f485 b/458124197 - Added
ExpandedDockedSearchBarWithGap. Idb7f8
API Changes
- Add checks to enable precision pointer component sizing. I8108d
- Add
Modifier.aligntoButtonGroupScopeI03890 b/416590906 - Remove deprecated experimental
ModalBottomSheetAPIs that have been in at least one stable release. Ifbe1d b/449757604 - New
ButtonGroupoverload withverticalAlignmentparameter. I23a37 b/416590906 - Removed deprecated hidden experimental APIs that have been in at least one stable release. I4f68d b/449754465 b/449749933 b/401311419 b/449749928 b/449756019
Bug Fixes
- Add tooltip to floating toolbar's default overflow button. Ife952 b/422781172
- Fix
WideNavigationRail's indicator being cut if its set to a larger width via a larger label size. I9d740 b/444728723 - Update split button trailing buttons to center the icon optically depending on the given shape even in RTL. Icab82
Bug Fixes
- Fixes
ThreePaneScaffoldcrashes when margins are set. 2df348
Bug Fixes
- Transfers invalidations of the scope in movable content before moving that content out of the slot table I9d123 b/451651649
Bug Fixes
- Guard against reentrant modification when recording derived states in
SnapshotStateObserverI7b862 b/435655844 b/456249373 b/402535073 - [Lint] Minor bug fix to make the detector warn compound assignment properly. I08319 b/456775556
Bug Fixes
- Correctly send
visibilityChangedcallbacks with false whenminDurationMsis not zero. 2ac08b8 b/456384555 - Do not call
onVisibilityChangedcallback when the node is initially not visible. 3969e8d b/447364998
New Features
- Added KMP Web support in
DataStoreby using thesessionStorageAPI. This feature allowsDataStoreto persist data temporarily within a single browser tab. I60fad b/316376114
API Changes
EmojiMetadatatypeface specified as non null. Ic727f b/236341259EmojiCompatcorrectly setsEditorInfo.extrason Android R I1ea9b b/196452690- Custom widgets that use IME not subclassing
EditTextmay callEmojiCompat.updateEditorInfoto inform IME that they supportEmojiCompatprocessing. I1ea9b b/196452690
Bug Fixes
- Moving the default
minSdkfrom API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223 - This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler arguments to enforce correct usage:
-Xjspecify-annotations=strict, -Xtype-enhancement-improvements-strict-modeIbb74c b/326456246 EmojiCompatinit callbacks will now use the handler from each view, respecting views not on the main thread. Iccbcf b/278897602
- This release transitions
androidx.games:games-activityfrom alpha to beta.
- This release transitions
androidx.games:games-text-inputfrom alpha to beta.
API Changes
- Experimental custom low latency shape APIs, assorted bug fixes Ib8d2f
Bug Fixes
- Improve floating point precision on
StrokeInputBatchserialization, fixing a drift in the values from repeated encoding and decoding - More robust system input sanitization.
- Fix brush texture support in
InProgressStrokescomposable
New Features
- Adds an API for retrieving a
ScenePosethat represents the composition of the perception space origin pose and a pose with respect to the perception space origin. I5b50a - Added
getGravityAlignedPosefunction. The gravity aligned pose ignores the Pitch and Roll of rotation. I5ae21 AnchorEntity.Stateconstant types have been changed from Ints to State subtypes. Ib0c49- Added
getChildren()to Entity interface. UpdatedMainPanelEntitylifecycle. Ia69d6
API Changes
PointerCaptureComponent.PointerCaptureStateconstant types have been changed from Ints toPointerCaptureStatesubtypes. Ic888aScene.spatialCapabilitiesis now of typeSet<SpatialCapability>instead of an Int field. TheSpatialCapabilityconstants have been renamed. I9c109SurfaceEntityconstant types have been renamed and changed from Ints toSurfaceEntitysubtypes. I419edSpatializerConstantconstant types have been renamed and changed from Ints toSpatializerConstantsubtypes. Ia0e18TextureSamplerconstant types have been renamed and changed from Ints toTextureSamplersubtypes. I44078SpatialVisibilityconstant types have been changed from Ints toSpatialVisibilitysubtypes. I70739ResizeEvent.ResizeStateconstant types have been renamed and changed from Ints toResizeStatesubtypes. I384d5InputEventconstant types have been renamed and changed from Ints to inherit from their respective enclosing type. I82817GltfModelEntity.AnimationStateconstant types have been changed from Ints toAnimationStatesubtypes. I24f4eAlphaModeconstant types have been renamed and changed from Ints toAlphaModesubtypes. I27b56Spaceconstant types have been changed from Ints to Space subtypes. I9255bScenePose.hitTestand related methods now returnnullif no intersection was found, instead of aHitTestResultwith a nullhitPosition.HitTestResult.hitPositionis no longer nullable. I1400a- Changed references of
ActivityPosetoScenePose. I7fe43
Important changes since 2.9.0:
Add a
rememberLifecycleOwnercomposable to enable creating scoped lifecycles directly within the UI. This is useful for components that need to manage their own lifecycles independently such as aHorizontalPagerthat wants to only make the current pageRESUMEDor libraries like Navigation3:@Composable fun MyComposable() { // This LifecycleOwner is automatically moved to DESTROYED when // it leaves composition and its maxLifecycle is the maximum of either // the maxLifecycle you set or the Lifecycle.State of the parentLifecycleOwner val lifecycleOwner = rememberLifecycleOwner( maxLifecycle = RESUMED, parentLifecycleOwner = LocalLifecycleOwner.current, ) CompositionLocalProvider(LocalLifecycleOwner provides lifecycleOwner) { val childLifecycleOwner = LocalLifecycleOwner.current } }The
lifecycle-viewmodel-navigation3artifact provides a prebuilt integration for Navigation3, allowing you to enable scopingViewModelinstances to individual screens (‘entries’) by using therememberViewModelStoreNavEntryDecorator()API:@Composable fun MyComposable() { NavDisplay( backStack = backStack, entryDecorators = listOf( rememberSaveableStateHolderNavEntryDecorator(), // Add this line to automatically scope ViewModels to each entry rememberViewModelStoreNavEntryDecorator(), ), entryProvider = entryProvider { // Add your entries here } } }Add a builder factory function for
CreationExtras, providing a more convenient and idiomatic Kotlin API.override val defaultViewModelCreationExtras: CreationExtras // Use the CreationExtras builder to add in a custom value to the default // CreationExtras in your Activity or Fragment get() = super.defaultViewModelCreationExtras + CreationExtras { this[CustomKey] = "customValue" }Add native support for nullable types in
SavedStateHandle.saved, simplifying saving and restoring nullable properties.Mark
SavedStateHandleconstructors as@VisibleForTesting.The minSdk has changed from API 21 to API 23.
Introducing Navigation3!
- The Navigation3 library is now stable! Navigation3 is the AndroidX Compose first approach to navigation.
- For more information, see our announcement blog post, visit the resources, and try the recipes.
Major features of 1.0.0:
The Navigation Event library is now stable! Navigation Event is the AndroidX library for handling system level interactions such as system-back and predictive back in Android (and other platforms).
To handle
NavigationEvents, you can implement your ownNavigationEventHandlerthat overrides the desired functions. You then need to add the handler to aNavigationEventDispatcher. Starting with the Activity1.12.0release,ComponentActivityimplements the newNavigationEventDispatcherOwnerinterface, which provides a dispatcher that is ready to use :// The NavigationEventInfo provides information about a navigation state object CurrentInfo : NavigationEventInfo() // you can retrieve this from any component that is a NavigationEventDispatcherOwner // or you can instantiate your own custom dispatcher val dispatcher = myActivity.navigationEventDispatcher val myHandler = object : NavigationEventHandler<NavigationEventInfo>( initialInfo = CurrentInfo, isBackEnabled = true ) { override fun onBackStarted(event: NavigationEvent) { // Prepare for the back event } override fun onBackProgressed(event: NavigationEvent) { // Use event.progress for predictive animations } // This is the required method for final event handling override fun onBackCompleted() { // Complete the back event } override fun onBackCancelled() { // Cancel the back event } } dispatcher.addHandler(myHandler)The
navigationevent:navigationevent-composemodule provides a convenient compose functionNavigationBackHandlerthat automatically hooks up the handler to the closestLocalNavigationEventDispatcherOwner’sNavigationEventDispatcherand allows developers to provide the desired behavior as parameters:object CurrentInfo : NavigationEventInfo() object PreviousInfo : NavigationEventInfo() val navEventState = rememberNavigationEventState( currentInfo = CurrentInfo, backInfo = PreviousInfo ) // Inside composition NavigationBackHandler( State = navEventState, isBackEnabled = true, // optional onBackCancelled = { // Cancel the back event }, // required onBackCompleted = { // Complete the back event } , )
Using this pattern in Compose makes it very easy to hoist the NavigationEventState and allow it to be observed by different Composable (i.e. in the case of Navigation3, where you can hoist the state out of the NavDisplay).
Each
NavigationEventDispatcherhas the ability to provide a parent dispatcher, for both the compose and non-compose cases. This allows developers to create a hierarchical structure where several dispatchers can be managed by a single parent. Having a parent makes handling groups of dispatchers that might need to be disabled or disposed, relatively simple:// Non-Compose val parentDispatcher = NavigationEventDispatcher() val childDispatcher = NavigationEventDispatcher(parent = parentDispatcher) // Compose val composeChildDispatcher = rememberNavigationEventDispatcher( // This defaults to `LocalNavigationEventDispatcherOwner.current` // Must explicitly provide null to have an unparented dispatcher created here parent = NavigationEventDispatch() )The library also makes it possible to provide signals directly to the
NavigationEventDispatchervia aNavigationEventInput.NavigationEventInputs acts as the "input" side of the navigation system, translating platform-specific events (like system back gestures or button clicks) into standardized events that can be sent to aNavigationEventDispatcher. Thenavigationevent:navigationeventmodule currently provides 2NavigationEventInputs: a more genericDirectNavigationEventInputto allow any event to be dispatched and an Android specificOnBackInvokedInputthat allows aNavigationEventDispatcherto support system back and the predictive back gesture. If you implement your own dispatcher (instead of using the one provided byComponentActivity) you must manually add your input:val dispatcher = NavigationEventDispatcher() dispatcher.addInput(DirectNavigationEventInput()) dispatcher.addInput(OnBackInvokedDefaultInput(invoker))
API Changes
- The Slices framework has been deprecated, it will not receive any update moving forward. If you are looking for a framework that handles communication across apps, consider using AppSearchManager. Ie09cb b/207128063
Bug Fixes
- Added a prepared statement cache to Room’s connection pool when using a
SQLiteDriverthat does not internally have a pool, such as theBundledSQLiteDriver. This improves performance on repeated execution of the same SQL statement. 5f43bc b/319653917 - Fix an issue where the actual / expected error message on schema validation was missing information. 8b23da b/454531083
- Fix an issue with Room’s Kotlin code generation missing
@TransactionDAO functions with type variables. a8365d b/251316420 - Improve Room’s
SupportSQLiteWrapper performance by avoiding thread hops maintaining the same blocking behaviour as theSupportSQLiteDatabaseAPIs. fc70e4
Bug Fixes
- Improve
BundledSQLiteDriverperformance by using@FastNativeto improve JNI calls. 952b92 b/313895287 - Enable extended error codes on the
SQLiteconnections created byBundledSQLiteDriver. This means error messages coming fromSQLitewill have a more detailed code which is useful for diagnosing I/O issues and constraint violations. f1ec6f
Bug Fixes
- Support for 16KB page sizes b7a7dd
- Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (e.g. R8 version 3.3) and for all builds when using AGP 8.1 or later (e.g. D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. See this article for more details. Ia60e0 b/345472586
- Avoid bundling copies of
FastNative/CriticalNativein the library, and use the stable platform copies. I8238a b/35664282 b/280878596
API Changes
- Introduce
RotarySnapSensitivityfor rotary snap behavior andPagerSensitivityfor pager fling behavior, to allow applications to adjust the sensitivity level of rotary and fling behavior, especially for pagers. Ic3a83 b/449949891 - Simplified changes to
rememberTransformingLazyColumnStatethat were made with the introduction of reverse layout forTransformingLazyColumn, consolidating to a single function and using a sentinel value to use the default anchor index. I09302 b/453731755 - Added a new default
GenericFailureIconto be used inFailureConfirmationDialog, which shows a generic error icon. Renamed existingFailureIcontoConnectionFailureIcon. I8e965 b/453730430
Bug Fixes
- Made
TimePickermore robust when parsing complex locale patterns. I7b169 b/456538838 - Fixed the initial
TransformingLazyColumnlayout whenverticalArrangementisArrangement.Center. Id18ef b/451481233 - Aligned
TransformingLazyColumnStateconstructor withrememberTransformingLazyColumnStatefunction I36d6a b/453731755 - Updated the tick icon for
CheckboxButtonto be rounded. Ie645e b/378645751 - Updated the tick icon for
SwitchButtonto be rounded. I31fbf b/378642590 - Corrected
scrollToItemoffset inTransformingLazyColumnwhich was inverting the scrolling direction. Ib2c93 b/451481233 - Improved
SwitchButtonandSplitSwitchButtonperformance. I708de b/448781327
API Changes
- Add experimental
WebViewBuilderAPIs I06828 b/409740828 - Add
UiThreadStartupModefor async startup that stopsisMultiProcessEnabled()call from startup up Chromium I524ee b/397372092 - Hiding
UserAgentform factor until 1.16 release Ibac8a b/430554841 b/454438418 - Update navigation API to allow applications to provide
NavigationListenerinstances, which can optionally be configured with a custom Executor for background thread callbacks. MultipleNavigationListenerinstances can now be added to a singleWebView.
Additionally, this update also adds timing information to theonFirstContentfulPaintcallback, providing the time information from navigation start to the paint event. I6aa8e b/448580228 - Adds
Profile#addQuicHintswhich allows apps to tellWebViewto prefer QUIC / HTTP3 when connecting to the provided origins. I8e364 b/445339041 - Updated feature constants with experimental annotations, and updated library README with more information about experimental APIs. I1b914
Bug Fixes
- Releasing
androidx.webkit:webkit:1.15.0-beta01I0b1bd b/417241552
Bug Fixes
- Fixes
ClassCastExceptionthat occurs on certain devices 4d58979
New Features
- Add helper methods to construct
WindowSizeClassSetsin a grid form.
API Changes
- Add helper methods to construct
WindowSizeClassSetsin a grid form. I4d623 b/444174274
New Features
- Initial alpha release of the Projected library.
New Features
XrDeviceadded to provide information about device capabilities. Ic9d1f- Added new
ConfigMode.isSupportedAPI for querying session capabilities. Iff7af - Added
XrDisplay.BlendModeAPI. I484e4
API Changes
- Renamed [XrDevice.getPreferredBlendMode] to [XrDevice.getPreferredDisplayBlendMode]. I7e48f