January 15, 2025

Important changes since 1.9.0

  • PhotoPicker now allows picking images in order and choosing which tab (either albums or images) should be initially visible.
  • The PickVisualMedia and PickMultipleVisualMedia Activity Result contracts that trigger the Photo Picker no longer directly delegates to Google Play services if the system Photo picker is not available, but uses the public ACTION_SYSTEM_FALLBACK_PICK_IMAGES action and related extras to provide a consistent Photo Picker experience to OEMs and system apps as a fallback.
  • New LocalActivity composition local that provides the Activity for the current scope, removing the need for developers to get an Activity from the LocalContext.

New Features

  • AppSearch module enters Beta.

API Changes

  • Disable experimental AppSearch delete propagation API due to stability issues. Iea386
  • Create GlobalSearchApplicationInfo API, an experimental and optional way for producers and consumers to indicate interest in certain types. I116fd
  • Minor changes to experimental AST (query builder) APIs Ibd852

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). Ic2976 b/326456246
  • Adds required permission to searchPersonCorpus I4431d

API Changes

  • Add VideoCapture.getSelectedQuality() to know the selected Quality based on the QualitySelector. I70508 b/204288986
  • When an image capture is invoked with the ImageCapture.OnImageCapturedCallback API, the ImageInfo at the returned ImageProxy can now be used to know whether flash was fired through the new ImageInfo.getFlashState() API. Id2c61 b/380527406
  • Added OUTPUT_IMAGE_FORMAT_NV21 output format support for ImageAnalysis. I484ab
  • Remove the experimental annotation of the featurecombinationquery artifact I4427f
  • Adjust the zoom ratio range allowed for CameraControl by Extensions-specific characteristics when an extensions mode is enabled. I85af1

Bug Fixes

  • Upgraded compileSdk as 35 for using Android 15 related API. Apps using CameraX libraries will also need to upgrade their compileSdk config setting. Ic80cd
  • 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). Idc6c6 b/326456246

New Features

  • Upgraded compileSdk as 35 for using Android 15 related API. Apps using CameraX libraries will also need to upgrade their compileSdk config setting. Ic80cd
  • 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). I7bcd7 b/326456246
  • This is the first RC that includes the fix for CVE-2024-10382 patched on beta03. If you are using a lower version than 1.7-beta03, please update to use this version.

Bug Fixes

  • Fixed incorrect placement animation from animateBounds in LazyGrid due to MotionFrameOfReferencePlacement being reset. 16193b
  • Fixed intrinsic query in SharedTransitionLayout by redirecting the intrinsic query to lookahead pass from a top-level lookahead root. a07d12
  • Added missing @param tags in docs. e5cf67

API Changes

  • AutoSize: Renamed AutoSize to TextAutoSize and published APIs that enable creating custom TextAutoSize implementations. See TextAutoSizeSample for an example of a custom text auto size implementation. I85756
  • Moved the DetectTapGesturesEnableNewDispatchingBehavior feature flag to ComposeFoundationFlags and renamed it to isDetectTapGesturesImmediateCoroutineDispatchEnabled. The old flag is deprecated and will now delegate to ComposeFoundationFlags.isDetectTapGesturesImmediateCoroutineDispatchEnabled instead. I62932

Bug Fixes

  • Enabled DetectTapGesturesEnableNewDispatchingBehavior by default. TapGestureDetector APIs now use the new dispatching behavior (immediate dispatch) by default. I9f2bc b/369648479
  • Fixed the requiredWidth/Height/Size modifiers to properly handle intrinsic sizes. Ie3d7d b/368113212

External Contribution

  • Commonized BasicTooltip in foundation and BasicTooltip/Tooltip in material3. Ifc2e6
  • Added a new Clipboard interface and a composition local for it. I80809

Bug Fixes

  • Adds displayCutout to the group of insets that Material components take into account by default, to avoid content overlapping with the display cutout.
    • This is a behavior change that will impact how inset-aware components behave around a display cutout. This includes the default value of the WindowInsets parameter for inset-aware Material 3 components, and the WindowInsets values provided in the component.
    • Defaults objects for both Material 2 and Material 3. If this change causes undesirable behavior, manually specify the WindowInsets parameter on a per-component basis. I43ee9 b/362508045
  • The activity that is used as the host for the composable under test when using ComposeContentTestRule.setContent now uses the theme Theme.Material.Light.NoActionBar, to avoid the ActionBar from overlapping with test content when targeting SDK 35. To opt out of this behavior, you can remove the dependency on ui-test-manifest and add an activity entry in your test app's AndroidManifest.xml for ComponentActivity with the theme of your choice. I7ae1b b/383368165

External Contribution

Behavior Change

  • Added displayCutout to the group of insets that Material components take into account by default, to avoid content overlapping with the display cutout. This is a behavior change that will impact how inset-aware components behave around a display cutout. This includes the default value of the WindowInsets parameter for inset-aware Material 3 components, and the WindowInsets values provided in the component Defaults objects for both Material 2 and Material 3. If this change causes undesirable behavior, manually specify the WindowInsets parameter on a per-component basis. I43ee9 b/362508045

API Changes

  • Updates to the TopAppBar API. Rename the medium and large top app bars with a subtitle to *FlexibleTopAppBar. Unified the color variations into a single TopAppBarDefault.topAppBarColors() function, and added a subtitle color parameter to be applied for a provided subtitle Composable I41b65
  • Remove WideNavigationRailArrangement API in favor of Arrangement.Vertical Id0341
  • Add a new VerticalSlider @Composable. I2bfba
  • Add a new Track @Composable that allows specifying custom external track corners and track icons. I436a4
  • Update the floating toolbar APIs to use the FloatingToolbarColors object instead of a single container color. I9a054
  • Add and use new experimental annotation ExperimentalMaterial3ComponentOverrideApi Ia1eaf
  • Modifier.indicatorLine now takes a shape for the text field to handle clipping. I8c5f3 b/380704151
  • Rename the experimental FloatingAppBar functions to FloatingToolbar I1dbf8
  • Added a new floatingToolbarVerticalNestedScroll that can be attached to a scrollable container to update the floating toolbar expansion state based on a scroll motion that crosses a threshold. I6d65f
  • Introducing a new API for creating a floating toolbar with an attached Floating Action Button (FAB). The API provides flexible customization options, allowing you to arrange the toolbar horizontally or vertically and place the FAB at the start or end of the toolbar. I9e350

Bug Fixes

  • Fix a Snackbar accessibility issue that caused it to announce itself on dismiss when TalkBack is on. /I9db53

External Contribution

  • Commonized BasicTooltip in foundation and BasicTooltip/Tooltip in material3. Ifc2e6

API Changes

  • Add and use new experimental annotation ExperimentalMaterial3AdaptiveComponentOverrideApi. Id45aa
  • Hide ThreePaneScaffoldHorizontalOrder.toLtrOrder. I6f8d2
  • ThreePaneScaffoldPredictiveBackHandler has been made public. I1a995 b/370543873
  • Added isPredictiveBackInProgress property to ThreePaneScaffoldState. I1a995 b/370543873
  • Create overriding mechanism for AnimatedPane to support sideloading implementations for different form factors. Id7622

Bug Fixes

  • Fix the issue when the settling direction has no anchors. df8257d

API Changes

  • Making AutofillManager an abstract class. I0a3b0
  • Fixed several focus-related issues, including crashes when IME tries to focus on ComposeView without focusable items, focus change within child AndroidViews, and focus request leaving an AndroidView. Ia03c3 b/369256395 b/378570682 b/376142752
  • Change FocusEnterExitScope.cancelFocus() to cancelFocusChange() I89959
  • You may now calculate Composable occlusions with RectInfo.calculateOcclusions().
  • Added extension function on DelegatableNode to register a listener for global layout changes. I68b59

Bug Fixes

  • The activity that is used as the host for the composable under test when using ComposeContentTestRule.setContent now uses the theme Theme.Material.Light.NoActionBar, to avoid the ActionBar from overlapping with test content when targeting SDK 35. To opt out of this behavior, you can remove the dependency on ui-test-manifest and add an activity entry in your test app's AndroidManifest.xml for ComponentActivity with the theme of your choice. I7ae1b b/383368165
  • Resource fonts with the same variation settings will now avoid over-caching causing the incorrect variation settings to be applied. If3dff b/372044241
  • AnnotatedString.fromHtml now supports <ul>/<li> tags. I7c2fe b/299662276 b/139326648

External Contribution

  • Added a new Clipboard interface and a composition local for it. I80809

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). I9ab25 b/326456246
  • App Bar now properly collapses with Keyboard down when using a recyclerview inside a CoordinatorLayout.

Bug Fixes

  • Improve warm read latency (DataStore.data.first()) by 8x. 22b8a40
  • ReplaceFileCorruptionHandler can be created from KMP common code. 7632e839

API Changes

  • Update HEIC XMP handling to prefer XMP data from a separate segment in the file, rather than tag 700 in the Exif data.

Bug Fixes

  • Fix ExifInterface.getThumbnail*() method to work correctly after a call to saveAttributes() (previously the calls would succeed, but the result would be incorrect/undefined)
  • Fix PNG XMP handling to read and write the separate iTXt XMP chunk instead of tag 700 inside the eXIf chunk.
  • Fix WebP image corruption when handling image files with trailing non-WebP data. b/385766064.

Bug Fixes

  • Better documented newly added locale-related functionality.
  • Added backing types to all enumeration types.

New Features

  • Updated background and history read permissions to support Android 13 and below.

API Changes

  • Added inline reified overloads for HealthPermission.getReadPermission and HealthPermission.getWritePermission I59a2e

Bug Fixes

  • Remove legacy permission methods Ifd080
  • 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). Iaf73a b/326456246
  • Fixed documentation for HealthPermission.READ_HEALTH_DATA_HISTORY, specifically by pointing out that reads without this permission only fail when attempting to read a single data point. Id5b5a

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). Icdd6c b/326456246
  • Fixed b/372391363 releasing buffer queues in the correct order to fix CTS failure.

API Changes

  • New API to support stream expansion with route connection. I87373
  • Update onRouteDisconnected callback with both disconnected and requested routes. Iae5f3
  • These libraries add a set of platform compatibility mechanisms intended for androidx internal use only. These libraries are used as implementation dependencies only.

Important changes since RecyclerView 1.3.2

  • Adaptive refresh rate support: RecyclerView now calls setFrameContentVelocity when it is scrolling via OverScroller (such as settling from a fling or smooth scroll). I8f8a4

API Changes

  • Change FocusEnterExitScope.cancelFocus() to cancelFocusChange()I89959
  • FocusProperties.enter and FocusProperties.exit have been replaced with onEnter and onExit, respectively,using a receiver scope instead of FocusDirection parameter. I6e667

Bug Fixes

  • Moved CompositingStrategy.OffScreen from Surface to Text for fixing the jittery text while scaling. I92b15f17
  • Fixed broken focus management in Carousel Ie508b721375
  • Surface (non-interactive) has a simplified implementation as compared to the interactive ones. I7ea545150

API Changes

  • We have updated all Wear Compose libraries to ‘explicit API’ mode. Iebf9f
  • We have made the pager’s snap animation parameter part of PagerDefaults. Ifff64
  • We have added an offset parameter was to SwipeToDismissBoxState. I586bd

Bug Fixes

  • Rotary platform haptics are now called for Wear OS versions after V Idb03e

API Changes

  • We have updated all Wear Compose libraries to ‘explicit API’ mode. Iebf9f
  • We have updated the ScreenScaffold and EdgeButton APIs, so that it is easier to specify content paddings on screens that include an EdgeButton. In the new API the EdgeButton's size is only passed to the EdgeButton, and the ScreenScaffold takes an edgeButtonSpacing parameter for the spacing between EdgeButton and list content. I424fd
  • In DatePicker, we have renamed parameters minDate to maxDate, and minValidDate to maxValidDate. In DatePickerColors, we have renamed parameter selectedPickerContentColor to activePickerContentColor, and unselectedPickerContentColor to inactivePickerContentColor Iba17b
  • We have updated the ArcProgressIndicator defaults to strokeWidth=6dp and recommended diameter = 81.24% of screen height I6f248
  • We have updated the Confirmation API to reflect its usage as a dialog. The composable is now called ConfirmationDialog, with associated updates to the naming of colors and defaults classes. We have also renamed the show parameter to visible for compatibility with other Compose animation APIs. In addition, we have made ConfirmationDialogContent, SuccessConfirmationDialogContent, FailureConfirmationDialogContent available for situations where developers need to customize the intro/outro dialog animations. Iaeb33
  • We have updated CircularProgressIndicatorContent to CircularProgressIndicatorStatic (the non-animated variation of CircularProgressIndicator) so that it can now be used to build CircularProgressIndicator with custom animations. I1346f
  • We have fixed the parameter ordering on the ArcProgressIndicator, putting the modifier parameter first I4656a
  • Improved the SwipeToReveal API to receive a text slot parameter for the labels of the actions (except secondary action) and to remove label parameters from undo action I5b3db

Bug Fixes

  • We have fixed a bug where LongPress haptics were triggered more than once in Button, Card, IconButton, TextButton Ia8b0f
  • Changes to the UX of AlertDialog - on large screens the confirm and dismiss buttons are now smaller. There is also increased spacing below the confirm and dismiss buttons. I4f066
  • We have changed the animation specs of the action button label of the SwipeToReveal component. Ib87fb
  • Changed SwipeToReveal to expand the container at the same time that the text is displayed. I44cf8
  • Improved SwipeToReveal to perform haptic feedback when the swipe passes the threshold where the primary action is committed. I23efe
  • We have updated SwipeToReveal to display ellipsis on text overflow by default, for primary and undo actions. I71f5a
  • We have fixed an issue causing jitter on ButtonGroup animations. I63f8f
  • We have added text semantics to AnimatedText I6063c
  • Dialog now resets background scaling when the dialog is removed from the composition (without this fix, the launching screen may have been left in a scaled down state) Id24ac
  • We have added a shape morph animation to the buttons in the Stepper component Id6ed3

New Features

  • LayoutColor to support both static and dynamic color types I4c89b
  • Added ProtoLayout Material3 textButton component. Id680d
  • Add iconButton ProtoLayout Material3 component. Ica3f0
  • Added ProtoLayout Material3 button container component. I17a38
  • Added support for Chainable semantic modifiers to protolayout-material3 I4af62
  • Added ProtoLayout Material3 single segment CircularProgressIndicator I2c8a2
  • Added padding,metadata modifiers I8720a
  • Added background,clip and clickable modifiers I35478
  • Add LinearGradient to Brush and allow it to be used in the Background Modifier. Ic4dea
  • Add small size for appCard and titleCard. I91f98
  • Added ProtoLayout Material3 graphicDataCard component. I92be7
  • Added ProtoLayout Material3 iconDataCard and textDataCard components. I4e1e4
  • Added ProtoLayout Material3 appCard component. Id4c57
  • Abstract EdgeButtonColors to ButtonColors. I83624
  • Added ProtoLayout Material3 titleCard component. I2dc72

API Changes

  • ProtoLayout Material3 API now accepts LayoutString to support both static and dynamic texts. I9c24a

Bug Fixes

  • Add renderer implementation for inflating DashedArcLine I0c700
  • Renderer change for allowing ArcSpacer to take dp length. I1437b

New Features

Watch faces commonly allow the user to select colors using a ListUserStyle. While this works, it entails sending the icons over bluetooth to the companion editor which is inefficient, so we’ve introduced ColorUserStyleSetting where the payload is a list of one or more color per style which has a significantly more compact wire format.

We’ve added an OEM facing feature which allows OEM complication providers to add extras to ComplicationData for use by OEM watch faces.

API Changes

  • UserStyleSetting and UserStyleOption classes now have builders which is the recommended way to construct them. Iacd03
  • Support for passing extras in ComplicationData. This is intended for use by OEMs where they control both the complication provider and the receiving watch face. Setting an extra requires the privileged com.google.android.wearable.permission.COMPLICATION_EXTRAS permission. I4e3b2
  • Watch faces commonly allow the user to select colors using a ListUserStyle, with an icon for each ListOption. Since UserStyle schemas are sent over bluetooth, it is important to keep the size of the schema down which can be a problem if many dozens of color options are given due to all those icons. To help with this we've added ColorUserStyleSetting where the option contains a list of colors instead of an icon, which is much more compact. Ib542e
  • ColorUserStyleSetting and ColorOption require API 34 for use. I8771d

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). Ifd363 b/326456246

New Features

  • Introduce a new experimental API for Url prerendering to allow developers to speculative prerender candidate urls resulting in faster navigations. I0cfe7
  • Introducing a set of new APIs to delete browsing data stored by WebView. The new APIs in WebStorageCompat should be preferred over the existing APIs in android.webkit.WebStorage, as they will guarantee deletion of all local storage, including the network cache and cookies, as well as any installed service workers. If new storage APIs are introduced in the future, then these new methods will be updated to include them in the storage deleted. Iad54f b/382273208
  • Add setPartitionedCookiesEnabled API. This will allow developers to enable and disable partitioned cookies in WebView. Ic506a b/364904765

API Changes

  • Change thread requirement for Prefetch API to only be called on the UI thread. I866b5
  • Update WebAuthn methods to highlight that they must be called on the UI thread. This requirement is enforced by the implementation already, and this change only adds the relevant annotation. I6d6ba

New Features

  • Add API to allow customizing ActivityEmbedding Animations.
  • Expand WindowMetricsCalculator test APIs to allow faking the window metrics.

API Changes

  • Hide a few constructors I87b8d
  • Allow apps to customize ActivityEmbedding animations If31a8
  • Adds support for watchosDeviceArm64 KMP target and target kotlin 1.9 Icf15d b/364652024
  • Expose WindowMetricsCalculator APIs. I1cebf

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). Ie69ac b/326456246