November 13, 2024

Bug Fixes

  • Fixed an issue on API 34+ where CompilationMode.None() would have inconsistent performance not representative of initial, worst case performance. This works around a platform change which allows ART's compilation state verify to partially compile apps (only affecting class loading) shortly after first launch. Ie48d0
  • Fixed issue where (especially short) traces could be captured that wouldn't report measurement from built-in Macrobenchmark Metrics, due to the process name being truncated within the Perfetto trace. Now macrobenchmark works around this issue by looking for the truncated package name in all built-in queries, in addition to the expected package name. Note that custom TraceMetric implementations or other direct callers of PerfettoSession.query can implement this same behavior by changing process.name LIKE "$packageName" in a Perfetto query to instead be (process.name LIKE "$packageName" OR process.name LIKE "$(packageName.takeLast(15))"). I5bf01 b/377565760

Fixed a security vulnerability and other general bug fixes. If you are using a lower version, please update to use this version.

androidx.car.app:app-*:1.7.0-beta03 is released. Version 1.7.0-beta03 contains these commits.

API Changes

  • Update CAL Serialization / De-serialization code to only handle objects which have the annotation @CarProtocol declared on them. Ic730e
  • CarAppExtender can now be used to extend the framework Notification.Builder instead of only NotificationCompat.Builder. Id3ad7
  • Add KEY_EXCLUDE_MEDIA_ITEM_FROM_MIXED_APP_LIST extra. I201f9
  • Deprecate the empty Builder constructor on ConversationItem and replace it with a constructor that takes required parameters. Also adds a check to guard against null messages. Ic8221

Bug Fixes

  • Ensure PlaceList map uses string (Text-only) Header title. Ic992f
  • 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). Ib5367 b/326456246

API Changes

  • Adds stylusHoverIcon modifier. Iff20a b/331289114
  • Deprecated AnchoredDraggableState's confirmValueChange. Instead of vetoing state changes, disallowed anchors should not be in the active anchor set, and an OverscrollEffect should be used to indicate the unavailability of the requested action. Ia717f
  • Changes Autofill manager to be an interface. I84914 b/376080755
  • Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling APIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere. Idbb3d b/266550551 b/204650733 b/255554340 b/229537244
  • Adding autofill support in text toolbar. Ie6a4c
  • Deprecates OverscrollConfiguration and LocalOverscrollConfiguration, and adds rememberPlatformOverscrollFactory to create an instance of / customize parameters of the default overscroll implementation. To disable overscroll, instead of LocalOverscrollConfiguration provides null, use LocalOverscrollFactory provides null. To change the glow color / padding, instead of LocalOverscrollConfiguration provides OverscrollConfiguration(myColor, myPadding), use LocalOverscrollFactory provides rememberPlatformOverscrollFactory(myColor, myPadding). Ie71f9 b/255554340 b/234451516
  • Changed the effectModifier property on OverscrollEffect to be node: DelegatableNode, consistent with other APIs. Ic0b46 b/255554340
  • Removed the experimental GlobalAssertions API. It's intended use was to run accessibility checks, see enableAccessibilityChecks() for that purpose instead. I59322

Behavior Changes

  • Revert color changes introduced in aosp/3212478 to iconButtonColors, iconToggleButtonColors, outlinedIconButtonColors, outlinedIconToggleButtonColors and outlinedIconToggleButtonBorder. Moved the now-reverted behavior into a new set of functions called iconButtonVibrantColors and so forth to emphasize the high contrast colors being returned. Iffd8d

New Features

  • Introduce VerticalDragHandle component I6c770

API Changes

  • Rename DismissibleModalWideNavigationRailDefaults to ModalWideNavigationRailDefaults. I8e877
  • Add NavigationBarComponentOverrides. I8a3f3
  • Add NavigationRailComponentOverride. I83e13
  • Introduce WideNavigationRailState to handle collapsing/expanding of the rail, allow ModalWideNavigationRail to be dismissible and delete DismissibleModalWideNavigationRail. I88568
  • Add xSmall, medium, large, and xLarge size defaults into toggle button defaults. Ie95d1
  • Add xSmall, medium, large, and xLarge size defaults into button defaults. If8b6d

Bug Fixes

  • Filter chip trailing icon color has been updated from Primary to OnSurfaceContainer, per spec. All chip outline colors have been updated from Outline to Outline Variant, per spec. I68bd4

API Changes

  • Remove drag handle implementation in the adaptive library and encourage people to use the M3 version of it. And at the same time introduce a modifier to provide pane expansion dragging ability to a provided drag handle composable. Also hide DraggableState as an implementation detail so we can change it later if needed. Ib50cd
  • Moves the entry point of pane motion customization from the scaffold functions to AnimatedPane according to UXR feedback. I10f72
  • Introduce fling support and custom animation spec for pane expansion. Ie207d b/362584341

Bug Fixes

API Changes

  • Changes to the PausableComposition API. These breaking changes with respect to previous releases of 1.8.0-alpha (since 1.8.0-alpha02) but, as these are new APIs in 1.8.0, backwards compatibility is not maintained as the APIs are still in alpha. I39819
  • Adds tooling APIs to observe the creation of new compositions within a Recomposer Iaeb7e
  • Added snapshotId, of type Long, to Snapshot and deprecated id. The ID of a snapshot changed from a Int to a Long to avoid the snapshot ID from overflowing on systems with very high frame rates and long running animations. The type was made expect/actual to allow this type to be Int, or other type, on platforms that don't have a native Long type. Platforms that do not have a native Long, such as JavaScript, should avoid high frame rates (over 1000 FPS) which would cause an overflow for Int approximate every 24 days. I38ac3 b/374821679

Bug Fixes

API Changes

  • Adds stylusHoverIcon modifier. Iff20a b/331289114
  • Changes Autofill manager to be an interface. I84914 b/376080755
  • Adds requestFocus(FocusDirection) to both focusRequester and FocusTargetModifierNode to allow focusing with a specific direction. I5d9ec b/245755256
  • FocusProperties.enter and FocusProperties.exit have been replaced with onEnter and onExit, using a receiver scope instead of FocusDirection parameter. I6e667
  • Adding autofill support in text toolbar. Ie6a4c
  • API changes to Modifier.focusRestorer() I99c03:
    • parameter name changed to 'fallback'
    • parameter is now a FocusRequester and not a lambda
    • parameter is now non-NULL with Default as the default value
  • Removing @Experimental annotation from autofill manager interface. The feature is still WIP targeting this release but we do not want to introduce @Expemiental API Id8398
  • LocalHapticFeedback now provides a default HapticFeedback implementation when the Vibrator API indicates that haptics are supported. The following have been added to the HapticFeedbackType - Confirm, ContextClick, GestureEnd, GestureThresholdActivate, Reject, SegmentFrequentTick, SegmentTick, ToggleOn, ToggleOff, VirtualKey. Wear Compose long-clickable components such as Button, IconButton, TextButton, and Card now perform the LONG_PRESS haptic when a long-click handler has been supplied. I5083d
  • Removes OverscrollConfiguration and LocalOverscrollConfiguration, and adds rememberPlatformOverscrollFactory to create an instance of / customize parameters of the default overscroll implementation. To disable overscroll, instead of LocalOverscrollConfiguration provides null, use LocalOverscrollFactory provides null. To change the glow color / padding, instead of LocalOverscrollConfiguration provides OverscrollConfiguration(myColor, myPadding), use LocalOverscrollFactory provides rememberPlatformOverscrollFactory(myColor, myPadding). Ie71f9 b/255554340 b/234451516
  • Removed the experimental GlobalAssertions API. It's intended use was to run accessibility checks, see enableAccessibilityChecks() for that purpose instead. I59322

New Features

  • Add support for reading XMP data from HEIF images.
  • Add support for reading Exif and XMP from AVIF images.

API Changes

  • Indicate that the location param for setGpsInfo is @Nullable and that passing null will result in a No-Op. If924c b/236484611

Bug Fixes

  • Continue parsing after encountering an invalid IFD offset b/264729367.
  • Handle WebP images which incorrectly contain a JPEG APP1 marker before their Exif data b/281638358.
  • Ensure XMP changes in JPEGs with a separate XMP segment are stored into the same separate XMP segment by saveAttributes(), instead of being written to TIFF/Exif tag 700 which is not supported by the XMP spec and where many tools won't find them.
  • Avoid duplicating XMP data from a separate segment into the TIFF preview directory when saving b/309843390.
  • Improve precision of double to rational conversions. b/312680558.
  • Accept rational format (x/y) to setAttribute for 'legacy' rational tags which are auto-converted to decimal when returned from getAttribute b/312680558.
  • Ensure XMP data added to a JPEG image which doesn't already contain XMP is written to a separate segment, as specified by the XMP spec. ExifInterface is documented to prefer the XMP in the Exif 700 tag in JPEG images (violating the spec), so this behavior is preserved when reading/writing images with existing XMP data.
  • Fix corrupted output when writing WebP images with a height or width greater than 8191px b/342697059.
  • 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). I5cd0f b/326456246
  • 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 Compatibility

  • Lifecycle ViewModel SavedState is now KMP compatible. This allows you to use SavedStateHandle in common code. Ib6394 b/334076622

KotlinX Serialization Support

  • With the support of KotlinX Serialization added in SavedState 1.3.0-alpha05, we have introduced saved, a lazy property delegate, to make it easy to store @Serializable classes in a SavedStateHandle and have those classes automatically be restored across process death and recreation. Please note the saved delegate is lazy and will not call the init lambda or save anything into the SavedStateHandle until it is accessed. I47a88 b/376026744

    @Serializable
    data class Person(val firstName: String, val lastName: String)
    
    class MyViewModel(handle: SavedStateHandle) : ViewModel() {
        var person by handle.saved { Person("John", "Doe") }
    
        fun onPersonChanged(person: Person) {
            this.person = person
        }
    }
    

API Changes

  • Add getMutableStateFlow to SavedStateHandle to return a MutableStateFlow. This new function is key-exclusive and cannot be used with getLiveData. An exception will be thrown if you try to use both to access the same state. I04a4f b/375408415

New Features

  • Navigation type safety now supports value classes as a route or as the argument type of a route. I9344a b/374347483

Bug Fixes

  • Fixed a ConcurrentModificationException that could occur when a LifecycleObserver attached to a NavBackStackEntry triggers a change to the back stack when the host LifecycleOwner such as the containing Activity or Fragment changes its lifecycle state. Ia9494

Bug Fixes

  • Android unit tests pulling in Paging 3.3 or later will no longer throw an error such as Method isLoggable in android.util.Log not mocked. Ia9400 b/331684448

Expanded Compatibility

  • The PDFViewer library now supports Android versions S, T, U, and V. This enhanced compatibility is linked to the SDK extension 13 update.

API Changes

  • Added minimum SdkExtension constraint to PdfViewerFragment. I922af
  • Exposing new apis for PDF Viewer library. I0af57

Bug Fixes

  • Crash fix for process death issue.
  • UI fixes related to the password dialog.
  • Accessibility fixes for findInFileView and FastscrollView.

Ongoing Development

  • We are actively working on incorporating Jetpack Compose into the library.

New Features

  • Supported LayoutInflater creation from SdkContext in backcompat mode.
  • Supported DisplayContext/WindowContext creation from SdkContext in backcompat mode.

New Features

  • Introduced an experimental API, DelegatingSandboxedUiAdapter, which extends SandboxedUiAdapter and can be used to delegate between different SandboxedUiAdapters. When this adapter is set on a client container such as SandboxedSdkView, the delegating adapter can change the delegate adapter using updateDelegate. This will close the existing session and create a new SandboxedUiAdapter.Session for the new delegate. This allows for seamless transitions between delegates. I5f1c5 I9e3e7
  • Added better SandboxedSdkView support for padding. Ic414f

Bug Fixes

  • Fixed NullPointerException that could occur on a global layout event.

KotlinX Serialization Support

  • SavedState now includes KotlinX Serialization support. You can convert a class annotated with @Serializable to a SavedState using the methods encodeToSavedState and decodeFromSavedState. The returned SavedState is a regular Bundle on Android and can be used by any API that accepts a Bundle. I6f59f b/374102924

    @Serializable
    data class Person(val firstName: String, val lastName: String)
    
    fun main() {
        val person = Person("John", "Doe")
        val encoded: SavedState = encodeToSavedState(person)
        val decoded: Person = decodeFromSavedState(encoded)
    }
    
  • We also have included saved, a lazy property delegate, to make it easy to store @Serializable classes in a SavedStateRegistryOwner (e.g., ComponentActivity, Fragment, etc.) and have those classes automatically be restored across process death and recreation. Please note the saved delegate is lazy and will not call the init lambda or save anything into the SavedStateRegistry until it is accessed. I66739 b/376027806

    @Serializable
    data class Person(val firstName: String, val lastName: String)
    
    class MyActivity : ComponentActivity() {
        var person by saved { Person("John", "Doe") }
    
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            this.person = Person("Jane", "Doe")
        }
    }
    
  • There is a similar saved property delegate for SavedStateHandle added in Lifecycle 2.9.0-alpha07.

API Changes

  • Add toMap to SavedState, allowing any SavedState to be converted to a regular Map (shallow copy). I487b9 b/334076622
  • SavedState KMP now supports arrays. Ic0552 b/334076622

API Changes

  • We have simplified the ScrollInfoProvider for PagerState by removing the orientation parameter, which is no longer needed. The new behavior is for TimeText to remain in place for both horizontal and vertical paging. I71767
  • TransformingLazyColumn was introduced in earlier releases. We are now removing Wear's LazyColumn aliases (which were forwarding to TransformingLazyColumn) in favor of the new name TransformingLazyColumn. We have also removed TransformingLazyColumnVisibleItemInfo's height property - please use measuredHeight instead. I0ea1e
  • We have changed the PagerDefaults.snapFlingBehavior snapAnimationSpec from a Tween to a Spring spec.I10d02 b/349781047 b/303807950
  • We have promoted the LocalReduceMotion CompositionLocal to stable Ia6f32

Bug Fixes

  • We have updated Modifier.rotaryScrollable to use focusTargetWithSemantics for better semantics support in rotary. Ief0a0
  • We have updated the minimum API dependency to 1.7.4 for Compose libraries. I88b46
  • We have disabled width morphing in TransformingLazyColumn as a workaround to a clipping bug. I3dfb8
  • We have fixed a bug that caused disappearing items after overscroll with TransformingLazyColumn Id7668
  • We have added LazyLayoutSemantics for TransformingLazyColumn. Ia8f56

API Changes

  • We have updated TimeText to provide default content that shows the time. Id23b3
  • We have simplified the ScrollInfoProvider for PagerState by removing the orientation parameter, which is no longer needed. The new behavior is for TimeText to remain in place for both horizontal and vertical paging. I71767
  • LocalHapticFeedback now provides a default HapticFeedback implementation when the Vibrator API indicates that haptics are supported. The following have been added to the HapticFeedbackType - Confirm, ContextClick, GestureEnd, GestureThresholdActivate, Reject, SegmentFrequentTick, SegmentTick, ToggleOn, ToggleOff, VirtualKey. Wear Compose long-clickable components such as Button, IconButton, TextButton, and Card now perform the LONG_PRESS haptic when a long-click handler has been supplied. I5083d

Bug Fixes

  • We have updated the motion for Confirmations. I04bff
  • We have updated the minimum API dependency to 1.7.4 for Compose libraries. I88b46
  • New motion was added for the OpenOnPhone dialog. I1e10a
  • We have fixed a bug in the LevelIndicator so that it is now correctly displayed with the level is zero. Ie95a4
  • We have updated the HorizontalPageIndicator and VerticalPageIndicator animations. I5c8f3
  • We have added a shrink-to-dot animation to the indeterminate ArcProgressIndicator. I9fd51

New Features

  • Updated Material3 shape to be a class with fields that hold the actual Corner value, same as in Wear Compose. Ied8cd
  • Updated Material3 colors to include ColorScheme concept, same as in Wear Compose. If645e
  • Add multiple commonly used matcher to the testing library. Ie5cec

New Features

  • Add experimental WebView async startup API. I94b8a
  • URL Prefetching in Profile: Introduced a new API in Profile to allow developers to trigger URL prefetching. Prefetch Clearing: Added an API to clear ongoing prefetches. I42c5c

API Changes

  • Deprecate WebView.startSafeBrowsing. If5626