forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 121
Merge Jetpack Compose 1.11.0-alpha05 #2755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eymar
merged 10 commits into
jb-main
from
integration-copy/compose/9d4064b90bd/to-jb-main
Feb 16, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c7a4e82
Copy compose from 9d4064b90bd
eymar 22a9c23
bump artifactRedirection compose version to 1.11.0-alpha05
eymar d9c6a49
update Kotlin to 2.3.0
eymar 3344ad6
optin InternalComposeApi
eymar 93bec98
stub new Key declarations
eymar 42c4567
pass default values to HistoricalChange call to fix iOS compilation
eymar 48e8948
sync copied compose-foundation scrollable tests with AOSP
eymar 6059744
update API dump
eymar df639f1
post 1.11.0-alpha05 code-review fixes
eymar 072bb01
fix js compilation error - redeclaration
eymar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../animation-benchmark/integration-tests/macrobenchmark-target/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| Copyright 2026 The Android Open Source Project | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| xmlns:tools="http://schemas.android.com/tools"> | ||
|
|
||
| <application | ||
| android:allowBackup="false" | ||
| android:label="Animation Benchmark Target" | ||
| android:supportsRtl="true" | ||
| android:theme="@android:style/Theme.Material.Light.NoActionBar"> | ||
| <activity | ||
| android:name=".SeekableTransitionInterrupt" | ||
| android:exported="true"> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN" /> | ||
|
|
||
| <category android:name="android.intent.category.LAUNCHER" /> | ||
| </intent-filter> | ||
| </activity> | ||
|
|
||
| <profileable | ||
| android:shell="true" | ||
| tools:targetApi="29" /> | ||
| </application> | ||
|
|
||
| </manifest> |
100 changes: 100 additions & 0 deletions
100
.../main/java/androidx/compose/animation/benchmark/target/SeekableTransitionInterruptDemo.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| /* | ||
| * Copyright 2026 The Android Open Source Project | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package androidx.compose.animation.benchmark.target | ||
|
|
||
| import android.os.Bundle | ||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.compose.animation.animateColor | ||
| import androidx.compose.animation.core.SeekableTransitionState | ||
| import androidx.compose.animation.core.animateDp | ||
| import androidx.compose.animation.core.rememberTransition | ||
| import androidx.compose.animation.core.tween | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.material.Text | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.runtime.rememberCoroutineScope | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.unit.dp | ||
| import kotlinx.coroutines.delay | ||
| import kotlinx.coroutines.launch | ||
|
|
||
| class SeekableTransitionInterrupt : ComponentActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| setContent { SeekableTransitionInterruptDemo() } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun SeekableTransitionInterruptDemo() { | ||
| var isToggled by remember { mutableStateOf(false) } | ||
|
|
||
| val seekableState = remember { SeekableTransitionState(isToggled) } | ||
| val scope = rememberCoroutineScope() | ||
|
|
||
| val transition = rememberTransition(seekableState, label = "DemoTransition") | ||
|
|
||
| val size by transition.animateDp(label = "Size") { state -> if (state) 200.dp else 100.dp } | ||
| val color by | ||
| transition.animateColor(label = "Color") { state -> if (state) Color.Red else Color.Blue } | ||
|
|
||
| Column( | ||
| modifier = Modifier.fillMaxSize(), | ||
| verticalArrangement = Arrangement.Center, | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| Box(modifier = Modifier.size(size).background(color)) | ||
|
|
||
| Button( | ||
| onClick = { | ||
| isToggled = !isToggled | ||
|
|
||
| scope.launch { | ||
| seekableState.snapTo(!isToggled) | ||
|
|
||
| val animationJob = launch { | ||
| seekableState.animateTo( | ||
| targetState = isToggled, | ||
| animationSpec = tween(2000), | ||
| ) | ||
| } | ||
|
|
||
| delay(500) | ||
|
|
||
| seekableState.seekTo(fraction = 0.3f, targetState = isToggled) | ||
|
|
||
| animationJob.cancel() | ||
| } | ||
| } | ||
| ) { | ||
| Text("interrupt animation w/ seekTo") | ||
| } | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
...va/androidx/compose/animation/macrobenchmark/SeekableTransitionInterruptMacrobenchmark.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright 2026 The Android Open Source Project | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package androidx.compose.animation.macrobenchmark | ||
|
|
||
| import androidx.benchmark.macro.ExperimentalMetricApi | ||
| import androidx.benchmark.macro.FrameTimingMetric | ||
| import androidx.benchmark.macro.MemoryUsageMetric | ||
| import androidx.benchmark.macro.StartupMode | ||
| import androidx.benchmark.macro.junit4.MacrobenchmarkRule | ||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
| import androidx.test.uiautomator.By | ||
| import androidx.test.uiautomator.UiObject2 | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
|
|
||
| /** | ||
| * This benchmark measures the cost of interrupting an animation with a seekTo for | ||
| * [SeekableTransition]. Before running this benchmark, switch the target app's active build variant | ||
| * to "benchmark" in Android Studio. | ||
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| class SeekableTransitionInterruptMacrobenchmark { | ||
| @get:Rule val benchmarkRule = MacrobenchmarkRule() | ||
|
|
||
| @OptIn(ExperimentalMetricApi::class) | ||
| @Test | ||
| fun clickInterrupt() { | ||
| lateinit var button: UiObject2 | ||
| benchmarkRule.measureRepeated( | ||
| packageName = "androidx.compose.animation.benchmark.target", | ||
| metrics = listOf(FrameTimingMetric(), MemoryUsageMetric(MemoryUsageMetric.Mode.Max)), | ||
| iterations = 10, | ||
| // Warm startup simulates a user interacting with an app that's already warmed up | ||
| startupMode = StartupMode.WARM, | ||
| setupBlock = { | ||
| pressHome() | ||
| startActivityAndWait() | ||
| val buttonText = "interrupt animation w/ seekTo" | ||
| button = device.findObject(By.text(buttonText)) | ||
| }, | ||
| ) { | ||
| button.click() | ||
|
|
||
| device.waitForIdle() | ||
| } | ||
| } | ||
| } |
61 changes: 61 additions & 0 deletions
61
.../src/androidTest/java/androidx/compose/animation/benchmark/SeekableTransitionBenchmark.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* | ||
| * Copyright 2025 The Android Open Source Project | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package androidx.compose.animation.benchmark | ||
|
|
||
| import androidx.benchmark.junit4.BenchmarkRule | ||
| import androidx.benchmark.junit4.measureRepeated | ||
| import androidx.compose.animation.core.SeekableTransitionState | ||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
| import androidx.test.filters.LargeTest | ||
| import kotlinx.coroutines.runBlocking | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
|
|
||
| @LargeTest | ||
| @RunWith(AndroidJUnit4::class) | ||
| class SeekableTransitionBenchmark { | ||
|
|
||
| @get:Rule val benchmarkRule = BenchmarkRule() | ||
|
|
||
| private enum class State { | ||
| Visible, | ||
| Gone, | ||
| } | ||
|
|
||
| /** Measures the cost of creating a new instance of [SeekableTransitionState]. */ | ||
| @Test | ||
| fun instantiation() { | ||
| benchmarkRule.measureRepeated { SeekableTransitionState(State.Visible) } | ||
| } | ||
|
|
||
| /** Measures the cost of using seekTo for a [SeekableTransitionState]. */ | ||
| @Test | ||
| fun seekTo() { | ||
| val seekableState = SeekableTransitionState(State.Visible) | ||
| runBlocking { | ||
| seekableState.snapTo(State.Visible) | ||
| seekableState.seekTo(fraction = 0.1f, targetState = State.Gone) | ||
| } | ||
| benchmarkRule.measureRepeated { | ||
| runBlocking { | ||
| val fraction = if (seekableState.fraction > 0.4f) 0.2f else 0.5f | ||
| seekableState.seekTo(fraction) | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kotlin change usually breaks our TeamCity. Did we run it? If not, let's run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it green, we need to update Kotlin version in compose-multiplatform too. I'll make a PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JetBrains/compose-multiplatform#5535
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to run CI before merge, to avoid mid-breakages.
To do this, we need to have the same branch name in 2 repos.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just merge that PR first, also works, indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
started the TC CI run - https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_AllPersonalBuild/5887197?branch=&buildTypeTab=overview&buildTab=overview (SNAPSHOT)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more update in compose-multiplatform - JetBrains/compose-multiplatform#5536