Bug Fixes
- Fixed a resource leak in Viewfinder where SurfaceControl was not properly released. If9da7 b/532595493
API Changes
- Deprecated legacy Camera2Interop APIs (
Camera2Interop.Extender,Camera2CameraControl,Camera2CameraInfo, andCaptureRequestOptions) in favor ofCamera2Interopconfigurator factory methods and Kotlin extension functions. Ib0845 b/529609261 - Added Kotlin DSL
camera2Interopextension blocks forpreview,imageAnalysis,videoCapture,imageCapture, andSessionConfig.Builder, as well asCameraControl.applyCamera2InteropAsyncextension function. I51af9 b/529609261 - Added new
Camera2Interopconfigurator factory methods (forUseCase,forImageCapture,forSessionConfig,forCameraControl) and correspondingsetInterop/applyInteropAsyncmethods onPreview.Builder,ImageCapture.Builder,ImageAnalysis.Builder,VideoCapture.Builder,SessionConfig.Builder, andCameraControl. I0007b b/529609261 - Added helper methods to
Camera2Interopand equivalent Kotlin extension properties (CameraInfo.cameraId,CameraInfo.cameraCharacteristics, andString.toCameraSelector()) to retrieve Camera2 camera ID and characteristics fromCameraInfo. I11803 b/529609261 - Added
Preview.setMirrorMode,Preview.getMirrorModeandVideoCapture.setMirrorModeto public APIs, and removed theExperimentalMirrorModeannotation. I4ed60 b/519794349 b/470629643 - Added Kotlin DSL builders
preview{ ... },imageCapture{ ... },imageAnalysis{ ... }, andvideoCapture{ ... } for creatingUseCases. I91df9 b/530013719 - Modified ImagePlane.buffer to be non-nullable ByteBuffer. I98593
- Deprecated the property getters on
SessionConfig.Builder,HighSpeedVideoSessionConfig.Builder, andExtensionSessionConfig.Builderin Kotlin DSL to enforce write-only properties. I2875b b/534570559
Bug Fixes
- Fixed an issue where binding multiple
Previewuse cases with anOverlayEffectcaused one Preview stream delivery failure. I7a383 b/532577546 b/532924417 - Fixed an issue where
Recording.pause()andRecording.resume()failed when switching cameras during a persistent video recording. I71004 b/532327691 b/367121726 - Fixed HAL crashes when using Zero-Shutter Lag (ZSL) while zooming across physical camera boundaries on multi-camera devices. I1c374 b/527782712 b/514757157
- Fixed an issue where HDR video recording could fail on Samsung Galaxy S25, S26, and Fold 7 devices. Ic0827 b/529618629
API Changes
- Restored
EnterTransition.withas deprecated withDeprecationLevel.HIDDENfor binary compatibility. I71214 b/535291175 - Annotated overridable empty base methods across Compose with
@EmptySuperto denote that overriding implementations should not invoke super. Id407b - Introduced
CapturedAnimatedVisibility, an alternative toAnimatedVisibilitythat immediately disposes child composition on exit and animates the last rendered frame via aGraphicsLayer. I6c5b3 - Renamed the
rememberTransitionoverload that accepts aDeferredTransitionStatetorememberDeferredTransitionto disambiguate it from the standardTransitionStatevariants. I7bb7e - Made
EnterExitTransitionConfigpublic forEnterTransitionandExitTransition. Idd5a4 b/330152398 Transition.CrossfadeandcreateChildTransitionare now stable.EnterTransition.withhas been removed (usetogetherWith). I38f66createChildTransitionis now stable. Ied832 b/261422996androidx.benchmarknow has aminSdkof 24. Ic2a85- Exposed the current animated value on
DeferredTargetAnimation. Ie4f6e b/434659224 - Replace experimental
@AnimationToolingApiwith@RestrictToAPI that has stricter tracking guarantees. Ia4fd1 b/524317805 - Made
unveilInandveilOutAPIs stable I9e3a3
Bug Fixes
Breaking Changes
- Following on from the announcement in the previous release,
Modifier.onFocusedBoundsChangedhas had its implementation fully removed. Using this modifier now no-ops. Migrate to usingFocusTargetModifierNode.getFocusedRect()to query this information on demand as needed. Ia39db b/220030968
API Changes
- Providing
LazyLayoutCacheWindowandLazyGridPrefetchStrategyviaLazyGridStatehas been deprecated in favour of providing aLazyLayoutCacheWindowto the composable function. I3f31e - Remove
isSkipItemPlacementAnimationFixEnabledflag I890f3 b/493183465 - Remove
isClearNestedScrollCoroutineScopeFixEnabledflag Iedfd7 b/506963276 - Changed flag
isCacheWindowVisibleItemCountCheckEnabledtoisCacheWindowLookaheadCheckEnabledI2ea06 TextFieldStatenow saves and restores text style information.AnnotatedString.Annotation.Saveris now public to allow saving and restoring ofAnnotatedString.Annotationobjects. I8b533 b/135556699- Adds a cache window to lazy staggered grid layout. To revert to the old prefetch behaviour, set
isUsingCacheWindowInStaggeredGridsto false. I1c70d FlexBoxand its related configuration APIs have been promoted to stable and are no longer experimental. I209ed b/475491619- Added
maxItemsInEachLineconfiguration toFlexBoxto allow limiting the number of items per line when wrapping is enabled. I2744b b/475491619 - Annotated overridable empty base methods across Compose with
@EmptySuperto denote that overriding implementations should not invoke super. Id407b - Promoted
WindowInsetsvisibility and animation APIs to stable. I37441 b/537329254 - Clicks on clickable elements now automatically play interaction sound effects on Android. Ia72f8
- The cache window now refils the ahead window if the number of visible items change without having scrolled. Set the
isCacheWindowVisibleItemCountCheckEnabledflag tofalseto disable this check and revert to old behaviour. I67b5a - Updated
NestedScrollDispatcher.coroutineScopeproperty to safely return a cancelledCoroutineScopewhen unattached or detached. I9b112 b/535290281 - Renamed
enableNonScrollCachingtoisNonScrollCachingEnabledI7a54b b/535290282 - Added @
CheckResulttoSemanticsNodeInteraction.isDisplayed() andisNotDisplayed() to ensure their return values are asserted, preventing silent test failures when developers mistakenly use them instead of assertion APIs. I1b447 b/508178494 - Make
LazyLayoutCacheWindowstable I2cda3 - Added the
bringIntoViewSpecparam for Horizontal and Vertical Pager to allow overriding Pager's default implementation. Icdcbf b/505052292 - Fixes a bug in the lazy layout prefetch scheduler's idle detection. Previously, the scheduler might have incorrectly considered itself idle when a frame is severely delayed, potentially leading to jank when scrolling. To revert to the old behaviour set the
isLazyPrefetchSchedulerIdleTimeFixEnabledcompose flag to false. If0594 b/458024295 - Introduce
coroutineScopeOrNull()inNestedScrollDispatcher, an alternative API to access the dispatcher's parent coroutine scope. I18c0f - Fixed horizontal text shifting during overscroll in Compose. Can be disabled via
AndroidComposeFoundationFlags.isOverscrollPixelRoundingEnabled. Ica169 b/532079110 b/532081619 - Introduce the flag
isDraggableZeroDeltaConsumptionEnabledto control the rollout of this fix in Draggable. Zero delta events are now processed correctly. I50eb1 b/524163413 - Text selection is now safely constrained to the text length during concurrent text updates to prevent crashes. I64fd7
androidx.benchmarknow has aminSdkof 24. Ic2a85- The links are now better handling the clicks when span multiline. The touch target has been override to 0 to support this. If this is not a desirable behavior, use
ComposeFoundationFlags.isLinkMinimumTouchTargetSizeZeroEnabledflag to override it. Ide41b b/361106057 - Fixed a low-volume exception when writing to a mutable state object. I48194 b/503110696
- Expose observable
keysonSaveableStateHolderto simplify navigation/back stack state management and remove the need for externalkeytracking. Access viaholder.keys; remove withremoveState. I9bbbb b/398887924 - Removes experimental outdated
IndirectPointerEventhelper function. I05dee b/499336763 b/501098299 b/501098376 b/513249467 - Make
LocalBringIntoViewSpecstable on Android. Ibcb97 - Add
isMultiLaneCacheWindowEnabledflag I3d997 - Created a new
SelectionStateAPI, to be passed toSelectionContainerfor observing selected text and programmatically updating selection." into androidx-main am: 929401883c am: c02871cac4 I15bd4 - Added
LocalTextFieldContentObserverRegistrationExecutorthat offers a way to delegate the implicitContentObserverregistration that happens inTextFields to a background thread. Ib4fa6 b/505287297 b/509842675 - Renamed
TextObfuscationMode.DefaulttoSystem.TextObfuscationMode.RevealLastTypednow acts as an absolute override and always reveals the last typed character. The default argument ofBasicSecureTextFieldis updated to System. If26d3 b/425658491 b/453647378
Bug Fixes
- Fixed an issue where fast scrolling in Compose nested inside an Android scroll container (like
ScrollVieworCoordinatorLayout) would sometimes calculate incorrect velocity. I0f017 - Fixed an issue in
FlexBoxwhere focus traversal did not match the visual order of items when using reverse directions, reverse wrap, or custom item order. I4cc61 b/521609263 - Fixed an issue where standard layout modifiers like
Modifier.fillMaxWidth()andModifier.fillMaxHeight()had no effect on items insideFlexBoxunless an explicit flex grow factor was specified. Ib0ac3 b/515657458 - Optimized file-level initialization of
foundationtop-level value class properties by using dynamic getters. I570d7 - Optimized companion object initialization of
foundation-layoutvalue classes (WindowInsetsSides, etc.) by using dynamic getters. I01c2b - Fixed an issue where Compose text selection context menu items displayed stale strings after an in-app locale switch when Activity restarts were disabled via
android:configChanges. Ic910b b/515156417 - Optimized companion object initialization of
compose:foundationvalue classes (KeyModifiers,MarqueeAnimationMode,Source, etc.) by using dynamic getters. I78455 - Fixes style animations to ensure that, when transitioning to and from a value that is only conditionally set in an animation, it will be treated as animating to and from the default value of the property. I8e41d b/527140078
- Fixed an issue in Grid where auto-placed items with a span larger than the available explicit tracks in the constrained direction would bleed outside the grid's bounds when gaps were applied. I00ce0 b/506570362
- Cleans up API information Ia8066
- Fixed a bug in
BasicTextFieldwhere it would not correctly provide extracted text updates to the IME when requested. I746fa b/203549026 b/492363474
API Changes
- Added
ElevatedToggleButtonDefaults,FilledTonalToggleButtonDefaults, andOutlinedToggleButtonDefaults, and cleaned up non-semantic shape properties inToggleButtonDefaults. Ia0a85 - Fixed a11y contrast issue for the horizontal
NavigationItem's label in high contrast themes. The label's color is now specified viaselectedTextColorTopIconPosition(vertical item's label color, which has not changed) andselectedTextColorStartIconPosition(horizontal item's label color, now set to matchselectedIconColor). To revert this update, pass inShortNavigationBarItemDefaults/WideNavigationRailItemDefaults.colors().copy(selectedTextColorStartIconPosition=MaterialTheme.colorScheme.secondary) I85855 b/490910896 - Scroll offset variables have been removed from
SearchBarScrollBehaviorand should now be accessed via the new classSearchBarScrollState. Ib24e4 - Promoted
BottomAppBarand its associated methods to stable. These APIs no longer require the @ExperimentalMaterial3Apiopt-in. I42c61 - Saved active selection mode in
TimePickerStateacross state restorations and addedinitialSelectionparameter toTimePickerStatefactory function. Iad905 ExposedDropdownMenuis now an extension function onExposedDropdownMenuBoxScopeinstead of a member. You may need to update your code with a new import. Ie8a65 b/356452026
Bug Fixes
- Fixed an issue where partial color customization in
MenuDefaults.itemColorsoverwrote unprovided colors withColor.Unspecified. Iea847 - Fixed
TalkBackannouncements to read formatted time values in the scrollableTimePicker. Ice981 - Fixed a crash in
ExposedDropdownMenuwhen screen height is smaller than menu height. I6adf1 - Fixed wrong content padding of wide navigation rail. Bottom padding is now 0. To revert this update you can set
contentPadding = PaddingValues(0.dp,44.dp,0.dp,44.dp). I572bb - Updated the public API surface to align with recent API review feedback. I71aff b/532657001
External Contribution
- Fixed Material3
SliderLabelnot showing while dragging the slider by its thumb with a mouse. I97a6d b/533483487
New Features
We are excited to announce the release of the adaptive-navigation3 library. This new library, part of the Material Adaptive and Navigation3 ecosystem, is designed to help you build adaptive Material UIs integrated with the Navigation3 library.
Use scene strategies to implement a canonical list-detail pane scaffold (
ListDetailSceneStrategy,rememberListDetailSceneStrategy) or a supporting pane scaffold (SupportingPaneSceneStrategy,rememberSupportingPaneSceneStrategy). For more information about scenes, scene strategies, and other new concepts introduced in Navigation 3, refer to the Navigation3 guide.ListDetailPaneScaffoldandSupportingPaneScaffoldare now supporting margins and edge-to-edge.
Important changes since 1.2.0:
- Support RTL with pane expansion anchors I0770b
Important changes since 1.11.0:
Updates to the Experimental Slot Table
- We've made progress towards stabilizing the experimental
LinkTableimplementation introduced in 1.11. The new implementation is designed to improve recomposition performance, especially with small random changes. We encourage users to try the newSlotTableand report any issues you encounter. SeeComposeRuntimeFlags.isLinkBufferComposerEnabledfor more information.
Side Effect with Keys API
- Added an overload to
SideEffectthat accepts key arguments. The new API can be used to fire one-shotSideEffects without the need for aLaunchedEffectorDisposableEffectwhoseCoroutineScopeoronDisposeblock are unused. I528b2 b/476108743
API Changes
We've adjusted the
LinkTablefeature flag to reduce contention in merged proguard rule sets and to increase compatibility when an app is minified outside of Gradle. The proguard syntax used to configure the flag has changed slightly. See below, and note the added parenthesis I419da:-assumevalues public class androidx.compose.runtime.ComposeRuntimeFlags { static boolean isLinkBufferComposerEnabled() return true; }produceState()andFlow.collectAsState()now accept aSnapshotMutationPolicyargument to control the equality and merging policy of the underlyingStateobject. I0c167 b/405128869Made
@ComposableTargetrepeatable. See the updated documentation for more information. I99a89 b/481422057Added
RecompositionTracerto record recomposition invalidation flow I1dbc1 Ia991d b/531813367Exposed observable
keysonSaveableStateHolderto simplify navigation/back stack state management and remove the need for externalkeytracking. Access viaholder.keys; remove withremoveState. I9bbbb b/398887924Added
staticCompositionLocalWithComputedDefaultOfto createProvidableCompositionLocalsthat act as static when provided, or computed when unprovided. I844e4
Bug Fixes
- Fixed an issue in the
GapComposerthat can causeRememberObserverinstances after awithCompositionLocalblock to incorrectly execute their forget callbacks beforeRememberObservers in the block. I4d54c - Fixed a low-volume exception when writing to a mutable state object. I48194 b/503110696
- Fixed a bug in
SnapshotStateSet.writeToParcelwhere it was only serializing the first entry. I64f4c b/537461421 - The
CancellationExceptions used to cancelLaunchedEffects and rememberedCoroutineScopeshave been tweaked for clarity when appearing in stack traces. I89840 b/449897855 - Optimized companion object initialization of
compose:runtimevalue classes (ComposeStackTraceMode,GroupKind) by using dynamic getters. I50640 - Remove requirement for
compileSdk37 If78b4
External Contribution
### Downloadable Variable Fonts & Zero-Config Setup (ui-text-google-fonts)
• Variable Fonts & Zero-Config GMS certificates!
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontVariation
import androidx.compose.ui.text.googlefonts.Font
import androidx.compose.ui.text.googlefonts.GoogleFont
val fontFamily = FontFamily(
Font(
googleFont = GoogleFont("Google Sans Flex"),
// Automatically uses default GMS certificates!
variationSettings = FontVariation.Settings(
FontVariation.weight(900),
FontVariation.slant(0f)
)
)
)
──────
### Wide Color Gamut (WCG) Support (ui-graphics)
WCG Preservation: * Non-sRGB color spaces (e.g., AdobeRgb, DisplayP3) set on Paint or Shader are preserved on API 29+. * Falls back to sRGB on older API levels.
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.colorspace.ColorSpaces
val wcgColor = Color(0.9f, 0.5f, 0.1f, colorSpace = ColorSpaces.AdobeRgb)
val paint = Paint().apply {
color = wcgColor // Preserved on API 29+
}
──────
### Hardware-Accelerated Mesh Gradients (ui)
• Painter API: Modifier.meshGradient is replaced by MeshGradientPainter, which uses hardware-accelerated Canvas.drawMesh.
• Usage: Use MeshGradientPainter inside Modifier.paint.
import androidx.compose.ui.draw.paint
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.MeshGradientPainter
val meshPainter = remember {
MeshGradientPainter(rows = 1, columns = 1, hasBicubicColor = true) {
setVertex(0, 0, Offset(0f, 0f), Color.Red)
setVertex(0, 1, Offset(1f, 0f), Color.Blue)
setVertex(1, 0, Offset(0f, 1f), Color.Green)
setVertex(1, 1, Offset(1f, 1f), Color.Yellow)
}
}
Box(Modifier.fillMaxSize().paint(meshPainter))
──────
### 4. Credential Manager Integration (ui)
Autofill: * Adds low level credentialRequest semantics property for API 34+ text fields.
import androidx.compose.ui.semantics.credentialRequest
import androidx.compose.ui.semantics.CredentialRequestData
import androidx.compose.ui.semantics.semantics
BasicTextField(
value = value,
onValueChange = onValueChange,
modifier = Modifier.semantics {
if (Build.VERSION.SDK_INT >= 34) {
credentialRequest = CredentialRequestData(request, callback)
}
}
)
──────
### 5. Automatic Interaction Sounds (ui)
Click and Nav sounds: * Support Android-compatible click and nav sounds using platform sound configuration. * Opt-out: Use SoundEffectOnInteraction wrapper to disable sounds for a subtree.
import androidx.compose.ui.platform.SoundEffectOnInteraction
// Opt-out of sounds for everything inside
SoundEffectOnInteraction(enabled = false) {
Button(onClick = {}) {
Text("Silent Button")
}
}
### 6. Espresso Integration for Hybrid UIs (ui-test)
Scope Compose interactions to the View hierarchy matched by an Espresso ViewInteraction.
import androidx.compose.ui.test.junit4.onRootWithViewInteraction
import androidx.test.espresso.Espresso.onView
// Match RecyclerView row using Espresso
val specificRow = onView(allOf(withId(R.id.row), hasDescendant(withText("Item #5"))))
// Scope Compose interactions to that row
composeTestRule.onRootWithViewInteraction(specificRow)
.onNodeWithTag("fav_icon")
.performClick()
API Changes
- Adds the
isVelocityTrackerMinSampleSizeFixEnabledfeature flag Ic9b51 b/533444810 b/533775739 b/523705159 - Removed obsolete
ExperimentalVelocityTrackerApiannotation class. I6f9c6 b/483449576 - Remove isClearNestedScrollCoroutineScopeFixEnabled flag Iedfd7 b/506963276
TextFieldStatenow saves and restores text style information.AnnotatedString.Annotation.Saveris now public to allow saving and restoring ofAnnotatedString.Annotationobjects. I8b533 b/135556699- Introduced
TestFailurePolicyandTestFailureHandlerinComposeTestConfigto support custom failure event handlers and failure artifact context in Compose UI tests. Ib1a85 b/414802953 b/291106656 b/430644575 - Added
SemanticsProperties.alpha to expose the resolved composite parent-child alpha values of layout nodes for testing. Ifddb6 b/524035059 - Deprecated the
createComposeRule,createAndroidComposeRule, andcreateEmptyComposeRuleoverloads in theui-test-junit4v2 package that take individual parameters. Use the overloads acceptingComposeUiTestConfigor the parameterless overloads, which use a defaultComposeUiTestConfig. Note that a defaultComposeUiTestConfigsets the initial input mode toInputMode.Touchat the start of each test. This might cause existing tests expecting keyboard mode (InputMode.Keyboard) to fail. To fix affected tests, passComposeUiTestConfig(inputMode = InputMode.Keyboard)explicitly and remove any manual setup logic for input modes. Alternatively, you can setAndroidComposeUiTestFlags.isInputModeSetForDeviceTests = falseto temporarily disable setting the default input mode at the start of each test and retain legacy behavior while migrating your tests. This flag will be removed in the future, so if only a small number of tests fail, it is recommended to resolve the tests directly by changing their configuration instead. Idfb86 b/504195741 - No-argument calls to
createComposeRuleandcreateAndroidComposeRule(e.g.,createComposeRule()orcreateAndroidComposeRule<MyActivity>()) now use a defaultComposeUiTestConfig, which sets the initial input mode toInputMode.Touchat the start of each test, ensuring the device is in a clean state and preventing previous input mode changes from leaking across tests. However, this new default touch mode might cause existing tests expecting keyboard mode (InputMode.Keyboard) to fail. To fix affected tests, passComposeUiTestConfig(inputMode = InputMode.Keyboard)explicitly and remove any manual setup logic for input modes. Alternatively, you can setAndroidComposeUiTestFlags.isInputModeSetForDeviceTests = falseto temporarily disable setting the default input mode at the start of each test and retain legacy behavior while migrating your tests. This flag will be removed in the future, so if only a small number of tests fail, it is recommended to resolve the tests directly by changing their configuration instead. Idc4dd b/267253920 b/504195741 - Annotated overridable empty base methods across Compose with
@EmptySuperto denote that overriding implementations should not invoke super. Id407b ExposedDropdownMenuis now an extension function onExposedDropdownMenuBoxScopeinstead of a member. You may need to update your code with a new import. Ie8a65 b/356452026- Added
blurBehindRadius,backgroundBlurRadius,scrimAlpha, andwindowShapeproperties toDialogProperties, as well asblurBehindRadiusandscrimAlphatoPopupProperties. Developers can now configure background blur, window blur, and scrim opacity directly on Dialogs and Popups. SettingwindowShapeallows clipping dialog window background blurs to rounded corners. I5d437 - Removed feature flag - Compose buttons now correctly retain accessibility focus and do not flicker when explore by touch is active, as hover events are correctly marked as handled. Ib1c80
- Added merge overloads to
FontVariation.Settingsfor merging other settings collections or overriding settings inline. I6340c - Exposed
variationSettingson the Font interface, defaulting to the newFontVariation.Empty. Optimized theFontVariation.Settingsvararg constructor to useasList()to avoid array copy allocations. I9c22f - Updated
NestedScrollDispatcher.coroutineScopeproperty to safely return a cancelledCoroutineScopewhen unattached or detached. I9b112 b/535290281 - Deprecated the
runComposeUiTest,runAndroidComposeUiTest, andAndroidComposeUiTestEnvironmentoverloads that take individualeffectContext,runTestContext, andtestTimeoutparameters. Use the overloads acceptingComposeUiTestConfigor the parameterless overloads, which use a defaultComposeUiTestConfig. Note that a defaultComposeUiTestConfigsets the initial input mode toInputMode.Touchat the start of each test. This might cause existing tests expecting keyboard mode (InputMode.Keyboard) to fail. To fix affected tests, passComposeUiTestConfig(inputMode = InputMode.Keyboard)explicitly and remove any manual setup logic for input modes. Alternatively, you can setAndroidComposeUiTestFlags.isInputModeSetForDeviceTests = falseto temporarily disable setting the default input mode at the start of each test and retain legacy behavior while migrating your tests. This flag will be removed in the future, so if only a small number of tests fail, it is recommended to resolve the tests directly by changing their configuration instead. Ia6d55 b/504195741 - Calls to
runComposeUiTest,runAndroidComposeUiTest, andAndroidComposeUiTestEnvironmentwith only a trailing lambda now use a defaultComposeUiTestConfig, which sets the initial input mode toInputMode.Touchat the start of each test, ensuring the device is in a clean state and preventing previous input mode changes from leaking across tests. However, this new default touch mode might cause existing tests expecting keyboard mode (InputMode.Keyboard) to fail. To fix affected tests, passComposeUiTestConfig(inputMode = InputMode.Keyboard)explicitly and remove any manual setup logic for input modes. Alternatively, you can setAndroidComposeUiTestFlags.isInputModeSetForDeviceTests = falseto temporarily disable setting the default input mode at the start of each test and retain legacy behavior while migrating your tests. This flag will be removed in the future, so if only a small number of tests fail, it is recommended to resolve the tests directly by changing their configuration instead. I8c85d b/504195741 - Added @
CheckResulttoSemanticsNodeInteraction.isDisplayed() andisNotDisplayed() to ensure their return values are asserted, preventing silent test failures when developers mistakenly use them instead of assertion APIs. I1b447 b/508178494 - The flag
AndroidComposeUiFlag.isDelayAndroidViewsHandlerCreationEnabledwill cause theViewGroupthat containsAndroidViews to only be instantiated when anAndroidViewis added to improve performance ofComposeViews that don't haveAndroidViews. When the flag is disabled, the containingViewGroupis instantiated and attached when theComposeViewis attached to the window. I306a3 b/524283041 - Introduce
coroutineScopeOrNull()inNestedScrollDispatcher, an alternative API to access the dispatcher's parent coroutine scope. I18c0f - Change
clearCallbackstorunAndClearCallbacksto make sure that cleanup actions are always executed. If4720 b/526700075 ComposeTestConfighas been renamed toComposeUiTestConfigand moved from the v2 package to the parentandroidx.compose.ui.testpackage. I1d2a1 b/504195741- Added a
timeoutMillisparameter (defaulting to 2000 ms) toSemanticsNodeInteraction.captureToImage() to allow configuring a custom timeout when waiting for redraw passes. Ib7d62 b/249501063 - Adds historical information to indirect pointer input changes Ie62d2 b/526961645
- Added a new
hintTextsemantic property to represent hint text in text fields, improving accessibility support by mapping toAccessibilityNodeInfo.hintText. Ib65da b/448376876 - Optimized
CompositionLocalresolution by resolving them dynamically fromLocalOwnerandLocalAndroidComposeViewon-demand, which can be toggled usingComposeUiFlags.isMinimalistLocalsEnabled. I2bf6d androidx.benchmarknow has aminSdkof 24. Ic2a85- Added an experimental flag
isPropagateHideFromAccessibilityToMergingChildrenEnabledtoAndroidComposeUiFlagsto control propagation ofhideFromAccessibilityto merging children. Ie41ff b/483506400 - Promoted
ComposeUiTestand related testing APIs (includingComposeTestRuleandwaitUntilvariants) from Experimental to stable. Iaec77 b/471148519 b/485124363 - Fixed
TalkBacknavigation order in merged traversal groups. If necessary, this change can be reverted by disablingAndroidComposeUiFlags.isTraversalGroupSortingEnabled. I5ae09 b/285043826 - Removes experimental outdated
IndirectPointerEventhelper function. I05dee b/499336763 b/501098299 b/501098376 b/513249467 - Replace experimental @AnimationToolingApi with @RestrictTo API that has stricter tracking guarantees. Ia4fd1 b/524317805
- Added the
onDescendants()selector to find all semantics nodes within the subtree of a given node. Id6b9b b/444588117 - Deprecated
waitUntilNodeCount,waitUntilAtLeastOneExists,waitUntilExactlyOneExists, andwaitUntilDoesNotExisthelper APIs that do not acceptuseUnmergedTree. Added new overloads that acceptuseUnmergedTreeto support waiting for nodes in the unmerged semantics tree. If675f b/268432145 - Added a
toleranceparameter toSemanticsNodeInteractionsize and position assertions (assertWidthIsEqualTo,assertHeightIsEqualTo,assertTouchWidthIsEqualTo,assertTouchHeightIsEqualTo,assertPositionInRootIsEqualTo,assertTopPositionInRootIsEqualTo,assertLeftPositionInRootIsEqualTo) to allow developers to configure the comparison threshold, improving test robustness across different screen densities. I3a477 b/202752461 - Compose testing now supports main-thread synchronization. You can now safely invoke synchronization APIs (such as
waitForIdle() andrunOnIdle()) and execute Compose assertions or actions directly within UI/main thread callbacks. I0247a b/498478569 - Introduced a new configuration model (
ComposeTestConfig) for Compose test APIs to simplify parameter management and enhance scalability. Added support for configuring input mode (Touch/Keyboard) directly viaComposeTestConfig, ensuring automatic setup and reset to prevent test flakiness due to state leakage. Added new overloads forrun*ComposeUiTestandcreate*ComposeRulethat accept theComposeTestConfigobject. Ia3da9 b/267253920 b/504195741 - Fixed a crash in Compose Preview when using
PreviewParameterProviderwith Media Query properties (Posture,PointerPrecision, etc.) by changing their underlying representation fromStringtoInt. Ic8f92 b/489939558 - Added an
includeInputTextparameter tohasTextExactlyandassertTextEqualsto enable exact matching on raw input text alongside visual text. Iee329 b/519026043
Bug Fixes
- Optimized
SaveableStateRegistry.performSave()to preventHashMapallocations. UsesScatterMapinternally. I7d510 - Populated text colors in AccessibilityNodeInfo.ExtraRenderingInfo for Text Composables. I11c94 b/518049030
- Fixed an issue where accessing
NestedScrollDispatcher.coroutineScopeOrNullduring layout node detachment threw anIllegalStateExceptioninstead of returningnull. I55634 b/533444810 - Optimized file-level initialization of
compose:uitop-level value class properties by using dynamic getters. I34184 - Optimized companion object initialization of
ui-unitvalue classes (TextUnit) by using dynamic getters. If4a99 - Optimized companion object initialization of
ui-graphicsvalue classes (BlendMode,Color, etc.) by using dynamic getters. Iaa86a - Optimized companion object initialization of
compose:ui:uivalue classes (Key,CompositingStrategy, etc.) by using dynamic getters. I1a340 - Optimized companion object initialization of
compose:uitext value classes (TextAlign,TextOverflow,ImeAction, etc.) by using dynamic getters. I776e0 - Optimized companion object initialization of
compose:uitooling and test value classes (AnimatedVisibilityState,MouseButton,ScrollWheel) by using dynamic getters. I23e1b - Optimized companion object initialization of
compose:uiunit value classes (Dp,DpOffset,TextUnitType, etc.) by using dynamic getters. If5eb5 - Optimized companion object initialization of
compose:uigeometry value classes (Offset,Size,CornerRadius) by using dynamic getters. I3b110 - Optimized companion object initialization of
compose:uivalue classes (Role,FocusDirection,PointerEventType, etc.) by using dynamic getters. Ie35dd - Correctly handle
BaselineShift.NoneandBaselineShift.Unspecified, andBaselineShift(0f)to avoid unnecessary slow layout passes. I4350c - Fixed an issue where Dp values containing negative zero (-0.0) behaves differently in comparisons or equality checks from floating point comparisons or equality checks. I7dbcf b/525506543
- Cleans up API information Ia8066
External Contribution
Alignment.topRatio,Trim.isTrimFirstLineTop()andTrim.isTrimLastLineBottom()are public APIs now I84f62
Important changes since 1.8.0:
Fragmentnow implements theContextAwareinterface and can be used to execute code when the fragment is attached.- The
AndroidFragmentcomposable now accepts amaxLifecycleparamater that allows you to cap the lifecycle state of the embeddedFragment. Fragmentlibrary now supports system tracing of the lifecycle event viaJetpack Tracing.
New features
- Added Lint validation for
<wearwidget-provider>XML metadata to ensure required configuration elements (such ascontainerandpreviewImage) are present. Ia9983 b/464458215 - Added Lint error warning for setting black or transparent background to a Wear Widget Idedb0 b/529269573
- Enabled
CORE_TEXTRemote Compose operation for Wear Widgets profile. This allowsRemoteTextto use variable font features, such as font axes, line heights, etc., on supported Host renderers, with automatic fallback when its not supported.
Fixes
- Updated KDocs for
AssociateWithGlanceWearWidgetannotation per developers' feedback
API Changes
- Added
FakePermissionControllerOverridesto allow tests to stub and intercept permission checks and revocations, and updatedFakePermissionControllerfor thread-safe in-memory storage. 2af6e8b - Added
HealthConnectClient#getChanges(changeLogsToken, pageSize)that allows setting the soft limit for the number of change logs returned. I6837d - Updated facade class names in testing stubs (
StubandMutableStub). c7657ba
Bug Fixes
- Fixed a bug in
FakeHealthConnectClientwhere open-endedTimeRangeFilterevaluation inreadRecordswould fail when running under non-UTC system time zones. Ifbc32
API Changes
- Fix performance regression affecting dense particle brushes, update Brush.Version constants based on API feedback I87f0f
API Changes
- Remove the
Metervalue class, it is replaced byvirtualPixelDensityinScenecore. I690ee - The
SpatialGltfModelAPI is now experimental and must be opted in for use. I4557e - Make
systemresizable nullable Ib0093 - Exposed
DensityinSubspaceSemanticsInfofor testing. I2e826 - Rename
ResizePolicydefault option tosystemand add a newDefaultoption without parameters Ic8b16 - Mark
FollowTargetexperimental. The wholeFollowingSubspaceAPI is now experimental. Id4ee3 - Remove
GltfAnimationAPIs Ic2894 - Renamed the parameterized
MovePolicy.default()method toMovePolicy.system(). Introduced aval MovePolicy.Defaultproperty to represent the standard default movement behavior. Iedcc9 - Expand
ExperimentalMoveAnchorPolicyopt in requirements toPlaneSemanticandPlaneOrientationIef927 - Remove
resetMinsfromVolumeConstraints.offsetIb2f2f - Removed deprecated
SceneCoreEntitySizeAdapterfunction. Ib6722 - Removed deprecated
Subspaceoverload withallowUnboundedSubspace. I8e97f - Removed deprecated semantics modifier overload. I4ac10
Bug Fixes
- Fixed issue where children of a
Composablewith anInteractionPolicyattached trigger input events Icdba6
Bug fixes
toMoveEvent()will returnnullif the parent entity has been garbage collected. Ia7a1b
Bug Fixes
- Deprecate
lifecycle-compilerannotation processor artifact. Please migrate toDefaultLifecycleObserverorLifecycleEventObserverinstead of using the annotation processor. Ibf571 b/541926513 SavedStateViewModelFactoryandAbstractSavedStateViewModelFactorynow fail-fast immediately if the providedSavedStateRegistryOwnerdoes not implementViewModelStoreOwner, preventing delayed crashes during component recreation. Icf317- Add system tracing to
LifecycleRegistryevent dispatches. Ie1f92 b/112161409
Behavior changes
- The minimum SDK for Navigation has been moved to API 24 along with the rest of the AndroidX libraries. I972da b/474169350
Bug Fixes
NavEntry.contentKeynow defaults to a composite ofkey.toString()andkey::class.toString(). This ensures that data objects that share the same name but implement different interfaces will no longer have the samecontentKey. However, JS platform'skey::classonly returns simple class name instead of fully qualified name, so JS platform should still implement customcontentKeyfor data objects with duplicate names. I1fbbb b/512534342- Fixed
IllegalArgumentExceptionthrown bySaveableStateHolderfor key reuse when multiple pop transitions are in-flight simulatenously due to rapid popping from the back stack. I4d728 b/516312097
API Changes
- Added new APIs
hasEnabledBackHandlersandhasEnabledForwardHandlerstoNavigationEventInputto allow tracking directional capabilities independently. I772bf b/123456789
Bug Fixes
- Introduce fallback context traversal lookup to resolve
LocalNavigationEventDispatcherOwnerwhen view tree owners are not available. I51e30 b/530641649
Bug Fixes
- Fixed
PagingSource.getRefreshKeyproviding an incorrectanchorPositionthat is too large when refreshing a page with separators while scrolling into placeholders. I475f0 b/516565503
API Changes
- Promoted several
RemoteComposeunit and type conversion APIs to public, includingtoRemoteFloat(),toRemoteLong(),toPx(density),asRdp(),toRemoteDp(),asRemoteTextUnit(), andtoRsp(). Idca36 b/465743273 - Promoted
drawCircle,drawOval, anddrawLineinRemoteDrawScopeto public. Iccf34 b/465743273 - Added arithmetic and comparison operations to
RemoteDp. I4b712 b/467023174 - Exposed
RemoteBrush,radialGradient, andsweepGradientas public APIs in remote-creation-compose. I24695 b/465743273
Other
- Move to default
minSdk24. I972da b/474169350 - Disallow parent touch interception when
RemoteComposeViewhandles touch. I4c6cd b/514549600
Bug Fixes
- Require Compose UI 1.8.0+ to use
LocalSavedStateRegistryOwner. This removes internal reflection fallbacks, improving performance but enforcing a strict dependency upgrade for clients. I16fb0
API Changes
- Deprecated
DEFAULT_VULNERABILITY_REPORTS_URLandgetVulnerabilityReportUrlin favor ofcreateVulnerabilityReportUrl, which defaults to the new OSV vulnerability report endpoint (android-api.osv.dev). Ie0b69
Bug Fixes
- Improved performance by moving cleanup operations off the synchronous write path to a background executor, resolving tail latency issues. 58acc7
Major features of 2.0.0:
New in-process API enables:
- Record trace content in-process, in the field
- Perfetto flows (arrows from one slice to another)
- Perfetto annotations (key/value slice metadata)
traceCoroutine() {}- Coroutine Tracing API which traces thread switches- Category filtering
- Significantly lower overhead than existing
android.os.TraceAPI andtrace() {}wrapper - KMP tracing - can be used on libraries without Android dependency, and on host JVM projects
- After the fact merging with System trace recording (implemented by default in AndroidX Benchmark 1.5)
Note that the new tracing APIs record to a process-controlled buffer which is not yet captured by Studio system trace recording. This will be addressed in the Studio Profilers in an upcoming release.
The existing android.os.Trace / trace() {} APIs have not been deprecated. These APIs are still recommended for low frequency events that should always be recorded into the system trace buffer, especially in libraries.
The 1.7.0-beta01 release of Compose for Wear OS indicates that this release of the library is feature complete and the API is locked. Wear Compose 1.7.0-beta01 includes the following new functionality:
- One-handed gesture support, consisting of gesture handlers for primary action (e.g. double-pinch) and dismiss action (e.g. wrist-turn) and animated indicators that show when the gestures are available on clickable UI elements (like buttons and cards), scrollable lists and pagers.
- Added
PinnableContainersupport toTransformingLazyColumn, for holding an item in memory instead of disposing when the item is scrolled out of the viewport. TransformingLazyColumnnow has support for animating items as they move out of the viewport, allowing them to smoothly slide off-screen instead of fading out.- Added
firstLayoutItemProvidertoTransformingLazyColumnas an optional customization for the first layout item. When specified, the provider defines the item and its edge used as the initial placement reference, which is useful for controlling the direction of content-shifting when items are dynamically updated. - Improvements to
SwipeToRevealto support nested scroll, fast flings, a second haptic at the partial reveal state andactionContentSpacingfor the distance between the main content and the action buttons. - Introduced
@FrequentlyChangingValueand@RememberInCompositionannotations that provide lint warnings to prevent performance issues caused by reading high-frequency state updates or failing to remember objects during composition.
API Changes
- Renamed
GestureActiontoOneHandedGestureAction,GesturePrioritytoOneHandedGesturePriorityandGestureIndicatorSizetoOneHandedGestureIndicatorSizeIfc7f4 b/522761843
Bug Fixes
- Fixed an issue in
ScrollInfoProviderwhich causedTimeTextto flash or disappear when list items change or resized. Ief762 b/537433564
API Changes
- Expose
RemotePageIndicatorAPIs I990e1 b/527877281
Important Changes Since 1.16.0
- Enhanced Navigation Capabilities (
WebViewCompat#navigate): Introduces a modern replacement forWebView#loadUrl. Key capabilities include replacing history entries, returning a trackableNavigationobject, and consistent header persistence during state save/restore. - HTTP Cache Quota Control (
Profile#getHttpCache): Provides APIs to inspect and adjust profile-level HTTP cache quotas, benefiting static-content-heavy applications and reducing cache directory footprint when unused. - Preconnection Queueing (
Profile#enqueuePreconnect): Allows enqueuing preconnect requests in advance without forcing an immediate startup WebView. - Favicon Download Optimization (
WebSettingsCompat#setDownloadFaviconsEnabled): Enables apps to disable automatic Favicon fetching on navigation to reduce memory consumption and network bandwidth. - Prerender Management (
Profile#getMaxPrerenders/clearMaxPrerenders): Introduces methods to retrieve and reset maximum allowed concurrent prerenders. - API Modernization & Cleanups: Deprecated
SpeculativeLoadingParametersin favor ofPrerenderParameters/PrefetchParameters. Removed experimentalProfile#setOriginMatchedHeader(superseded byProfile#addCustomHeaderin 1.15.0). - Proactive Crash Prevention Lint Rule: Adds an AndroidX lint check that flags missing
onRenderProcessGoneimplementations when a customWebViewClientis attached, encouraging developers to handle renderer crashes gracefully.
Bug Fixes
- Fixed typo in
WorkConstraintsDaoTestclass and file name. I0868d - Reduced lock contention in
PackageManagerServiceduringWorkManagerstartup by querying and caching component manifest default enablement states inPackageManagerHelper. Id84ba b/528755807 - Fixed an issue where calling
WorkManager.updateWorkwhile a worker was actively running caused execution lifecycle event hooks and telemetry tracking to immediately shift to the post-update generation. Ie80e8 b/511074795