October 30, 2024

API Changes

  • Added a new LocalActivity composition local that provides the Activity for the current scope, removing the need for developers to get an Activity from the LocalContext. It also comes with a new lint rule that checks when the LocalContext is incorrectly being cast to an Activity. I7746a b/283009666

Bug Fixes

  • From Activity 1.9.3: PredictiveBackHandler will no longer fire it's callback after the handler has been disabled. This will fix an issue where the NavHost from Navigation Compose would throw an IndexOutOfBoundsException. I3f75e b/365027664 b/340202286

Dependency Update

New Features

  • (Experimental) Enable Baseline Profile generation, and benchmarking on apps installed to a secondary user, for example any app on headless Android Auto devices. This support has been tested in some scenarios, but let us know with a bug if it doesn't work for you. I9fcbe b/356684617 b/373641155

Bug Fixes

  • isProfileable is now always overridden in benchmark builds, and isDebuggable is also now always overridden in both benchmark and nonMinified (baseline profile capture) builds. I487fa b/369213505
  • Fixes compilation detection on some physical devices prior to API 28 - affects json context.compilationMode, as well as behavior of androidx.benchmark.requireAot=true (which no longer incorrectly throws) Ic3e08 b/374362482
  • In CpuEventCounter metrics, throw if invalid measurements are observed (e.g. instructions/cpucycles==0) I8c503

Important changes since 1.3.0

CameraX 1.4.0 is packed with exciting updates! Here's a summary:

Headline Feature: 10-bit HDR:

  • Capture stunning HDR photos and videos with ease.
  • Supports HLG and 10-bit HEVC encoding.
  • Enjoy 10-bit HDR preview and query device capabilities.
  • Works with UltraHDR images and HDR video on a growing range of devices.

Other Cool Features:

  • Kotlin Extensions: Added takePicture and awaitInstance suspend functions.
  • Real-time Effects: Apply effects like watermarks and object highlighting.
  • CameraController API: New controls for video capture configuration.
  • Preview Stabilization: Query device capability and enable stabilization.
  • VideoCapture Enhancements: Finer control over quality and access to higher resolutions.
  • CameraX Extensions Integration: Seamless integration with VideoCapture and new ImageCapture features.
  • Shutter Sound API: Easily check regional shutter sound requirements.
  • Screen Flash: Improved low-light photos for front-facing cameras.
  • Camera Extensions Metadata APIs: Supporting APIs for adjusting extensions strength and get notification of current Extensions mode in ExtensionMode#AUTO. You can find more bug fixes in our Beta and RC announcements.

API Changes

  • Add output format APIs for RAW and RAW + JPEG ImageCapture, the device capability check is exposed in ImageCaptureCapabilities#getSupportedOutputFormats. The OUTPUT_FORMAT_RAW is to capture RAW image, which is Adobe DNG format and OUTPUT_FORMAT_RAW_JPEG is to simultaneously capture RAW and JPEG images. The new ImageCapture#takePicture API is used for simultaneous image capture, it needs to provide two OutputFileOptions, the first one is for RAW image and the second one is for JPEG image. Ib0f3d

Bug Fixes

  • Fixed preview and video under-exposure issue on TCL devices when VideoCapture is enabled. Id7a64
  • Fixed the issue where invoking startFocusMetering with PreviewView.getMeteringPointFactory doesn't get the correct sensor coordinates when an effect is enabled or when 4 use cases are bound (stream-sharing). I916c5 b/345993685
  • Fixed the VideoRecordEvent.Finalize.ERROR_INSUFFICIENT_STORAGE event is not triggered when recording a video and there is insufficient storage space available. I35779 b/356399842

New Features

  • Lookahead is now supported in LazyGrid. This includes differentiating lookahead pass versus approach pass in scrolling, item composition/disposal, and item animation, and uses lookahead pass for source of truth for scrolling, and item animation target.

Bug Fixes

  • Update internal states for AnimatedContent’s size transform when transition is recreated. This ensures the target size information is always up to date. b/372512085

New Features

  • Support for auto-sizing text. Pass an AutoSize instance (e.g. AutoSize.StepBased) to your favorite text composable (like BasicText) and see your text size adapt to the available space! Ice7e0 b/139320827
  • Adds OverscrollFactory and LocalOverscrollFactory APIs to allow configuring overscroll within a hierarchy. The value provided through LocalOverscrollFactory will be used by default to create an OverscrollEffect. To create and remember an effect from the current provided factory, use rememberOverscrollEffect(). I51ca4 b/255554340

API Changes

  • Introduce CompositionLocal that can be used to modify the hue of Autofill's successful filling highlight. I32092
  • Removed ScrollableDefaults.overscrollEffect - instead you should use rememberOverscrollEffect. This will create an instance of the current overscroll implementation provided with LocalOverscrollFactory. I1651a b/255554340,b/234451516
  • Introduces new AutofillManager interface that can be used to fine-tune users' Autofill journey and a isSemanticAutofillEnabled flag to turn on this new version of Autofill. I9d484
  • Removes CombinedClickableNode. This experimental API was temporarily exposed to unblock performance work, but is no longer needed. Instead you should directly use Modifier.combinedClickable as with other modifier APIs. I4b658
  • Adds overloads to horizontalScroll, verticalScroll, LazyColumn, LazyRow, LazyHorizontalGrid, LazyVerticalGrid, LazyHorizontalStaggeredGrid, LazyVerticalStaggeredGrid, HorizontalPager, and VerticalPager with support for specifying a custom OverscrollEffect. The provided OverscrollEffect will receive events, and be rendered within the bounds of these components. Note that drawing the same OverscrollEffect twice is unsupported - so you cannot draw the same OverscrollEffect provided to one of these components separately with Modifier.overscroll. The use case of drawing the overscroll outside of the bounds of these components will be addressed separately in the future. I2dc42 b/266550551 b/234274772 b/224572538 b/353805117

Bug Fixes

  • The DatePicker and DateRangePicker now correctly update the displayed month when set via their state's displayedMonthMillis. If9e47 b/333414302
  • Fix crashes in the DatePicker and DateRangePicker when the minimum selectable year is set to a future year. I78656 b/319395747
  • Fix a date-picker issue to update the UI when an updated SelectableDates instance is applied. Iad59a b/290135807 b/339898760
  • Change back callback priority used by bottom sheets to PRIORITY_DEFAULT to allow IME keyboard to dismiss first. I447fb

API Changes

  • SheetState constructor with density has been deprecated in favor of positional and velocity thresholds. Ifd16e
  • Added rememberTooltipPositionProvider that contains an updated positioning logic. Deprecated rememberPlainTooltipPositionProvider and rememberRichTooltipPositionProvider. Ie66e2
  • Additional ModalBottomSheetProperties allow for customization of status and navigation bar colors. By default, these update based on content color instead of system dark theme status. Ib874e b/362539765
  • Improved the input experience for date pickers: when in input mode, the date text field will be focused for immediate text entry. The change adds a requestFocus parameter to the DatePicker and the DateRangePicker. You may prevent a focus by passing false. I12d09 b/286399710 b/340102743
  • Caching the shape defaults into the Shape object. Making the shape defaults @Composable for toggle button. Collapsing the shapes into one shape default since the variants point to the same token file. Iaa014

Bug Fixes

  • Optimize Scaffold contentPadding behavior to avoid always recomposing the body content when the contentPadding changes. I8c8e2 b/373904168
  • TextFieldLabelScope progress renamed to labelMinimizedProgress
  • TextFieldLabelPosition Default renamed to Attached. Interface members have been removed. If75c6
  • Fixed an issue with the DatePicker in input mode where validation errors could cause the component's height to change. I2e229 b/280462363
  • Make the material Slider change its value when control keys are pressed. I1c442

Bug Fixes

  • Fixed issues where elevation and clipping with custom outlines would not render properly.
  • Fixes a text crash that happens with a zero-width LinkAnnotation. Ic1e2e
  • Fixes an announcement in Talkback of the button when it's built as a clickable Text composable. I1f588

New Features

Autofill is exposed behind a feature flag in this release. We are working on improving performance, and are looking for early feedback on the APIs. The APIs are expected to evolve prior to stable based on feedback.

  • To enable Autofill, set ComposeUiFlags.isSemanticAutofillEnabled to true in onCreate and use the latest Compose Snapshot.
  • This version of Autofill supports saving credentials manually, through Suggest Strong Password, and through navigation. It also supports filling when an autofillable field receives focus or when Autofill is triggered via the text toolbar on text components. The component will become highlighted to indicate when autofill has completed.

API Changes

  • Modify Autofill interface to follow expect/actual structure. I22dce
  • Introduce CompositionLocal that can be used to modify the hue of Autofill's successful filling highlight. I32092
  • Added Modifier.onRectChanged API which is an API that allows one to subscribe to the root/window/screen-relative position and size of a LayoutNode. The API solves many use cases that the existing onGloballyPositioned modifier does, however it does so with much less overhead and the API comes with facilities to debounce and throttle the callback per what one's use case demands. Id28c7 b/372765423 b/372757007 b/372994338
  • Expands Autofill manager to include commit() and cancel() APIs that help users save newly entered credentials. I2da00
  • Introduces new AutofillManager interface that can be used to fine-tune users' Autofill journey and a isSemanticAutofillEnabled flag to turn on this new version of Autofill. I9d484
  • Added Modifier.onRectChanged API which is an API that allows one to subscribe to the root/window/screen-relative position and size of a LayoutNode. The API solves many use cases that the existing onGloballyPositioned modifier does, however it does so with much less overhead and the API comes with facilities to debounce and throttle the callback per what one's use case demands. I3c8fa
  • Add in semantic properties and data types for extended Autofill support. I52c7d
  • All methods in AnnotatedString builder are non-experimental now Ia89c8 b/261561823

Bug Fixes

  • Views embedded in compose can now receive rotary events if they are focused I4d53a b/320510084
  • Fixed an issue where various resource types wouldn't update on configuration changes Ia9b99 b/352336694
  • Addressed an issue that prevented TextField from functioning correctly when using the POBox Japanese Keyboard on certain older Sony devices. Ia9b99 b/373743376
  • Fixed problem with dialogs showing at bottom of the screen instead of centering (Ia2ec, b/373093006)
  • Targeting API 35+ no longer forces dialogs to have decorFitsSystemWindows set to false. (Ibc94, b/364492593)
  • Fix crash when layers are moved between windows (e.g. dialog and main content) (I675ba, b/330955281)

Important changes since 2.1.0

  • Parity release with underlying constraintlayout-core library.

Important changes since 1.14.0

  • 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. Ieb9ae b/345472586
  • Various updates to compatibility classes for parity with Android 15 SDK.

New Features

Beta release for the following new features:

  • Secondary UI experience for credential selection: App developers that call Credential Manager APIs at sign-in moments to present the user with a selector, are now able to use new APIs to associate the same GetCredentialRequest with a given view, such as a username or a password field. Subsequently, when the user focuses on one of these views, the corresponding request will be sent to Credential Manager. The resulting credentials are aggregated across providers and displayed in autofill like secondary UIs, such as keyboard or dropdown suggestions. As such when all APIs are used together, the user is first presented with a selector, and if dismissed and taps on one of the fields mentioned above, is then presented with keyboard/dropdown suggestions.
  • Restore Credentials. The restore credential is used to restore the user's credential from the previous device to a new Android device. By creating a RestoreCredential for the user, the credential will be automatically transferred over to the user's new device if the user selects the app to be transferred from the old device during the setup stage.

API Changes

  • Allow developers the flexibility to condition within the CryptoObject and BiometricPromptData setters. Ie7e8e

Bug Fixes

  • Fixed an IllegalStateException triggered by saveBackStack only after a Predictive Back gesture was canceled or interrupted. I3387d b/342419080

Behavior Changes

  • The Lifecycle.DESTROYED state is terminal, and any attempt to move a Lifecycle from it to any other state will now result in an IllegalStateException. I116c4 b/370577987
  • SavedStateHandle no longer includes any SavedStateProvider.saveState() where the returned Bundle is empty. I910b5 b/370577987

Bug Fixes

  • Lifecycle.eventFlow now correctly complete when Lifecycle is DESTROYED I293b2 b/374043130

External Contribution

  • New common NavController.handleDeepLink(request: NavDeepLinkRequest) method. Thanks Konstantin Tskhovrebov! I3e228

New Features

  • This update removes support for privacysandbox measurement and adid APIs on Android R, which has been deprecated. Calls to get the manager classes on Android R will now return null.

API Changes

  • Revisit the newly added convertRows() method signature to be a suspend function that receives a RawRoomQuery for room-paging. Ie57b5 b/369136627

Bug Fixes

  • Fixed the issue in room-paging where invalid code was being generated when using @Relation in conjunction with PagingSource.

API Changes

  • We have added support for animateScrollTo on TransformingLazyColumnState so that scrolling to an item can be animated. I4097d
  • We have added requestScrollTo on TransformingLazyColumnState to defer scrolling to the next measurement. I20a5e
  • We have added support for contentPadding in TransformingLazyColumn. I3a69c

Bug Fixes

  • We have fixed a bug in rendering the TransformingLazyColumn when the content height is shorter than the screen height. I6c3e1
  • The ScrollInfoProvder for TransformingLazyColumn now correctly tracks the first item. I1e4a3
  • TransformingLazyColumnState now saves its state (anchorItemIndex and anchorItemScrollOffset). I3d265

API Changes

  • We have added an arc variation on the indeterminate circular progress indicator I2efc1
  • We have made public the AlertDialogContent and Dialog composables that make up the AlertDialog API, so that it is possible to add customization if necessary (such as customizing AlertDialog animation whilst keeping the recommended content layout). In addition, we have added Modifier and Color parameters to the EdgeButton, ConfirmButton and DismissButton members of AlertDialogDefaults. I4eb71
  • We have updated the Placeholder API as follows: renamed PlaceholderState.startPlaceholderAnimation to PlaceholderState.animatePlaceholder, PlaceholderState.isShowContent to PlaceholderState.isHidden, and PlaceholderDefaults.shape to PlaceholderDefaults.Shape; renamed the painter parameter in painterWithPlaceholderOverlayBackgroundBrush to originalPainter; changed visibility of PlaceholderState.placeholderProgression from public to internal and renamed it to placeholderShimmerProgression; added placeholder animation duration constants to PlaceholderDefaults. Ie5a59
  • We have updated the EdgeButton API as follows: renamed the parameter on ScreenScaffold from bottomButton to edgeButton; made EdgeButtonSize a value class. Ieef15
  • We have changed the visibility of copy() to public in wear material3 Colors classes I0287f

Bug Fixes

  • Added minimum animation duration for IconToggleButton and TextToggleButton on click Ieb333
  • Added minimum duration on IconButton and TextButton shape animation Iebcee
  • Corrected the repeat option state of DatePicker. I3587c
  • Added motion for Alert and Confirmation dialogs. I173b1

Significant changes since version 2.9.1

  • Added trace tags to Jobs from WorkManager which makes ‘adb shell dumpsys jobscheduler’ a lot simpler to understand since it will contain the name of the Worker being executed. Trace sections are also added around key areas of WorkManager.
  • Configuration.workerCoroutineContext was added to for control of dispatcher where CoroutineWorker is executed.
  • Developers can specify NetworkRequest as a constraint for a worker via the Constraints.setRequiredNetworkRequest method. This enables more granular control over which network this worker should run.
  • WorkManager 2.10.0 is now compiled with SDK 35 and contain various changes for SDK 35 compatibility.