New Features
- Added hand tracking support. Use
Hand.leftandHand.rightto access the tracking information. - APIs that generate an anchor (
Anchor.create,Anchor.load,Plane.createAnchor) now all returnAnchorCreateResultand properly implementAnchorCreateResourcesExhausted.
Bug fixes
Anchor.detachno longer causes a fatal crash due to a race condition with the Session update thread.Anchor.createis more stable when running on an emulator
- This release moves Autofill 1.3.0 into stabilization.
API Changes
- Moved
TraceProcessor.runSession()extension APIs to be experimental, as they are likely to move to be concrete constructors eventually on Android. Ib0528 b/393640753 - Most of the implementation of Startup Insights are now public/experimental, and move to the
TraceProcessorartifact SeeStartupInsights. I0aa00 - Deprecate
BenchmarkRule.runWithTimingDisabled {}in favor ofBenchmarkRule.runWithMeasurementDisabled {}, which more clearly describes the behavior - all metrics are paused. Additionally, expose theMicrobenchmarkScopesuperclass since redeclaring therunWithMeasurementDisabledfunction to open access isn't possible, since it's inline. I9e23b b/389149423 b/149979716 - Benchmark libraries have moved to Kotlin 2.0. I9d1e0
- Removed
androidx.benchmark.startupProfiles.enableinstrumentation argument. It is no longer useful, as it can be controlled byincludeInStartupProfilearg inBaselineProfileRule.collect(). I39eb4
Bug Fixes
- Reduced the amount of Microbenchmark internal functions called during profiling to make e.g. Method traces more clear Ifaed8
- Speculative fix for crashes: 'Failed to stop [
ProcessPid(processName=perfetto, pid=...)]'. Now Benchmark will log a message instead of crashing when a background Perfetto process isn't able to be stopped before running the benchmark. I37d3e b/323601788 - Fix
IllegalStateExceptionswith 'Expectedpm dump-profilesstdout' label that were caused by overly strict output format check. I358dc
Bug Fixes
- Fix crash in
BasicTextFieldwith input transformation when replacing part of the pasted text. I73702
Bug Fixes
- Fixed an issue where overscroll implementations using
LayoutModifierNodewould not work correctly inside scrolling containers.
New Features
Added an
TimePickerDialogAPI that can be used forTimePicker,TimeInputor to have a switchable version. Id2d83New search bar APIs:
- Collapsed search bars and expanded search "views" are now separate composables.
SearchBarrepresents a search bar in the collapsed state.ExpandedFullScreenSearchBarandExpandedDockedSearchBarrepresent the search bar in the expanded state. These open in a new window.SearchBarStateto control the state of the search barTopSearchBarto add insets handling and scroll behavior- New overload of
InputFieldwhich usesSearchBarStateIe0723 b/261496232 b/283311462 b/350916229 b/352872248
API Changes
- Support corner shape morphing of icon buttons on press. I21843
- Text field decorator/decoration box APIs are no longer experimental. I31d95
- Added samples and defaults for the connected variant for
ButtonGroup. I5c8ce - Make state param the last one in
NavigationSuiteScaffoldandNavigationSuiteScaffoldLayout. I9cc7b
Bug Fixes
- Added custom accessibility actions to the
FloatingToolbarsso accessibility services can now expand or collapse allFloatingToolbarvariations. The FAB-equipped version applies this to the FAB, while the FAB-less version applies it to the main content. I26420 - The
FloatingToolbarsnow observe the touch exploration service (e.g., TalkBack) and keep the toolbar expanded and visible whenever the service is on. I02172 - Fixed a crash at the progress and loading indicators in case a
Float.NaNis passed in as a progress. I4fa96 b/352364576
API Changes
- Changed how
isPredictiveBackInProgressis set inMutableThreePaneScaffoldStateanimation functions to preserve state consistency. Idc97f
Bug Fixes
- The default back behavior of
NavigableListDetailPaneScaffoldandNavigableSupportingPaneScaffoldhas been changed toPopUntilScaffoldValueChangefor consistency with the rest of the library. I873f0 - Set the correct accessibility traversing order of pane scaffolds. 67d030
- Fix the issue that pane content states are not saved. 88b0ff
- Support alternative accessibility actions in place of dragging. 28266d
- Announce the current pane split after it's changed. 0c3a80
Bug Fixes
- Rethrow caught exception in pausable composition .384486d
New Features
- Added a lint check to warn against calls to
Configuration#screenWidth/heightDp-LocalWindowInfo.current.containerSizecan be used instead to retrieve the current window size.
Bug Fixes
FragmentContainerView'ssetOnApplyWindowInsetsListeneroverride now takes a null listener, matching what the framework allows. I575f0 b/282790626
Major features of 4.0.0
- AAR files now contain prebuilt static libraries. Application code is now expected to use those libraries via prefabs and only include headers (like
#include "GameActivity.h") instead of including the implementation (like#include "GameActivity.cpp"). - Also Android locale information is now available to the native code that uses
GameActivity.
Bug Fixes
- Numerous bugs in
GameTextInputhave been fixed. The library is now more stable and works with many popular software and hardware keyboards.
New Features
- Disk and network size savings: Serialization of
StrokeInputBatch, saving many lines of code, with the resulting objects a tiny fraction of the size of traditionally stored strokes. Ie898d - Lasso selection: dashed line brush to draw a selection stroke, and a function to turn the selection stroke into a
PartitionedMeshfor geometry queries. Ia38a0
New Features
- The Activity Panel can now scrim its content when a Spatial Dialog is activated.
- The
OrbiterAPI is now usable inSubspaceComposablecontexts and will attach Orbiters to their nearestSubspaceLayout-based composable parent. - Introduced
LayoutCoordinatesAwareModifierNodeto allow custom positioning-based modifiers. - Added attach/detach lifecycle methods to
SubspaceModifier.Node. - Added
scaleWithDistanceto the movable modifier. WhenscaleWithDistanceis enabled, the subspace element moved will grow or shrink. It will also maintain any explicit scale that it had before movement.
API Changes
- Removed
SessionCallbackProviderin favor ofSpatialCapabilities.
Other changes
- Reduced
minSDKto 24. All Jetpack XR APIs continue to require API 34 at runtime. OrbiterEdgeOffset.inner,EdgeOffset.outer, andEdgeOffset.overlapconstructors are no longer@Composablemethods, which allows them to be used in non-composable contexts.- Update Spatial Elevation Levels to match the latest UX spec.
- Implement
SubspaceSemanticsInfointerface intoMeasurableLayout. - Renamed
SubspaceModifierElementtoSubspaceModifierNodeElement.
Bug fixes
- Fixes to stabilize
SubspaceModifierordering.SubspaceModifiershould behave more reliably. Offset, rotate, scale, movable, and resizable modifier should now be usable in any order.
Upcoming breaking change affecting apps built before 1.0.0-alpha02
- Factory methods have been moved from the
Sessionclass to a companion method on each respective type:Session.createActivityPanelEntity(Dimensions, String, Activity, Pose)has been deleted and replaced withActivityPanelEntity.create(Session, Dimensions, String, Pose)Session.createAnchorEntity(Anchor)has been deleted and replaced withAnchorEntity.create(Session, Anchor)Session.createAnchorEntity(Dimensions, Int, Int, Duration)has been deleted and replaced withAnchorEntity.create(Session, Dimensions, Int, Int, Duration)Session.createEntity(String, Pose)has been deleted and replaced withContentlessEntity.create(Session, String, Pose)Session.createExrImageResource(String)has been deleted and replaced withExrImage.create(Session, String)Session.createGltfEntity(GltfModel, Pose)has been deleted and replaced withGltfModelEntity.create(Session, GltfModel, Pose)Session.createGltfModelResource(String)has been deleted and replaced withGltfModel.create(Session, String)Session.createInteractableComponent(Executor, InputEventListener)has been deleted and replaced withInteractableComponent.create(Session, Executor, InputEventListener)Session.createMovableComponent(Boolean, Boolean, Set<AnchorPlacement>, Boolean)has been deleted and replaced withMovableComponent.create(Session, Boolean, Boolean, Set<AnchorPlacement>, Boolean)Session.createPanelEntity(View, Dimensions, Dimensions, String, Pose)has been deleted and replaced withPanelEntity.create(Session, View, Dimensions, Dimensions, String, Pose)Session.createResizableComponent(Dimensions, Dimensions)has been deleted and replaced withResizableComponent.create(Session, Dimensions, Dimensions)Session.createStereoSurfaceEntity(Int, Dimensions, Pose)has been deleted and replaced withStereoSurface.create(Session, Int, Dimensions, Pose)
- The following deprecated methods were removed:
Session.canEmbedActivityPanel(Activity)has been deleted. UsegetSpatialCapabilities.hasCapabilility(SPATIAL_CAPABILITY_EMBED_ACTIVITY)instead.Session.hasSpatialCapability(Int)has been deleted. It has been replaced in favor of usinggetSpatialCapabilities().hasCapability()as a more compartmentalized way to check for the presence of spatial capabilities sincegetSpatialCapabilities()returns aSpatialCapabilitiesobject.Session.requestFullSpaceMode()has been deleted and replaced withSpatialEnvironment.requestFullSpaceMode()Session.requestHomeSpaceMode()has been deleted and replaced withSpatialEnvironment.requestHomeSpaceMode()
Session.setFullSpaceMode(Bundle)andSession.setFullSpaceModeWithEnvironmentInherited(Bundle)have been moved to extension functions. Developer files will need to add the new imports for access:import androidx.xr.scenecore.setFullSpaceModeimport androidx.xr.scenecore.setFullSpaceModeWithEnvironmentInherited
Session.setPreferredAspectRatio(Activity, Float)has been moved to an extension function. Developer files will need to add the new import for access:import androidx.xr.scenecore.setPreferredAspectRatio
Session.getEntitiesOfType(Class<out T>)andSession.getEntityForRtEntity(RtEntity)have been moved to extension functions. Developer files will need to add the new imports for access:import androidx.xr.scenecore.getEntitiesOfTypeimport androidx.xr.scenecore.getEntityForRtEntity
Session.unpersistAnchor(Anchor)has been deletedSession.createPersistedAnchorEntity(UUID)has been deleted
Known issues
PanelEntity.setCornerRadius()andActivityPanelEntity.setCornerRadius()may not take effect until the panel is next moved, this can be mitigated by moving the panel to its current position- When
BoundsChangedis called on theActivitySpace, someActivityPoses may not have been correctly updated. It will be updated on the followingOnSpaceUpdatedcall on theActivitySpace
Breaking & behavioral changes
PanelEntityandActivityPanelEntitywill have a default corner radius of 32dp or smaller if the panel has a width or height smaller than 32dp
New APIs and capabilities
- Introduces
StereoSurface.CanvasShape, which allows for the creation ofSphericalandHemisphericalcanvases for rendering immersive media. StereoSurfaceEntity.create()now accepts aCanvasShapeparameter. (This parameter is currently ignored, but will be used in a future release)StereoSurfaceEntity.create()no longer takes aDimensionsparameter. Applications should control the size of the canvas through setting theCanvasShapeStereoSurfaceEntityhas aCanvasShapemember which can be set dynamically.StereoSurfaceEntity.dimensionsis now a read-only property; applications should set theCanvasShapeto change dimensions.StereoSurfaceEntitynow allows theStereoModeto be re-set after construction.
Other changes
- Reduced compile-time minSDK to 24. All Jetpack XR APIs continue to require API 34 at runtime.
SceneCore's Session factory (Session.create) no longer launches an intent to acquire theSCENE_UNDERSTANDINGpermission. Instead, the client application must explicitly request the permissions from the user, before attempting to create the anchors. Anchor creation will fail if the permission is not granted by the user.
Bug fixes
getActivitySpacePose()has been fixed to account for theActivitySpacescale by returning translation values in scaled meters rather than always returning non-scaled meters.transformPoseTonow also uses the right units to compute coordinate changes when theActivitySpaceis involved in the source or destination.- The skybox will now be set to an all-black skybox whenever a null skybox preference is passed using
setSpatialEnvironmentPreference(new SpatialEnvironmentPreference(null, geom)). To revert to the system default skybox and geometry, usesetSpatialEnvironmentPreference(null).
API Changes
- Move
MutableStateSerializertosavedstate-composefromlifecycle-viewmodel-compose. I4f690 b/378895074
External Contribution
- Adds a new Lint issue for calling
Lifecycle::currentStatein composition, instead suggesting usingcurrentStateAsalue().valueto ensure that changes in the Lifecycle state correctly cause recomposition. Thanks Steven Schoen! Iad484
Bug Fixes
- Navigation Safe Args now provides support for composable destinations. I35320 b/362791955
New Features
- Navigation Safe Args actions are now generated with the
@CheckResultannotation to ensure they are used. I14d4c b/356323084
Bug Fixes
- Fixed an error in
NavControllerwhere the backStack states were incorrectly attempted to be restored into an array when they were saved into a list. Idfb9b - From Navigation
2.8.7: Navigation Safe Args now provides support for composable destinations. I35320 b/362791955
Bug Fixes
- Fix an issue with
RoomDatabase.inTransaction()opening a closed database when it shouldn’t and should quickly return false if the database is closed b/325432967. - Fix a crash (
IllegalArgumentException: not a valid name) in Room’s compiler when processing DAO functions with Kotlin inline / value classes b/388299754. - Include Proguard rules in the JVM artifact of
room-runtimeso that the default constructor of the generated database implementation is not removed since it is used by Room’s default initialization that uses reflection b/392657750.
New Features
- Move
MutableStateSerializertosavedstate-composefromlifecycle-viewmodel-compose, allowing you to use the SavedState Serialization APIs with Compose’sMutableState. I4f690 b/378895074
API Changes
API Changes
- Specified nullability of
SwipeRefreshLayoutmethod parameters and return types I006d1 b/236497776
Bug Fixes
- This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage:
-Xjspecify-annotations=strict(this is the default starting with version 2.1.0 of the Kotlin compiler). Iaf490 b/326456246
API Changes
- Moved all the code from the
tracing-ktxmodule totracing. Iba550 - Converted
androidx.tracing.Traceclass to Kotlin. Ie4e5d
Bug Fixes
- 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
Bug Fixes
- We have guarded against a crash when accessing the global reducemotion setting, which was triggered on some platforms where that setting was not provided. I01e2c
New Features
- Add
FontSettinglist parameter for Material3 text. Ic102d - Added
DynamicDataMapclass whichStateBuildernow supports for a better type safe Kotlin API for app states I012ba - Added factory methods such as
intAppDataKeyfor easier creation ofAppDataKeyobjects Icea2a DynamicDataValuenow has ahasValueOfType(Class<?>)method in addition tohasInt/hasColor/.... methods I4f7a6- We have added
errorDimto the Material3 ProtoLayoutColorScheme, for high priority errors or emergency actions such as safety alerts. Ia17bb - We have added a guard against a crash when accessing the global reducemotion setting, which was triggered on some platforms where that setting was not provided. I01e2c
API Changes
addKeyToValueMappingis renamed toaddToStateMapandDynamicDataMap.putmethods are removed as they were redundant. Ibe9dd- Material3 Typography now supports roundness variable axis for system fonts that support this axis. ProtoLayout
FontSettingsupports roundness axis for fonts that support this axis. I33eb5 - Renamed
multilineAlignmentto alignment in Material3 text method. I2b66b - Update the circular progress indicator to be Box type, also specify the
mainContentinconstructGraphicto be Box type I5a3dc - Better support for using circular progress indicator in graph I039db
Bug Fixes
- Allow dynamic values in
ColorStopand also for start/end angles inSweepGradient. I0146d - Docs fixes. I4a63a
- Updated Material 3 components (
graphicCardandavatarButton) to provide fallback whenweightexpand dimension is not supported (e.g. below API 33). Updated text component to fallback toTEXT_OVERFLOW_ELLIPSIZE_ENDwhenTEXT_OVERFLOW_ELLIPSIZEis not supported by the renderer. I19e2c - Docs update for
PrimaryLayoutMargins. Ibaf7b
API Changes
TileService.onRecentInteractionEvents()to returnListenableFuture<Void>to allow for long running tasks. Iaa6c5
API Changes
- Add Async suffix to prerender API. Rename any Data to Header in
NoVarySearchto reflect the new name. Ie91c9 - Add executor parameter to the url prerendering API. Also, restricting the API to be called only from the UI thread. I50520
- Add an API to configure cache config for the profile prefetch requests. It also applies to Prerender requests initiated from
WebViewsassociated with this Profile. Iebb6e
Bug Fixes
- Change behavior of
URLUtilCompat.guessFileNameto only use themimeTypeparameter to suggest an extension for filenames derived from the URL parameter. I53ecd b/382864232
New Features
- Fix an annotation that was only on the property but not the getter.
Breaking & behavioral changes
OpenXRruntime functions that return an Anchor now throwAnchorResourcesExhaustedExceptionif they encounter an error code notifying that theOpenXRresource limit has been reached.- Permission
android.permission.HAND_TRACKINGis now required forSession.createandSession.resume.
New features
- Added hand tracking support.
Bug fixes
- Creating anchors is more stable when running on an emulator