New Features
- Introduces
TiltGestureAPI, providing a reactiveFlowfor stable detection of device tilt (UP/DOWN) state with transition progress. Ic269f b/448152779 - ARCore for Jetpack XR now uses the XR Runtime Logging mechanism. See
androidx.xr.runtime.Logfor more information. l52735 b/448697662
API Changes
Geospatial.createPoseFromGeospatialPosenow works on OpenXR-enabled devices. l362c6
Bug Fixes
Add partial support for baseline profile generation for Kotlin multi-platform modules. Typically dependencies on profiles can be defined using the
baselineProfileGradle configuration in the dependencies block, but this doesn't currently work for KMP modules.kotlin { androidLibrary { namespace = "com.example.namespace" compileSdk = 36 } sourceSets { androidMain.dependencies { // THIS DOES NOT WORK // baselineProfile(":yourProducerProject") } } }Instead you should be defining your dependencies using the
baselineProfile**extension. Ie19c4plugins { id("org.jetbrains.kotlin.multiplatform") id("com.android.kotlin.multiplatform.library") id("androidx.baselineprofile.consumer") } kotlin { androidLibrary { namespace = "com.example.namespace" compileSdk = 36 } sourceSets { androidMain.dependencies { // ... } } } // Define dependencies // This works ! baselineProfile { variants { androidMain { from(project(":yourProducerProject")) } } }
Bug Fixes
- Updated the ExifInterface dependency to 1.4.2. This fixes an image capture failure that occurs on devices producing JPEGs with additional (and permitted) 0xFF bytes before a marker. I16df4
Bug Fixes
- Fixed
CameraExtensionsInfocurrent type issue in CameraX 1.6.0-alpha that the LiveData object can't receive the updated type data. I2c7a5 - Updated the ExifInterface dependency to include a fix for parsing JPEGs with 0xFF padding, which resolves image capture failures on devices where the JPEG encoder adds fill bytes before markers. I0eb49
Bug Fixes
- Fixed a crash when navigating back from a screen with an active text selection. I9f540 b/444482508
API Changes
- Fixed a bug where
AnchoredDraggableState'stargetValuewas incorrect in some scenarios with multiple anchors at the same offset. When settled at an anchor that had the same offset as another anchor,targetValueincorrectly returned the last of the anchors at this offset. It now returns thecurrentValuewhen settled at thecurrentValue's offset. I66a7a b/476365336 - Introduced
FlexBox, a configurable layout system that is a superset ofRow,Column,FlowRow, andFlowColumn. It supports features like flex-grow, flex-shrink, custom wrapping, direction change and detailed alignment control viaFlexBoxConfigandModifier.flex. I44780 - Introduced
Grid, a new non-lazy 2D layout composable inspired by CSS Grid. This initial version allows defining explicit grid structures with various track sizes includingFixed,Percentage,Flex, and content-based options via theconfigblock. The core layout logic supports explicit item placement within the grid usingModifier.gridItem(). All Grid related APIs are currently experimental and require opt-in with@OptIn(ExperimentalGridApi::class). We are actively seeking feedback on this new layout! I04907 b/462550392
API Changes
- Added support for search bar
animationSpecForContentExpandandanimationSpecForContentCollapse. I033a5
Bug Fixes
- Fixed an issue where the content of an expanded
SearchBardid not use a theme-aware color I878e0 b/379441904 - Fixed a bug where
BottomSheetScaffoldwould invokeSheetState'sconfirmValueChangecallback with incorrect values when passing a drag handle toBottomSheetScaffold. Please note thatconfirmValueChangeshould only be used to veto state changes. Use asnapshotFlowto observe state changes. Ice9ee b/465824174 b/477031833
API Changes
- Added a composition local to query Material adaptive scene scope. I2e0d9 b/457721741
- Add a boolean flag to
PaneScaffoldDirectiveto opt out the behavior that automatically moves the focus to the current destination pane. I929f5 b/445720462 ListDetailSceneStrategyandSupportingPaneSceneStrategycan now opt in to handle scenes with only a single pane. I79384 b/417475283
API Changes.
- We've rewritten the
SlotTable, which is the internal data structure used by the Compose Runtime to track your composition hierarchy, determine the changes caused by a recomposition, and store remembered values. This rewrite is focused on improving recomposition performance and does so primarily by using substantially fewer memory copy operations than the gap bufferSlotTable. Certain changes to your composition hierarchy, like reordering a long list of items, can recompose over twice as fast compared to the formerSlotTable. Most other operations are on the order of 10% faster to recompose under the newSlotTableimplementation. TheSlotTableimplementation used by the runtime affects all Composable methods and requires no recompilation. Using the newSlotTableis an app-wide change, including for dependencies. - This
SlotTableimplementation is currently disabled by default and can be enabled by settingComposeRuntimeFlags.isLinkBufferComposerEnabledtotrue. - In release builds with minification enabled, this value is assumed to be
falsein the defaultproguard-rules.profile supplied with the runtime. To enable the newSlotTablein production, this assumption needs to be changed totruein the application'sproguard-rules.profile. See the documentation onComposeRuntimeFlags.isLinkBufferComposerEnabledfor more information. Ib741d b/268366116
New Features
- Added
compositionLocalWithHostDefaultOfwhich allows definingCompositionLocalsthat fallback to the hosting environment (e.g. Android View tags) for their default values. I15b81
Bug Fixes
- Ensured that
Snapshot.sendApplyNotificationscalls cannot return until the necessary apply notifications have been sent. I95f20 b/418800424 - Prevent source information stack traces downgrading to group keys in cases when source information is not present at runtime. If3712
- Introduce
ComposeToolingFlags. These flags are intended to be permanent (as opposed toComposeRuntimeFlags) and are used for tooling features that have non-trivial impact on performance. I87863
External Contribution
API Changes
- Exposed the
TestCoroutineSchedulerto enable usage ofrunCurrent()and ensure access to the shared scheduler instance. Iea662 b/254115946 - Add support for walking up nested scrolling in response to
android.R.id.accessibilityActionShowOnScreenfrom Accessibility. Ib2723 b/431148846
Bug Fixes
- Fixed conversion of custom Android RGB color space. Custom grayscale transforms were incorrectly converted between custom Compose and Android RGB color spaces.ebd45 b/377021410
Bug Fixes
- Removed the unit test dependencies from the artifact. Ib02d9
New Features
- Baseline profiles added to datastore. 3916245 b/469127532.
- Implement WASM/JS support in DataStore via
localStorage. This creates a distinct advantage over the existingsessionStorageimplementation by enabling cross-tab event notifications and synchronization. I67246 b/441511612
API Changes
- Removing deprecated API -
ApplicationSubspaceIa6596 b/468345186 - Updated
SpatialShapeto a sealed interface I7e3f5 b/460426800 - Removing Deprecated APIs in
SpatialAlignment. Ib0b61 b/468011887 - Deprecating
SpatialLayoutSpacerand introducingSpatialSpacer. I2ebf3 b/466071383 - Updated
UserSubspaceAPI to replace "lazy locking" terminology with "soft locking". I9ded1 b/464035984
API Changes
- Renames
PerceivedResolutionResult.InvalidCameraViewtoPerceivedResolutionResult.InvalidRenderViewpointas thegetPerceivedResolutionAPIs now rely on ARCore'sRenderViewpointAPI instead ofCameraViewScenePose. This name better reflects the new implementation. I8c967 b/446989745 b/419311998 - The
PanelEntity/SurfaceEntity.getPerceivedResolutionmethods now take aRenderViewpointprovided by the developer as an argument. Before, the runtime arbitrarily chose theRenderViewpointused in the perceived resolution calculation. I8c967 b/446989745 b/419311998 - Removed
SpatialUser,ScenePose.Head, andScenePose.CameraView. The functionality of these APIs is covered by theArDeviceandRenderViewpointAPIs within ARCore for Jetpack XR. To obtain aScenePosecorresponding to the user's head or left or right eye, developers can usePerceptionSpace.getScenePoseFromPerceptionPosewith the appropriate pose obtained using ARCore APIs. I2f69c b/446989745
Bug Fixes
- Navigation
SafeArgsno longer has configuration caching issues when being used with Google Services. I57cda b/458071608 - Fixed the test
SavedStateHandleconstructor in navigation-testing not decodingList<String>. I26aac b/454180135
New Features
- You can now dynamically add metadata with consideration for the entry key via the
EntryProviderDSL. I942fb b/474416976
Bug Fixes
- Fix crash when using
NavigationEventHandlerin Android Studio Previews. The handler now detects inspection mode and does nothing, allowing the Preview to render without a provided dispatcher. I370f2 b/454313986.
Important changes since 3.3.0:
- Added more KMP targets to
paging-common,paging-testing, andpaging-compose. In total they all now support JVM(Android and Desktop), Native (Linux, iOS, watchOS, tvOS, macOS, MinGW), and Web (JavaScript, WasmJS) paging-common,paging-testing, andpaging-composehas removed support formacosX64,iosX64,watchosX64, andtvosX64to align with Jetbrains deprecation of the macosX64 targets.- Added a new
PagingStateAPIclosestItemAroundPositionto retrieve the loaded item that is closest to the target position and matches the input predicate. This can be used to generate item-based refresh keys where the ideal anchorable item is around but not at the exact target position.
New Features
- Support for different shapes &
RemoteColorsinBorderModifier0afd343 - Add
CombinedActionto support multiple actions on click events 10e16a2
API Changes
- Migrated the APIs of
RemoteColorandRemoteBitmapto use Compose types, rather than exposing Android types directly a9bfbb8 - Introduce a
RemoteDensitytype, to allow determining whether to evaluate Density on the Player (when producing a document for a remote device), or to inline the expressions (to optimize document size when on the same device) 54352bb RemoteState constantValueOrNullrename I6ad5c b/467050397
New Features
AndroidX Tracing 2.0 introduces a significant new API surface for low-overhead, in-process tracing, as a complement to the existing android.os.Tracing-based APIs in Tracing 1.0. The new APIs are available both on Android and host JVM, which enables host tools to emit low overhead traces for performance analysis, using the same standard Perfetto trace format.
Emitted traces are supported both by Android Studio and Perfetto, and can be recorded with an expanded feature set including tagging slices with metadata (such as function arguments!), and coroutine context trace propagation.
This initial alpha is only meant for in-process tracing workflows, and does not yet integrate with Android OS tracing or Studio Profiler System Tracing - these will be coming in a future alpha.
/**
* A [TraceSink] defines how traces are serialized.
*
* [androidx.tracing.wire.TraceSink] uses the `Perfetto` trace packet format.
*/
fun createSink(): TraceSink {
val outputDirectory = File(/* pathname = */ "/tmp/perfetto")
// We are using the factory function defined in androidx.tracing.wire
return TraceSink(
sequenceId = 1,
directory = outputDirectory
)
}
/**
* Creates a new instance of [androidx.tracing.TraceDriver].
*/
fun createTraceDriver(): TraceDriver {
// We are using a factory function from androidx.tracing.wire here.
// `isEnabled` controls whether tracing is enabled for the application.
val driver = TraceDriver(sink = createSink(), isEnabled = true)
return driver
}
fun main() {
val driver = createTraceDriver()
driver.use {
driver.tracer.trace(category = CATEGORY_MAIN, name = "basic") {
Thread.sleep(100L)
}
}
}
API Changes
- Make
Tracera property of theTraceDriver. Iabd9b - Add support for manual context propagation. I899ff
- Add the ability to add call stack information in a trace section. If6a1b
- Introduce the new
androidx.tracingAPIs. I5102b - Allow instant events to contain metadata, and add counters to instants & counters. Ia2ed3
- Reduce the surface area of the API annotated with
@DelicateTracingApi. Nothing in the top level API should require the use of@DelicateTracingApi. I565e0 - Simplify context propagation by unifying
PropagationTokens. Iab839 - Stabilize
BlackHoleAPIs inandroidx.benchmark. I2b67e b/451749438 - Add the ability to annotate the trace section as a root span. Ic8365
- Allow the developer to explicit about propagation tokens. I06bb1
- Renamed
MetadataHandleCloseabletoEventMetadataCloseable, andMetadataHandletoEventMetadata. Also added an optionalCoroutinePropagationTokenargument toTracer.traceCoroutineto allow the developer to explicitly specify the propagation token to use. I219f7 b/454147392 - Introduced a new
Tracerentry point which gives developers a lot more control on how to trace. I24a7b - Add the ability to control how context propagation happens in a
SliceTrack. Ieb8fc fillCountinPooledTracePacketArrayis now correctly marked volatile. I75d2c- Mark
MetadataEntry@DelicateTracingApi. I8c723 - Add the ability for a
TraceSinkto be able to handle lost trace events (when the pool is exhausted). I3b374 - Add the ability to conditionally emit trace events based on a predicate. I621b4
- Add the ability to add categories to a trace event. I449c2
- Mark
TraceEvent,PooledTracePacketArrayasDelicateTracingApi. Iaac6d - Make
ProcessTrack.id,ThreadTrack.id,ThreadTrack.name,CounterTrack.nameandCounterTrack.parentpublic. I81210 - Renamed the
SliceTrack.traceFlow()API totraceCoroutine(). I79ad0 - Add the ability to add contextual information to slices via debug annotations in a Perfetto trace. Ic2b56
- Make it possible to construct an instance of
WireTraceSinkwith aFile/OutputStream. Iecea0 - Removing obsolete
@RequiresApi(21)annotations Ic4792
- There are no new changes between the beta01 and rc01.
API Changes
- Rename
PagerScaffoldDefaults.SnapPositionalThresholdtoLowSnapPositionalThresholdandRotaryScrollableDefaults.SnapSensitivitytoLowSnapSensitivityI157ee b/449949891 - Removed modifier from
SwipeDismissableSceneStrategy. Iff30f b/449949891
Bug Fixes
- Fix rotary over-scroll animation lag in snap behavior I7db89 b/474016470
- Fix
SwipeDismissableSceneStrategyblocking system back on API 36+ Icf20b b/476105162 - Fix
SwitchButtonanimation to scale/fade as a complete shape I7a7eb b/378644361 - Improve
CheckboxButtoncheck icon intro rotation animation I89944 b/378646769
API Changes
- A new kotlin
Transformationmodifier has been added. I195a7 b/397169191
Bug Fixes
- We have fixed the issue with better resource handling by removing stateful
ProtoLayoutScopefromTileService. I5dc0a b/474614772
API Changes
- We have added metadata keys for the major/minor Tiles schema version as an XML tag. I2cf66
Bug Fixes
- We have fixed the issue with better resource handling by removing stateful
ProtoLayoutScopefromTileServiceand fixed the issue about keys for holding the resources data. I5dc0a b/474614772 - Code for unbinding service when update is requested is run on the main thread for testing environments. 8fd7348
New Features
- Add support for static previews of complications 8b2bed3
Bug Fixes
- Updated dependency on Play Basement version which contained CVE-2022-2390 vulnerability.
Bug Fixes
- Fix network state constraint from passing while connectivity is blocked on Android 15 and above. I5abb7 b/465016918
- Fixed network constraint tracking not considering blocked state for its initial value. I8a0a2 b/452081708
- Fixed an issue with network request constraint passing while connectivity is blocked on Android 15 and above. I60f24 b/452081708
API Changes
ConfigMode.HeadTrackingModeis replaced withConfigMode.DeviceTrackingMode. le273e b/467150206- Removed Quaternion's
toNormalized,times(float),div(float)methods. These methods are redundant given that all Quaternions are normalized at construction time and given that the class is immutable. l558fc b/460210457
Bug Fixes
- Added documentation to
Session.createthat illustrates how to avoid creating a session on the application’s main thread. le5554 b/463687170 - Prevented applications from creating a
BoundingBoxwith aNaNvalue. l58c14 b/464025895