Skip to content

2023-06-07

Choose a tag to compare

@github-actions github-actions released this 07 Jun 18:37
· 143 commits to main since this release

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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

API Changes

  • Activity now provides a BackEventCompat class that serves as a backward compatible version of BackEvent that is decoupled from the framework BackEvent class.
  • Breaking change: The handleOnBackStarted and handleOnBackProgressed methods of OnBackPressedCallback now receive an androidx.activity.BackEventCompat instance rather than a framework android.window.BackEvent class. The equivalent @VisibleForTesting APIs on OnBackPressedDispatcher have also been updated.
  • The constructor for OnBackPressedDispatcher now takes an optional Consumer<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

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 MemoryUsageMetric for 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 collectBaselineProfile API always generates stable baseline profiles. The collectStableBaselineProfile API has been removed and collectBaselineProfile should be used instead. (I17262, b/281078707)
  • Changed BaselineProfileRule's filterPredicate arg to non-null, with a equivalent default value so that the default filter behavior is more clear in docs. (I3816e)

Bug Fixes

  • Disable IsolationActivity and Perfetto tracing in dryRunMode to 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=StackSampling and androidx.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 requestPostMessageChannel API 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 EngagementSignalsCallback documentation. (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 readableHash in DerivedState if 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 asComposePaint API to enable consumption of an android.graphics.Paint instance to be used in Compose

Bug Fixes

  • Added asComposePaint API to replace toComposePaint as the returned object wraps the original android.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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher. It contains the same bug fixes as 1.11.0-beta02.

Bug Fixes

  • Updated the documentation on the ColorUtils classes 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 ColorUtils classes 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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

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 MetricsAffectingSpans such as RelativeSizeSpan to apply twice. Once during text layout, and again inside of EmojiSpan.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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

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 experimental enablePredictiveBack()and passing in false.
Note: If using the Navigation Component, you must upgrade to Navigation 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 (custom Parcelable classes) and state provided by the developer, which is now always stored in a Bundle that allows determining exactly where a fragment’s state is originating.
  • The FragmentManager.OnBackStackChangedListener interface has been expanded with two additional callbacks of onBackStackChangeStarted and onBackStackChangeCommitted that are called with each Fragment right before they are added/removed from the fragment back stack and right after the transaction is committed, respectively.
  • FragmentStrictMode added a new WrongNestedHierarchyViolation that detects when a child fragment is nested within it’s parent’s View hierarchy, but not added to the parent’s childFragmentManager.
  • The Fragment and FragmentManager APIs that take an Intent or IntentSender are now properly annotated with @NonNull to prevent passing in a null value as a null value would always immediately crash the respective android framework APIs these methods call into.
  • DialogFragment now provides access to underlying ComponentDialog via the requireComponentDialog() 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-manifest artifact 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-testing and androidx.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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

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 CanvasFrontBufferedRenderer to support low latency graphics leveraging the android.graphics.Canvas API alongside the existing OpenGL implementation

API Changes

  • Updated SurfaceControlCompat.Transaction#setBuffer API to allow for nullable HardwareBuffer instances 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 CanvasFrontBufferedRenderer API to enable 3ps to leverage a front buffered rendering system using the Canvas API. (Ibfc29)

Bug Fixes

  • Fixed issue where GLFrontBufferedRenderer would not render content after resuming the corresponding Activity.
  • Fixed issue where front buffered content would be cleared prematurely.
  • Fixed issue where SurfaceHolder.Callbacks would 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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

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 SleepSessionRecord and removed SleepStageRecord.
    • Added ExerciseLap and ExerciseSegment into ExerciseSessionRecord.
  • Periodic and daily rate limits (including memory limits), for read, changelog, insertion and deletion operations.
  • Added validation for all NutritionRecord fields.
  • Added validation for HeartRateVariabilityRmssdRecord.
  • Removed two deprecated APIs: HealthConnectClient#isProviderAvailable and HealthConnectClient#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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

New Features

  • Revamp the MediaRouteButton to 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 MediaRouteDescriptor device types from the platform. (I75ba6).

Bug Fixes

  • Fixed volume adjustment on non-dynamic route controllers (I730ec).
  • Make MediaRouteButton always 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

  • NavHost in Navigation Compose now correctly intercepts system back calls even after the Activity has been STOPPED and RESUMED. (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's arguments and the arguments passed to an OnDestinationChangedListener are 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 the arguments or other OnDestinationChangedListener instances.
  • NavDeepLink now supports default values for arrays, which allows support for repeated query params that will map to the argument's array type. NavType also now includes a default method which can be overridden to combine two parsed values.
  • Custom subclasses of NavType can now override serializeAsValue to serialize a value into a String, allowing both serialization and deserialization (via parseValue) to be entirely encapsulated in the NavType class. StringType now overrides this method to call Uri.encode on the given String.

Important changes to Navigation Compose since 2.5.0

  • When previewing a composable with NavHost, it will now show the NavGraph's startDestination by 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 NavDeepLink using the navDeepLink Kotlin 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

  • NavHostFragment no longer intercepts the system back button itself. This allows the underlying FragmentManager to handle system back. This allows Fragment 1.7.0-alpha01 and higher to provide an In-App Predictive Back animation on Android U devices.
  • When using Navigation with Fragments, attempting to manually do a FragmentTransaction that adds a fragment to the FragmentManager's back stack will now throw an IllegalArgumentException. You should always add fragments via the navigate() API.
  • When using the exact string ${applicationId} as the placeholder in the app:data and app:dataPattern attributes in the activity element of a navigation XML file, the placeholder will be automatically filled in with the packageName of the context upon inflation.
  • The FragmentNavigator now uses the transition APIs when navigating and popping NavBackStackEntries. This means that the NavBackStackEntry Lifecycle will now wait for the entering and exiting fragment special effects to complete before moving their final Lifecycle.State.
  • The DialogFragmentNavigator now uses the transition APIs when navigating and popping NavBackStackEntries. This means that the NavBackStackEntry Lifecycle will now wait for the DialogFragment Lifecycle to move to DESTROYED before moving to DESTROYED itself.
  • NavHostFragment now allows you to retrieve the NavController as soon as the NavHostFragment is attached to the FragmentManager, rather than only after onCreate().
  • 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 a Menu), NavigationUI now 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 new isTopLevelDestination function on AppBarConfiguration.
  • The setupWithNavController integrations in NavigationUI for working with the top app bar will now parse R.string values for ReferenceType arguments found in your android:label into their String values instead of outputting the auto-generated resource integer.
  • NavigationUI now provides logs when it fails to navigate via a selected MenuItem.

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.

Note: This version will only compile against the Android 14 (Upside Down Cake) Beta 1 SDK or higher.

New Features

  • (PrivacySandbox Developer Preview 8+ only) Add support for App-Sandbox mediation (see SdkSandboxManagerCompat#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)
  • CarouselItem and CarouselScope have been removed. Foreground content animation can be achieved in the slide by using Modifier.animateEnterExit from AnimatedContentScope. (Ic038e)
  • Merged color and contentColor params as colors for TV Material Surface. (Ie69eb)
  • Introduced RadioButton composable in TV Material. (I08690)
  • Introduced Switch composable in TV Material. (I45e29)
  • Introduced Checkbox composable 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 AmbientLifecycleObserver after feedback. AmbientLifecycleObserverInterface has been renamed to AmbientLifecycleObserver, and an instance can be obtained by calling AmbientLifecycleObserver(...). isAmbient has 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 LocalReduceMotion CompositionLocal variable which disables scaling and fading on ScalingLazyColumn. (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 SwipeToDismissBox contentScrimColor parameters (I2d70f)
  • We have fixed the DefaultTextStyle default value used for the IncludeFontPadding setting (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 TextButton to use the toDisabledColor extension 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 PlatformDataKey for heart rate accuracy. (I7f9b8)

API Changes

  • Rename StateBuilders#getIdToValueMapping to getKeyToValueMapping and change the return type to Map<<AppDataKey<?>,DynamicDataValue>. (Iaa7ae)
  • Make StateStore a final class (I408ca)
  • TimeGateway interface has been replaced by PlatformTimeUpdateNotifier in protolayout-expression-pipeline library which provides desired frequency for updating time data. (I60869)
  • Rename register/unregisterForData in PlatformDataProvider to set/clearReceiver (I14b02)
  • In Material Text, getExcludeFontPadding has been renamed to hasExcludeFontPadding. (Iea01d)
  • Setter for perfectly aligning label was added to all chip components. All chips now have min tappable target applied. (I8ae92)
  • LayoutDefaults#BUTTON_MAX_NUMBER has been renamed to MAX_BUTTONS. (I84788)
  • DAILY_DISTANCE is renamed to DAILY_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)
  • PlatformDataKey namespaces 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.setState allows 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 ArrayBuffer over WebMessagePortCompat#postMessage, JsReplyProxy#postMessage and WebViewCompat#postWebMessage, receiving ArrayBuffer from JavaScript over WebMessagePortCompat and WebMessageListener, and receiving transferable ArrayBuffer from JavaScript over WebMessagePortCompat. Please note that this API will only be available from WebView version 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 WindowLayoutInfoPublishRule will override all values of windowLayoutInfo, including the Context based API.

API Changes

  • Add constant for unspecified center folding feature. (I7530c)

Bug Fixes

  • Update WindowLayoutInfoPublishRule to support overrides on Context based WindowLayoutInfo. (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_ENABLED as a boolean property of the <application> tag in the app manifest.
  • Deprecated isSplitSupported and replaced with splitSupportStatus to provide more detailed information about why the split feature is not available.
  • Added the SplitController.SplitSupportStatus nested class to provide state constants for the splitSupportStatus property.
  • Refactored SplitController to several modules:
    • ActivityEmbeddingController module for Activity or ActivityStack related APIs.
    • Moved isActivityEmbedded from SplitController to ActivityEmbeddingController.
    • RuleController module for EmbeddingRule related operations:
    • Removed SplitController APIs:
    • clearRegisteredRules()
    • getSplitRules()
    • initialize()
    • registerRule()
    • unregisterRule()
    • Added RuleController APIs:
    • 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 EmbeddingAspectRatio class to define enum-like behavior constants related to display aspect ratio.
  • Added the SplitAttributes class to define the split layout.
  • Added SplitAttributes calculator functions to SplitController to customize split layouts:
    • setSplitAttributesCalculator(Function)
    • clearSplitAttributesCalculator()
    • isSplitAttributesCalculatorSupported() to check if the SplitAttributesCalculator APIs are supported on the device
  • Added EmbeddingRule#tag field.
  • API updates in SplitRule:
    • Added defaultSplitAttributes — Defines the default split layout of a split; replaces splitRatio and layoutDirection.
    • Added translation of the XML properties splitRatio and splitLayoutDirection to defaultSplitAttributes.
    • Changed minimum dimension definitions to use density-independent pixels (dp) instead of pixels.
    • Added minHeightDp with default value 600dp.
    • Changed minWidth to minWidthDp with default value 600dp.
    • Changed minSmallestWidth to minSmallestWidthDp with default value 600dp.
    • Added maxAspectRatioInHorizontal with default value ALWAYS_ALLOW.
    • Added maxAspectRatioInPortrait with default value 1.4.
    • Defined FinishBehavior nested class to replace finish behavior constants.
    • Applied the property changes to the Builder nested class of SplitPairRule and SplitPlaceholderRule.
  • Replaced SplitInfo#getSplitRatio() with SplitInfo#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_ENABLED property 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.
  • SplitInfo ratio
    • 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. }
  • SplitController migrations:
    • SplitController.getInstance() changes to SplitController.getInstance(Context).
    • SplitController.initialize(Context, @ResId int) changes to RuleController.getInstance(Context).setRules(RuleController.parse(Context, @ResId int)).
    • SplitController.getInstance().isActivityEmbedded(Activity) changes to ActivityEmbeddingController.getInstance(Context).isActivityEmbedded(Activity).
    • SplitController.getInstance().registerRule(rule) changes to RuleController.getInstance(Context).addRule(rule).
    • SplitController.getInstance().unregisterRule(rule) changes to RuleController.getInstance(Context).removeRule(rule).
    • SplitController.getInstance().clearRegisteredRules() changes to RuleController.getInstance(Context).clearRules().
    • SplitController.getInstance().getSplitRules() changes to RuleController.getInstance(Context).getRules().
  • SplitRule property migrations:
    • minWidth and minSmallestWidth now use dp units instead of pixels. Apps can use the following call: kotlin TypedValue.applyDimension( COMPLEX_UNIT_DIP, minWidthInPixels, resources.displayMetrics ) or simply divide minWith in pixels by displayMetrics#density.
  • Finish behavior constants must be migrated to FinishBehavior enum-like class constants:
    • FINISH_NEVER changes to FinishBehavior.NEVER.
    • FINISH_ALWAYS changes to FinishBehavior.ALWAYS.
    • FINISH_ADJACENT changes to FinishBehavior.ADJACENT.
  • Layout direction must be migrated to SplitAttributes.LayoutDirection:
    • ltr changes to SplitAttributes.LayoutDirection.LEFT_TO_RIGHT.
    • rtl changes to SplitAttributes.LayoutDirection.RIGHT_TO_LEFT.
    • locale changes to SplitAttributes.LayoutDirection.LOCALE.
    • splitRatio must be migrated to SplitAttributes.SplitType.ratio(splitRatio).
  • SplitPairRule.Builder migrations:
    • SplitPairRule.Builder(filters, minWidth, minSmallestWidth) changes to kotlin SplitPairRule.Builder(filters) .setMinWidthDp(minWidthInDp) // Optional if minWidthInDp is 600. .setMinSmallestWidthDp(minSmallestWidthDp) // Optional if minSmallestWidthInDp is 600.
    • setLayoutDirection(layoutDirection) and setSplitRatio(ratio) changes to kotlin setDefaultSplitAttributes( SplitAttributes.Builder() .setLayoutDirection(layoutDirection) .setSplitType(SplitAttributes.SplitType.ratio(ratio)) .build() )
    • setFinishPrimaryWithSecondary and setFinishSecondaryWithPrimary take the FinishBehavior enum-like constants. See “SplitRule migrations” for details.
    • Use setMaxAspectRatioInPortrait(EmbeddingAspectRatio.ALWAYS_ALLOW) to show splits on portrait devices.
  • SplitPlaceholder.Builder migrations:
    • Has only filters and placeholderIntent parameters. Other properties move to setters. See “SplitPairRule.Builder migrations” for details.
    • setFinishPrimaryWithPlaceholder takes the FinishBehavior enum-like constants. See “SplitRule migrations” for details.
    • setLayoutDirection(layoutDirection) and setSplitRatio(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.

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 see androidx.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 of LiveData, Worker's progress now can be observed via Flow’s via WorkManager.getWorkInfosFlow and 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.UPDATE should 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_EXECUTORS can be used to preserve executors set in Configuration and to use the real main thread.
  • Coroutines APIs such as CoroutineWorker have been moved from additional artifact work-runtime-ktx to the main artifact work-runtime. work-runtime-ktx is now empty.

API Changes

  • WorkInfo's constructor is public now, that can be useful in testing. (Ia00b6, b/209145335)
  • work-runtime-ktx is now empty, CoroutineWorker and other kotlin specific utilities are now available in the main work-runtime artifact. (I71a9a)
  • Added setNextScheduleTimeOverride method, which allows accurate setting of periodic work schedules (I3b4da)
  • Renamed getEarliestRunTimeMillis to getNextScheduleTimeMillis. (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 in Constraints.Builder that existed from early versions of WorkManager. (I6d7d2)
  • WorkManager now has a separate limit for content uri workers to give them guaranteed slots in JobScheduler to prevent missing content updates under the high load. Limit can be configured via Configuration.Builder.setContentUriTriggerWorkersLimit. (Ic128f)
  • Constraints are added to WorkInfo. (I162c0)