2023-06-07
Activity: v1.8.0-alpha05
June 7, 2023
androidx.activity:activity:1.8.0-alpha05, androidx.activity:activity-compose:1.8.0-alpha05, and androidx.activity:activity-ktx:1.8.0-alpha05 are released. This version is developed in an internal branch.
API Changes
- Activity now provides a
BackEventCompatclass that serves as a backward compatible version ofBackEventthat is decoupled from the frameworkBackEventclass. - Breaking change: The
handleOnBackStartedandhandleOnBackProgressedmethods ofOnBackPressedCallbacknow receive anandroidx.activity.BackEventCompatinstance rather than a frameworkandroid.window.BackEventclass. The equivalent@VisibleForTestingAPIs onOnBackPressedDispatcherhave also been updated. - The constructor for
OnBackPressedDispatchernow takes an optionalConsumer<Boolean>instance that allows the owners of the dispatcher to receive a callback whenever the number of enabled callbacks changes from zero to non-zero or vice versa.
Bug Fixes
- From Activity
1.7.2: FixReportDrawncrashing when navigating away from a screen beforereportis called. (Ic46f1, b/260506820)
Benchmark: v1.2.0-alpha15
June 7, 2023
androidx.benchmark:benchmark-*:1.2.0-alpha15 is released. Version 1.2.0-alpha15 contains these commits.
New Features
- Added experimental
MemoryUsageMetricfor tracking memory usage of a target application. (I56453, b/133147125, b/281749311) - Add support for fully custom Perfetto configs with
PerfettoTrace.record(If9d75, b/280460183) - Added property to skip baseline profile generation. Usage:
./gradlew assemble -Pandroidx.baselineprofile.skipgeneration. (I37fda, b/283447020)
API Changes
- The
collectBaselineProfileAPI always generates stable baseline profiles. ThecollectStableBaselineProfileAPI has been removed andcollectBaselineProfileshould be used instead. (I17262, b/281078707) - Changed
BaselineProfileRule'sfilterPredicatearg to non-null, with a equivalent default value so that the default filter behavior is more clear in docs. (I3816e)
Bug Fixes
- Disable
IsolationActivityand Perfetto tracing indryRunModeto significantly improve performance, as these were majority of runtime. (Ie4f7d) - Support for call stack sampling in Macrobenchmarks using instrumentation test arguments
androidx.benchmark.profiling.mode=StackSamplingandandroidx.benchmark.profiling.sampleFrequency. (I1d13b, b/282188489) - Fixes crash when dropping shaders on Android U (API 34), as well as on emulators. (I031ca, b/274314544)
Browser: v1.6.0-alpha02
June 7, 2023
androidx.browser:browser:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.
API Changes
- Removed
CustomTabsSession#getGreatestScrollPercentage. (I6c5ba) - Added a new
requestPostMessageChannelAPI which allows specifying the target origin. This means that users can be certain their messages are delivered only to the website they expect. (Id5b7f)
Bug Fixes
- Updated
EngagementSignalsCallbackdocumentation. (Ie833c)
Compose Animation: v1.5.0-beta02
June 7, 2023
androidx.compose.animation:animation-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Compose Foundation: v1.5.0-beta02
June 7, 2023
androidx.compose.foundation:foundation-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Compose Material: v1.5.0-beta02
June 7, 2023
androidx.compose.material:material-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Compose Runtime: v1.5.0-beta02
June 7, 2023
androidx.compose.runtime:runtime-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
Performance Improvements
- Avoid calculating
readableHashinDerivedStateif snapshot wasn't modified. (307102)
Compose UI: v1.5.0-beta02
June 7, 2023
androidx.compose.ui:ui-*:1.5.0-beta02 is released. Version 1.5.0-beta02 contains these commits.
API Changes
- Added
asComposePaintAPI to enable consumption of anandroid.graphics.Paintinstance to be used in Compose
Bug Fixes
- Added
asComposePaintAPI to replacetoComposePaintas the returned object wraps the originalandroid.graphics.Paint(I22b4c)
Core and Core-ktx: v1.12.0-alpha05
June 7, 2023
androidx.core:core:1.12.0-alpha05, androidx.core:core-ktx:1.12.0-alpha05, and androidx.core:core-testing:1.12.0-alpha05 are released. This version is developed in an internal branch.
Bug Fixes
- Updated the documentation on the
ColorUtilsclasses for generating a color from the Material 3 Hue, Chroma, and Tone (M3HCT) parameters. (I32979, I21c8c) - Fix deprecation replaceWith for
android.os.Trace(I730f9)
Core and Core-ktx: v1.11.0-beta02
June 7, 2023
androidx.core:core:1.11.0-beta02, androidx.core:core-ktx:1.11.0-beta02, and androidx.core:core-testing:1.11.0-beta02 are released. Version 1.11.0-beta02 contains these commits.
Bug Fixes
- Updated the documentation on the
ColorUtilsclasses for generating a color from the Material 3 Hue, Chroma, and Tone (M3HCT) parameters. (I32979, I21c8c) - Fix deprecation replaceWith for
android.os.Trace(I730f9)
credentials: v1.2.0-alpha05
June 7, 2023
androidx.credentials:credentials:1.2.0-alpha05 and androidx.credentials:credentials-play-services-auth:1.2.0-alpha05 are released. This version is developed in an internal branch.
New Features
- Backwards compatible parsing for the get API across GMS modules introduced alongside the public branch.
credentials: v1.0.0-alpha09
June 7, 2023
androidx.credentials:credentials:1.0.0-alpha09 and androidx.credentials:credentials-play-services-auth:1.0.0-alpha09 are released. Version 1.0.0-alpha09 contains these commits.
Bug Fixes
- Validate that exception types are accurate and consistent. (Id13d7)
- Support the json format on get passkey request. (I25100)
- Passkey Retrieval flow is backwards compatible with earlier GMS modules.(I23878)
Emoji2: v1.4.0-beta05
June 7, 2023
androidx.emoji2:emoji2-*:1.4.0-beta05 is released. Version 1.4.0-beta05 contains these commits.
Bug Fixes
- Fixed a bug introduced in 1.3 that would cause
MetricsAffectingSpanssuch asRelativeSizeSpanto apply twice. Once during text layout, and again inside ofEmojiSpan.draw. The result was incorrectly sized draw, visible if any of the text size parameters were changed by the span. (b/283208650)
Fragment: v1.7.0-alpha01
June 7, 2023
androidx.fragment:fragment-*:1.7.0-alpha01 is released. This version is developed in an internal branch.
New Features
- Fragments now provide support for Predictive in-app back when using
Animator. This allows you to use the back gesture to see the previous fragment with your custom Animator before deciding to either commit the transaction via the completed gesture or cancel. You can also disable this new behavior by using the experimentalenablePredictiveBack()and passing infalse.
2.6.0 to allow FragmentManager to intercept the system back gesture and run the Predictive Back animation.
Fragment: v1.6.0
June 7, 2023
androidx.fragment:fragment-*:1.6.0 is released. Version 1.6.0 contains these commits.
Important changes since 1.5.0
- The saved state of
Fragments has been split entirely between private library state (customParcelableclasses) and state provided by the developer, which is now always stored in aBundlethat allows determining exactly where a fragment’s state is originating. - The
FragmentManager.OnBackStackChangedListenerinterface has been expanded with two additional callbacks ofonBackStackChangeStartedandonBackStackChangeCommittedthat are called with eachFragmentright before they are added/removed from the fragment back stack and right after the transaction is committed, respectively. FragmentStrictModeadded a newWrongNestedHierarchyViolationthat detects when a child fragment is nested within it’s parent’s View hierarchy, but not added to the parent’schildFragmentManager.- The
FragmentandFragmentManagerAPIs that take anIntentorIntentSenderare now properly annotated with@NonNullto prevent passing in a null value as a null value would always immediately crash the respective android framework APIs these methods call into. DialogFragmentnow provides access to underlyingComponentDialogvia therequireComponentDialog()API.- Fragment now depends on Lifecycle
2.6.1. - Fragment now depends on SavedState
1.2.1. - Fragment now depends on ProfileInstaller
1.3.0. The
fragment-testing-manifestartifact separates out the manifest entries from the rest of the fragment-testing components. This means you can do the following:debugImplementation("androidx.fragment:fragment-testing-manifest:X.Y.Z") androidTestImplementation("androidx.fragment:fragment-testing:X.Y.Z")This avoids conflicts due to version skew between
fragment-testingandandroidx.test
Graphics Path: v1.0.0-alpha02
June 7, 2023
androidx.graphics:graphics-path:1.0.0-alpha02 is released. This version is developed in an internal branch.
New Features
- Fixed problem with internal platform version check which caused problems when running on Android 14 previews (the version check would fail, but the mechanism for doing things on previous releases doesn’t work correctly on Android 14 in particular).
Graphics Core: v1.0.0-alpha04
June 7, 2023
androidx.graphics:graphics-core:1.0.0-alpha04 is released. Version 1.0.0-alpha04 contains these commits.
New Features
- Introduced
CanvasFrontBufferedRendererto support low latency graphics leveraging theandroid.graphics.CanvasAPI alongside the existing OpenGL implementation
API Changes
- Updated
SurfaceControlCompat.Transaction#setBufferAPI to allow for nullableHardwareBufferinstances to mirror the corresponding platform API (I173d7) - Rename methods referring to Double Buffered rendering to Multi Buffered instead as the backing swapchain may contain more than 2 buffers. (I830d7)
- Create
CanvasFrontBufferedRendererAPI to enable 3ps to leverage a front buffered rendering system using the Canvas API. (Ibfc29)
Bug Fixes
- Fixed issue where
GLFrontBufferedRendererwould not render content after resuming the corresponding Activity. - Fixed issue where front buffered content would be cleared prematurely.
- Fixed issue where
SurfaceHolder.Callbackswould not be removed after low latency graphics APIs were released.
Graphics Shapes: v1.0.0-alpha03
June 7, 2023
androidx.graphics:graphics-shapes:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.
API Changes
- Added new
RoundedPolygon.rectangle()function (I78e7e, b/280322189) - Star and Circle functions are now decapitalized and called via
RoundedPolygon's companion object: e.g.,RoundedPolygon.star(...)(I14735)
Bug Fixes
- Fixed bug on smoothing (Ibf894)
- Fixed a bug that occured when start and end shape were the same. Better distribute available space on side for cuts, first using available space for rounding, then for smoothing if there is space left. (Ibd320, b/277936300)
Health Connect: v1.1.0-alpha01
June 7, 2023
androidx.health.connect:connect-client:1.1.0-alpha01 is released. This version is developed in an internal branch.
New Features
- Support for the Android 14 framework version of Health Connect. This SDK is a prerequisite for Android 14. Apps will not be able to integrate with Health Connect on Android 14 without it.
- Added recording method to record metadata.
API Changes
- Session API changes:
- Added various sleep stages into
SleepSessionRecordand removedSleepStageRecord. - Added
ExerciseLapandExerciseSegmentintoExerciseSessionRecord.
- Added various sleep stages into
- Periodic and daily rate limits (including memory limits), for read, changelog, insertion and deletion operations.
- Added validation for all
NutritionRecordfields. - Added validation for
HeartRateVariabilityRmssdRecord. - Removed two deprecated APIs:
HealthConnectClient#isProviderAvailableandHealthConnectClient#isApiSupported.
Bug Fixes
- Fixed units equality for all unit types, equality no longer depends on type used for unit initialization. E.g. Mass.grams(1000) is now equal to Mass.kilograms(1).
Mediarouter: v1.6.0-alpha04
June 7, 2023
androidx.mediarouter:mediarouter:1.6.0-alpha04 and androidx.mediarouter:mediarouter-testing:1.6.0-alpha04 are released. This version is developed in an internal branch.
New Features
- Revamp the
MediaRouteButtonto provide a better user experience (I9dbcb). Including:- Add a hint to the user to check the searched device is on the same wifi.
- Add an end state with an error message to be shown at the end of a predefined period of time.
API Changes
- Bring in new
MediaRouteDescriptordevice types from the platform. (I75ba6).
Bug Fixes
- Fixed volume adjustment on non-dynamic route controllers (I730ec).
- Make
MediaRouteButtonalways enabled (I1e9ff). - Fix some android version runtime checks preventing Android U features from being accessible using the AndroidX media router library (I97cab).
Navigation: v2.7.0-beta01
June 7, 2023
androidx.navigation:navigation-*:2.7.0-beta01 is released. Version 2.7.0-beta01 contains these commits.
Bug Fixes
NavHostin Navigation Compose now correctly intercepts system back calls even after theActivityhas beenSTOPPEDandRESUMED. (Icb6de, b/279118447)
Navigation: v2.6.0
June 7, 2023
androidx.navigation:navigation-*:2.6.0 is released. Version 2.6.0 contains these commits.
Important changes to Navigation since 2.5.0
NavBackStackEntry'sargumentsand theargumentspassed to anOnDestinationChangedListenerare now only a copy of the immutable arguments that were created when you navigated to the destination. This means any changes made to those Bundles will not be reflected in subsequent accesses to theargumentsor otherOnDestinationChangedListenerinstances.NavDeepLinknow supports default values for arrays, which allows support for repeated query params that will map to the argument's array type.NavTypealso now includes a default method which can be overridden to combine two parsed values.- Custom subclasses of
NavTypecan now overrideserializeAsValueto serialize a value into a String, allowing both serialization and deserialization (viaparseValue) to be entirely encapsulated in theNavTypeclass.StringTypenow overrides this method to callUri.encodeon the givenString.
Important changes to Navigation Compose since 2.5.0
- When previewing a composable with
NavHost, it will now show the NavGraph'sstartDestinationby default. NavController.popBackStack(route),NavController.getBackStackEntry(route),NavController.clearBackStack(route)now all support routes with arguments partially or fully filled in. Note that the arguments have to be an exact match with the entry's arguments.- Attempting to create an empty
NavDeepLinkusing thenavDeepLinkKotlin DSL will now result in a lint warning indicating that a deep link needs an uri, action, and/or mimetype to be valid.
Important changes to Navigation with Fragments since 2.5.0
NavHostFragmentno longer intercepts the system back button itself. This allows the underlyingFragmentManagerto handle system back. This allows Fragment1.7.0-alpha01and higher to provide an In-App Predictive Back animation on Android U devices.- When using Navigation with Fragments, attempting to manually do a
FragmentTransactionthat adds a fragment to theFragmentManager's back stack will now throw anIllegalArgumentException. You should always add fragments via thenavigate()API. - When using the exact string
${applicationId}as the placeholder in theapp:dataandapp:dataPatternattributes in the activity element of a navigation XML file, the placeholder will be automatically filled in with thepackageNameof the context upon inflation. - The
FragmentNavigatornow uses the transition APIs when navigating and poppingNavBackStackEntries. This means that theNavBackStackEntryLifecyclewill now wait for the entering and exiting fragment special effects to complete before moving their finalLifecycle.State. - The
DialogFragmentNavigatornow uses the transition APIs when navigating and poppingNavBackStackEntries. This means that theNavBackStackEntryLifecyclewill now wait for theDialogFragmentLifecycleto move toDESTROYEDbefore moving toDESTROYEDitself. NavHostFragmentnow allows you to retrieve theNavControlleras soon as theNavHostFragmentis attached to theFragmentManager, rather than only afteronCreate().- Navigation's support for Dynamic Feature Modules now depend on the granular Play Feature Delivery Library.
- Navigation Safe Args now depends on Android Gradle Plugin version 7.3.0. This means it is now only compatible with versions 7.3.0+.
Important changes to NavigationUI since 2.5.0
- When passing the ID of a navigation graph to
AppBarConfiguration(such as via aMenu),NavigationUInow only considers the start destination of that navigation graph as a top level destination, rather than incorrectly marking every destination within the graph as a top level destination. The behavior of passing the ID of an individual destination is unchanged. This same functionality is available to your own code via the newisTopLevelDestinationfunction onAppBarConfiguration. - The
setupWithNavControllerintegrations inNavigationUIfor working with the top app bar will now parseR.stringvalues forReferenceTypearguments found in yourandroid:labelinto their String values instead of outputting the auto-generated resource integer. NavigationUInow provides logs when it fails to navigate via a selectedMenuItem.
Paging:
privacysandbox ads: v1.0.0-beta05
June 7, 2023
androidx.privacysandbox.ads:ads-adservices:1.0.0-beta05 and androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta05 are released. Version 1.0.0-beta05 contains these commits.
Bug Fixes
- Adds an sdk extension 5 check to
TopicsManager - Bumps Kotlin coroutines dependency to 1.7.1 to prevent duplicate class build errors in gradle
privacysandbox sdkruntime: v1.0.0-alpha05
June 7, 2023
androidx.privacysandbox.sdkruntime:sdkruntime-client:1.0.0-alpha05 and androidx.privacysandbox.sdkruntime:sdkruntime-core:1.0.0-alpha05 are released. This version is developed in an internal branch.
New Features
- (
PrivacySandboxDeveloper Preview 8+ only) Add support for App-Sandbox mediation (seeSdkSandboxManagerCompat#registerAppOwnedSdkSandboxInterface+SdkSandboxControllerCompat#getAppOwnedSdkSandboxInterfaces)
Tracing: v1.3.0-alpha01
June 7, 2023
androidx.tracing:tracing:1.3.0-alpha01 and androidx.tracing:tracing-ktx:1.3.0-alpha01 are released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Remove crossinline from trace to allow using in a
@Composable. (I53882, b/248344805)
Tracing Perfetto: v1.0.0-alpha16
June 7, 2023
androidx.tracing:tracing-perfetto:1.0.0-alpha16, androidx.tracing:tracing-perfetto-binary:1.0.0-alpha16, and androidx.tracing:tracing-perfetto-common:1.0.0-alpha16 are released with no changes from previous alpha. Version 1.0.0-alpha16 contains these commits.
tv: v1.0.0-alpha07
June 7, 2023
androidx.tv:tv-foundation:1.0.0-alpha07 and androidx.tv:tv-material:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.
API Changes
- Components’ scale indications now include None to disable scaling. (I50df5)
- Added long click support for TV Material Surface, Cards and Buttons. (Id2b89)
CarouselItemandCarouselScopehave been removed. Foreground content animation can be achieved in the slide by usingModifier.animateEnterExitfromAnimatedContentScope. (Ic038e)- Merged
colorandcontentColorparams ascolorsfor TV Material Surface. (Ie69eb) - Introduced
RadioButtoncomposable in TV Material. (I08690) - Introduced
Switchcomposable in TV Material. (I45e29) - Introduced
Checkboxcomposable in TV Material. (I6a45a) - Introduced non-interactable Surface in TV Material. (Ic5f85)
- Make indications internal. (Ibff82)
Wear: v1.3.0-beta01
June 7, 2023
androidx.wear:wear:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
API Changes
- Updated
AmbientLifecycleObserverafter feedback.AmbientLifecycleObserverInterfacehas been renamed toAmbientLifecycleObserver, and an instance can be obtained by callingAmbientLifecycleObserver(...).isAmbienthas been moved to be a field instead of a method. (I84b4f)
Bug Fixes
- Adding null checks to handle cases when the parent view is null while resetting alpha and translation in
SwipeToDismiss. (Ib0ec7)
Wear Compose: v1.2.0-beta02
June 7, 2023
androidx.wear.compose:compose-*:1.2.0-beta02 is released. Version 1.2.0-beta02 contains these commits.
New Features
- We have added the new experimental
LocalReduceMotionCompositionLocalvariable which disables scaling and fading onScalingLazyColumn. (I58024)
Bug Fixes
- We have updated the baseline profiles for the wear compose foundation and material libraries(I4725d)
- We have fixed an inconsistency in the default values for
SwipeToDismissBoxcontentScrimColorparameters (I2d70f) - We have fixed the
DefaultTextStyledefault value used for theIncludeFontPaddingsetting (I737ed)
Wear Compose Material3: v1.0.0-alpha06
June 7, 2023
androidx.wear.compose:compose-material3:1.0.0-alpha06 is released. Version 1.0.0-alpha06 contains these commits.
Bug Fixes
- We have updated
TextButtonto use thetoDisabledColorextension function for correct disabled alpha values. (I814c8)
wear protolayout: v1.0.0-alpha11
June 7, 2023
androidx.wear.protolayout:protolayout-*:1.0.0-alpha11 is released. Version 1.0.0-alpha11 contains these commits.
New Features
- We've added a
PlatformDataKeyfor heart rate accuracy. (I7f9b8)
API Changes
- Rename
StateBuilders#getIdToValueMappingtogetKeyToValueMappingand change the return type toMap<<AppDataKey<?>,DynamicDataValue>. (Iaa7ae) - Make
StateStorea final class (I408ca) TimeGatewayinterface has been replaced byPlatformTimeUpdateNotifierinprotolayout-expression-pipelinelibrary which provides desired frequency for updating time data. (I60869)- Rename
register/unregisterForDatainPlatformDataProvidertoset/clearReceiver(I14b02) - In Material Text,
getExcludeFontPaddinghas been renamed tohasExcludeFontPadding. (Iea01d) - Setter for perfectly aligning label was added to all chip components. All chips now have min tappable target applied. (I8ae92)
LayoutDefaults#BUTTON_MAX_NUMBERhas been renamed toMAX_BUTTONS. (I84788)DAILY_DISTANCEis renamed toDAILY_DISTANCE_M. (I4f758)
Bug Fixes
- Update Prop types docs to clarify why static value is enforced. Specify the default value used if static value wasn't provided. (I155aa)
PlatformDataKeynamespaces should follow Java style naming. (I47bda)
Wear Tiles: v1.2.0-alpha07
June 7, 2023
androidx.wear.tiles:tiles-*:1.2.0-alpha07 is released. Version 1.2.0-alpha07 contains these commits.
New Features
TileRenderer.setStateallows setting the state for the rendering session. This state will apply to the current layout and any future one (until a new state is set) (Iaaf35)- protolayout types are now fully supported across all tile-renderer APIS. (I428b0)
Bug Fixes
- Setting a custom theme is now possible in the
ProtoLayoutViewInstance. (Iae8c0)
Webkit: v1.8.0-alpha01
June 7, 2023
androidx.webkit:webkit:1.8.0-alpha01 is released. Version 1.8.0-alpha01 contains these commits.
API Changes
- See the External Contribution section.
External Contribution
- Add support for passing
ArrayBufferoverWebMessagePortCompat#postMessage,JsReplyProxy#postMessageandWebViewCompat#postWebMessage, receivingArrayBufferfrom JavaScript overWebMessagePortCompatandWebMessageListener, and receiving transferableArrayBufferfrom JavaScript overWebMessagePortCompat. Please note that this API will only be available fromWebViewversion 116. (Ie7567, b/251152171)
WindowManager: v1.2.0-alpha02
June 7, 2023
androidx.window:window-*:1.2.0-alpha02 is released. Version 1.2.0-alpha02 contains these commits.
New Features
- Update test API to have a constant for unspecified folding features.
- Overriding with
WindowLayoutInfoPublishRulewill override all values ofwindowLayoutInfo, including the Context based API.
API Changes
- Add constant for unspecified center folding feature. (I7530c)
Bug Fixes
- Update
WindowLayoutInfoPublishRuleto support overrides onContextbasedWindowLayoutInfo. (I2037a)
WindowManager: v1.1.0
June 7, 2023
androidx.window:window-*:1.1.0 is released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
Activity Embedding
- Added
PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLEDas a boolean property of the<application>tag in the app manifest. - Deprecated
isSplitSupportedand replaced withsplitSupportStatusto provide more detailed information about why the split feature is not available. - Added the
SplitController.SplitSupportStatusnested class to provide state constants for thesplitSupportStatusproperty. - Refactored
SplitControllerto several modules:ActivityEmbeddingControllermodule forActivityorActivityStackrelated APIs.- Moved
isActivityEmbeddedfromSplitControllertoActivityEmbeddingController. RuleControllermodule forEmbeddingRulerelated operations:- Removed
SplitControllerAPIs: clearRegisteredRules()getSplitRules()initialize()registerRule()unregisterRule()- Added
RuleControllerAPIs: addRule()— Adds a rule or updates the rule that has the same tag.removeRule()— Removes a rule from the collection of registered rules.setRules()— Establishes a collection of rules.clearRules()— Removes all registered rules.parseRules()— Parses rules from XML rule definitions.
- All modules require a context to be initialized by
#getInstance()method, including:ActivityEmbeddingController#getInstance(Context)SplitController#getInstance(Context)RuleController#getInstance(Context)
- Added the
EmbeddingAspectRatioclass to define enum-like behavior constants related to display aspect ratio. - Added the
SplitAttributesclass to define the split layout. - Added
SplitAttributescalculator functions toSplitControllerto customize split layouts:setSplitAttributesCalculator(Function)clearSplitAttributesCalculator()isSplitAttributesCalculatorSupported()to check if theSplitAttributesCalculatorAPIs are supported on the device
- Added
EmbeddingRule#tagfield. - API updates in
SplitRule:- Added
defaultSplitAttributes— Defines the default split layout of a split; replacessplitRatioandlayoutDirection. - Added translation of the XML properties
splitRatioandsplitLayoutDirectiontodefaultSplitAttributes. - Changed minimum dimension definitions to use density-independent pixels (dp) instead of pixels.
- Added
minHeightDpwith default value 600dp. - Changed
minWidthtominWidthDpwith default value 600dp. - Changed
minSmallestWidthtominSmallestWidthDpwith default value 600dp. - Added
maxAspectRatioInHorizontalwith default valueALWAYS_ALLOW. - Added
maxAspectRatioInPortraitwith default value 1.4. - Defined
FinishBehaviornested class to replace finish behavior constants. - Applied the property changes to the Builder nested class of
SplitPairRuleandSplitPlaceholderRule.
- Added
- Replaced
SplitInfo#getSplitRatio()withSplitInfo#getSplitAttributes()to provide additional split-related information.
WindowLayout
- Added experimental non-activity UI context support to
WindowInfoTracker. - Added experimental non-activity UI context to
WindowMetricsCalculator.
Migration Steps
- To enable activity embedding to display activities in splits, apps must add the
PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLEDproperty to the manifest<application>tag:xml <property android:name="android.window.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED" android:value="true" />This allows the system to optimize the split behaviors for an application ahead of time. SplitInforatio- Check if the current split is stacked:
kotlin SplitInfo.splitAttributes.splitType is SplitAttributes.SplitType.ExpandContainersSplitType - Check the current ratio:
kotlin if (SplitInfo.splitAttributes.splitType is SplitAttributes.SplitType.RatioSplitType) { val ratio = splitInfo.splitAttributes.splitType.ratio } else { // Ratio is meaningless for other types. }
- Check if the current split is stacked:
- SplitController migrations:
SplitController.getInstance()changes toSplitController.getInstance(Context).SplitController.initialize(Context, @ResId int)changes toRuleController.getInstance(Context).setRules(RuleController.parse(Context, @ResId int)).SplitController.getInstance().isActivityEmbedded(Activity)changes toActivityEmbeddingController.getInstance(Context).isActivityEmbedded(Activity).SplitController.getInstance().registerRule(rule)changes toRuleController.getInstance(Context).addRule(rule).SplitController.getInstance().unregisterRule(rule)changes toRuleController.getInstance(Context).removeRule(rule).SplitController.getInstance().clearRegisteredRules()changes toRuleController.getInstance(Context).clearRules().SplitController.getInstance().getSplitRules()changes toRuleController.getInstance(Context).getRules().
SplitRuleproperty migrations:minWidthandminSmallestWidthnow use dp units instead of pixels. Apps can use the following call:kotlin TypedValue.applyDimension( COMPLEX_UNIT_DIP, minWidthInPixels, resources.displayMetrics )or simply divideminWithin pixels bydisplayMetrics#density.
- Finish behavior constants must be migrated to
FinishBehaviorenum-like class constants:FINISH_NEVERchanges toFinishBehavior.NEVER.FINISH_ALWAYSchanges toFinishBehavior.ALWAYS.FINISH_ADJACENTchanges toFinishBehavior.ADJACENT.
- Layout direction must be migrated to
SplitAttributes.LayoutDirection:ltrchanges toSplitAttributes.LayoutDirection.LEFT_TO_RIGHT.rtlchanges toSplitAttributes.LayoutDirection.RIGHT_TO_LEFT.localechanges toSplitAttributes.LayoutDirection.LOCALE.splitRatiomust be migrated toSplitAttributes.SplitType.ratio(splitRatio).
SplitPairRule.Buildermigrations:SplitPairRule.Builder(filters, minWidth, minSmallestWidth)changes tokotlin SplitPairRule.Builder(filters) .setMinWidthDp(minWidthInDp) // Optional if minWidthInDp is 600. .setMinSmallestWidthDp(minSmallestWidthDp) // Optional if minSmallestWidthInDp is 600.setLayoutDirection(layoutDirection)andsetSplitRatio(ratio)changes tokotlin setDefaultSplitAttributes( SplitAttributes.Builder() .setLayoutDirection(layoutDirection) .setSplitType(SplitAttributes.SplitType.ratio(ratio)) .build() )setFinishPrimaryWithSecondaryandsetFinishSecondaryWithPrimarytake theFinishBehaviorenum-like constants. See “SplitRule migrations” for details.- Use
setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW)to show splits on portrait devices.
SplitPlaceholder.Buildermigrations:- Has only
filtersandplaceholderIntentparameters. Other properties move to setters. See “SplitPairRule.Builder migrations” for details. setFinishPrimaryWithPlaceholdertakes theFinishBehaviorenum-like constants. See “SplitRule migrations” for details.setLayoutDirection(layoutDirection)andsetSplitRatio(ratio)change to:kotlin setDefaultSplitAttributes( SplitAttributes.Builder() .setLayoutDirection(layoutDirection) .setSplitType(SplitAttributes.SplitType.ratio(ratio)) .build() )- Use
setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW)to show splits on portrait devices.
- Has only
window extensions core: v1.0.0
June 7, 2023
androidx.window.extensions.core:core:1.0.0 is released. Version 1.0.0 contains these commits.
Major features of 1.0.0
- Simple interfaces to work with
androidx.window.extensions. Not meant for generic developer use. For generic use seeandroidx.core.
WorkManager: v2.9.0-alpha01
June 7, 2023
androidx.work:work-*:2.9.0-alpha01 is released. Version 2.9.0-alpha01 contains these commits.
New Features
- Observability via
Flow-s. Instead ofLiveData, Worker's progress now can be observed via Flow’s viaWorkManager.getWorkInfosFlowand similar methods. - Precise scheduling of periodic workers via
setNextScheduleTimeOverride. This allows dynamic calculation of the next Periodic work schedule, which can be used to implement advanced features like adaptive refresh times, custom retry behavior, or making a newsfeed worker run before the user wakes up every morning without drift.ExistingPeriodicWorkPolicy.UPDATEshould be used with these techniques to avoid cancelling a currently-running worker while scheduling the next one. WorkManager’s testing with threading matching production.ExecutorsMode.PRESERVE_EXECUTORScan be used to preserve executors set inConfigurationand to use the real main thread.- Coroutines APIs such as
CoroutineWorkerhave been moved from additional artifactwork-runtime-ktxto the main artifactwork-runtime.work-runtime-ktxis now empty.
API Changes
WorkInfo's constructor is public now, that can be useful in testing. (Ia00b6, b/209145335)work-runtime-ktxis now empty,CoroutineWorkerand other kotlin specific utilities are now available in the mainwork-runtimeartifact. (I71a9a)- Added
setNextScheduleTimeOverridemethod, which allows accurate setting of periodic work schedules (I3b4da) - Renamed
getEarliestRunTimeMillistogetNextScheduleTimeMillis. (I2bd7a) - Next scheduled run time info is added to
WorkInfo. (I797e4) - Initial delay and periodicity info are added to
WorkInfo. (I52f2f) - Added method observe workers via Flows via methods
getWorkInfosByTagFlow,getWorkInfoByIdFlow,getWorkInfosForUniqueWorkFlow,getWorkInfosFlow(If122a) - Added missing
@RequiresApi(...)annotations to Constraints' constructors and properties. They are now aligned with corresponding annotations on setters inConstraints.Builderthat existed from early versions ofWorkManager. (I6d7d2) WorkManagernow has a separate limit for content uri workers to give them guaranteed slots inJobSchedulerto prevent missing content updates under the high load. Limit can be configured viaConfiguration.Builder.setContentUriTriggerWorkersLimit. (Ic128f)- Constraints are added to
WorkInfo. (I162c0)