2022-06-29
Activity: v1.5.0
June 29, 2022
androidx.activity:activity:1.5.0, androidx.activity:activity-compose:1.5.0, and androidx.activity:activity-ktx:1.5.0 are released. Version 1.5.0 contains these commits.
Important changes since 1.4.0
- ComponentDialog -
ComponentDialogis a subclass ofDialogthat includes anOnBackPressedDispatcherthat will be called when the system back button is pressed and the dialog is visible. Importantly, this subclass also sets theViewTreeOnBackPressedDispatcherOwner, allowing views a generic way to retrieve the correct dispatcher whether it exists in aComponentActivityor aComponentDialog. - Callback Interfaces -
ComponentActivitynow implements a set of modular callback interfaces that can be used instead of theActivitycallbacks. These interfaces include the following:OnNewIntentProvider,OnConfigurationChangedProvider,OnTrimMemoryProvider,OnPictureInPictureModeChangedProvider,OnMultiWindowModeChangedProvider - CreationExtras Integration -
ComponentActivitynow has the ability to provide a statelessViewModelProvider.Factoryvia Lifecycle2.5.0’sCreationExtras.
Other changes
- The no parameter constructor for
ActivityResultContracts.CreateDocumenthas been deprecated and replaced with a new constructor that takes a concrete mime type (e.g., "image/png") as is required byIntent.ACTION_CREATE_DOCUMENT.
Camera-Camera2, Camera-Core, Camera-Lifecycle, & Camera-Video: v1.1.0
June 29, 2022
androidx.camera:camera-*:1.1.0 is released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
- Landed View, Extension and Video Capture libraries as their first RC version. From 1.1.0-beta01, all CameraX libraries will align the same version number. This will help developers track versions much easier and reduce the complexity of large version compatibility matrices.
- Introduced new public APIs and features which including:
- Add the official camera-video library to support video capture use cases.
- YUV to RGB conversion and rotation capability (
ImageAnalysis.Builder.setOutputImageRotationEnabledandsetOutputImageFormat) - Support multi-window mode by allowing CameraX applications to resume the camera when the camera is interrupted by another app and focus is back.
- Ensures CameraX works well in foldable devices by fixing some preview issues.
- Added a
CameraStateAPI that will be exposed through CameraInfo. - Added an API
ProcessCameraProvider.getAvailableCameraInfos()to directly retrieve information about the available cameras - Output JPEG format for
ImageCapture#OnImageCapturedCallbackwhen Extensions are enabled. - Added a API
isFocusMeteringSupportedinCameraInfowhich allows applications to check if the givenFocusMeteringActionis supported on current camera or not. - Exposed
getResolutionInfoAPI to provide the resolution information for Preview,ImageCaptureandImageAnalysis. - Added a new API
ImageCapture.Builder#setJpegQualityto allow changing the output JPEG image compression quality when taking pictures. - Added
CameraSelector#filterto the public API to filter a list ofCameraInfosbased on aCameraSelector. - Added
Camera2CameraControl.clearCaptureRequestOptionsfor clearing the existing capture request options. - Added an experimental API for using
CameraControllerwith external image processing libraries. e.g. MLKit - Added experimental API
CameraInfo#getCameraSelector()which returns aCameraSelectorunique to its camera - Promoted several experimental APIs to formal public APIs
- Replaced annotation
@Experimentalwith@RequiresOptInto experimental APIs. For calling experimental APIs, use androidx.annotation.OptIn instead of deprecated androidx.annotation.experimental.UseExperimental. - Promoted the following experimental APIs to official APIs:
CameraXConfig.Builder#setAvailableCamerasLimiter(),CameraXConfig.Builder#setMinimumLoggingLevel(),CameraXconfig.Builder#setSchedulerHandler(),CameraXConfig#getAvailableCamerasLimiter(),CameraXConfig#getMinimumLoggingLevel(),CameraXConfig#getCameraExecutor(),CameraXConfig#getSchedulerHandler(), @ExperimentalCameraFilterAPIs- experimental exposure compensation APIs.
- Promoted the experimental
UseCaseGroupAPI for camera-core, camera-lifecycle and camera-video. AddedViewPort#getLayoutDirection,ViewPort.Builder#setLayoutDirectionandViewPort.Builder#setScaleTypefor customizing viewport. - Promoted the
ExperimentalUseCaseGroupLifecycleto formal public APIs. - Changes to the existing APIs
Renamed MediaStoreOutputOptions.getCollectiontoMediaStoreOutputOptions.getCollectionUri.ActiveRecordinghas been renamed to "Recording" to reduce verbosity.- Changed
QualitySelectorcreator API to a list-based API
Bug Fixes
- Fixed
YuvToJpegProcessorEOFExceptionissue when extension mode is enabled andImageCapture#CAPTURE_MODE_MAX_QUALITYmode is set. - Fixed codec configuration failed due to video recording is closing
- Fixed stretched preview/video aspect ratio when recording at FHD
- Fixed audio/video out of sync after pause and resume on some devices
- Fixed the issue where flash is triggered during tap-to-focus (
startFocusAndMetering) when flash mode is auto or always_on in low-light environment.
CameraX: v1.2.0-alpha03
June 29, 2022
androidx.camera:camera-*:1.2.0-alpha03 is released. Version 1.2.0-alpha03 contains these commits.
API Changes
- Removed the experimental annotation for
ImageAnalysis.AnalyzerandMLKitAnalyzer. (I0ff22)
Bug Fixes
- Added auto focus default timeout 5000ms that will complete the AF part with
isFocusSuccessfulfalse if theFocusMeteringActionis not cancelled and the AF part is not converged in the duration. (Ibc2e3) - Fix the issue to take picture with unbind preview (I1d3a2, b/235119898)
- Enabled advanced extender implementation and update the CameraX support extensions-interface version to 1.2 (I92256)
Collection: v1.3.0-alpha01
June 29, 2022
androidx.collection:collection:1.3.0-alpha01 and androidx.collection:collection-ktx:1.3.0-alpha01 are released. Version 1.3.0-alpha01 contains these commits.
New Features
collection-ktxextensions have been migrated into the main collections artifact,androidx.collection:collection. This change makes the pre-existing -ktx extensions accessible to Kotlin users without requiring the -ktx dependency, while still maintaining compatibility for existing users. Maintaining these extensions in a separate -ktx artifact is no longer beneficial since the main artifact has moved to Kotlin. (I6eef2)
API Changes
ArraySetnow extendsAbstractMutableCollectionand no longer directly implements the Collection interface. (If6da0, b/230860589)- Converted
ArraySetto Kotlin. Due to stricter typing, some Kotlin calls may no longer compile. (Id68c1, b/230860589)- The following calls have the argument type
T, notT?:ArraySet<T>.contains(null)ArraySet<T>.add(null)ArraySet<T>.remove(null)
- The following calls have the return type
T?, notT!:ArraySet<T?>.valueAt(n)ArraySet<T?>.removeAt(n)ArraySet<T?>().iterator().next()
- The following calls are no longer possible from Kotlin:
set.toArray()- useset.toTypedArray()set.toArray(array)- useset.forEachIndexed(array::set)
- The following calls have the argument type
- Combine overloaded constructor for
SparseArrayCompatas an optional argument for Kotlin users. (If8407, b/227474719) - Remove operator syntax for
SparseArrayCompat.get(key, defaultValue).Note this still allows operator syntax for.get(key), but better aligns the API surface ofSparseArrayCompatwith the other classes in this library. (I9a38d) - Migrate
LongSparseArrayextensions into the main artifact, androidx.collection:collection. This change makes the pre-existing -ktx extensions accessible to Kotlin users without requiring the -ktx dependency, while still maintaining compatibility for existing users. Maintaining these extensions in a separate -ktx artifact is no longer beneficial since the main artifact has moved to Kotlin. (I8659a) - Convert
LongSparseArrayto Kotlin. This change adds explicit nullity to its types, which is a binary compatible change, but may cause source incompatibilities. In particular: *.isEmptyis no longer accessible as a property, it must be accessed as a function call in Kotlin -.isEmpty()(Idfd0f) - Convert
SimpleArrayMapto Kotlin. This change introduces a few incompatible changes, as a result of Java-Kotlin interop and the ability to correctly define nullity of types in the source.- The package private APIs,
.mSize,.mArray,.mHashes,.indexOf(),.indexOfNull(), and.indexOfValue(), were made private - this is technically a binary incompatible change, but reflects the intended visibility of these fields and is the closest we can achieve in Kotlin since it does not include a way to specify package-private visibility. - The nullity of some types are now properly defined, the affected methods are:
.getOrDefault,.keyAt,.valueAt,.setValueAt,.put,.putIfAbsent,.removeAt,.replace. - For Kotlin users,
.isEmpty()is now only available as a function instead of also through property access. (I271b7, b/182813986)
- The package private APIs,
Convert
CircularArrayto Kotlin. Notable changes:- Corrects the nullity of its generics to be non-null, which was previously impossible to declare, but was enforced in all of its public APIs.
- Due to Kotlin's Java interop, it was previously possible to access certain methods as both properties or functions. However, to reduce duplication while maintaining binary compatibility, it was necessary to remove these, which is a source-incompatible change. The affectedn calls are:
.isEmpty,.getLast()and.getFirst(). (Ifffac)
Convert
CircularIntArrayto Kotlin. Due to Kotlin's Java interop, it was previously possible to access certain methods as both properties or functions. However, to reduce duplication while maintaining binary compatibility, it was necessary to remove these, which is a source-incompatible change. The affected calls are:.isEmpty,.getLast()and.getFirst(). (Ie36ce)Convert
LruCacheto Kotlin (Ia2f19)Convert
SparseArrayCompatto Kotlin. (If6fe8)A small behavior change is added to
SparseArrayCompat.valueAt(), which no longer incorrectly returnsnullfor un-initialized calls out of bounds ofsize()but within the provided initial capacity.This change also introduces the correct nullity for some types which was previously missing.
.get(): E?->.get(): E.replace(Int, Int?): Int?->.replace(Int, Int): Int?.replace(Int, Int?, Int?): Boolean->.replace(Int, Int, Int): Boolean.put(Int, Int?)->.put(Int, Int).putIfAbsent(Int, Int?): Int?->.putIfAbsent(Int, Int): Int?.setValueAt(index: Int, value: Int?)->.setValueAt(index: Int, value: Int).indexOfValue(value: Int?): Int->.indexOfValue(value: Int): Int.containsValue(value: Int?): Boolean->.containsValue(value: Int): Boolean.append(key: Int, value: Int?)->.append(key: Int, value: Int)
Compose Animation: v1.2.0-rc03
June 29, 2022
androidx.compose.animation:animation:1.2.0-rc03, androidx.compose.animation:animation-core:1.2.0-rc03, and androidx.compose.animation:animation-graphics:1.2.0-rc03 are released. Version 1.2.0-rc03 contains these commits.
- No changes since 1.2.0-rc02.
Compose Animation: v1.3.0-alpha01
June 29, 2022
androidx.compose.animation:animation:1.3.0-alpha01, androidx.compose.animation:animation-core:1.3.0-alpha01, and androidx.compose.animation:animation-graphics:1.3.0-alpha01 are released. Version 1.3.0-alpha01 contains these commits.
API Changes
- New
LookaheadLayoutthat supports a lookahead pass before the actual measure/layout. This allows a pre-calculation of the layout when it changes, while permitting the post-lookahead measure/layout to use the pre-calculated size/position to animate the size and positions towards the target.SubcomposeLayoutsare not yet supported, but will be in an upcoming release. (I477f5)
Compose Compiler: v1.2.0
June 29, 2022
androidx.compose.compiler:compiler:1.2.0 is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
- Support for Kotlin 1.7.0
- Check out our blog post explaining our new Compose Compiler Versioning strategy in Compose.
Compose Foundation: v1.2.0-rc03
June 29, 2022
androidx.compose.foundation:foundation:1.2.0-rc03 and androidx.compose.foundation:foundation-layout:1.2.0-rc03 are released. Version 1.2.0-rc03 contains these commits.
- No changes since 1.2.0-rc02.
Compose Foundation: v1.3.0-alpha01
June 29, 2022
androidx.compose.foundation:foundation:1.3.0-alpha01 and androidx.compose.foundation:foundation-layout:1.3.0-alpha01 are released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Introduced the
UrlAnnotationannotation type and associated methods to supportTalkBacklink support inAnnotatedStrings. (I1c754, b/231495122)
Bug Fixes
BasicTextFieldcursorBrushmay now be animated without restarting the cursor timer. (I812e6, b/236383522)- When adding
InputEventChangeevents to Velocity Tracker we will consider now deltas instead of positions, this will guarantee the velocity is correctly calculated for all cases even if the target element moves (If9ef3, b/216582726, b/223440806, b/227709803)
Compose Material: v1.2.0-rc03
June 29, 2022
androidx.compose.material:material-*:1.2.0-rc03 is released. Version 1.2.0-rc03 contains these commits.
- No changes since 1.2.0-rc02.
Compose Material: v1.3.0-alpha01
June 29, 2022
androidx.compose.material:material-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Change parameter name from values to value in
RangeSlider(I3b79a)
Bug Fixes
- Update badge sample to provide more meaningful content description. (I10b9d)
Compose Material 3: v1.0.0-alpha14
June 29, 2022
androidx.compose.material3:material3:1.0.0-alpha14 and androidx.compose.material3:material3-window-size-class:1.0.0-alpha14 are released. Version 1.0.0-alpha14 contains these commits.
New Features
- Added M3 list implementation, see the documentation for sample usage (Id7a20)
API Changes
- Change parameter name from values to value in
RangeSlider(I3b79a) - API changes to the
InputChipimplementation to support a selectable state per the Material Design spec. Additional support at theFilterChipcolors for selected disabled state. (I55244, b/235792432) - Add
BottomAppBardefault FAB (Ida4c8) ColorScheme.surfaceColorAtElevationwas added (Id41af)- Interfaces in compose libraries are now built using jdk8 default interface methods (I5bcf1)
WindowWidthSizeClassandWindowHeightSizeClassnow implement Comparable, so they can be compared using operators (<, <=, >=, >) and other APIs. (I747d0)
Bug Fixes
- Update badge sample to provide more meaningful content description. (I10b9d)
- Adds option to use the system font size to the Material 3 catalog's theme picker. (I10605)
- Adds sample code for Badge and indeterminate progress indicators. (I8fbe0)
Compose Runtime: v1.2.0-rc03
June 29, 2022
androidx.compose.runtime:runtime-*:1.2.0-rc03 is released. Version 1.2.0-rc03 contains these commits.
Bug Fixes
- Derived state observations were previously unconditionally removed from the recompose scope and composition together, which broke other scopes which might be still observing derived state. This change only removes derived state instances if it is no longer observed by other scopes. (b/236618362)
Compose Runtime: v1.3.0-alpha01
June 29, 2022
androidx.compose.runtime:runtime-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Moving utility functionality to runtime (I4f729)
Compose UI: v1.2.0-rc03
June 29, 2022
androidx.compose.ui:ui-*:1.2.0-rc03 is released. Version 1.2.0-rc03 contains these commits.
- No changes since 1.2.0-rc02.
Compose UI: v1.3.0-alpha01
June 29, 2022
androidx.compose.ui:ui-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
API Changes
- New
LookaheadLayoutthat supports a lookahead pass before the actual measure/layout. This allows a pre-calculation of the layout when it changes, while permitting the post-lookahead measure/layout to use the pre-calculated size/position to animate the size and positions towards the target.SubcomposeLayoutsare not yet supported, but will be in an upcoming release. (I477f5) - Add optional alpha parameter to Brush flavor of
TextStyleandSpanStyleto modify opacity of the wholeText. (Ic2fac, b/234117635) - Introduced the
UrlAnnotationannotation type and associated methods to supportTalkBacklink support inAnnotatedStrings. (I1c754, b/231495122) - Moving utility functionality to runtime (I4f729)
Bug Fixes
- When adding
InputEventChangeevents to Velocity Tracker we will consider now deltas instead of positions, this will guarantee the velocity is correctly calculated for all cases even if the target element moves (If9ef3, b/216582726, b/223440806, b/227709803) TextLayoutResult.getLineForOffsetdoes not throw. (Idc5d6, b/235876324)
External Contribution
- Added a new API
WindowInfo.keyboardModifiersto observe its state within composable functions or via snapshotFlow (Icdb8a)
Core Remote Views: v1.0.0-beta01
June 29, 2022
androidx.core:core-remoteviews:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.
New Features
- Moves
Core-RemoteViewsto beta.
Core Ultra Wideband (UWB): v1.0.0-alpha02
June 29, 2022
androidx.core.uwb:uwb-rxjava3:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.
New Features
- Introducing a java interoperable artifact for the uwb module. The new artifact depends on rxjava3 and will be consumable for java clients.
Fragment: v1.5.0
June 29, 2022
androidx.fragment:fragment:1.5.0, androidx.fragment:fragment-ktx:1.5.0, and androidx.fragment:fragment-testing:1.5.0 are released. Version 1.5.0 contains these commits.
Important changes since 1.4.0
- CreationExtras Integration -
Fragmentnow has the ability to provide a statelessViewModelProvider.Factoryvia Lifecycle2.5.0’sCreationExtras. - Component Dialog Integration -
DialogFragmentnow usesComponentDialogvia Activity1.5.0as the default dialog returned byonCreateDialog(). - Saved Instance State Refactoring - Fragments have begun to change the way they save their instance state. This is an effort to help clearly identify what state has been saved in the fragment and the source of the state. The current changes include the following:
FragmentManagernow saves its saved instance state into aBundleinstead of directly in a customParcelable.- Results set via the
Fragment Result APIsthat have not yet been delivered are now saved separately from the internal state of theFragmentManager. - The state associated with each individual fragment is now saved separately from the internal state of the
FragmentManager, thus allowing you to correlate the amount of saved state associated with an individual fragment with the unique IDs present in theFragmentdebug logging.
Other Changes
FragmentStrictModenow offers the ability for private third-party fragments to bypass specific violation penalties by usingallowViolation()with the class name.- The Fragment APIs for providing a menu to your activity’s
ActionBarhave been deprecated. TheMenuHostandMenuProviderAPIs added in Activity1.4.0provide a testable, lifecycle aware equivalent API surface that fragments should use.
Lifecycle: v2.5.0
June 29, 2022
androidx.lifecycle:lifecycle-*:2.5.0 is released. Version 2.5.0 contains these commits.
Important changes since 2.4.0
SavedStateHandlenow offers agetStateFlow()API that returns a KotlinStateFlowfor monitoring value changes as an alternative to usingLiveData.ViewModel CreationExtras - when writing a custom
ViewModelProvider.Factory, it is no longer required to extendAndroidViewModelFactoryorAbstractSavedStateViewModelFactoryto gain access to anApplicationorSavedStateHandle, respectively. Instead, these fields are provided to everyViewModelProvider.Factorysubclass asCreationExtrasvia the new overload ofcreate:create(Class<T>, CreationExtras). These extras are provided automatically by your Activity or Fragment when using Activity1.5.0and Fragment1.5.0, respectively.class CustomFactory : ViewModelProvider.Factory { override fun <T : ViewModel> create(modelClass: Class<T>, extras: CreationExtras): T { return when (modelClass) { HomeViewModel::class -> { // Get the Application object from extras val application = checkNotNull(extras[ViewModelProvider.AndroidViewModelFactory.APPLICATION_KEY]) // Pass it directly to HomeViewModel HomeViewModel(application) } DetailViewModel::class -> { // Create a SavedStateHandle for this ViewModel from extras val savedStateHandle = extras.createSavedStateHandle() DetailViewModel(savedStateHandle) } else -> throw IllegalArgumentException("Unknown class $modelClass") } as T } }lifecycle-viewmodelnow provides aviewModelFactoryKotlin DSL that allows you define yourViewModelProvider.Factoryin terms of one or more lambda initializers, one for each particularViewModelclass your custom factory supports, usingCreationExtrasas the primary data source.val customFactory = viewModelFactory { // The return type of the lambda automatically sets what class this lambda handles initializer { // Get the Application object from extras provided to the lambda val application = checkNotNull(get(ViewModelProvider.AndroidViewModelFactory.APPLICATION_KEY)) HomeViewModel(application) } initializer { val savedStateHandle = createSavedStateHandle() DetailViewModel(savedStateHandle) } }lifecycle-viewmodel-composenow offers aviewModel()API that takes a lambda factory for creating aViewModelinstance without requiring the creation of a customViewModelProvider.Factory.// Within a @Composable, you can now skip writing a custom Factory // and instead write a lambda to do the initialization of your ViewModel val detailViewModel = viewModel { // This lambda is only called the first time the ViewModel is created // and all CreationExtras are available inside the lambda val savedStateHandle = createSavedStateHandle() DetailViewModel(savedStateHandle) }SavedStateHandle Compose Saver Integration - the
lifecycle-viewmodel-composeartifact now contains new experimental APIs inSavedStateHandle.saveablethat allowrememberSaveablelike behavior backed by theSavedStateHandleof a `ViewModel.class ListScreenViewModel(handle: SavedStateHandle): ViewModel() { // This value survives both configuration changes and process death and recreation val editMode by handle.saveable { mutableStateOf(false) } }Added an
addCloseable()API and a new constructor overload that allow you to add one or moreCloseableobjects to theViewModelthat will be closed when theViewModelis cleared without requiring any manual work inonCleared().For instance, to create a coroutine scope that you can inject into a ViewModel, but control via testing, you can create a
CoroutineScopethat implementsCloseable:class CloseableCoroutineScope( context: CoroutineContext = SupervisorJob() + Dispatchers.Main.immediate ) : Closeable, CoroutineScope { override val coroutineContext: CoroutineContext = context override fun close() { coroutineContext.cancel() } }Which can then be used in your
ViewModelconstructor while maintaining the same lifetime asviewModelScope:class TestScopeViewModel( val customScope: CoroutineScope = CloseableCoroutineScope() ) : ViewModel(customScope) { // You can now use customScope in the same way as viewModelScope }
Behavior changes
- Attempting to move the
Lifecycle.StatefromINITIALIZEDtoDESTROYEDwill now always throw anIllegalStateExceptionregardless of whether theLifecyclehas an attached observer. LifecycleRegistrywill now clear their observers when they reach theDESTROYEDstate.
Lifecycle: v2.6.0-alpha01
June 29, 2022
androidx.lifecycle:lifecycle-*:2.6.0-alpha01 is released. Version 2.6.0-alpha01 contains these commits.
New Features
- Added a new extension on
StateFlowandFlowofcollectAsStateWithLifecyclethat collect from flows and represents its latest value as Compose State in a lifecycle-aware manner. The flow is collected and the new emission is set to the State's value when the lifecycle is at least in a certainLifecycle.State. When the lifecycle falls below thatLifecycle.State, the flow collection stops and the State's value is not updated. (I1856e, b/230557927)
Metrics: v1.0.0-alpha02
June 29, 2022
androidx.metrics:metrics-performance:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.
API Changes
- Renamed
MetricsStateHolderto just Holder (withinPerformanceMetricsState): (I5a4d9, b/226565716, b/213499234)
Bug Fixes
- Fixed timing issue where states could be replaced with new values before the frames had been processed where the old state would have been correct (aosp/2061892, b/213499234)
- Fixed concurrent modification exception in adding/removing listeners (aosp/2092714, b/213499234)
- Made startTime calculations more accurate (aosp/2027704, b/213245198)
- Fixed bug in
FrameData.equals()implementation (aosp/2025866, b/218296544)
Navigation: v2.5.0
June 29, 2022
androidx.navigation:navigation-*:2.5.0 is released. Version 2.5.0 contains these commits.
Important changes since 2.4.0
- CreationExtras Integration -
Navigationnow has the ability to provide a statelessViewModelProvider.Factoryvia Lifecycle2.5.0’sCreationExtras.
Navigation SafeArgs
Navigation Safe Argshas upgraded theAndroid Gradle Plugindependency to rely on7.0.4, dropping compatibility for AGP versions before7.0.- Added support for the namespace build.gradle attribute to be used instead of applicationId.
Other Changes
- The
visibleEntriesAPI is no longer experimental and provides a function to retrieve all of the entries whose destination is currently visible according to theNavController.
Recyclerview:
Savedstate: v1.2.0
June 29, 2022
androidx.savedstate:savedstate:1.2.0 and androidx.savedstate:savedstate-ktx:1.2.0 are released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
SavedStateRegistryControllernow allows early attachment of theSavedStateRegistryviaperformAttach().- You can now retrieve a previously registered
SavedStateProviderfrom aSavedStateRegistryviagetSavedStateProvider(). - The
SavedStatelibrary has been rewritten in Kotlin.- For
SavedStateRegistryOwner, this is a source incompatible change for those classes written in Kotlin - you must now override thesavedStateRegistryproperty rather than implement the previousgetSavedStateRegistry()function. - For
ViewTreeSavedStateRegistryOwner, this is a source incompatible change for those classes written in Kotlin - you must now directly import and use the Kotlin extension methods onViewofandroidx.savedstate.setViewTreeSavedStateRegistryOwnerandandroidx.savedstate.findViewTreeSavedStateRegistryOwnerto set and find a previously set owner. This replaces thesavedstate-ktxAPI offindViewTreeSavedStateRegistryOwner.
- For
Behavior Changes
SavedStateRegistryno longer saves an empty Bundle if there is no state to save.
Wear Compose: v1.1.0-alpha01
June 29, 2022
androidx.wear.compose:compose-foundation:1.1.0-alpha01, androidx.wear.compose:compose-material:1.1.0-alpha01, and androidx.wear.compose:compose-navigation:1.1.0-alpha01 are released. Version 1.1.0-alpha01 contains these commits.
API Changes
- Picker's
contentDescriptionparameter is now used only for the selected Picker option and takes a nullable String (previously, it was necessary to pass a mapping from option to the content description, but only the selected option was used). (Ife6a7) - We have made accessibility improvements to Picker so that multi-picker screens are navigable with screen readers and the content description is accessible (I64edb)
Bug Fixes
- We have updated the baseline profile rules packaged with the Wear Compose library (I9c694)
- We have corrected the direction of the gradient for Chips in right to left mode. Was top left->bottom right, is now top right->bottom left. (Ic2e77)
- We have updated the default gradients for
Chip/ToggleChip/Cardto bring them in line with latest UX spec.ChipDefaults.gradientBackgroundChipColorshas been updated to start from 50% of primary rather than 32.5%.CardDefaults.cardBackgroundPainterhas been updated to start from 30% of primary and end at 20% ofonSurfaceVariant(was previously 20% to 10%onSurfaceVariant).ToggleChip.toggleChipColorschanges from a linear gradient of 75% surface to 32.5% primary to 0% surface to 50% primary. (I43bbd) - We have added a background color (
MaterialTheme.color.surface) behindChip/ToggleChipsthat have gradient backgrounds in order to ensure that they are properly visible in the unlikely event that a light color is used behind them. (Ibe1a4, b/235937657) - Picker items are now always center-aligned, fixing a bug when setting
gradientRatioto zero had the side-effect of changing the alignment. (I712b8)
Wear Tiles: v1.1.0-alpha09
June 29, 2022
androidx.wear.tiles:tiles-*:1.1.0-alpha09 is released. Version 1.1.0-alpha09 contains these commits.
New Features
- We have added support for adding optional labels in
ProgressIndicatorLayout. (I30788)
API Changes
- Helper methods for
ElementMetadatanow acceptElementMetadatainstead of Modifiers. (I5a70f)
Bug Fixes
- The limitation of 9 characters on
CompactChipwas removed. If text is too big to fit into the screen inPrimaryLayout, it will be ellipsized. (Id56ec) - Getters in
Chipnow have Content suffix. (Iba437) - Javadoc clarification across Tiles Material classes. (I56e41), (I80f31), (Iba437)
Webkit: v1.5.0-beta01
June 29, 2022
androidx.webkit:webkit:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
API Changes
- Alogrithimic Darkening related APIs are now annotated to require API level Q. The API will not have any effect on API levels < Q, since dark theme is not an option on these devices. (I0905e)