October 2, 2024

Bug Fixes

  • Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. I2f678 b/285187547

To use FTL apply the plugin to the baseline profile module in the plugin block, with:

  plugins {
      ...
      id("com.google.firebase.testlab")
  }

and then configure firebase test lab with:

  firebaseTestLab {

      // Credentials for FTL service
      serviceAccountCredentials.set(file("credentials.json"))

      // Creates one or more managed devices to run the tests on.
      managedDevices {
          "ftlDeviceShiba34" {
              device = "shiba"
              apiLevel = 34
          }
      }

      // Ensures the baseline profile is pulled from the device.
      // Note that this will be automated as well later with aosp/3272935.
      testOptions {
          results {
              directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
          }
      }
  }

Also the created FTL device needs to be added to the baseline profile extension:

  baselineProfile {
      managedDevices += "ftlDeviceShiba34"
      useConnectedDevices = false
  }

API Changes

  • Moved Gradle tasks lockClocks and unlockClocks to be on benchmark projects, instead of available at the top level. This change was necessary as there is unfortunately no way to register these as top level actions without breaking project isolation. I02b8f b/363325823

Bug Fixes

  • BaselineProfileRule now collects profiles for multi-process apps by signaling each running process at the end of the block to dump profiles. If a profile based compilation never successfully finds a process to broadcast to, the compilation will fail, as it's unexpected to have profile data within. Additionally, added an instrumentation argument to control dump wait duration: androidx.benchmark.saveProfileWaitMillis I0f519 b/366231469
  • From Benchmark 1.3.2: Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin. I2f678 b/285187547

To use FTL apply the plugin to the baseline profile module in the plugin block, with:

  plugins {
      ...
      id("com.google.firebase.testlab")
  }

and then configure firebase test lab with:

  firebaseTestLab {

      // Credentials for FTL service
      serviceAccountCredentials.set(file("credentials.json"))

      // Creates one or more managed devices to run the tests on.
      managedDevices {
          "ftlDeviceShiba34" {
              device = "shiba"
              apiLevel = 34
          }
      }

      // Ensures the baseline profile is pulled from the device.
      // Note that this will be automated as well later with aosp/3272935.
      testOptions {
          results {
              directoriesToPull.addAll("/storage/emulated/0/Android/media/${android.namespace}")
          }
      }
  }

Also the created FTL device needs to be added to the baseline profile extension:

  baselineProfile {
      managedDevices += "ftlDeviceShiba34"
      useConnectedDevices = false
  }

Bug Fixes

  • Added flash/torch/3A functionalities for image captures with CameraEffect. The image captures with CameraEffect should now have the same pre-capture and post-capture processings (e.g. flash trigger, 3A convergence etc. when applicable) as image capture without any CameraEffect. I5ff30
  • Optimized the pinch-to-zoom smoothness in PreviewView I04ffc
  • Decouple Ultra HDR from 10-bit output capability, as Ultra HDR support no longer requires devices to have 10-bit output capability. I96ff2 I0c3b3

New Features

  • New APIs for querying camera features supported by the device. For example, checking if HDR and 60FPS can be enabled at the same time. It includes 2 artifacts: camera-feature-combination-query and camera-feature-combination-query-play-services. This is a compatible version of camera2's CameraManager#getCameraDeviceSetup#isSessionConfigurationSupported API with additional data provided by Google Play Service.

Bug Fixes

  • Fixed Preview/VideoCapture target frame rate issue on LEGACY level devices. The target frame rate set via the setTargetFrameRate or Camera2Interop API was always overwritten to the value provided by the AeFpsRangeLegacyQuirk. With this fix, CameraX library will respect the value set via the setTargetFrameRate or Camera2Interop API. Ie2d32
  • Added flash/torch/3A functionalities for image captures with CameraEffect. The image captures with CameraEffect should now have the same pre-capture and post-capture processings (e.g. flash trigger, 3A convergence etc. when applicable) as image capture without any CameraEffect. I5ff30
  • Excluded problematic output sizes for ImageAnalysis on Samsung SM-A057G device. When ImageAnalysis uses a resolution larger or equal to 1920x1440, it will cause black preview issue. Applied ExcludedSupportedSizesQuirk to the SM-A057G device to avoid the issue. I63dfe b/365877975
  • Fixed Preview/VideoCapture target frame rate issue when stream sharing mechanism is enabled internally to share a stream to Preview and VideoCapture. I4fdac
  • Enabled the workaround to fix the incorrect JPEG image metadata issue on Samsung S10e and S10+ devices. With the fix, CameraX can successfully save the JPEG image, or correct Bitmap objects can be returned when calling the ImageProxy.toBitmap() function on these devices if the incorrect JPEG image metadata issue happens. Iae493 b/356428987
  • Disabled extensions for Samsung A52s' back camera whose id is 0, because native crashes might happen when capturing HDR images and configuring capture sessions might fail for the BOKEH or FACE_RETOUCH modes. I03ec9 b/364152642
  • Fixed the VideoRecordEvent.Finalize.ERROR_INSUFFICIENT_STORAGE event is not triggered when recording a video and there is insufficient storage space available. Ia5b4f b/356399842
  • Fixed issue where second video recording attempt fails on Oppo A5 (CPH1931). I181d6

API Changes

  • Kotlin version update to 1.9 I1a14c

External Contribution

  • Forward contains to containsKey. Thanks Jake Wharton! I9362b
  • Add container builders for scalar-specialized collections. Thanks Jake Wharton! I13179

API Changes

  • Kotlin version update to 1.9 I1a14c

Bug Fixes

  • Fixed an issue in AnimatedContent size animation by always tracking and starting animation from the current size to ensure continuity.

Bug Fixes

  • Fixed a memory leak with BasicText when minLines is set to a non-default value.

API Changes

  • Kotlin version update to 1.9 I1a14c
  • Introduced flag DraggableAddDownEventFixEnabled I848d5
  • Introduced a new Semantics Role called Carousel to emulate the list behavior in Pagers for a11y services. Id354b b/354109776 b/239672673
  • Removed the implicit graphicsLayer modifier from BasicText composable. Added experimental ComposeFoundationFlags.RemoveBasicTextGraphicsLayerEnabled flag to be able to revert to the old behavior. Ie478d
  • Added Modifier.recalculateWindowInsets() to allow children in the hierarchy to use insetsPadding even when parents aligned them without consumeWindowInsets(). I7f9e4

Bug Fixes

  • Implement gesture pick-up in detectDragGestures, draggables and scrollables. Now if a child draggable gives up on a gesture, the parent has the opportunity to pick it up. This allows for a more continuous and integrated gesture handling. Ic88fe
  • Update fling cancellation behavior in scrollables. Now if a scrollable flings and hits the bounds it will correctly pass on the fling velocity to the next scrollable in the chain instead of continue to drive the fling. I9326a

Behavior Changes

  • Library no longer adds a dependency to material-icons-core so if your project relied on that, you will have to explicitly add that dependency in your build.gradle[.kts] files. I735ff b/349894318
  • NavigationBarItem and NavigationRailItem’s active label color change from onSurface to secondary in order to improve usability, color contrast and improve coherence within the system Ibc297, to revert to the previous behavior, copy the default colors and change the selectedTextColor to MaterialTheme.colorScheme.onSurface.
  • Material 3 components are now using the new MotionScheme to define their motion. Ie0f93
  • Indeterminate circular Progress Indicator motion changes I3c07e
  • Update OutlinedIconButtonColors and OutlinedIconToggleButtonColors for better color contrast. I2743d
  • Updated container and content color for FilledIconToggleButtonColors and FilledTonalIconToggleButtonColors. Ic5d0f
  • Updated OutlinedButton border color from outline to outlineVariant. 057f00

API Changes

  • Added an optional reverseLayout parameter to the TopAppBar's enterAlwaysScrollBehavior function to better support content that was set with a reverseLayout. I4e0e5
  • SegmentedButton now supports contentPadding argument. I5ad91 b/358414376
  • PullToRefreshState does no longer have default implementation for isAnimating I6a593
  • Added new overloads of Material TextField and OutlinedTextField that use TextFieldState. Added decoration box APIs that are compatible with TextFieldDecorator. If13a1
  • Added parameter to control text field's labelPosition. Using alwaysMinimize allows the UI pattern of displaying a label and placeholder in a text field at the same time even when the field is unfocused. I1ef2c
  • Added Material SecureTextField and OutlinedSecureTextField for password entry fields. I7e22d
  • Added a scope to text field labels to query animation progress. If5ec8
  • Adds support for MotionEvent.CLASSIFICATION_DEEP_PRESS to tooltips. I62e6a
  • TimePickerState’s isAfternoon is now an extension val instead of a var in the interface, renamed to isPm I89a97
  • Updating typography class to support emphasized type scales. Ifa13c
  • Added ModalWideNavigationRail API and renamed ModalExpandedNavigationRail APIs to DismissibleModalWideNavigationRail. Ic9118
  • Updated FloatingAppBarScrollBehavior to auto-calculate the screenOffset and not require a @Composable. Idf349
  • Updates to the LoadingIndicator API to fix the naming at its defaults object. Added a LoadingIndicatorElevation constant at the PullToRefresh. I1d72b
  • Updates to the LoadingIndicator API to fix the naming at its defaults object. Added a LoadingIndicatorElevation constant at the PullToRefresh. I1d72b
  • Added an amplitude and a waveSpeed parameters to the indeterminate variations of the LinearWavyProgressIndicator and the CircularWavyProgressIndicator. I2a0c5
  • Support changing an icon toggle button's shape based on its pressed or checked state. Ibc781
  • Updating typography class to support emphasized type scales. Ifa13c
  • SplitButton shape morphs based on default / pressed state. Removed AnimatedTrailingButton api because TrailingButton api can offer the same customizations I95066
  • Add modifier to animate showing and hiding of FAB, e.g. when content scrolls. I8338d
  • Adding connected button group shapes and spacing to ButtonGroupDefaults to be used in a sample. I68e30
  • Split button add horizontal padding for trailing button and enable optical centering calculated from start and end corner differences I122e2
  • Introducing a new Material MotionScheme to allow setting a scheme for the component's motion. The scheme is set through the MaterialTheme. Id50c2

Bug Fixes

  • Apply the correct focus traversal index to Scaffold child Composables. The order is topBar, bottomBar, fab, content, snackbar. I5936b
  • Fixed an issue at the DatePicker and DateRangePicker where in certain locales and format-skeletons some of the date elements (e.g. month names) did not start with a capital letter. I1430f
  • Integrate FAB and FAB Menu component tokens (minor visual updates to paddings and text) Ib57f3
  • ModalBottomSheet is now first in semantic traversal order, followed by the scrim. I436f9 b/358594665
  • Fix bottom app bar not disappearing entirely when scrolling under the navigation pill in edge to edge mode I3ee21

New Features

  • Added predictive back support to NavigableListDetailPaneScaffold and NavigableSupportingPaneScaffold. I4dc21 b/359616816

API Changes

  • Added ThreePaneScaffoldState to ThreePaneScaffoldNavigator. Navigation methods have been made suspend to support navigation with animation. Added seekBack to support partial navigation states (e.g. predictive back). I5a651 b/359616816
  • Added MutableThreePaneScaffoldState to control the transition between scaffold values. The existing ThreePaneScaffoldState has been made read-only. Idb3c6
  • Expose default pane motion implementations I95a7b
  • Enable setting initial anchor of pane expansion state Ie41b3 b/362350560

Bug Fixes

Performance Improvements

  • Lazily create child context for rememberCoroutineScope f61464
    • rememberCoroutineScope is typically used to launch coroutines in response to events that happen post-composition. In some scenarios these events may never occur, leading to added costs of Job creation and cancellation without any benefit.
    • Make the scope returned by rememberCoroutineScope create its coroutineContext lazily when accessed, avoiding job creation and cancellation entirely if the scope is never used.

Bug Fixes

  • Fixed issue where specifying a generic outline clip would lead to an empty clip boundary on certain Android versions.
  • Fixed exception thrown when the IME is active on an external View and the Next action is used to enter focus on the ComposeView. The clearFocus() behavior aligns with View behavior on API < 28, where clearFocus() can cause the default View to be focused.
  • Fixed an issue where an incorrect placeOrder was used for lookahead invalidation, therefore fixing an edge case where lookahead placement was skipped.

API Changes

  • Kotlin version update to 1.9 I1a14c
  • Introduced a new Semantics Role called Carousel to emulate the list behavior in Pagers for a11y services. Id354b b/354109776 b/239672673
  • Rename invisibleToUser() to hideFromAccessibility. Its function remains the same. See documentation for more details. Ib43a3

Bug Fixes

  • Updating docs for SensitiveContent modifier Ib0442
  • Fixed issue where certain generic outline clips would be ignored in combination with elevation shadows on some Android versions
  • Fixed issue where empty clips would be applied when a generic outline clips was specified on certain Android versions.
  • Fixed exception thrown when the IME is active on an external View and the Next action is used to enter focus on the ComposeView. The clearFocus() behavior aligns with View behavior on API < 28, where clearFocus() can cause the default View to be focused.
  • Fixed an issue where placement happened on detached nodes in LazyList by separating the management of subcomposition for different layout passes.
  • Fixed a problem where the Software Keyboard flickers when focus switches from a TextField to an EditText or any other View based editor.
  • Nested Scroll nodes will now dispatch onPostFling events correctly after they get detached.
  • General performance improvements

Important changes since 1.2.0

Various important improvements in making the library more reliable and consistent, including but not limited to:

  • Support preferImmediatelyAvailableCredentials on all android versions.
  • Improved proguard rule to reduce the app size increase.
  • Various minor bug fixes.

Bug Fixes

  • Fixed an issue where quickly pressing the system back button or quickly doing gesture back will cause Fragments to crash when using Androidx Transitions. Ibc038 b/364804225
  • Fixed an issue in fragments where interrupting a predictive back gesture would send the fragment manager into an undefined state and even up showing the wrong fragment. If82e2 b/338624457
  • Fixed an UninitializedPropertyAccessException in AndroidFragment when dynamically swapping out the Class your AndroidFragment instance is using. I12dea

New Features

  • A modular and configurable library to make it easy to create, render, and manipulate beautiful ink strokes authored in your application.

API Changes

New modules to help developers build rich inking experiences:

  • Authoring: Use InProgressStrokesView for high-performance, low latency rendering of strokes in real time as inputs are received.
  • Rendering: Use CanvasStrokeRenderer and ViewStrokeRenderer to draw the finished ink strokes as part of an app’s user interface.
  • Strokes: Core data types used for inking features.
  • Brush: Configurable specification of how strokes will look and act in response to user input.
  • Geometry: Geometric operations like intersection and coverage to power tools like selection and erasing.

Bug Fixes

  • Prevent prediction from going beyond requested amount Ifbf49 b/369330439
  • 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. If6b4c b/345472586

Kotlin Multiplatform

  • The lifecycle-viewmodel-savedstate module is now configured to be KMP compatible in preparation for APIs like SavedStateHandle being made available in the common source set in a future release. I503ed I48764 b/334076622

New Features

  • Navigation Type Safety now supports Serializable classes that include a Double, Double?, DoubleArray, DoubleArray?, List<Double>, and List<Double>? without requiring any custom NavType. I570eb Ibc4c0 I37461 I5bed4 b/359245753

Bug Fixes

  • Improved the error message for when Navigation fails to map a route's argument to a NavType, the new error message will contain the argument name, argument fully qualified name, and the route's fully qualified name. Id8416 b/346264232

New Features

  • Add support for SDK-defined constants using const val in annotated interfaces and annotated values.

API Changes

  • Disallow objects in the apicompiler (these were previously silently ignored)

Bug Fixes

  • Fix crash when there are source directories ending in .class

Bug Fixes

  • Fixed support for multi-process Baseline Profile recording by signaling multiple processes sequentially. This fix requires both updating to androidx.benchmark:benchmark-macro:1.4.0-alpha02 in your macrobenchmark/baseline profile module and androidx.profileinstaller:profileinstaller:1.4.1 in the app. I0f519 b/366231469

Bug Fixes

  • Fix an issue with the KMP implementation of room-paging that would cause an Error code: 8, message: attempt to write a readonly database due to starting a write transaction on a read connection. b/368380988

Kotlin Multiplatform

  • The SavedState module is now KMP compatible. Supported platforms now include Android, iOS, Linux, Mac, and JVM desktop environments. I26305 b/334076622

New Features

  • Introduce SavedState opaque type as an abstraction to provide a consistent way to save and restore application state in KMP. It includes a SavedStateReader and SavedStateWriter for modifying the state to be saved. On Android, SavedState is a type alias for Bundle, ensuring binary compatibility and facilitating the migration of existing APIs to a common source set. On other platforms, SavedState is a Map<String, Any> instance. I18575 b/334076622
  // Create a new SavedState object using the savedState DSL:
  val savedState = savedState {
    putInt("currentPage", 1)
    putString("filter", "favorites")
  }

  // Read from a SavedState object
  val currentPage = savedState.read { getInt("currentPage") }

  // Edit an existing SavedState object
  savedState.write {
    remove("currentPage")
  }

API Changes

  • SavedStateRegistry and SavedStateRegistryController are now KMP compatible. Id7bb8 b/334076622
  • SavedState, SavedStateWriter and SavedStateReader are now KMP compatible. I26305 b/334076622

API Changes

  • We have added support for bi-directional swiping in SwipeToReveal, for rare cases where the current screen does not support swipe to dismiss. . The default is still to swipe-to-reveal only on right-to-left swipes and it is strongly advised to respect the default behavior to avoid conflict with swipe to dismiss. Ifac04
  • We have updated LazyColumnState to override canScrollForward and canScrollBackward - this now stops scrolling when the first or last item is exactly at the center of the screen. Ia77d7
  • We have added new HorizontalPager and VerticalPager components which address common issues, such as focus handling and interacting with system swipe to dismiss that could occur on Wear. I2902b
  • We have added support for LazyColumn to expose the client's key and contentType through layoutItems. I1bd9c

Bug Fixes

  • We have updated the curved text animations to be smoother, using paint flags. I73a15
  • We have updated the Material Dialog documentation to reflect that onDismissRequest is not called after show flag is set to false. Ifd8d6
  • We have fixed a bug with the vignette animation in the Material Dialog I126bf

API Changes

  • We have updated the API and appearance of HorizontalPageIndicator and added VerticalPageIndicator for use with VerticalPager Ic9309
  • AlertDialog now supports the ability to omit the default bottom button from the button stack variation, for custom layouts in which EdgeButton is not required. I34fa9
  • We have added a SwipeToReveal component for Wear Material 3 Ic38b2
  • We have added support for bi-directional swiping in SwipeToReveal, for rare cases where the current screen does not support swipe to dismiss. The default is still to swipe-to-reveal only on right-to-left swipes and it is strongly advised to respect the default behavior to avoid conflict with swipe to dismiss. Ifac04
  • We have renamed EdgeButton's buttonHeight parameter to preferredHeight. I4fab3
  • The Kotlin version has been updated to 1.9 I1a14c
  • We have renamed OpenOnPhoneDialogDefaults.Icon to OpenOnPhoneDialogDefaults.OpenOnPhoneIcon to avoid clashing with IconI0f391
  • We have added support for ScrollIndicator in LazyColumn. Ia546a
  • We have updated default values for TextToggleButton and IconToggleButton. I7aaa9
  • We have simplified the Picker and PickerGroup API. Id0653
  • We have added CardDefaults.Shape and CardDefaults.Height, which (being tokens) were otherwise private to developers using the library. I1594a b/347649765
  • We have renamed the progress parameter for the binary segmented circular progress indicator to segmentValue. Ib72d9
  • We have updated the colors and layout for Slider. Ic3eec

Bug Fixes

  • We have updated the openOnPhone icon animation I66f85
  • We are now using Google Symbols icons in Slider, TimePicker and DatePicker. I46c7c
  • We have updated the paddings in Confirmation and OpenOnPhoneDialog. Iaa82e

Bug Fixes

  • Resolve the issue that prevented the 1.12.0 APIs from being available in the release.

API Changes

  • Added a method to compute the WindowSizeClass from WindowMetrics. 874dba
  • Change the WindowSizeClass methods to containsWidthDp, containsHeightDp, and containsWindowSizeDp for clarity. fa760d
  • Convert WindowAreaController to abstract base class. I90893

Bug Fixes

  • Add support for relative bounds when creating a test FoldingFeature. 2e6b3e
  • General bug fixes when selecting a WindowSizeClass.