Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
bb1c20b
Mark innerLayerCoordinatorIsDirty as not dirty once it is resolved
ShikaSD Jan 6, 2026
f3fcaeb
Whitebox: create a new activity that combines planes, anchors, and hi…
Dec 5, 2025
a2b7e44
Fix conversion of custom Android RGB color space
Jan 6, 2026
8f1b52b
[Carousel] Fixed center aligned carousels not accounting for itemSpac…
hunterstich Jan 8, 2026
c6e7ad1
Create project task: kotlin android project
Jan 6, 2026
6a00cde
Update Kdocs for ConfigModes to specify supported runtimes and requir…
Jan 7, 2026
8e29610
Fix SlidingPaneLayout crash in onTouchEvent
Jan 9, 2026
abf4fa6
Ignores AdSelectionService related test failures caused by API deprec…
Jan 8, 2026
14038c6
Don't write empty BCV files
fsladkey Jan 8, 2026
cf27d28
Add ViewBoundsTracker in core-pip library
hwwang-google Jan 9, 2026
6973ea4
Enable strict API mode for activity projects
liutikas Jan 9, 2026
c420c92
Rename PagerScaffoldDefaults.SnapPositionalThreshold to LowSnapPositi…
Jan 8, 2026
8091b84
Fix aggregation for activity intensity and mindfulness.
Jan 6, 2026
a3d364e
Create an `xr:glimmer:test-utils` module and move `GlimmerRule` there,
beloglazov Jan 5, 2026
dc9812e
Add a scrolling benchmark for VerticalStack.
beloglazov Dec 31, 2025
10e16a2
Adds `CombinedAction` to support executing multiple actions.
yingmak Jan 8, 2026
c96eee5
Fix `RemoteText` use of `RemoteTextV2` and `CoreText`
yschimke Jan 9, 2026
0248995
Merge changes from topics "glimmer-testutils", "stack-benchmark" into…
beloglazov Jan 9, 2026
5804f0b
Isolate DataStore CoroutineScope with SupervisorJob to prevent Cancel…
droid-wan-kenobi Jan 9, 2026
d67b5cd
Merge "Enable strict API mode for activity projects" into androidx-main
Jan 9, 2026
218c7e2
Merge "Fix `RemoteText` use of `RemoteTextV2` and `CoreText`" into an…
yschimke Jan 9, 2026
88924c5
Merge "Fix conversion of custom Android RGB color space" into android…
Jan 9, 2026
ed80c3b
Merge "Adds `CombinedAction` to support executing multiple actions." …
yingmak Jan 9, 2026
4fcb3cf
Merge "Create project task: kotlin android project" into androidx-main
Jan 9, 2026
2da52d9
Remove anonymous object to fix Metalava crash
marcellogalhardo Jan 9, 2026
7b8e282
Merge "Mark innerLayerCoordinatorIsDirty as not dirty once it is reso…
ShikaSD Jan 9, 2026
de9621b
Improve captureSingleRemoteDocumentV2
yschimke Jan 9, 2026
a9d0ef8
Merge "[Carousel] Fixed center aligned carousels not accounting for i…
hunterstich Jan 9, 2026
2f0aeac
Merge "Don't write empty BCV files" into androidx-main
fsladkey Jan 9, 2026
8caa942
Merge "Rename PagerScaffoldDefaults.SnapPositionalThreshold to LowSna…
Jan 9, 2026
cd616b2
Revert "Reapply "Move common AndroidComposeView structures to Compose…
Jan 9, 2026
f74de9a
Merge "Ignores AdSelectionService related test failures caused by API…
Jan 9, 2026
70ee513
Merge "Fix aggregation for activity intensity and mindfulness." into …
Jan 9, 2026
4e26d03
Merge "Remove anonymous object to fix Metalava crash" into androidx-main
Jan 9, 2026
261cdfb
[webview] Implement WebViewBuilder.applyTo
ashleynewson Nov 26, 2025
0744376
Merge "Whitebox: create a new activity that combines planes, anchors,…
Jan 9, 2026
6f350e8
Merge "Improve captureSingleRemoteDocumentV2" into androidx-main
yschimke Jan 9, 2026
f9f05f7
Updating docs-public/build.gradle
Jan 9, 2026
61382db
Don't return early if there are target errors
fsladkey Jan 8, 2026
6748b9e
Move a variety of wear libraries to rc01
liutikas Dec 17, 2025
8a8692d
Inexact timestamp matching for video outputs.
codelogic Jan 7, 2026
c7c7ab7
Merge "Isolate DataStore CoroutineScope with SupervisorJob to prevent…
Jan 9, 2026
a9fd96a
Merge "Revert "Reapply "Move common AndroidComposeView structures to …
Jan 9, 2026
be7ea92
Merge "Updating docs-public/build.gradle" into androidx-main
Jan 9, 2026
1e7ad73
Merge "Add ViewBoundsTracker in core-pip library" into androidx-main
hwwang-google Jan 9, 2026
47559ec
Merge "Move a variety of wear libraries to rc01" into androidx-main
Jan 9, 2026
bf52d82
Merge "Inexact timestamp matching for video outputs." into androidx-main
Jan 9, 2026
f8de904
Merge "[webview] Implement WebViewBuilder.applyTo" into androidx-main
ashleynewson Jan 9, 2026
23f7b7a
Merge "Fix SlidingPaneLayout crash in onTouchEvent" into androidx-main
Jan 9, 2026
4138fb8
Merge "Update Kdocs for ConfigModes to specify supported runtimes and…
Jan 9, 2026
0379fdb
Merge "Don't return early if there are target errors" into androidx-main
fsladkey Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion activity/activity-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ androidx {
type = SoftwareType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS
inceptionYear = "2020"
description = "Compose integration with Activity"
legacyDisableKotlinStrictApiMode = true
samples(project(":activity:activity-compose:activity-compose-samples"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
package androidx.activity.compose

import android.app.Activity
import androidx.compose.runtime.ProvidableCompositionLocal
import androidx.compose.runtime.compositionLocalWithComputedDefaultOf
import androidx.compose.ui.platform.LocalContext

/**
* Provides the [android.app.Activity] belonging to the current [LocalContext].
* Provides the [Activity] belonging to the current [LocalContext].
*
* Note, when possible you should always prefer using the finer grained composition locals where
* available. This API should be used as a fallback when the required API is only available via
* [android.app.Activity].
* [Activity].
*
* See [androidx.compose.ui.platform.LocalConfiguration]
* [androidx.compose.ui.platform.LocalLifecycleOwner] [androidx.compose.ui.platform.LocalView]
*/
val LocalActivity =
compositionLocalWithComputedDefaultOf<Activity?> { findOwner(LocalContext.currentValue) }
public val LocalActivity: ProvidableCompositionLocal<Activity?> =
compositionLocalWithComputedDefaultOf {
findOwner(LocalContext.currentValue)
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ private class ReportDrawnComposition(
* Provides a [FullyDrawnReporterOwner] that can be used by Composables hosted in a
* [androidx.activity.ComponentActivity].
*/
object LocalFullyDrawnReporterOwner {
public object LocalFullyDrawnReporterOwner {
private val LocalFullyDrawnReporterOwner = compositionLocalOf<FullyDrawnReporterOwner?> { null }

/**
* Returns current composition local value for the owner or `null` if one has not been provided,
* one has not been set via [androidx.activity.setViewTreeFullyDrawnReporterOwner], nor is one
* available by looking at the [LocalContext].
*/
val current: FullyDrawnReporterOwner?
public val current: FullyDrawnReporterOwner?
@Composable
get() =
LocalFullyDrawnReporterOwner.current
?: LocalView.current.findViewTreeFullyDrawnReporterOwner()
?: findOwner<FullyDrawnReporterOwner>(LocalContext.current)

/** Associates a [LocalFullyDrawnReporterOwner] key to a value. */
infix fun provides(
public infix fun provides(
fullyDrawnReporterOwner: FullyDrawnReporterOwner
): ProvidedValue<FullyDrawnReporterOwner?> {
return LocalFullyDrawnReporterOwner.provides(fullyDrawnReporterOwner)
Expand All @@ -114,7 +114,7 @@ object LocalFullyDrawnReporterOwner {
* @sample androidx.activity.compose.samples.ReportDrawnWhenSample
*/
@Composable
fun ReportDrawnWhen(predicate: () -> Boolean) {
public fun ReportDrawnWhen(predicate: () -> Boolean) {
val fullyDrawnReporter = LocalFullyDrawnReporterOwner.current?.fullyDrawnReporter ?: return
DisposableEffect(fullyDrawnReporter, predicate) {
if (fullyDrawnReporter.isFullyDrawnReported) {
Expand All @@ -133,7 +133,7 @@ fun ReportDrawnWhen(predicate: () -> Boolean) {
*
* @sample androidx.activity.compose.samples.ReportDrawnSample
*/
@Composable fun ReportDrawn() = ReportDrawnWhen { true }
@Composable public fun ReportDrawn(): Unit = ReportDrawnWhen { true }

/**
* Adds [block] to the methods that must complete prior to [Activity.reportFullyDrawn] being called.
Expand All @@ -146,7 +146,7 @@ fun ReportDrawnWhen(predicate: () -> Boolean) {
* @sample androidx.activity.compose.samples.ReportDrawnAfterSample
*/
@Composable
fun ReportDrawnAfter(block: suspend () -> Unit) {
public fun ReportDrawnAfter(block: suspend () -> Unit) {
val fullyDrawnReporter = LocalFullyDrawnReporterOwner.current?.fullyDrawnReporter ?: return
LaunchedEffect(block, fullyDrawnReporter) { fullyDrawnReporter.reportWhenComplete(block) }
}
1 change: 0 additions & 1 deletion activity/activity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ androidx {
type = SoftwareType.PUBLISHED_LIBRARY
inceptionYear = "2018"
description = "Provides the base Activity subclass and the relevant hooks to build a composable structure on top."
legacyDisableKotlinStrictApiMode = true
}

baselineProfile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ import androidx.annotation.VisibleForTesting
import androidx.navigationevent.NavigationEvent

/** Compat around the [BackEvent] class */
class BackEventCompat
public class BackEventCompat
@VisibleForTesting
@JvmOverloads
constructor(
/**
* Absolute X location of the touch point of this event in the coordinate space of the view that
* * received this back event.
*/
val touchX: Float,
public val touchX: Float,
/**
* Absolute Y location of the touch point of this event in the coordinate space of the view that
* received this back event.
*/
val touchY: Float,
public val touchY: Float,
/** Value between 0 and 1 on how far along the back gesture is. */
@FloatRange(from = 0.0, to = 1.0) val progress: Float,
@FloatRange(from = 0.0, to = 1.0) public val progress: Float,
/** Indicates which edge the swipe starts from. */
val swipeEdge: @SwipeEdge Int,
public val swipeEdge: @SwipeEdge Int,
/** Frame time of the back event. */
val frameTimeMillis: Long = 0,
public val frameTimeMillis: Long = 0,
) {

/**
Expand All @@ -57,7 +57,7 @@ constructor(
* @param backEvent The [BackEvent] instance to convert.
*/
@RequiresApi(34)
constructor(
public constructor(
backEvent: BackEvent
) : this(
touchX = backEvent.touchX,
Expand All @@ -75,7 +75,7 @@ constructor(
*
* @param navigationEvent The [NavigationEvent] instance to convert.
*/
constructor(
public constructor(
navigationEvent: NavigationEvent
) : this(
touchX = navigationEvent.touchX,
Expand All @@ -90,7 +90,7 @@ constructor(
@RestrictTo(RestrictTo.Scope.LIBRARY)
@Retention(AnnotationRetention.SOURCE)
@IntDef(EDGE_LEFT, EDGE_RIGHT, EDGE_NONE)
annotation class SwipeEdge
public annotation class SwipeEdge

/**
* Convert this [BackEventCompat] object to a [BackEvent] object.
Expand All @@ -99,7 +99,7 @@ constructor(
* @throws UnsupportedOperationException if this API is called on an API prior to 34.
*/
@RequiresApi(34)
fun toBackEvent(): BackEvent {
public fun toBackEvent(): BackEvent {
return if (Build.VERSION.SDK_INT >= 36) {
BackEvent(touchX, touchY, progress, swipeEdge, frameTimeMillis)
} else {
Expand All @@ -112,7 +112,7 @@ constructor(
*
* @return A new [NavigationEvent] object populated with this [BackEventCompat] data.
*/
fun toNavigationEvent(): NavigationEvent {
public fun toNavigationEvent(): NavigationEvent {
return NavigationEvent(
touchX = touchX,
touchY = touchY,
Expand All @@ -127,18 +127,18 @@ constructor(
"swipeEdge=$swipeEdge, frameTimeMillis=$frameTimeMillis)"
}

companion object {
public companion object {
/** Indicates that the edge swipe starts from the left edge of the screen */
const val EDGE_LEFT = 0
public const val EDGE_LEFT: Int = 0

/** Indicates that the edge swipe starts from the right edge of the screen */
const val EDGE_RIGHT = 1
public const val EDGE_RIGHT: Int = 1

/**
* Indicates that the back event was not triggered by an edge swipe back gesture. This
* applies to cases like using the back button in 3-button navigation or pressing a hardware
* back button.
*/
const val EDGE_NONE = 2
public const val EDGE_NONE: Int = 2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ import java.util.concurrent.atomic.AtomicInteger
* level building blocks are included. Higher level components can then be used as needed without
* enforcing a deep Activity class hierarchy or strong coupling between components.
*/
open class ComponentActivity() :
public open class ComponentActivity() :
androidx.core.app.ComponentActivity(),
ContextAware,
LifecycleOwner,
Expand Down Expand Up @@ -143,7 +143,7 @@ open class ComponentActivity() :
// Lazily recreated from NonConfigurationInstances by val viewModelStore
private var _viewModelStore: ViewModelStore? = null
private val reportFullyDrawnExecutor = createFullyDrawnExecutor()
override val fullyDrawnReporter by lazy {
override val fullyDrawnReporter: FullyDrawnReporter by lazy {
FullyDrawnReporter(reportFullyDrawnExecutor) { reportFullyDrawn() }
}

Expand Down Expand Up @@ -325,7 +325,7 @@ open class ComponentActivity() :
* required for API 27 and lower or when using the default [android.app.AppComponentFactory].
*/
@ContentView
constructor(@LayoutRes contentLayoutId: Int) : this() {
public constructor(@LayoutRes contentLayoutId: Int) : this() {
this.contentLayoutId = contentLayoutId
}

Expand Down Expand Up @@ -389,12 +389,12 @@ open class ComponentActivity() :
* [lastCustomNonConfigurationInstance].
*/
@Deprecated("Use a {@link androidx.lifecycle.ViewModel} to store non config state.")
open fun onRetainCustomNonConfigurationInstance(): Any? {
public open fun onRetainCustomNonConfigurationInstance(): Any? {
return null
}

@get:Deprecated("Use a {@link androidx.lifecycle.ViewModel} to store non config state.")
open val lastCustomNonConfigurationInstance: Any?
public open val lastCustomNonConfigurationInstance: Any?
/** Return the value previously returned from [onRetainCustomNonConfigurationInstance]. */
get() {
val nc = lastNonConfigurationInstance as NonConfigurationInstances?
Expand Down Expand Up @@ -430,7 +430,7 @@ open class ComponentActivity() :
* attach listeners will see them already present.
*/
@CallSuper
open fun initializeViewTreeOwners() {
public open fun initializeViewTreeOwners() {
window.decorView.setViewTreeLifecycleOwner(this)
window.decorView.setViewTreeViewModelStoreOwner(this)
window.decorView.setViewTreeSavedStateRegistryOwner(this)
Expand Down Expand Up @@ -590,7 +590,7 @@ open class ComponentActivity() :
/**
* Called when the activity has detected the user's press of the back key. The
* [onBackPressedDispatcher] will be given a chance to handle the back button before the default
* behavior of [android.app.Activity.onBackPressed] is invoked.
* behavior of [Activity.onBackPressed] is invoked.
*
* @see onBackPressedDispatcher
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import androidx.savedstate.SavedStateRegistryOwner
import androidx.savedstate.setViewTreeSavedStateRegistryOwner

/** Base class for dialogs that enables composition of higher level components. */
open class ComponentDialog
public open class ComponentDialog
@JvmOverloads
constructor(context: Context, @StyleRes themeResId: Int = 0) :
Dialog(context, themeResId),
Expand Down Expand Up @@ -153,7 +153,7 @@ constructor(context: Context, @StyleRes themeResId: Int = 0) :
* attach listeners will see them already present.
*/
@CallSuper
open fun initializeViewTreeOwners() {
public open fun initializeViewTreeOwners() {
window!!.decorView.setViewTreeLifecycleOwner(this)
window!!.decorView.setViewTreeOnBackPressedDispatcherOwner(this)
window!!.decorView.setViewTreeSavedStateRegistryOwner(this)
Expand Down
12 changes: 6 additions & 6 deletions activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private var Impl: EdgeToEdgeImpl? = null
*/
@JvmName("enable")
@JvmOverloads
fun ComponentActivity.enableEdgeToEdge(
public fun ComponentActivity.enableEdgeToEdge(
statusBarStyle: SystemBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT),
navigationBarStyle: SystemBarStyle = SystemBarStyle.auto(DefaultLightScrim, DefaultDarkScrim),
) {
Expand Down Expand Up @@ -129,15 +129,15 @@ fun ComponentActivity.enableEdgeToEdge(
}

/** The style for the status bar or the navigation bar used in [enableEdgeToEdge]. */
class SystemBarStyle
public class SystemBarStyle
private constructor(
private val lightScrim: Int,
internal val darkScrim: Int,
internal val nightMode: Int,
internal val detectDarkMode: (Resources) -> Boolean,
) {

companion object {
public companion object {

/**
* Creates a new instance of [SystemBarStyle]. This style detects the dark mode
Expand All @@ -161,7 +161,7 @@ private constructor(
*/
@JvmStatic
@JvmOverloads
fun auto(
public fun auto(
@ColorInt lightScrim: Int,
@ColorInt darkScrim: Int,
detectDarkMode: (Resources) -> Boolean = { resources ->
Expand All @@ -185,7 +185,7 @@ private constructor(
* the contrast against the light system icons.
*/
@JvmStatic
fun dark(@ColorInt scrim: Int): SystemBarStyle {
public fun dark(@ColorInt scrim: Int): SystemBarStyle {
return SystemBarStyle(
lightScrim = scrim,
darkScrim = scrim,
Expand All @@ -204,7 +204,7 @@ private constructor(
* system icon color is always light. It is expected to be dark.
*/
@JvmStatic
fun light(@ColorInt scrim: Int, @ColorInt darkScrim: Int): SystemBarStyle {
public fun light(@ColorInt scrim: Int, @ColorInt darkScrim: Int): SystemBarStyle {
return SystemBarStyle(
lightScrim = scrim,
darkScrim = darkScrim,
Expand Down
Loading
Loading