MinSdk Update
- The default
minSdkfor the AndroidX has been moved from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
Documentation Updates
- Updated KDocs for
PredictiveBackHandlerto call out a known timing issue where it may process a gesture in the same frame it is disabled. I5be5c b/431534103 - Updated KDocs for
BackHandlerandPredictiveBackHandlerto explicitly state the 'last composed wins' behavior in addition to recommending unconditional composition with theenabledflag. I7ab94
Dependency update
- Activity now depends on Navigation Event
1.0.0-alpha06.
New Features
- Use KDoc(s) as
AppFunctiondescriptions - Restrict values for Int and String types using
AppFunctionIntValueConstraintandAppFunctionStringValueConstraintannotations, respectively. - Specify a natural language description for large language models and a user visible description displayed within agent apps.
- Automatically grant permissions to URI(s) returned from an app function using
AppFunctionUriGrantclass. - Write Robolectric tests using
AppFunctionTestRulefor testing your app function setup.
API Changes
- Add
AppFunctionStringValueConstraintI10e3f - Add
AppFunctionIntValueConstraintIfda13 - Refactor
AppFunctionPrimitiveTypeMetadatato specific data type classes. I1a3b2 - Add description field in
AppFunctionResponseMetadataI2332b - Remove permission requirement from
setAppFunctionEnabledAPI I1b92a - Add description field in
AppFunctionParameterMetadataI40a67 - Add
AppFunctionUriGrantI67ca9 - Add
resolveAppFunctionAppMetadataAPI. I17408 - Add
isDescribedByKdocin@AppFunctionSerializableannotation Ie14e7 - Add description field in
AppFunctionDataTypeMetadataI1bcac - Return
AppPackageMetadatafromobserveAppFunctionsAPI. I68c7e - Add description field in
AppFunctionMetadataI060e2 - Add
AppFunctionTestRuleId5ed0 - Add
isDescribedByKdocin@AppFunctionannotation Ia84d2
Bug Fixes
API Changes
- Added support for the
display_overrideTWA manifest property Ib036b - Removing obsolete
@RequiresApi(21)annotations Ic4792 - Removing obsolete
@RequiresApi(21)annotations I9103b - Allow Null for
pageUrlinContentActionSelectedDataIfed54 - Added an Intent to allow launching the initial url in an external app Id9349
- Add an Intent to allow launching the initial url in an external app Ifed54
Bug Fixes
- Moving the default
minSdkfrom API 21 to API 23. Ibdfca b/380448311 b/435705964 b/435705223 - Allow Null for
pageUrlinContentActionSelectedData. Id9349
Bug Fixes
- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
- Removed the 10-bit output restriction for the low-light boost auto-exposure mode. Applications can now simultaneously enable both features on supported devices. I5a638
- Resolved an issue that caused devices with
UniSocchipsets to hang when capturing an image. The problem occurred whenVideoCapture,Preview, andImageCapturewere used simultaneously with all streams set to a 1280x720 resolution. Ia00c4 b/380802479 - Fixed preview black screen when no high-speed frame rate is set for high-speed/slow-motion recording. cdf0ff2e9
- Improve error handling and logging in
getViewportAspectRatioInt82fca18
Bug Fixes
- Fixed the crash in
androidx.camera.media3.effectwith media3 1.7 or later I450a6
Bug Fixes
- Moving the default
minSdkfrom API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
New Features
- New API to allow dynamically enable and disable shared elements that also allows accounting for whether there is already an ongoing shared element transition.
- New API to set up an alternative target bounds when the target shared element is disposed during the transition.
- New API to obtain the
LayoutCoordinatesof aLookaheadScope. I18dd4 b/409819304 b/395670637 - New modifier
Modifier.skipToLookaheadPositioninSharedTransitionScopefor anchoring a layout at the target position during a shared transition. I88734
API Changes
- Simplified
renderInSharedTransitionOverlayby removing theclipInOverlayDuringTransitionlambda as this has been rarely used. Introduced new factory method forSharedContentConfig. Id01b2 - Added a set of Defaults for shared element, shared bounds,
renderInSharedTransitionOverlayconfigurations. These defaults are now accessible through public APIs. Id23cc ScaleToBoundsResizeMode has been renamed toscaleToBoundsI5ac50
Bug Fixes
- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
Important changes since 1.8.0
- Lint checks shipped with Compose now require a minimum AGP version of 8.8.2. If you are unable to upgrade AGP, you can instead upgrade Lint on its own by using
android.experimental.lint.version=8.8.2(or a newer version) in yourgradle.properties. To run Compose lint checks inside the IDE, Android Studio Ladybug or newer is required. - Breaking change:
clickable,combinedClickable,selectable,toggleable, andtriStateToggleableoverloads without an Indication parameter now only supportIndicationNodeFactoryinstances provided usingLocalIndication. This change will apply when you recompile your usages of these modifiers using this version of Compose. Binary / transitive dependencies are not affected. If you are providing a deprecated Indication implementation toLocalIndication, and using these APIs, this will introduce a crash at runtime. This behavior change is needed to enable improved performance, and allow Composable functions using these modifiers to skip during recomposition. You can useComposeFoundationFlags.isNonComposedClickableEnabled=falseto temporarily opt-out of this behavior change, to enable upgrading Compose without being blocked on this migration. This flag will be removed after one stable release. To resolve, migrate any deprecated Indication implementations to useIndicationNodeFactoryinstead. You can also use the overloads with an explicit Indication parameter - these overloads will continue to support non-IndicationNodeFactoryinstances of Indication, although this is not recommended for performance reasons. I6bcdc b/316914333 - Introduced
isFlingCancellationWithNestedScrollFixEnabledto fix an issue with fling propagation in nested scrolling. In this CL we are restoring the fling continuation behavior removed in I9326a. We will still cancel the fling animation in case the child is removed from composition. I467f4 b/405910180 b/419049142 b/416784125 - Re-add usage of
scrollAnimationSpecinContentInViewNode. The behavior was removed during thescrollAnimationSpecdeprecation which caused use cases to be broken. I1436a b/403301605 - Stabilized
LazyLayout. If5db4,LazyLayoutPrefetchStateand it's scheduling methodschedulePrecompositionandschedulePrecompositionAndPremeasure. I4362f b/252853717 andLazyLayoutItemProviderIcce09 b/261565751 - Allow Compose to trigger
ViewTreeObserver.OnScrollChanged. This behavior is introduced under the flagisOnScrollChangedCallbackEnabled. We also introduced an extension function ofDelegatableNode dispatchOnScrollChanged. I34b9d b/238109286 - Introduce
Modifier.scrollable2D,Scrollable2DStateand companion APIs for state creation. Also introduced common scroll extension functions. Ic61c8 b/214410040 PrefetchSchedulerand customisation have been deprecated in favor of the internal implementation that does all the work automatically. I3a9a6 b/420551535TextFieldState.edit { }no longer clears the undo history. Instead it creates a standalone undo entry. If the desired behavior is to clear the undo stack after an edit call, please useTextFieldState.undoState.clearHistory(). I12c14- Context Menu and Selection toolbar now both support Smart Items (Smart Selection)
- Added styled text
OutputTransformationto allow styling the output ofTextFieldusing thestateoverload. TextField: Support context menu (right click menu).- Text copied from multiple Text composables in a
SelectionContainernow will have a line separator \n added between text coming from the separate Text composables. I25332 b/285036739 - Introduce API for creating custom bullet lists through
AnnotatedStringI1d066 b/383269496 b/139326648 - The
stateoverload ofBasicTextFieldwill keep the cursor scrolled into view when its size changes. I0eb41 b/406187741 - Breaking change: the
backgroundandbordermodifier nodes now implementSemanticsModifierNode. This can result in newSemanticsNodesadded to the semantics tree and, therefore, lead to test failures in tests that make assumptions about the semantics tree structure. For example, tests that useonChild,onParent,onSibling, and other similar methods to make assertions can fail if a new node is added between the current and target nodes. The preferred way to fix these failures is to add atestTagto the target node directly. Another approach is to use a looser matcher, such asonNode(hasAnyAncestor(hasText("ancestor")) and hasText("target")). I638b5
API Changes
- Update Pager's prefetch strategy to use Cache Window instead of the default 1 item in the direction of the scroll. Now initial prefetching is enabled by default in Pager and prefetching will be based on the size of the window worth 1 viewport, that is, we will try to fill 1 whole view port with prefetched items. Items will be kept around longer as well. I4d45e b/292136289
ComposeFoundationLayoutFlags.isWindowInsetsOptimizationEnabledflag has been added to allow disabling aWindowInsetsperformance optimization should the new implementation cause a behavioral change. I8e912SnapFlingBehaviornow allows snap animation specs to overshoot during snapping. This allows enables e.g. a bouncy spring spec as thesnapAnimationSpecto produce a bouncy snap animation. Overshooting values continue to be ignored when performing an approach with the snap spec. I373c2- Pointer downs with a mouse or touchpad in a
ComposeViewwill now clear focus automatically if the pointer down doesn't occur in the bounds of the focused node. This results in a "tap-to-clear focus" UX that is more expected than current behavior when using pointer input devices. This behavior can be opt-ed out of with a newAbstractComposeView.isClearFocusOnPointerDownEnabledAPI. I6322b b/282963174 - Now Scrollable supports 2 dimensional mouse wheel scroll events better. A new test API landed to help test use cases in
MouseInjectionScope. We also introduced a new overload for scroll methods inMouseInjectionScopeand a flag to control the new behavior calledisMouseWheel1DAxisLockingEnabledI136df - Updated
DragGestureNodeto use raw pointer input instead of suspending pointer input for optimization. The changes are added behind the flagisNonSuspendingPointerInputInDraggableEnabledI0fa4b - Annotated some
AnchoredDraggableAPIs with@FrequentlyChangingValue.offset,requireOffsetandprogresschange often and should not be read in composition. Please access these values from the layout and draw phases, effects or otherwise outside of composition instead. I05539 - Removed flags
isOnScrollChangedCallbackEnabled,isAdjustPointerInputChangeOffsetForVelocityTrackerEnabled,isFlingContinuationAtBoundsEnabled,isAutomaticNestedPrefetchEnabled,DragGesturePickUpEnabled,isPointerInteropFilterDispatchingFixEnabled,isNestedScrollInteropPostFlingFixEnabled,isNestedScrollDispatcherNodeFixEnabledI36c18 - Introduce
CompositionLocalthat can be used to modify the brush of Autofill's successful filling highlight. I52329 - Added customizable focus rect to
FocusProperties. You can now define a custom focus area instead of defaulting the bounding box of the focusable. This information is used by the focus traversal system and the keep in view logic of scrollable containers. Id6555 b/368378073 - Added a new
LineHeightStyle.ModecalledTight. This mode helps enforce smaller line heights even when they may possibly cut taller glyphs. Id3849 - Introduced new Interpolatable interface which allows for automatic interpolation between different types, assuming one type knows how to convert from the other. This interface is leveraged in several compose types like Brush and Shape, but can be utilized externally as well. I58eab
- Adds indirect input events and a way to specify coordinate axis to use for scrolling. I58e7c
- Adds new
WindowInsets.cutoutPathAPI to get the path for the display cutout Ib90b1 b/279636456 - The
isWindowInsetsDefaultPassThroughEnabledflag has been removed, defaulting WindowInsets to not consuming so that child Views can receiveWindowInsetsby default. I888e0 b/412469666
Bug Fixes
isNonSuspendingPointerInputInDraggableEnabledshould be disabled for now. Ia41c4- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
- Updated
DraggableAnchors'minPosition/maxPositiondocumentation to indicate these APIs should return Float.NaN in line with otherDraggableAnchorsAPIs. I0460a - Fixed a bug where
DraggableAnchors#closestAnchorwould crash if the anchors were empty I4e646 - Performance improvements for
DraggableAnchorsIf4065 I0460a TextFieldState.edit { }no longer clears the undo history. Instead it creates a standalone undo entry. If the desired behavior is to clear the undo stack after aneditcall, please useTextFieldState.undoState.clearHistory(). I12c14- Added support for double-tap to select word in
SelectionContainerandBasicTextField(value, onValueChange)overload. Ibb06a - Minor bug fix to make
AutoboxingStateValuePropertyDetectorcompatible for both K1 and K2 Ie81c1 requestRectangleOnScreenrequests made by AndroidViews now properly propagates to Compose. This helps views likeEditTextto stay on screen when interacted with. Ibbf4c- Column and Row now correctly pass the item's actual size to
Alignment.Vertical.alignandAlignment.Horizontal.align, resolving an issue where custom alignment implementations received an incorrect 0 value. I3e460 b/349722072
Important changes since 1.8.0
Behavior Changes
- Lint checks shipped with Compose now require a minimum AGP version of 8.8.2. If you are unable to upgrade AGP, you can instead upgrade Lint on its own by using
android.experimental.lint.version=8.8.2(or a newer version) in your gradle.properties. To run Compose lint checks inside the IDE, Android Studio Ladybug or newer is required.
API Changes
- Projects released with Kotlin 2.0 require KGP 2.0.0 or newer to be consumed. Idb6b5
- Text field decoration box APIs are no longer experimental. I7480f
Bug Fixes
ExposedDropdownMenuis binary compat with older versions. I133f7
Bug Fixes
- Moving the default
minSdkfrom API 21 to API 23. Ibdfca b/380448311 b/435705964 b/435705223
Dependency Changes
- Remove
graphics-shapesdependency I219e0 b/436230765
API Changes
- In
PullToRefreshDefaults, renamedshapetoindicatorShapeandcontainerColortoindicatorContainerColorand addedindicatorMaxDistancefor indicator use. Ib6cbe - Remove deprecation tag from
PullToRefreshDefaults.indicatorColorIaaee2 BasicAlertDialogOverrideScopewas accidentally promoted to stable and had its experimental annotation removed in aosp/3701846. Marking it as internal. It will stay as public experimental in 1.5.0-alpha I9182a
Bug Fixes
- Fix bug where backpress incorrectly updates drawer offset. I85624 b/427778135
API Changes
- In
PullToRefreshDefaults, renamedshapetoindicatorShapeandcontainerColortoindicatorContainerColorand addedindicatorMaxDistancefor indicator use. Ib6cbe - Remove deprecation tag from
PullToRefreshDefaults.indicatorColorIaaee2 - Added
AppBarWithSearch, replacingTopSearchBarand supporting navigation/action icons. I213a5
Bug Fixes
- Fix bug where backpress incorrectly updates drawer offset. I85624 b/427778135
SwipeToDismissBoxnow falls back to a settledtargetValueif no other anchors exist.BottomSheetScaffoldnow falls back to an ExpandedtargetValueif no other anchors exist. I73d5e b/428856426- Fixed button padding in
AlertDialogwhen stacked vertically. Ia2118 - [FAB] Fix bug where FAB is still clickable after
Modifier.animateFloatingActionButtonhides it I8ea6c b/430336834 - [Slider] Fixed keyboard navigation for Slider I3a405
API Changes
- Introduce a generic
PaneScaffoldRoleinterface to improve API readability I1b757 - Remove
AdaptStrategy.Levitated.Strategyclass I6f798 - Changes
Modifier.preferredWidth/Height's proportion parameter from Int percentage values to Float ranges from 0 to 1. Ib2de2
Bug Fixes
- Fix the issue that initial anchors are not respected I32f5d b/418296559
Important changes since 1.8.0
- Lint checks shipped with Compose now require a minimum AGP version of 8.8.2. If you are unable to upgrade AGP, you can instead upgrade Lint on its own by using
android.experimental.lint.version=8.8.2(or a newer version) in your gradle.properties. To run Compose lint checks inside the IDE, Android Studio Ladybug or newer is required. - A new runtime-annotation library has been created. This contains annotation definitions without a dependency on Compose runtime, so it can be used from non-Compose modules.
@Stable,@Immutable, and@StableMarkerhave been moved to runtime-annotation, to allow annotating non-Compose modules@FrequentlyChangingValueand@RememberInCompositionhave been added to runtime-annotation.@FrequentlyChangingValuemarks declarations that can cause frequent recompositions, and@RememberInCompositionmarks declarations that should be remembered in composition. Corresponding lint checks warn for incorrect usage.
androidx.compose.runtime:runtimewill now support additional platforms. Support for desktop, iOS and native targets has been upstreamed from JetBrains' Compose Multiplatform project, and will be released through Google Maven moving forward. No other Compose artifacts are affected.
API Changes
- Introduces the retain API. Like
rememberSaveable, retain can persist and save remembered values that leave the composition hierarchy. Retained values are not serialized and have a shorter lifespan than saved values, and behave similarly to an androidxViewModel. See the documentation for more details. Ia3105 b/177562901 - Added an
awaitOrScheduleNextCompositionEnd()API, which issues a callback when the Recomposer finishes composing the current frame. If the Recomposer isn't currently composing a frame, this API suspends until the next frame's composition finishes and schedules a new frame to be composed. Ib873c - Add a non-unit returning composition local provider API I22521 b/271871288
- Added a feature flag,
isMovableContentUsageTrackingEnabled, that allows tracking the usage of movable content to avoid some overhead when initially creating the content. This feature flags is currently disabled by default. Ia713d
Bug Fixes
- Fixes a crash in movable content when it is moved between subcompositions. I3fa1e b/436858107
- Fixes a bug with part of a composable stack trace missing when inside multiple nested subcompositions. I98c6f
- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
- Fixed a race condition when internal state of a pausable composition was being updated from multiple threads. I03895
- Updates composition registration observer to be called before initial composition. I4adca b/430600932
- Minor bug fix to make
AutoboxingStateValuePropertyDetectorcompatible for both K1 and K2. Ie81c1
External Contribution
Important changes since 1.8.0
- Important changes in version 1.9.0 are covered in this blogpost
- Lint checks shipped with Compose now require a minimum AGP version of 8.8.2. If you are unable to upgrade AGP, you can instead upgrade Lint on its own by using
android.experimental.lint.version=8.8.2(or a newer version) in yourgradle.properties. To run Compose lint checks inside the IDE, Android Studio Ladybug or newer is required. - Breaking change: the
graphicsLayermodifier nodes now implementsSemanticsModifierNode. This can result in newSemanticsNodesadded to the semantics tree and, therefore, lead to test failures in tests that make assumptions about the semantics tree structure. For example, tests that useonChild,onParent,onSibling, and other similar methods to make assertions can fail if a new node is added between the current and target nodes. The preferred way to fix these failures is to add atestTagto the target node directly. Another approach is to use a looser matcher, such asonNode(hasAnyAncestor(hasText("ancestor")) and hasText("target")). I638b5
API Changes
- Pointer downs with a mouse or touchpad in a
ComposeViewwill now clear focus automatically if the pointer down doesn't occur in the bounds of the focused node. This results in a "tap-to-clear focus" UX that is more expected than current behavior when using pointer input devices. This behavior can be opt-ed out of with a newAbstractComposeView.isClearFocusOnPointerDownEnabledAPI. I6322b b/282963174 - Introduce
FillableDatainterface to support various autofill component types, in addition to Text. If9bd2 - New API to allow dynamically enable and disable shared elements that also allows accounting for whether there is already an ongoing shared element transition. New API to set up an alternative target bounds when the target shared element is disposed during the transition. New API to obtain the
LayoutCoordinatesof aLookaheadScope. I18dd4 b/409819304 b/395670637 - Introduce flag
isNestedScrollInteropIntegerPropagationEnabledto control the experiment of dispatching correct integers to nested scroll interop. If8316 - Added
requestFocusForChildInRootBounds()toDelegatableNodeto move focus to a child that overlaps with the given rect. I001ef - Removed flags
isOnScrollChangedCallbackEnabled,isAdjustPointerInputChangeOffsetForVelocityTrackerEnabled,isFlingContinuationAtBoundsEnabled,isAutomaticNestedPrefetchEnabled,DragGesturePickUpEnabled,isPointerInteropFilterDispatchingFixEnabled,isNestedScrollInteropPostFlingFixEnabled,isNestedScrollDispatcherNodeFixEnabledI36c18 - Added
@CheckResultannotation on theSemanticsNodefinder and selector functions to enforce usage of returned values. I6f86e b/201652748 - Improve the performance of the content capture process I3c7c0
- Introduce
CompositionLocalthat can be used to modify the brush of Autofill's successful filling highlight. I52329 - Introduced new Interpolatable interface which allows for automatic interpolation between different types, assuming one type knows how to convert from the other. This interface is leveraged in several compose types like Brush and Shape, but can be utilized externally as well. I58eab
- Now Scrollable supports 2 dimensional mouse wheel scroll events better. A new test API landed to help test use cases in
MouseInjectionScope. We also introduced a new overload for scroll methods inMouseInjectionScopeand a flag to control the new behavior calledisMouseWheel1DAxisLockingEnabledI136df - Add
DeviceConfigurationOverridesfor keyboard type & state, navigation type and state, touchscreen state, and UI mode type I282f0 - Added a new
LineHeightStyle.ModecalledTight. This mode helps enforce smaller line heights even when they may possibly cut taller glyphs. Id3849 BaselineShiftnow has an Unspecified value to prevent boxingBaselineShift,Hyphens,LineBreak,TextAlign, andTextDirectionnow haveisSpecifiedhelper functionsHyphens,TextAlign,TextDecoration, andTextDirectionnow havevalueOf()and value methods enabling efficient serialization/deserialization. I8d44c- Added a new
getDisplayNamemethod interface to allow custom display names for preview parameter instances. I19bdf b/241699422 - When Dp values are compared with Unspecified using less-than or greater-than, it now always returns false. Using
Dp.compareTo(Unspecified)always returns 0. Setting the flagComposeUiUnitFlags.isDpCompareToChangedto false will returnDp.compareTo()to is former behavior, where comparing Unspecified with less-than and greater-than don't always return false, andcompareTo()with Unspecified matches the behavior ofFloat.compareTo(). Ifa88b b/429221319
Bug Fixes
- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
- Fixes an issue that prevented the creation of new
AndroidComposeViewswhile a transition is ongoing. I2e23e b/340894487 b/287484338 - Fixes a color bug when using a vector drawable that uses one color and the
fillColoris neither fully opaque nor fully transparent. I3b041 b/328677973 - Fixes an issue where icons loaded via
painterResourcewith theme-specific colors didn't update on theme changes. I85ea0 b/424416571 - Introduce
onFillDataandfillableDatasemantics I45d9e - Platform-specific state encoding is now always enabled in
StateRestorationTester. This aligns test behavior with real application state restoration, such as Parcelization on Android. I38211 b/408154192 b/382294247 - Fixes occasional crashes when requesting focus. 57b31a11 b/431111149
Important changes since 1.16.0
- Core library has been updated to target Kotlin 2.0 language level and requires use of Kotlin Gradle Plugin 2.0.0 or newer.
New Features
The Core Backported Fixes library lets you check if a critical bug fix has been applied to a device. This is useful because it can take a long time for bug fixes to be rolled out to all devices, and this API provides a way for you to know when it is safe to use features that depend on a fix.
val fixManager = BackportedFixManager() if (fixManager.isFixed(KnownIssues.KI_1234)) { Offer_experience_that_needs_fix() } else { Offer_experience_that_avoids_the_bug() }
This release includes
KnownIssues.KI_398591036: Abnormal color tone when capturingJPEG-Rimages on some Pixel devices. Fix by usingJPEGoutputs until this KI is resolved.
API Changes
- Added APIs that allow relying parties (RPs) to send credential state signals to credential providers, such that they can update the state of the credentials on their end. Ia7a65
Bug Fixes
- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
API Changes
- Minor refactors to exception classes and
GetCapabilitiesRequestIa6ee3 - Added APIs that allow relying parties (RPs) to send credential state signals to credential providers, such that they can update the state of the credentials on their end. Ia7a65
- Refactor
ExportCredentialsResponsesuch that the metrics reported are grouped by the credential type I3a088 - Added new APIs for device setup service Icc9d5
Bug Fixes
- Added new apis for credential exchange I77c1c
Bug Fixes
- Fixed an issue where cancelling a predictive back gesture that pops a hide operation will cause the subsequent gesture not to animate correctly when using animators. I0a400 b/384765586
- Fixed an error where a combination of
setMaxLifecycleandpopBackStackcould fail to move the top fragment to RESUMED. I3448b b/406127576
New Features
- Support 16kb page sizes by default.
- Mouse support for GameActivity.
Bug Fixes
- Fixed a race condition between
onDestroyandonCreatelifecycle events. - Fixed an issue where apps needed to manually preserve a symbol to initialize native code.
- Improved
GameActivitytouch handling. - Fixed
GameTextInputgenerating as a shared library incorrectly.
New Features
- Support 16kb page sizes by default.
Bug Fixes
- Add implementation for conversion from conic to quadratic and use it on host platforms. f059b1
New Features
- Emoji highlighter stock brush: Highlight parts of a document with any emoji you choose, to add a fun flair and help stay organized.
- More helper APIs for geometry module primitive shapes
- Improve device compatibility and performance
API Changes
- Simplified API for
InProgressStrokesView, finish geometry APIs, emoji highlighter, remove factory functions fromMutableParallelogramin favor of populate methods, support seed for randomized brush behaviors. I38280
Bug Fixes
- Fix a performance issue and a wet/dry color consistency issue. Ifcd1d
New Features
- The library will now use the system prediction API if available.
API Changes
- Removing obsolete
@RequiresApi(21)annotations I9103b
Bug Fixes
- Recreate the
ComposeXrOwnerLocalswhen the lifecycle owner is destroyed. 9123ce1
API Changes
- Unrestrict
SceneCore'sBaseEntityandBaseScenePoseAPIs 88c0ff6
New Features
The
LifecycleOwnercomposable can now create a standalone root lifecycle. By (explicitly) settingparent = null, the new lifecycle operates independently of any host (like anActivity,FragmentorNavBackStackEntry). It starts as soon as the composable enters the composition and is automatically destroyed when it leaves. I8dfbe b/433659048@Composable fun IndependentComponent() { // Create a standalone lifecycle, not tied to the parent Activity/Fragment. LifecycleOwner(parent = null) { val rootLifecycle = LocalLifecycleOwner.current.lifecycle } }
API Changes
- In the
LifecycleOwnercomposable, theparentLifecycleOwnerparameter has been renamed toparent. I080bc
Bug Fixes
LifecycleOwnercomposable now correctly moves its lifecycle toDESTROYEDupon disposal. This prevents potential leaks for external code that holds a reference to the lifecycle. I9e5b7 b/433659048- Moving the default minSdk from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
External Contribution
- Remove unnecessary internal backing fields from
LifecycleOwner. Thanks Jake Wharton for the contribution. Ideddb
Bug Fixes
- Improve performance of
MediaSession.setMetadata()by reducing the number of intermediate allocations and removing unnecessary parceling/unparceling of bitmaps.
MinSdk Update
- The default minSdk for the AndroidX has been moved from API 21 to API 23 Ibdfca b/380448311 b/435705964 b/435705223
API Changes
SavedStateNavEntryDecoratornow uses theSaveableStateRegistrybuilt intoSaveableStateProviderto save and restore states. If8d9a- The
predictivePopTransitionSpecis now provided the swipe edge as a parameter, allowing you to customize the transition based on what edge the user started the Predictive Back gesture from. I753a8
Bug Fixes
- Fixed an issue that would cause custom scenes to be infinitely recalculated because the most recent scene was not being remembered. I7ba84 b/418153031
Dependency update
- Navigation3 now depends on Navigation Event
1.0.0-alpha06.
New Features
Passive Listeners API
You can now pass custom contextual information from any navigation host and passively listen to gesture state changes from anywhere in your UI. This enables context-aware animations for predictive back and other gesture-driven navigation.
This feature has two parts:
- Providing Info - Use
NavigationEventInfoto carry custom data. - Consuming State - Use
dispatcher.state(NavigationEventState) to observe gesture progress and context.
NavigationEventCallbacknow exposessetInfo(currentInfo, previousInfo)method to set gesture context in one call I1d5e7 b/424470518.NavigationEventHandleradds a new overload that acceptscurrentInfoandpreviousInfo, making it the primary API for supplying context in Compose apps I6ecd3 b/424470518.
Example:
data class MyScreenInfo(val screenName: String) : NavigationEventInfo
NavigationEventHandler(
enabled = true,
currentInfo = MyScreenInfo("Details Screen"),
previousInfo = MyScreenInfo("Home Screen")
) { /* Handle back completion */ }
NavigationEventDispatchernow exposesdispatcher.stateanddispatcher.getState<T>()If7fae Ia90ca b/424470518. TheseStateFlow-based APIs let any UI observe gesture progress and contextual data without handling the event directly.
Example:
val gestureState by LocalNavigationEventDispatcherOwner.current!!
.navigationEventDispatcher
.state
.collectAsState()
val progress = gestureState.progress // Returns latestEvent.progress or 0F
when (val state = gestureState) {
is InProgress -> {
val toScreen = state.currentInfo as MyScreenInfo
val fromScreen = state.previousInfo as MyScreenInfo
println("Navigating from ${fromScreen.screenName} to ${toScreen.screenName}")
}
is Idle -> { /* Idle state */ }
}
Add
progressproperty toNavigationEventStateI7b196 that returnslatestEvent.progresswhen in progress, or0Fotherwise:val progress = state.progressAdd
NavigationEventDispatcherOwnercomposable to create, link, and dispose ofNavigationEventDispatcherinstances hierarchically. Enable dynamic control of the dispatcher's enabled state and automatic cleanup.@Composable fun Sample() { NavigationEventDispatcherOwner(enabled = true) { val localDispatcherOwner = LocalNavigationEventDispatcherOwner.current } }
API Changes
- The
isPassthroughparameter has been removed from theNavigationEventCallback. I99028 b/424470518 NavigationEventStateconstructors are now internal. For testing, update the state (defaults toIdle) via theDirectNavigationEventInputHandler. CallhandleOnStartedorhandleOnProgressedto set state toInProgress, andhandleOnCompletedorhandleOnCancelledto return it toIdle. To updateNavigationEventInfo, useNavigationEventCallback.setInfo. I93dca b/424470518- Added default parameters to
NavigationEventto allow for easier instantiation and to simplify testing which should be used in place ofTestNavigationEvent. I5dc49 I232f4 - Added a
TestNavigationEventCallbackfor testing navigation events with specific current/previous states. Idd22e b/424470518 NavigationEventInputHandlerhas been made into an abstract class to replace the previousAbstractNavigationEventInputHandlerwith an implementation inDirectNavigationEventInputHandler(Iadde5, Ifed40I3897c, b/432616296, b/435416924)- The
send*functions inNavigationEventInputHandlerhave had their prefixes renamed tohandle*. Iffcaf OnBackInvokedInputHandlernow extends the newlyabstractNavigationInputHandler. Ib45aa- Changed
NavigationEventDispatcherOwnerto require a parent dispatcher where you must explicitly passnullto create a root dispatcher. Ia6f64 b/431534103
Bug Fixes
- Improved efficiency by avoiding collection copies in
NavigationEventDispatcher.dispose(). I4ab09 - Fixed an issue where the
NavigationEventHandlerdid not correctly respond to changes in its enabled state. Ia5268 I19bec I5be5c b/431534103
Docs Updates
- KDocs for
NavigationEventexpanded to clarify its role as a unified event wrapper and detail property behavior across different navigation types (gestures, clicks). I91e8d - Updated documentation for system back handling Compose APIs (
BackHandler,PredictiveBackHandler,NavigationEventHandler) to call out behavior specifically around callback order. (I7ab94, )
Dependency Update
NavigationEventnow depends on Compose Runtime 1.9.0-beta03 which allows thenavigationevent-composeartifact to support all KMP targets. Ia1b87
Bug Fixes
- Fixed a bug in
TimePickerwhere long, internationalised strings for the period (AM/PM) could break the layout. I0fa81
Bug Fixes
- Fixed a bug in
TimePickerwhere long, internationalised strings for the period (AM/PM) could break the layout. I0fa81