Merge "build.sh only setting up sysroot when existing libraries are older" into androidx-main
diff --git a/.github/actions/build-single-project/action.yml b/.github/actions/build-single-project/action.yml
index 9c69de3..c67b48d 100644
--- a/.github/actions/build-single-project/action.yml
+++ b/.github/actions/build-single-project/action.yml
@@ -68,4 +68,4 @@
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ inputs.gradle-enterprise-access-key }}
working-directory: ${{ inputs.project-root }}
shell: bash
- run: ./gradlew buildOnServer zipTestConfigsWithApks test ${{ inputs.gradlew_flags }}
+ run: ./gradlew buildOnServer zipTestConfigsWithApks test ${{ inputs.gradle-flags }}
diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml
index 7a0de22..40ba42a 100644
--- a/.github/workflows/presubmit.yml
+++ b/.github/workflows/presubmit.yml
@@ -7,7 +7,7 @@
# Allow precise monitoring of the save/restore of Gradle User Home by `gradle-build-action`
# See https://github.com/marketplace/actions/gradle-build-action?version=v2.1.1#cache-debugging-and-analysis
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
- GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "GoldBlooded" #GSW!!!
+ GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "2022.07.23"
jobs:
setup:
runs-on: ubuntu-latest
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/LibraryTypeTest.kt b/buildSrc-tests/src/test/kotlin/androidx/build/LibraryTypeTest.kt
deleted file mode 100644
index 4c86593..0000000
--- a/buildSrc-tests/src/test/kotlin/androidx/build/LibraryTypeTest.kt
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright 2022 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.build
-
-import com.google.common.truth.Truth.assertThat
-import org.junit.Test
-
-class LibraryTypeTest {
- @Test
- fun publishedLibrary() {
- val libraryType = LibraryType.PUBLISHED_LIBRARY
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.Yes::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun publishedTestLibrary() {
- val libraryType = LibraryType.PUBLISHED_TEST_LIBRARY
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.Yes::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun publishedNativeLibrary() {
- val libraryType = LibraryType.PUBLISHED_NATIVE_LIBRARY
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.Yes::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun internalTestLibrary() {
- val libraryType = LibraryType.INTERNAL_TEST_LIBRARY
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.NONE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun samples() {
- val libraryType = LibraryType.SAMPLES
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun lint() {
- val libraryType = LibraryType.LINT
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.NONE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun compilerDaemon() {
- val libraryType = LibraryType.COMPILER_DAEMON
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun compilerPlugin() {
- val libraryType = LibraryType.COMPILER_PLUGIN
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun gradlePlugin() {
- val libraryType = LibraryType.GRADLE_PLUGIN
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun annotationProcessor() {
- val libraryType = LibraryType.ANNOTATION_PROCESSOR
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun annotationProcessorUtils() {
- val libraryType = LibraryType.ANNOTATION_PROCESSOR_UTILS
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun otherCodeProcessor() {
- val libraryType = LibraryType.OTHER_CODE_PROCESSOR
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.HOST)
- }
-
- @Test
- fun idePlugin() {
- val libraryType = LibraryType.IDE_PLUGIN
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.NONE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun kmp() {
- val libraryType = LibraryType.KmpLibrary {
- jvm = Publish.SNAPSHOT_AND_RELEASE
- android = Publish.SNAPSHOT_AND_RELEASE
- }
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.publishExtension.jvm).isEqualTo(Publish.SNAPSHOT_AND_RELEASE)
- assertThat(libraryType.publishExtension.shouldPublishAny()).isTrue()
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.Yes::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun kmpWhenNotPublishing() {
- val libraryType = LibraryType.KmpLibrary {
- jvm = Publish.NONE
- android = Publish.NONE
- }
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.NONE)
- assertThat(libraryType.publishExtension.jvm).isEqualTo(Publish.NONE)
- assertThat(libraryType.publishExtension.shouldPublishAny()).isFalse()
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.Yes::class.java)
- assertThat(libraryType.sourceJars).isTrue()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-
- @Test
- fun unset() {
- val libraryType = LibraryType.UNSET
- assertThat(libraryType.publishExtension.android).isEqualTo(Publish.NONE)
- assertThat(libraryType.checkApi).isInstanceOf(RunApiTasks.No::class.java)
- assertThat(libraryType.sourceJars).isFalse()
- assertThat(libraryType.compilationTarget).isEqualTo(CompilationTarget.DEVICE)
- }
-}
\ No newline at end of file
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/LintConfiguration.kt b/buildSrc/private/src/main/kotlin/androidx/build/LintConfiguration.kt
index 67d020f..2ad8b64 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/LintConfiguration.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/LintConfiguration.kt
@@ -200,6 +200,13 @@
fatal.add("VisibleForTests")
}
+ // Broken in 7.4.0-alpha04 due to b/236262744
+ disable.add("CustomPermissionTypo")
+ disable.add("KnownPermissionError")
+ disable.add("PermissionNamingConvention")
+ disable.add("ReservedSystemPermission")
+ disable.add("SystemPermissionTypo")
+
// Reenable after b/235251897 is resolved
disable.add("IllegalExperimentalApiUsage")
diff --git a/compose/animation/animation-core/build.gradle b/compose/animation/animation-core/build.gradle
index 1d3e17f..40e0a9e 100644
--- a/compose/animation/animation-core/build.gradle
+++ b/compose/animation/animation-core/build.gradle
@@ -39,7 +39,7 @@
api("androidx.annotation:annotation:1.1.0")
implementation("androidx.compose.runtime:runtime:1.1.1")
- implementation("androidx.compose.ui:ui:1.2.0-rc01")
+ implementation("androidx.compose.ui:ui:1.2.0-rc02")
implementation("androidx.compose.ui:ui-unit:1.0.0")
implementation("androidx.compose.ui:ui-util:1.0.0")
implementation(libs.kotlinStdlib)
diff --git a/compose/animation/animation-core/samples/build.gradle b/compose/animation/animation-core/samples/build.gradle
index 738db47..7fd885d 100644
--- a/compose/animation/animation-core/samples/build.gradle
+++ b/compose/animation/animation-core/samples/build.gradle
@@ -30,7 +30,7 @@
implementation(libs.kotlinStdlib)
compileOnly(project(":annotation:annotation-sampled"))
implementation(project(":compose:animation:animation-core"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui:1.0.0")
implementation("androidx.compose.ui:ui-unit:1.0.0")
implementation("androidx.compose.foundation:foundation:1.0.0")
diff --git a/compose/animation/animation-core/src/test/java/androidx/compose/animation/core/SpringEstimationTest.kt b/compose/animation/animation-core/src/test/java/androidx/compose/animation/core/SpringEstimationTest.kt
index 06dda09..7396ca5 100644
--- a/compose/animation/animation-core/src/test/java/androidx/compose/animation/core/SpringEstimationTest.kt
+++ b/compose/animation/animation-core/src/test/java/androidx/compose/animation/core/SpringEstimationTest.kt
@@ -16,6 +16,8 @@
package androidx.compose.animation.core
+import android.os.Build
+import androidx.test.filters.SdkSuppress
import junit.framework.TestCase.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
@@ -45,6 +47,7 @@
}
@Test
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.N) // parallelStream() requires API level 24
fun runTestCases() {
val failedTestCaseResults = mutableListOf<TestCaseResult>()
diff --git a/compose/animation/animation-graphics/samples/build.gradle b/compose/animation/animation-graphics/samples/build.gradle
index cc264a1..2e646d9 100644
--- a/compose/animation/animation-graphics/samples/build.gradle
+++ b/compose/animation/animation-graphics/samples/build.gradle
@@ -34,7 +34,7 @@
implementation(project(":compose:animation:animation-graphics"))
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui-text:1.0.0")
}
diff --git a/compose/animation/animation/samples/build.gradle b/compose/animation/animation/samples/build.gradle
index 9a3b857..f0b1df1 100644
--- a/compose/animation/animation/samples/build.gradle
+++ b/compose/animation/animation/samples/build.gradle
@@ -34,7 +34,7 @@
implementation(project(":compose:animation:animation"))
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui-text:1.0.0")
}
diff --git a/compose/foundation/foundation-layout/build.gradle b/compose/foundation/foundation-layout/build.gradle
index 123ef41..41f4669 100644
--- a/compose/foundation/foundation-layout/build.gradle
+++ b/compose/foundation/foundation-layout/build.gradle
@@ -36,10 +36,10 @@
*/
api("androidx.annotation:annotation:1.1.0")
- api("androidx.compose.ui:ui:1.2.0-rc01")
+ api("androidx.compose.ui:ui:1.2.0-rc02")
api("androidx.compose.ui:ui-unit:1.1.1")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui-util:1.0.0")
implementation("androidx.core:core:1.7.0")
implementation("androidx.compose.animation:animation-core:1.1.1")
diff --git a/compose/foundation/foundation-layout/samples/build.gradle b/compose/foundation/foundation-layout/samples/build.gradle
index 905cda5..a0ad7b5 100644
--- a/compose/foundation/foundation-layout/samples/build.gradle
+++ b/compose/foundation/foundation-layout/samples/build.gradle
@@ -32,7 +32,7 @@
implementation(project(":compose:foundation:foundation"))
implementation(project(":compose:foundation:foundation-layout"))
implementation("androidx.compose.material:material:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui:1.0.0")
implementation("androidx.compose.ui:ui-text:1.0.0")
implementation("androidx.core:core-ktx:1.7.0")
diff --git a/compose/foundation/foundation/build.gradle b/compose/foundation/foundation/build.gradle
index 6fa1923..2f4378f 100644
--- a/compose/foundation/foundation/build.gradle
+++ b/compose/foundation/foundation/build.gradle
@@ -37,8 +37,8 @@
*/
api("androidx.annotation:annotation:1.1.0")
api("androidx.compose.animation:animation:1.1.1")
- api("androidx.compose.runtime:runtime:1.2.0-rc01")
- api("androidx.compose.ui:ui:1.2.0-rc01")
+ api("androidx.compose.runtime:runtime:1.2.0-rc02")
+ api("androidx.compose.ui:ui:1.2.0-rc02")
implementation(libs.kotlinStdlibCommon)
implementation(project(":compose:foundation:foundation-layout"))
diff --git a/compose/foundation/foundation/samples/build.gradle b/compose/foundation/foundation/samples/build.gradle
index fa88856..7bec7a5 100644
--- a/compose/foundation/foundation/samples/build.gradle
+++ b/compose/foundation/foundation/samples/build.gradle
@@ -34,7 +34,7 @@
implementation(project(":compose:foundation:foundation"))
implementation(project(":compose:foundation:foundation-layout"))
implementation("androidx.compose.material:material:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui:1.0.0")
implementation("androidx.compose.ui:ui-text:1.0.0")
}
diff --git a/compose/material/material-icons-core/samples/build.gradle b/compose/material/material-icons-core/samples/build.gradle
index ffaf157..f2d65d8 100644
--- a/compose/material/material-icons-core/samples/build.gradle
+++ b/compose/material/material-icons-core/samples/build.gradle
@@ -33,7 +33,7 @@
implementation(project(":compose:material:material"))
implementation(project(":compose:material:material-icons-core"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
}
androidx {
diff --git a/compose/material/material/build.gradle b/compose/material/material/build.gradle
index d0a021c..9c0fb33 100644
--- a/compose/material/material/build.gradle
+++ b/compose/material/material/build.gradle
@@ -34,12 +34,12 @@
* corresponding block below
*/
api("androidx.compose.animation:animation-core:1.0.0")
- api("androidx.compose.foundation:foundation:1.2.0-rc01")
+ api("androidx.compose.foundation:foundation:1.2.0-rc02")
api(project(":compose:material:material-icons-core"))
api(project(":compose:material:material-ripple"))
- api("androidx.compose.runtime:runtime:1.2.0-rc01")
- api("androidx.compose.ui:ui:1.2.0-rc01")
- api("androidx.compose.ui:ui-text:1.2.0-rc01")
+ api("androidx.compose.runtime:runtime:1.2.0-rc02")
+ api("androidx.compose.ui:ui:1.2.0-rc02")
+ api("androidx.compose.ui:ui-text:1.2.0-rc02")
implementation(libs.kotlinStdlibCommon)
implementation("androidx.compose.animation:animation:1.0.0")
diff --git a/compose/material/material/samples/build.gradle b/compose/material/material/samples/build.gradle
index 2b4db5e..4cf1daa 100644
--- a/compose/material/material/samples/build.gradle
+++ b/compose/material/material/samples/build.gradle
@@ -35,7 +35,7 @@
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.foundation:foundation-layout:1.0.0")
implementation(project(":compose:material:material"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui:1.0.0")
implementation("androidx.compose.ui:ui-text:1.0.0")
}
diff --git a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BadgeTest.kt b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BadgeTest.kt
index c3c0644..c2e3f2c 100644
--- a/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BadgeTest.kt
+++ b/compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BadgeTest.kt
@@ -15,6 +15,7 @@
*/
package androidx.compose.material
+import android.os.Build
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
@@ -54,6 +55,7 @@
import androidx.compose.ui.unit.width
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
import com.google.common.truth.Truth
import org.junit.Rule
import org.junit.Test
@@ -113,6 +115,7 @@
}
@Test
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.O) // captureToImage() requires API level 26
fun badge_noContent_shape() {
var errorColor = Color.Unspecified
rule.setMaterialContent {
diff --git a/compose/material3/material3-window-size-class/build.gradle b/compose/material3/material3-window-size-class/build.gradle
index 79f4095..93ff325 100644
--- a/compose/material3/material3-window-size-class/build.gradle
+++ b/compose/material3/material3-window-size-class/build.gradle
@@ -36,9 +36,9 @@
* corresponding block below
*/
implementation(libs.kotlinStdlibCommon)
- api("androidx.compose.runtime:runtime:1.2.0-rc01")
- api("androidx.compose.ui:ui:1.2.0-rc01")
- api("androidx.compose.ui:ui-unit:1.2.0-rc01")
+ api("androidx.compose.runtime:runtime:1.2.0-rc02")
+ api("androidx.compose.ui:ui:1.2.0-rc02")
+ api("androidx.compose.ui:ui-unit:1.2.0-rc02")
implementation("androidx.window:window:1.1.0-alpha02")
testImplementation(libs.kotlinTest)
diff --git a/compose/material3/material3-window-size-class/samples/build.gradle b/compose/material3/material3-window-size-class/samples/build.gradle
index 971e06a..623b22e 100644
--- a/compose/material3/material3-window-size-class/samples/build.gradle
+++ b/compose/material3/material3-window-size-class/samples/build.gradle
@@ -32,7 +32,7 @@
compileOnly(project(":annotation:annotation-sampled"))
implementation(project(":compose:material3:material3-window-size-class"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.activity:activity-compose:1.3.1")
}
diff --git a/compose/material3/material3/api/current.txt b/compose/material3/material3/api/current.txt
index 60e6505..2764de3 100644
--- a/compose/material3/material3/api/current.txt
+++ b/compose/material3/material3/api/current.txt
@@ -1,6 +1,22 @@
// Signature format: 4.0
package androidx.compose.material3 {
+ public final class AlertDialogDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method @androidx.compose.runtime.Composable public long getIconContentColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ method @androidx.compose.runtime.Composable public long getTextContentColor();
+ method @androidx.compose.runtime.Composable public long getTitleContentColor();
+ method public float getTonalElevation();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property @androidx.compose.runtime.Composable public final long IconContentColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ property @androidx.compose.runtime.Composable public final long TextContentColor;
+ property @androidx.compose.runtime.Composable public final long TitleContentColor;
+ property public final float TonalElevation;
+ field public static final androidx.compose.material3.AlertDialogDefaults INSTANCE;
+ }
+
public final class AlertDialogKt {
}
@@ -23,6 +39,12 @@
method @androidx.compose.runtime.Composable public static androidx.compose.material3.TopAppBarScrollState rememberTopAppBarScrollState(optional float initialOffsetLimit, optional float initialOffset, optional float initialContentOffset);
}
+ public final class BadgeDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ field public static final androidx.compose.material3.BadgeDefaults INSTANCE;
+ }
+
public final class BadgeKt {
method @androidx.compose.runtime.Composable public static void Badge(optional androidx.compose.ui.Modifier modifier, optional long containerColor, optional long contentColor, optional kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit>? content);
method @androidx.compose.runtime.Composable public static void BadgedBox(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> badge, optional androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
@@ -30,9 +52,13 @@
public final class BottomAppBarDefaults {
method @androidx.compose.runtime.Composable public void FloatingActionButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, optional androidx.compose.ui.graphics.Shape shape, optional long containerColor, optional long contentColor, optional androidx.compose.material3.FloatingActionButtonElevation elevation, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method public float getContainerElevation();
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
method @androidx.compose.runtime.Composable public long getFloatingActionButtonContainerColor();
method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFloatingActionButtonShape();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property public final float ContainerElevation;
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
property @androidx.compose.runtime.Composable public final long FloatingActionButtonContainerColor;
property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FloatingActionButtonShape;
@@ -60,20 +86,30 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors filledTonalButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonElevation filledTonalButtonElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float disabledElevation);
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getElevatedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledTonalShape();
method public float getIconSize();
method public float getIconSpacing();
method public float getMinHeight();
method public float getMinWidth();
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke getOutlinedButtonBorder();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method public androidx.compose.foundation.layout.PaddingValues getTextButtonContentPadding();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getTextShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ElevatedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledTonalShape;
property public final float IconSize;
property public final float IconSpacing;
property public final float MinHeight;
property public final float MinWidth;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
property public final androidx.compose.foundation.layout.PaddingValues TextButtonContentPadding;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape TextShape;
property @androidx.compose.runtime.Composable public final androidx.compose.foundation.BorderStroke outlinedButtonBorder;
field public static final androidx.compose.material3.ButtonDefaults INSTANCE;
}
@@ -101,9 +137,15 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation cardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardColors elevatedCardColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation elevatedCardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getElevatedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedCardBorder(optional boolean enabled);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardColors outlinedCardColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation outlinedCardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ElevatedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.CardDefaults INSTANCE;
}
@@ -205,6 +247,14 @@
property public static final androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.graphics.Color> LocalContentColor;
}
+ public final class DividerDefaults {
+ method @androidx.compose.runtime.Composable public long getColor();
+ method public float getThickness();
+ property @androidx.compose.runtime.Composable public final long Color;
+ property public final float Thickness;
+ field public static final androidx.compose.material3.DividerDefaults INSTANCE;
+ }
+
public final class DividerKt {
method @androidx.compose.runtime.Composable public static void Divider(optional androidx.compose.ui.Modifier modifier, optional long color, optional float thickness, optional float startIndent);
}
@@ -225,9 +275,19 @@
public final class FloatingActionButtonDefaults {
method @androidx.compose.runtime.Composable public androidx.compose.material3.FloatingActionButtonElevation elevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation);
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getExtendedFabShape();
method public float getLargeIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getLargeShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getSmallShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.FloatingActionButtonElevation loweredElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation);
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ExtendedFabShape;
property public final float LargeIconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape LargeShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape SmallShape;
field public static final androidx.compose.material3.FloatingActionButtonDefaults INSTANCE;
}
@@ -254,12 +314,16 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors filledIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors filledTonalIconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors filledTonalIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors iconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors iconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedIconButtonBorder(boolean enabled);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors outlinedIconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke? outlinedIconToggleButtonBorder(boolean enabled, boolean checked);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors outlinedIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
field public static final androidx.compose.material3.IconButtonDefaults INSTANCE;
}
@@ -335,6 +399,14 @@
public final class MenuKt {
}
+ public final class NavigationBarDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method public float getElevation();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property public final float Elevation;
+ field public static final androidx.compose.material3.NavigationBarDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Stable public interface NavigationBarItemColors {
method @androidx.compose.runtime.Composable public long getIndicatorColor();
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> iconColor(boolean selected);
@@ -355,6 +427,12 @@
public final class NavigationDrawerKt {
}
+ public final class NavigationRailDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ field public static final androidx.compose.material3.NavigationRailDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Stable public interface NavigationRailItemColors {
method @androidx.compose.runtime.Composable public long getIndicatorColor();
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> iconColor(boolean selected);
@@ -378,7 +456,15 @@
}
public final class ProgressIndicatorDefaults {
+ method @androidx.compose.runtime.Composable public long getCircularColor();
+ method public float getCircularStrokeWidth();
+ method @androidx.compose.runtime.Composable public long getLinearColor();
+ method @androidx.compose.runtime.Composable public long getLinearTrackColor();
method public androidx.compose.animation.core.SpringSpec<java.lang.Float> getProgressAnimationSpec();
+ property @androidx.compose.runtime.Composable public final long CircularColor;
+ property public final float CircularStrokeWidth;
+ property @androidx.compose.runtime.Composable public final long LinearColor;
+ property @androidx.compose.runtime.Composable public final long LinearTrackColor;
property public final androidx.compose.animation.core.SpringSpec<java.lang.Float> ProgressAnimationSpec;
field public static final androidx.compose.material3.ProgressIndicatorDefaults INSTANCE;
}
@@ -405,6 +491,20 @@
public final class ScaffoldKt {
}
+ public final class ShapeDefaults {
+ method public androidx.compose.foundation.shape.CornerBasedShape getExtraLarge();
+ method public androidx.compose.foundation.shape.CornerBasedShape getExtraSmall();
+ method public androidx.compose.foundation.shape.CornerBasedShape getLarge();
+ method public androidx.compose.foundation.shape.CornerBasedShape getMedium();
+ method public androidx.compose.foundation.shape.CornerBasedShape getSmall();
+ property public final androidx.compose.foundation.shape.CornerBasedShape ExtraLarge;
+ property public final androidx.compose.foundation.shape.CornerBasedShape ExtraSmall;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Large;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Medium;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Small;
+ field public static final androidx.compose.material3.ShapeDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Immutable public final class Shapes {
ctor public Shapes(optional androidx.compose.foundation.shape.CornerBasedShape extraSmall, optional androidx.compose.foundation.shape.CornerBasedShape small, optional androidx.compose.foundation.shape.CornerBasedShape medium, optional androidx.compose.foundation.shape.CornerBasedShape large, optional androidx.compose.foundation.shape.CornerBasedShape extraLarge);
method public androidx.compose.material3.Shapes copy(optional androidx.compose.foundation.shape.CornerBasedShape extraSmall, optional androidx.compose.foundation.shape.CornerBasedShape small, optional androidx.compose.foundation.shape.CornerBasedShape medium, optional androidx.compose.foundation.shape.CornerBasedShape large, optional androidx.compose.foundation.shape.CornerBasedShape extraLarge);
@@ -418,14 +518,6 @@
property public final androidx.compose.foundation.shape.CornerBasedShape large;
property public final androidx.compose.foundation.shape.CornerBasedShape medium;
property public final androidx.compose.foundation.shape.CornerBasedShape small;
- field public static final androidx.compose.material3.Shapes.Companion Companion;
- }
-
- public static final class Shapes.Companion {
- method public androidx.compose.foundation.shape.RoundedCornerShape getFull();
- method public androidx.compose.ui.graphics.Shape getNone();
- property public final androidx.compose.foundation.shape.RoundedCornerShape Full;
- property public final androidx.compose.ui.graphics.Shape None;
}
public final class ShapesKt {
@@ -453,6 +545,22 @@
property public abstract androidx.compose.material3.SnackbarVisuals visuals;
}
+ public final class SnackbarDefaults {
+ method @androidx.compose.runtime.Composable public long getActionColor();
+ method @androidx.compose.runtime.Composable public long getActionContentColor();
+ method @androidx.compose.runtime.Composable public long getColor();
+ method @androidx.compose.runtime.Composable public long getContentColor();
+ method @androidx.compose.runtime.Composable public long getDismissActionContentColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ property @androidx.compose.runtime.Composable public final long ActionColor;
+ property @androidx.compose.runtime.Composable public final long ActionContentColor;
+ property @androidx.compose.runtime.Composable public final long Color;
+ property @androidx.compose.runtime.Composable public final long ContentColor;
+ property @androidx.compose.runtime.Composable public final long DismissActionContentColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ field public static final androidx.compose.material3.SnackbarDefaults INSTANCE;
+ }
+
public enum SnackbarDuration {
method public static androidx.compose.material3.SnackbarDuration valueOf(String name) throws java.lang.IllegalArgumentException;
method public static androidx.compose.material3.SnackbarDuration[] values();
@@ -543,7 +651,11 @@
public final class TabRowDefaults {
method @androidx.compose.runtime.Composable public void Divider(optional androidx.compose.ui.Modifier modifier, optional float thickness, optional long color);
method @androidx.compose.runtime.Composable public void Indicator(optional androidx.compose.ui.Modifier modifier, optional float height, optional long color);
+ method @androidx.compose.runtime.Composable public long getColor();
+ method @androidx.compose.runtime.Composable public long getContentColor();
method public androidx.compose.ui.Modifier tabIndicatorOffset(androidx.compose.ui.Modifier, androidx.compose.material3.TabPosition currentTabPosition);
+ property @androidx.compose.runtime.Composable public final long Color;
+ property @androidx.compose.runtime.Composable public final long ContentColor;
field public static final androidx.compose.material3.TabRowDefaults INSTANCE;
}
@@ -564,15 +676,19 @@
}
@androidx.compose.runtime.Immutable public final class TextFieldDefaults {
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledShape();
method public float getFocusedBorderThickness();
method public float getMinHeight();
method public float getMinWidth();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
method public float getUnfocusedBorderThickness();
method @androidx.compose.runtime.Composable public androidx.compose.material3.TextFieldColors outlinedTextFieldColors(optional long textColor, optional long disabledTextColor, optional long containerColor, optional long cursorColor, optional long errorCursorColor, optional long focusedBorderColor, optional long unfocusedBorderColor, optional long disabledBorderColor, optional long errorBorderColor, optional long focusedLeadingIconColor, optional long unfocusedLeadingIconColor, optional long disabledLeadingIconColor, optional long errorLeadingIconColor, optional long focusedTrailingIconColor, optional long unfocusedTrailingIconColor, optional long disabledTrailingIconColor, optional long errorTrailingIconColor, optional long focusedLabelColor, optional long unfocusedLabelColor, optional long disabledLabelColor, optional long errorLabelColor, optional long placeholderColor, optional long disabledPlaceholderColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.TextFieldColors textFieldColors(optional long textColor, optional long disabledTextColor, optional long containerColor, optional long cursorColor, optional long errorCursorColor, optional long focusedIndicatorColor, optional long unfocusedIndicatorColor, optional long disabledIndicatorColor, optional long errorIndicatorColor, optional long focusedLeadingIconColor, optional long unfocusedLeadingIconColor, optional long disabledLeadingIconColor, optional long errorLeadingIconColor, optional long focusedTrailingIconColor, optional long unfocusedTrailingIconColor, optional long disabledTrailingIconColor, optional long errorTrailingIconColor, optional long focusedLabelColor, optional long unfocusedLabelColor, optional long disabledLabelColor, optional long errorLabelColor, optional long placeholderColor, optional long disabledPlaceholderColor);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledShape;
property public final float FocusedBorderThickness;
property public final float MinHeight;
property public final float MinWidth;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
property public final float UnfocusedBorderThickness;
field public static final androidx.compose.material3.TextFieldDefaults INSTANCE;
}
diff --git a/compose/material3/material3/api/public_plus_experimental_current.txt b/compose/material3/material3/api/public_plus_experimental_current.txt
index 1777393..44e6450 100644
--- a/compose/material3/material3/api/public_plus_experimental_current.txt
+++ b/compose/material3/material3/api/public_plus_experimental_current.txt
@@ -1,6 +1,22 @@
// Signature format: 4.0
package androidx.compose.material3 {
+ public final class AlertDialogDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method @androidx.compose.runtime.Composable public long getIconContentColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ method @androidx.compose.runtime.Composable public long getTextContentColor();
+ method @androidx.compose.runtime.Composable public long getTitleContentColor();
+ method public float getTonalElevation();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property @androidx.compose.runtime.Composable public final long IconContentColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ property @androidx.compose.runtime.Composable public final long TextContentColor;
+ property @androidx.compose.runtime.Composable public final long TitleContentColor;
+ property public final float TonalElevation;
+ field public static final androidx.compose.material3.AlertDialogDefaults INSTANCE;
+ }
+
public final class AlertDialogKt {
}
@@ -31,11 +47,19 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.ChipElevation elevatedAssistChipElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
method public float getHeight();
method public float getIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
property public final float Height;
property public final float IconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.AssistChipDefaults INSTANCE;
}
+ public final class BadgeDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ field public static final androidx.compose.material3.BadgeDefaults INSTANCE;
+ }
+
public final class BadgeKt {
method @androidx.compose.runtime.Composable public static void Badge(optional androidx.compose.ui.Modifier modifier, optional long containerColor, optional long contentColor, optional kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit>? content);
method @androidx.compose.runtime.Composable public static void BadgedBox(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> badge, optional androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
@@ -43,9 +67,13 @@
public final class BottomAppBarDefaults {
method @androidx.compose.runtime.Composable public void FloatingActionButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, optional androidx.compose.ui.graphics.Shape shape, optional long containerColor, optional long contentColor, optional androidx.compose.material3.FloatingActionButtonElevation elevation, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method public float getContainerElevation();
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
method @androidx.compose.runtime.Composable public long getFloatingActionButtonContainerColor();
method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFloatingActionButtonShape();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property public final float ContainerElevation;
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
property @androidx.compose.runtime.Composable public final long FloatingActionButtonContainerColor;
property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FloatingActionButtonShape;
@@ -73,20 +101,30 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors filledTonalButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonElevation filledTonalButtonElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float disabledElevation);
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getElevatedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledTonalShape();
method public float getIconSize();
method public float getIconSpacing();
method public float getMinHeight();
method public float getMinWidth();
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke getOutlinedButtonBorder();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method public androidx.compose.foundation.layout.PaddingValues getTextButtonContentPadding();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getTextShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ElevatedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledTonalShape;
property public final float IconSize;
property public final float IconSpacing;
property public final float MinHeight;
property public final float MinWidth;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
property public final androidx.compose.foundation.layout.PaddingValues TextButtonContentPadding;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape TextShape;
property @androidx.compose.runtime.Composable public final androidx.compose.foundation.BorderStroke outlinedButtonBorder;
field public static final androidx.compose.material3.ButtonDefaults INSTANCE;
}
@@ -114,9 +152,15 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation cardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardColors elevatedCardColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation elevatedCardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getElevatedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedCardBorder(optional boolean enabled);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardColors outlinedCardColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation outlinedCardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ElevatedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.CardDefaults INSTANCE;
}
@@ -248,6 +292,14 @@
property public static final androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.graphics.Color> LocalContentColor;
}
+ public final class DividerDefaults {
+ method @androidx.compose.runtime.Composable public long getColor();
+ method public float getThickness();
+ property @androidx.compose.runtime.Composable public final long Color;
+ property public final float Thickness;
+ field public static final androidx.compose.material3.DividerDefaults INSTANCE;
+ }
+
public final class DividerKt {
method @androidx.compose.runtime.Composable public static void Divider(optional androidx.compose.ui.Modifier modifier, optional long color, optional float thickness, optional float startIndent);
}
@@ -256,14 +308,18 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api public final class DrawerDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
method public float getDismissibleDrawerElevation();
method public float getModalDrawerElevation();
method public float getPermanentDrawerElevation();
method @androidx.compose.runtime.Composable public long getScrimColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
property public final float DismissibleDrawerElevation;
property public final float ModalDrawerElevation;
property public final float PermanentDrawerElevation;
- property @androidx.compose.runtime.Composable public final long scrimColor;
+ property @androidx.compose.runtime.Composable public final long ScrimColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.DrawerDefaults INSTANCE;
}
@@ -345,16 +401,28 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.SelectableChipElevation filterChipElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
method public float getHeight();
method public float getIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
property public final float Height;
property public final float IconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.FilterChipDefaults INSTANCE;
}
public final class FloatingActionButtonDefaults {
method @androidx.compose.runtime.Composable public androidx.compose.material3.FloatingActionButtonElevation elevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation);
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getExtendedFabShape();
method public float getLargeIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getLargeShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getSmallShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.FloatingActionButtonElevation loweredElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation);
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ExtendedFabShape;
property public final float LargeIconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape LargeShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape SmallShape;
field public static final androidx.compose.material3.FloatingActionButtonDefaults INSTANCE;
}
@@ -381,12 +449,16 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors filledIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors filledTonalIconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors filledTonalIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors iconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors iconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedIconButtonBorder(boolean enabled);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors outlinedIconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke? outlinedIconToggleButtonBorder(boolean enabled, boolean checked);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors outlinedIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
field public static final androidx.compose.material3.IconButtonDefaults INSTANCE;
}
@@ -416,12 +488,14 @@
method public float getAvatarSize();
method public float getHeight();
method public float getIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.SelectableChipBorder inputChipBorder(optional long borderColor, optional long selectedBorderColor, optional long disabledBorderColor, optional long disabledSelectedBorderColor, optional float borderWidth, optional float selectedBorderWidth);
method @androidx.compose.runtime.Composable public androidx.compose.material3.SelectableChipColors inputChipColors(optional long containerColor, optional long labelColor, optional long leadingIconColor, optional long trailingIconColor, optional long disabledContainerColor, optional long disabledLabelColor, optional long disabledLeadingIconColor, optional long disabledTrailingIconColor, optional long selectedContainerColor, optional long disabledSelectedContainerColor, optional long selectedLabelColor, optional long selectedLeadingIconColor, optional long selectedTrailingIconColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.SelectableChipElevation inputChipElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
property public final float AvatarSize;
property public final float Height;
property public final float IconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.InputChipDefaults INSTANCE;
}
@@ -482,6 +556,14 @@
public final class MenuKt {
}
+ public final class NavigationBarDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method public float getElevation();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property public final float Elevation;
+ field public static final androidx.compose.material3.NavigationBarDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Stable public interface NavigationBarItemColors {
method @androidx.compose.runtime.Composable public long getIndicatorColor();
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> iconColor(boolean selected);
@@ -522,6 +604,12 @@
method @androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Composable public static androidx.compose.material3.DrawerState rememberDrawerState(androidx.compose.material3.DrawerValue initialValue, optional kotlin.jvm.functions.Function1<? super androidx.compose.material3.DrawerValue,java.lang.Boolean> confirmStateChange);
}
+ public final class NavigationRailDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ field public static final androidx.compose.material3.NavigationRailDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Stable public interface NavigationRailItemColors {
method @androidx.compose.runtime.Composable public long getIndicatorColor();
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> iconColor(boolean selected);
@@ -545,7 +633,15 @@
}
public final class ProgressIndicatorDefaults {
+ method @androidx.compose.runtime.Composable public long getCircularColor();
+ method public float getCircularStrokeWidth();
+ method @androidx.compose.runtime.Composable public long getLinearColor();
+ method @androidx.compose.runtime.Composable public long getLinearTrackColor();
method public androidx.compose.animation.core.SpringSpec<java.lang.Float> getProgressAnimationSpec();
+ property @androidx.compose.runtime.Composable public final long CircularColor;
+ property public final float CircularStrokeWidth;
+ property @androidx.compose.runtime.Composable public final long LinearColor;
+ property @androidx.compose.runtime.Composable public final long LinearTrackColor;
property public final androidx.compose.animation.core.SpringSpec<java.lang.Float> ProgressAnimationSpec;
field public static final androidx.compose.material3.ProgressIndicatorDefaults INSTANCE;
}
@@ -590,6 +686,20 @@
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.unit.Dp> tonalElevation(boolean enabled, boolean selected, androidx.compose.foundation.interaction.InteractionSource interactionSource);
}
+ public final class ShapeDefaults {
+ method public androidx.compose.foundation.shape.CornerBasedShape getExtraLarge();
+ method public androidx.compose.foundation.shape.CornerBasedShape getExtraSmall();
+ method public androidx.compose.foundation.shape.CornerBasedShape getLarge();
+ method public androidx.compose.foundation.shape.CornerBasedShape getMedium();
+ method public androidx.compose.foundation.shape.CornerBasedShape getSmall();
+ property public final androidx.compose.foundation.shape.CornerBasedShape ExtraLarge;
+ property public final androidx.compose.foundation.shape.CornerBasedShape ExtraSmall;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Large;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Medium;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Small;
+ field public static final androidx.compose.material3.ShapeDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Immutable public final class Shapes {
ctor public Shapes(optional androidx.compose.foundation.shape.CornerBasedShape extraSmall, optional androidx.compose.foundation.shape.CornerBasedShape small, optional androidx.compose.foundation.shape.CornerBasedShape medium, optional androidx.compose.foundation.shape.CornerBasedShape large, optional androidx.compose.foundation.shape.CornerBasedShape extraLarge);
method public androidx.compose.material3.Shapes copy(optional androidx.compose.foundation.shape.CornerBasedShape extraSmall, optional androidx.compose.foundation.shape.CornerBasedShape small, optional androidx.compose.foundation.shape.CornerBasedShape medium, optional androidx.compose.foundation.shape.CornerBasedShape large, optional androidx.compose.foundation.shape.CornerBasedShape extraLarge);
@@ -603,14 +713,6 @@
property public final androidx.compose.foundation.shape.CornerBasedShape large;
property public final androidx.compose.foundation.shape.CornerBasedShape medium;
property public final androidx.compose.foundation.shape.CornerBasedShape small;
- field public static final androidx.compose.material3.Shapes.Companion Companion;
- }
-
- public static final class Shapes.Companion {
- method public androidx.compose.foundation.shape.RoundedCornerShape getFull();
- method public androidx.compose.ui.graphics.Shape getNone();
- property public final androidx.compose.foundation.shape.RoundedCornerShape Full;
- property public final androidx.compose.ui.graphics.Shape None;
}
public final class ShapesKt {
@@ -639,6 +741,22 @@
property public abstract androidx.compose.material3.SnackbarVisuals visuals;
}
+ public final class SnackbarDefaults {
+ method @androidx.compose.runtime.Composable public long getActionColor();
+ method @androidx.compose.runtime.Composable public long getActionContentColor();
+ method @androidx.compose.runtime.Composable public long getColor();
+ method @androidx.compose.runtime.Composable public long getContentColor();
+ method @androidx.compose.runtime.Composable public long getDismissActionContentColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ property @androidx.compose.runtime.Composable public final long ActionColor;
+ property @androidx.compose.runtime.Composable public final long ActionContentColor;
+ property @androidx.compose.runtime.Composable public final long Color;
+ property @androidx.compose.runtime.Composable public final long ContentColor;
+ property @androidx.compose.runtime.Composable public final long DismissActionContentColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ field public static final androidx.compose.material3.SnackbarDefaults INSTANCE;
+ }
+
public enum SnackbarDuration {
method public static androidx.compose.material3.SnackbarDuration valueOf(String name) throws java.lang.IllegalArgumentException;
method public static androidx.compose.material3.SnackbarDuration[] values();
@@ -690,11 +808,13 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.ChipElevation elevatedSuggestionChipElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
method public float getHeight();
method public float getIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.ChipBorder suggestionChipBorder(optional long borderColor, optional long disabledBorderColor, optional float borderWidth);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ChipColors suggestionChipColors(optional long containerColor, optional long labelColor, optional long iconContentColor, optional long disabledContainerColor, optional long disabledLabelColor, optional long disabledIconContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ChipElevation suggestionChipElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
property public final float Height;
property public final float IconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.SuggestionChipDefaults INSTANCE;
}
@@ -746,7 +866,11 @@
public final class TabRowDefaults {
method @androidx.compose.runtime.Composable public void Divider(optional androidx.compose.ui.Modifier modifier, optional float thickness, optional long color);
method @androidx.compose.runtime.Composable public void Indicator(optional androidx.compose.ui.Modifier modifier, optional float height, optional long color);
+ method @androidx.compose.runtime.Composable public long getColor();
+ method @androidx.compose.runtime.Composable public long getContentColor();
method public androidx.compose.ui.Modifier tabIndicatorOffset(androidx.compose.ui.Modifier, androidx.compose.material3.TabPosition currentTabPosition);
+ property @androidx.compose.runtime.Composable public final long Color;
+ property @androidx.compose.runtime.Composable public final long ContentColor;
field public static final androidx.compose.material3.TabRowDefaults INSTANCE;
}
@@ -770,9 +894,11 @@
method @androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Composable public void BorderBox(boolean enabled, boolean isError, androidx.compose.foundation.interaction.InteractionSource interactionSource, androidx.compose.material3.TextFieldColors colors, optional androidx.compose.ui.graphics.Shape shape, optional float focusedBorderThickness, optional float unfocusedBorderThickness);
method @androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Composable public void OutlinedTextFieldDecorationBox(String value, kotlin.jvm.functions.Function0<kotlin.Unit> innerTextField, boolean enabled, boolean singleLine, androidx.compose.ui.text.input.VisualTransformation visualTransformation, androidx.compose.foundation.interaction.InteractionSource interactionSource, optional boolean isError, optional kotlin.jvm.functions.Function0<kotlin.Unit>? label, optional kotlin.jvm.functions.Function0<kotlin.Unit>? placeholder, optional kotlin.jvm.functions.Function0<kotlin.Unit>? leadingIcon, optional kotlin.jvm.functions.Function0<kotlin.Unit>? trailingIcon, optional androidx.compose.material3.TextFieldColors colors, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional kotlin.jvm.functions.Function0<kotlin.Unit> border);
method @androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Composable public void TextFieldDecorationBox(String value, kotlin.jvm.functions.Function0<kotlin.Unit> innerTextField, boolean enabled, boolean singleLine, androidx.compose.ui.text.input.VisualTransformation visualTransformation, androidx.compose.foundation.interaction.InteractionSource interactionSource, optional boolean isError, optional kotlin.jvm.functions.Function0<kotlin.Unit>? label, optional kotlin.jvm.functions.Function0<kotlin.Unit>? placeholder, optional kotlin.jvm.functions.Function0<kotlin.Unit>? leadingIcon, optional kotlin.jvm.functions.Function0<kotlin.Unit>? trailingIcon, optional androidx.compose.material3.TextFieldColors colors, optional androidx.compose.foundation.layout.PaddingValues contentPadding);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledShape();
method public float getFocusedBorderThickness();
method public float getMinHeight();
method public float getMinWidth();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
method public float getUnfocusedBorderThickness();
method @androidx.compose.material3.ExperimentalMaterial3Api public androidx.compose.ui.Modifier indicatorLine(androidx.compose.ui.Modifier, boolean enabled, boolean isError, androidx.compose.foundation.interaction.InteractionSource interactionSource, androidx.compose.material3.TextFieldColors colors, optional float focusedIndicatorLineThickness, optional float unfocusedIndicatorLineThickness);
method @androidx.compose.runtime.Composable public androidx.compose.material3.TextFieldColors outlinedTextFieldColors(optional long textColor, optional long disabledTextColor, optional long containerColor, optional long cursorColor, optional long errorCursorColor, optional long focusedBorderColor, optional long unfocusedBorderColor, optional long disabledBorderColor, optional long errorBorderColor, optional long focusedLeadingIconColor, optional long unfocusedLeadingIconColor, optional long disabledLeadingIconColor, optional long errorLeadingIconColor, optional long focusedTrailingIconColor, optional long unfocusedTrailingIconColor, optional long disabledTrailingIconColor, optional long errorTrailingIconColor, optional long focusedLabelColor, optional long unfocusedLabelColor, optional long disabledLabelColor, optional long errorLabelColor, optional long placeholderColor, optional long disabledPlaceholderColor);
@@ -780,9 +906,11 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.TextFieldColors textFieldColors(optional long textColor, optional long disabledTextColor, optional long containerColor, optional long cursorColor, optional long errorCursorColor, optional long focusedIndicatorColor, optional long unfocusedIndicatorColor, optional long disabledIndicatorColor, optional long errorIndicatorColor, optional long focusedLeadingIconColor, optional long unfocusedLeadingIconColor, optional long disabledLeadingIconColor, optional long errorLeadingIconColor, optional long focusedTrailingIconColor, optional long unfocusedTrailingIconColor, optional long disabledTrailingIconColor, optional long errorTrailingIconColor, optional long focusedLabelColor, optional long unfocusedLabelColor, optional long disabledLabelColor, optional long errorLabelColor, optional long placeholderColor, optional long disabledPlaceholderColor);
method @androidx.compose.material3.ExperimentalMaterial3Api public androidx.compose.foundation.layout.PaddingValues textFieldWithLabelPadding(optional float start, optional float end, optional float top, optional float bottom);
method @androidx.compose.material3.ExperimentalMaterial3Api public androidx.compose.foundation.layout.PaddingValues textFieldWithoutLabelPadding(optional float start, optional float top, optional float end, optional float bottom);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledShape;
property public final float FocusedBorderThickness;
property public final float MinHeight;
property public final float MinWidth;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
property public final float UnfocusedBorderThickness;
field public static final androidx.compose.material3.TextFieldDefaults INSTANCE;
}
diff --git a/compose/material3/material3/api/restricted_current.txt b/compose/material3/material3/api/restricted_current.txt
index 60e6505..2764de3 100644
--- a/compose/material3/material3/api/restricted_current.txt
+++ b/compose/material3/material3/api/restricted_current.txt
@@ -1,6 +1,22 @@
// Signature format: 4.0
package androidx.compose.material3 {
+ public final class AlertDialogDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method @androidx.compose.runtime.Composable public long getIconContentColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ method @androidx.compose.runtime.Composable public long getTextContentColor();
+ method @androidx.compose.runtime.Composable public long getTitleContentColor();
+ method public float getTonalElevation();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property @androidx.compose.runtime.Composable public final long IconContentColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ property @androidx.compose.runtime.Composable public final long TextContentColor;
+ property @androidx.compose.runtime.Composable public final long TitleContentColor;
+ property public final float TonalElevation;
+ field public static final androidx.compose.material3.AlertDialogDefaults INSTANCE;
+ }
+
public final class AlertDialogKt {
}
@@ -23,6 +39,12 @@
method @androidx.compose.runtime.Composable public static androidx.compose.material3.TopAppBarScrollState rememberTopAppBarScrollState(optional float initialOffsetLimit, optional float initialOffset, optional float initialContentOffset);
}
+ public final class BadgeDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ field public static final androidx.compose.material3.BadgeDefaults INSTANCE;
+ }
+
public final class BadgeKt {
method @androidx.compose.runtime.Composable public static void Badge(optional androidx.compose.ui.Modifier modifier, optional long containerColor, optional long contentColor, optional kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit>? content);
method @androidx.compose.runtime.Composable public static void BadgedBox(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> badge, optional androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
@@ -30,9 +52,13 @@
public final class BottomAppBarDefaults {
method @androidx.compose.runtime.Composable public void FloatingActionButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional androidx.compose.foundation.interaction.MutableInteractionSource interactionSource, optional androidx.compose.ui.graphics.Shape shape, optional long containerColor, optional long contentColor, optional androidx.compose.material3.FloatingActionButtonElevation elevation, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method public float getContainerElevation();
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
method @androidx.compose.runtime.Composable public long getFloatingActionButtonContainerColor();
method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFloatingActionButtonShape();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property public final float ContainerElevation;
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
property @androidx.compose.runtime.Composable public final long FloatingActionButtonContainerColor;
property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FloatingActionButtonShape;
@@ -60,20 +86,30 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors filledTonalButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonElevation filledTonalButtonElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float disabledElevation);
method public androidx.compose.foundation.layout.PaddingValues getContentPadding();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getElevatedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledTonalShape();
method public float getIconSize();
method public float getIconSpacing();
method public float getMinHeight();
method public float getMinWidth();
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke getOutlinedButtonBorder();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method public androidx.compose.foundation.layout.PaddingValues getTextButtonContentPadding();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getTextShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
property public final androidx.compose.foundation.layout.PaddingValues ContentPadding;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ElevatedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledTonalShape;
property public final float IconSize;
property public final float IconSpacing;
property public final float MinHeight;
property public final float MinWidth;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
property public final androidx.compose.foundation.layout.PaddingValues TextButtonContentPadding;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape TextShape;
property @androidx.compose.runtime.Composable public final androidx.compose.foundation.BorderStroke outlinedButtonBorder;
field public static final androidx.compose.material3.ButtonDefaults INSTANCE;
}
@@ -101,9 +137,15 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation cardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardColors elevatedCardColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation elevatedCardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getElevatedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedCardBorder(optional boolean enabled);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardColors outlinedCardColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.CardElevation outlinedCardElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation, optional float draggedElevation, optional float disabledElevation);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ElevatedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
field public static final androidx.compose.material3.CardDefaults INSTANCE;
}
@@ -205,6 +247,14 @@
property public static final androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.ui.graphics.Color> LocalContentColor;
}
+ public final class DividerDefaults {
+ method @androidx.compose.runtime.Composable public long getColor();
+ method public float getThickness();
+ property @androidx.compose.runtime.Composable public final long Color;
+ property public final float Thickness;
+ field public static final androidx.compose.material3.DividerDefaults INSTANCE;
+ }
+
public final class DividerKt {
method @androidx.compose.runtime.Composable public static void Divider(optional androidx.compose.ui.Modifier modifier, optional long color, optional float thickness, optional float startIndent);
}
@@ -225,9 +275,19 @@
public final class FloatingActionButtonDefaults {
method @androidx.compose.runtime.Composable public androidx.compose.material3.FloatingActionButtonElevation elevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation);
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getExtendedFabShape();
method public float getLargeIconSize();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getLargeShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getSmallShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.FloatingActionButtonElevation loweredElevation(optional float defaultElevation, optional float pressedElevation, optional float focusedElevation, optional float hoveredElevation);
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape ExtendedFabShape;
property public final float LargeIconSize;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape LargeShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape SmallShape;
field public static final androidx.compose.material3.FloatingActionButtonDefaults INSTANCE;
}
@@ -254,12 +314,16 @@
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors filledIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors filledTonalIconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors filledTonalIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledShape();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors iconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors iconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedIconButtonBorder(boolean enabled);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconButtonColors outlinedIconButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke? outlinedIconToggleButtonBorder(boolean enabled, boolean checked);
method @androidx.compose.runtime.Composable public androidx.compose.material3.IconToggleButtonColors outlinedIconToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledShape;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
field public static final androidx.compose.material3.IconButtonDefaults INSTANCE;
}
@@ -335,6 +399,14 @@
public final class MenuKt {
}
+ public final class NavigationBarDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ method public float getElevation();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ property public final float Elevation;
+ field public static final androidx.compose.material3.NavigationBarDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Stable public interface NavigationBarItemColors {
method @androidx.compose.runtime.Composable public long getIndicatorColor();
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> iconColor(boolean selected);
@@ -355,6 +427,12 @@
public final class NavigationDrawerKt {
}
+ public final class NavigationRailDefaults {
+ method @androidx.compose.runtime.Composable public long getContainerColor();
+ property @androidx.compose.runtime.Composable public final long ContainerColor;
+ field public static final androidx.compose.material3.NavigationRailDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Stable public interface NavigationRailItemColors {
method @androidx.compose.runtime.Composable public long getIndicatorColor();
method @androidx.compose.runtime.Composable public androidx.compose.runtime.State<androidx.compose.ui.graphics.Color> iconColor(boolean selected);
@@ -378,7 +456,15 @@
}
public final class ProgressIndicatorDefaults {
+ method @androidx.compose.runtime.Composable public long getCircularColor();
+ method public float getCircularStrokeWidth();
+ method @androidx.compose.runtime.Composable public long getLinearColor();
+ method @androidx.compose.runtime.Composable public long getLinearTrackColor();
method public androidx.compose.animation.core.SpringSpec<java.lang.Float> getProgressAnimationSpec();
+ property @androidx.compose.runtime.Composable public final long CircularColor;
+ property public final float CircularStrokeWidth;
+ property @androidx.compose.runtime.Composable public final long LinearColor;
+ property @androidx.compose.runtime.Composable public final long LinearTrackColor;
property public final androidx.compose.animation.core.SpringSpec<java.lang.Float> ProgressAnimationSpec;
field public static final androidx.compose.material3.ProgressIndicatorDefaults INSTANCE;
}
@@ -405,6 +491,20 @@
public final class ScaffoldKt {
}
+ public final class ShapeDefaults {
+ method public androidx.compose.foundation.shape.CornerBasedShape getExtraLarge();
+ method public androidx.compose.foundation.shape.CornerBasedShape getExtraSmall();
+ method public androidx.compose.foundation.shape.CornerBasedShape getLarge();
+ method public androidx.compose.foundation.shape.CornerBasedShape getMedium();
+ method public androidx.compose.foundation.shape.CornerBasedShape getSmall();
+ property public final androidx.compose.foundation.shape.CornerBasedShape ExtraLarge;
+ property public final androidx.compose.foundation.shape.CornerBasedShape ExtraSmall;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Large;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Medium;
+ property public final androidx.compose.foundation.shape.CornerBasedShape Small;
+ field public static final androidx.compose.material3.ShapeDefaults INSTANCE;
+ }
+
@androidx.compose.runtime.Immutable public final class Shapes {
ctor public Shapes(optional androidx.compose.foundation.shape.CornerBasedShape extraSmall, optional androidx.compose.foundation.shape.CornerBasedShape small, optional androidx.compose.foundation.shape.CornerBasedShape medium, optional androidx.compose.foundation.shape.CornerBasedShape large, optional androidx.compose.foundation.shape.CornerBasedShape extraLarge);
method public androidx.compose.material3.Shapes copy(optional androidx.compose.foundation.shape.CornerBasedShape extraSmall, optional androidx.compose.foundation.shape.CornerBasedShape small, optional androidx.compose.foundation.shape.CornerBasedShape medium, optional androidx.compose.foundation.shape.CornerBasedShape large, optional androidx.compose.foundation.shape.CornerBasedShape extraLarge);
@@ -418,14 +518,6 @@
property public final androidx.compose.foundation.shape.CornerBasedShape large;
property public final androidx.compose.foundation.shape.CornerBasedShape medium;
property public final androidx.compose.foundation.shape.CornerBasedShape small;
- field public static final androidx.compose.material3.Shapes.Companion Companion;
- }
-
- public static final class Shapes.Companion {
- method public androidx.compose.foundation.shape.RoundedCornerShape getFull();
- method public androidx.compose.ui.graphics.Shape getNone();
- property public final androidx.compose.foundation.shape.RoundedCornerShape Full;
- property public final androidx.compose.ui.graphics.Shape None;
}
public final class ShapesKt {
@@ -453,6 +545,22 @@
property public abstract androidx.compose.material3.SnackbarVisuals visuals;
}
+ public final class SnackbarDefaults {
+ method @androidx.compose.runtime.Composable public long getActionColor();
+ method @androidx.compose.runtime.Composable public long getActionContentColor();
+ method @androidx.compose.runtime.Composable public long getColor();
+ method @androidx.compose.runtime.Composable public long getContentColor();
+ method @androidx.compose.runtime.Composable public long getDismissActionContentColor();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
+ property @androidx.compose.runtime.Composable public final long ActionColor;
+ property @androidx.compose.runtime.Composable public final long ActionContentColor;
+ property @androidx.compose.runtime.Composable public final long Color;
+ property @androidx.compose.runtime.Composable public final long ContentColor;
+ property @androidx.compose.runtime.Composable public final long DismissActionContentColor;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape Shape;
+ field public static final androidx.compose.material3.SnackbarDefaults INSTANCE;
+ }
+
public enum SnackbarDuration {
method public static androidx.compose.material3.SnackbarDuration valueOf(String name) throws java.lang.IllegalArgumentException;
method public static androidx.compose.material3.SnackbarDuration[] values();
@@ -543,7 +651,11 @@
public final class TabRowDefaults {
method @androidx.compose.runtime.Composable public void Divider(optional androidx.compose.ui.Modifier modifier, optional float thickness, optional long color);
method @androidx.compose.runtime.Composable public void Indicator(optional androidx.compose.ui.Modifier modifier, optional float height, optional long color);
+ method @androidx.compose.runtime.Composable public long getColor();
+ method @androidx.compose.runtime.Composable public long getContentColor();
method public androidx.compose.ui.Modifier tabIndicatorOffset(androidx.compose.ui.Modifier, androidx.compose.material3.TabPosition currentTabPosition);
+ property @androidx.compose.runtime.Composable public final long Color;
+ property @androidx.compose.runtime.Composable public final long ContentColor;
field public static final androidx.compose.material3.TabRowDefaults INSTANCE;
}
@@ -564,15 +676,19 @@
}
@androidx.compose.runtime.Immutable public final class TextFieldDefaults {
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getFilledShape();
method public float getFocusedBorderThickness();
method public float getMinHeight();
method public float getMinWidth();
+ method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
method public float getUnfocusedBorderThickness();
method @androidx.compose.runtime.Composable public androidx.compose.material3.TextFieldColors outlinedTextFieldColors(optional long textColor, optional long disabledTextColor, optional long containerColor, optional long cursorColor, optional long errorCursorColor, optional long focusedBorderColor, optional long unfocusedBorderColor, optional long disabledBorderColor, optional long errorBorderColor, optional long focusedLeadingIconColor, optional long unfocusedLeadingIconColor, optional long disabledLeadingIconColor, optional long errorLeadingIconColor, optional long focusedTrailingIconColor, optional long unfocusedTrailingIconColor, optional long disabledTrailingIconColor, optional long errorTrailingIconColor, optional long focusedLabelColor, optional long unfocusedLabelColor, optional long disabledLabelColor, optional long errorLabelColor, optional long placeholderColor, optional long disabledPlaceholderColor);
method @androidx.compose.runtime.Composable public androidx.compose.material3.TextFieldColors textFieldColors(optional long textColor, optional long disabledTextColor, optional long containerColor, optional long cursorColor, optional long errorCursorColor, optional long focusedIndicatorColor, optional long unfocusedIndicatorColor, optional long disabledIndicatorColor, optional long errorIndicatorColor, optional long focusedLeadingIconColor, optional long unfocusedLeadingIconColor, optional long disabledLeadingIconColor, optional long errorLeadingIconColor, optional long focusedTrailingIconColor, optional long unfocusedTrailingIconColor, optional long disabledTrailingIconColor, optional long errorTrailingIconColor, optional long focusedLabelColor, optional long unfocusedLabelColor, optional long disabledLabelColor, optional long errorLabelColor, optional long placeholderColor, optional long disabledPlaceholderColor);
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape FilledShape;
property public final float FocusedBorderThickness;
property public final float MinHeight;
property public final float MinWidth;
+ property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape OutlinedShape;
property public final float UnfocusedBorderThickness;
field public static final androidx.compose.material3.TextFieldDefaults INSTANCE;
}
diff --git a/compose/material3/material3/build.gradle b/compose/material3/material3/build.gradle
index 5000b8d..2891c4b 100644
--- a/compose/material3/material3/build.gradle
+++ b/compose/material3/material3/build.gradle
@@ -40,7 +40,7 @@
implementation("androidx.compose.animation:animation-core:1.1.1")
implementation("androidx.compose.foundation:foundation-layout:1.1.1")
implementation("androidx.compose.ui:ui-util:1.0.0")
- api("androidx.compose.foundation:foundation:1.2.0-rc01")
+ api("androidx.compose.foundation:foundation:1.2.0-rc02")
api("androidx.compose.material:material-icons-core:1.0.2")
api("androidx.compose.material:material-ripple:1.0.0")
api("androidx.compose.runtime:runtime:1.0.1")
diff --git a/compose/material3/material3/integration-tests/material3-demos/src/main/java/androidx/compose/material3/demos/ShapeDemos.kt b/compose/material3/material3/integration-tests/material3-demos/src/main/java/androidx/compose/material3/demos/ShapeDemos.kt
index 6c8ed23..e8388fe 100644
--- a/compose/material3/material3/integration-tests/material3-demos/src/main/java/androidx/compose/material3/demos/ShapeDemos.kt
+++ b/compose/material3/material3/integration-tests/material3-demos/src/main/java/androidx/compose/material3/demos/ShapeDemos.kt
@@ -20,14 +20,15 @@
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.Shapes
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.unit.dp
@Composable
@@ -37,7 +38,7 @@
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.verticalScroll(rememberScrollState()),
) {
- Button(shape = Shapes.None, onClick = {}) { Text("None") }
+ Button(shape = RectangleShape, onClick = {}) { Text("None") }
Spacer(modifier = Modifier.height(16.dp))
Button(shape = shapes.extraSmall, onClick = {}) { Text("Extra Small") }
Spacer(modifier = Modifier.height(16.dp))
@@ -49,6 +50,6 @@
Spacer(modifier = Modifier.height(16.dp))
Button(shape = shapes.extraLarge, onClick = {}) { Text("Extra Large") }
Spacer(modifier = Modifier.height(16.dp))
- Button(shape = Shapes.Full, onClick = {}) { Text("Full") }
+ Button(shape = CircleShape, onClick = {}) { Text("Full") }
}
}
diff --git a/compose/material3/material3/samples/build.gradle b/compose/material3/material3/samples/build.gradle
index 62d5775..86c3304 100644
--- a/compose/material3/material3/samples/build.gradle
+++ b/compose/material3/material3/samples/build.gradle
@@ -34,9 +34,9 @@
implementation("androidx.compose.animation:animation:1.0.0")
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.foundation:foundation-layout:1.0.0")
- implementation("androidx.compose.material:material:1.2.0-rc01")
+ implementation("androidx.compose.material:material:1.2.0-rc02")
implementation(project(":compose:material3:material3"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation("androidx.compose.ui:ui:1.0.0")
implementation("androidx.compose.ui:ui-text:1.0.0")
implementation("androidx.savedstate:savedstate-ktx:1.2.0-rc01")
diff --git a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/BadgeTest.kt b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/BadgeTest.kt
index 412857f..962da37 100644
--- a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/BadgeTest.kt
+++ b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/BadgeTest.kt
@@ -23,6 +23,7 @@
import androidx.compose.testutils.assertShape
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
@@ -103,7 +104,7 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
@Test
fun badge_noContent_shape() {
- var shape = Shapes.None
+ var shape = RectangleShape
var errorColor = Color.Unspecified
rule.setMaterialContent(lightColorScheme()) {
shape = BadgeTokens.Shape.toShape()
diff --git a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ShapesScreenshotTest.kt b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ShapesScreenshotTest.kt
index fe1fb3b..def51d0 100644
--- a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ShapesScreenshotTest.kt
+++ b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ShapesScreenshotTest.kt
@@ -21,10 +21,12 @@
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.testutils.assertAgainstGolden
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.test.ExperimentalTestApi
@@ -61,7 +63,7 @@
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.verticalScroll(rememberScrollState()),
) {
- Button(shape = Shapes.None, onClick = {}) { Text("None") }
+ Button(shape = RectangleShape, onClick = {}) { Text("None") }
Spacer(modifier = Modifier.height(16.dp))
Button(shape = shapes.extraSmall, onClick = {}) { Text("Extra Small") }
Spacer(modifier = Modifier.height(16.dp))
@@ -73,7 +75,7 @@
Spacer(modifier = Modifier.height(16.dp))
Button(shape = shapes.extraLarge, onClick = {}) { Text("Extra Large") }
Spacer(modifier = Modifier.height(16.dp))
- Button(shape = Shapes.Full, onClick = {}) { Text("Full") }
+ Button(shape = CircleShape, onClick = {}) { Text("Full") }
}
}
}
diff --git a/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidAlertDialog.android.kt b/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidAlertDialog.android.kt
index edb3dca..de055ea5 100644
--- a/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidAlertDialog.android.kt
+++ b/compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidAlertDialog.android.kt
@@ -78,12 +78,12 @@
icon: @Composable (() -> Unit)? = null,
title: @Composable (() -> Unit)? = null,
text: @Composable (() -> Unit)? = null,
- shape: Shape = DialogTokens.ContainerShape.toShape(),
- containerColor: Color = DialogTokens.ContainerColor.toColor(),
- tonalElevation: Dp = DialogTokens.ContainerElevation,
- iconContentColor: Color = DialogTokens.IconColor.toColor(),
- titleContentColor: Color = DialogTokens.SubheadColor.toColor(),
- textContentColor: Color = DialogTokens.SupportingTextColor.toColor(),
+ shape: Shape = AlertDialogDefaults.Shape,
+ containerColor: Color = AlertDialogDefaults.ContainerColor,
+ tonalElevation: Dp = AlertDialogDefaults.TonalElevation,
+ iconContentColor: Color = AlertDialogDefaults.IconContentColor,
+ titleContentColor: Color = AlertDialogDefaults.TitleContentColor,
+ textContentColor: Color = AlertDialogDefaults.TextContentColor,
properties: DialogProperties = DialogProperties()
) {
Dialog(
@@ -119,5 +119,28 @@
}
}
+/**
+ * Contains default values used for [AlertDialog]
+ */
+object AlertDialogDefaults {
+ /** The default shape for alert dialogs */
+ val Shape: Shape @Composable get() = DialogTokens.ContainerShape.toShape()
+
+ /** The default container color for alert dialogs */
+ val ContainerColor: Color @Composable get() = DialogTokens.ContainerColor.toColor()
+
+ /** The default tonal elevation for alert dialogs */
+ val TonalElevation: Dp = DialogTokens.ContainerElevation
+
+ /** The default icon color for alert dialogs */
+ val IconContentColor: Color @Composable get() = DialogTokens.IconColor.toColor()
+
+ /** The default title color for alert dialogs */
+ val TitleContentColor: Color @Composable get() = DialogTokens.SubheadColor.toColor()
+
+ /** The default text color for alert dialogs */
+ val TextContentColor: Color @Composable get() = DialogTokens.SupportingTextColor.toColor()
+}
+
private val ButtonsMainAxisSpacing = 8.dp
private val ButtonsCrossAxisSpacing = 12.dp
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
index 6492d35..3fc7f79d 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
@@ -324,9 +324,9 @@
icons: @Composable RowScope.() -> Unit,
modifier: Modifier = Modifier,
floatingActionButton: @Composable (() -> Unit)? = null,
- containerColor: Color = BottomAppBarTokens.ContainerColor.toColor(),
+ containerColor: Color = BottomAppBarDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
- tonalElevation: Dp = BottomAppBarTokens.ContainerElevation,
+ tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
) = BottomAppBar(
modifier = modifier,
@@ -379,9 +379,9 @@
@Composable
fun BottomAppBar(
modifier: Modifier = Modifier,
- containerColor: Color = BottomAppBarTokens.ContainerColor.toColor(),
+ containerColor: Color = BottomAppBarDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
- tonalElevation: Dp = BottomAppBarTokens.ContainerElevation,
+ tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
content: @Composable RowScope.() -> Unit
) {
@@ -801,6 +801,13 @@
/** Contains default values used for the bottom app bar implementations. */
object BottomAppBarDefaults {
+
+ /** Default color used for [BottomAppBar] container **/
+ val ContainerColor: Color @Composable get() = BottomAppBarTokens.ContainerColor.toColor()
+
+ /** Default elevation used for [BottomAppBar] **/
+ val ContainerElevation: Dp = BottomAppBarTokens.ContainerElevation
+
/**
* Default padding used for [BottomAppBar] when content are default size (24dp) icons in
* [IconButton] that meet the minimum touch target (48.dp).
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Badge.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Badge.kt
index 3fde459..3696f19 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Badge.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Badge.kt
@@ -137,7 +137,7 @@
@Composable
fun Badge(
modifier: Modifier = Modifier,
- containerColor: Color = BadgeTokens.Color.toColor(),
+ containerColor: Color = BadgeDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
content: @Composable (RowScope.() -> Unit)? = null,
) {
@@ -159,7 +159,8 @@
.clip(shape)
.then(
if (content != null)
- Modifier.padding(horizontal = BadgeWithContentHorizontalPadding) else Modifier),
+ Modifier.padding(horizontal = BadgeWithContentHorizontalPadding) else Modifier
+ ),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
@@ -179,6 +180,12 @@
}
}
+/** Default values used for [Badge] implementations. */
+object BadgeDefaults {
+ /** Default container color for a badge. */
+ val ContainerColor: Color @Composable get() = BadgeTokens.Color.toColor()
+}
+
/*@VisibleForTesting*/
// Leading and trailing text padding when a badge is displaying text that is too long to fit in
// a circular badge, e.g. if badge number is greater than 9.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
index 17f98e6..6c39046 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
@@ -52,7 +52,6 @@
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
-import kotlinx.coroutines.flow.collect
/**
* <a href="https://m3.material.io/components/buttons/overview" class="external" target="_blank">Material Design button</a>.
@@ -107,7 +106,7 @@
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
- shape: Shape = FilledButtonTokens.ContainerShape.toShape(),
+ shape: Shape = ButtonDefaults.Shape,
border: BorderStroke? = null,
colors: ButtonColors = ButtonDefaults.buttonColors(),
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
@@ -134,10 +133,11 @@
CompositionLocalProvider(LocalContentColor provides contentColor) {
ProvideTextStyle(value = MaterialTheme.typography.labelLarge) {
Row(
- Modifier.defaultMinSize(
- minWidth = ButtonDefaults.MinWidth,
- minHeight = ButtonDefaults.MinHeight
- )
+ Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
.padding(contentPadding),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
@@ -199,7 +199,7 @@
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(),
- shape: Shape = ElevatedButtonTokens.ContainerShape.toShape(),
+ shape: Shape = ButtonDefaults.ElevatedShape,
border: BorderStroke? = null,
colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
@@ -269,7 +269,7 @@
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(),
- shape: Shape = FilledTonalButtonTokens.ContainerShape.toShape(),
+ shape: Shape = ButtonDefaults.FilledTonalShape,
border: BorderStroke? = null,
colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(),
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
@@ -338,7 +338,7 @@
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ButtonElevation? = null,
- shape: Shape = OutlinedButtonTokens.ContainerShape.toShape(),
+ shape: Shape = ButtonDefaults.OutlinedShape,
border: BorderStroke? = ButtonDefaults.outlinedButtonBorder,
colors: ButtonColors = ButtonDefaults.outlinedButtonColors(),
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
@@ -409,7 +409,7 @@
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ButtonElevation? = null,
- shape: Shape = TextButtonTokens.ContainerShape.toShape(),
+ shape: Shape = ButtonDefaults.TextShape,
border: BorderStroke? = null,
colors: ButtonColors = ButtonDefaults.textButtonColors(),
contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding,
@@ -506,6 +506,22 @@
// TODO(b/201344013): Make sure this value stays up to date until replaced with a token.
val IconSpacing = 8.dp
+ // Shape Defaults
+ /** Default shape for a button. */
+ val Shape: Shape @Composable get() = FilledButtonTokens.ContainerShape.toShape()
+
+ /** Default shape for an elevated button. */
+ val ElevatedShape: Shape @Composable get() = ElevatedButtonTokens.ContainerShape.toShape()
+
+ /** Default shape for a filled tonal button. */
+ val FilledTonalShape: Shape @Composable get() = FilledTonalButtonTokens.ContainerShape.toShape()
+
+ /** Default shape for an outlined button. */
+ val OutlinedShape: Shape @Composable get() = OutlinedButtonTokens.ContainerShape.toShape()
+
+ /** Default shape for a text button. */
+ val TextShape: Shape @Composable get() = TextButtonTokens.ContainerShape.toShape()
+
/**
* Creates a [ButtonColors] that represents the default container and content colors used in a
* [Button].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt
index 6e640bf..d351ba1 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt
@@ -78,7 +78,7 @@
@Composable
fun Card(
modifier: Modifier = Modifier,
- shape: Shape = FilledCardTokens.ContainerShape.toShape(),
+ shape: Shape = CardDefaults.Shape,
border: BorderStroke? = null,
elevation: CardElevation = CardDefaults.cardElevation(),
colors: CardColors = CardDefaults.cardColors(),
@@ -136,7 +136,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledCardTokens.ContainerShape.toShape(),
+ shape: Shape = CardDefaults.Shape,
border: BorderStroke? = null,
elevation: CardElevation = CardDefaults.cardElevation(),
colors: CardColors = CardDefaults.cardColors(),
@@ -186,7 +186,7 @@
@Composable
fun ElevatedCard(
modifier: Modifier = Modifier,
- shape: Shape = ElevatedCardTokens.ContainerShape.toShape(),
+ shape: Shape = CardDefaults.ElevatedShape,
elevation: CardElevation = CardDefaults.elevatedCardElevation(),
colors: CardColors = CardDefaults.elevatedCardColors(),
content: @Composable ColumnScope.() -> Unit
@@ -236,7 +236,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = ElevatedCardTokens.ContainerShape.toShape(),
+ shape: Shape = CardDefaults.ElevatedShape,
elevation: CardElevation = CardDefaults.elevatedCardElevation(),
colors: CardColors = CardDefaults.elevatedCardColors(),
content: @Composable ColumnScope.() -> Unit
@@ -281,7 +281,7 @@
@Composable
fun OutlinedCard(
modifier: Modifier = Modifier,
- shape: Shape = OutlinedCardTokens.ContainerShape.toShape(),
+ shape: Shape = CardDefaults.OutlinedShape,
border: BorderStroke = CardDefaults.outlinedCardBorder(),
elevation: CardElevation = CardDefaults.outlinedCardElevation(),
colors: CardColors = CardDefaults.outlinedCardColors(),
@@ -333,7 +333,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = OutlinedCardTokens.ContainerShape.toShape(),
+ shape: Shape = CardDefaults.OutlinedShape,
border: BorderStroke = CardDefaults.outlinedCardBorder(enabled),
elevation: CardElevation = CardDefaults.outlinedCardElevation(),
colors: CardColors = CardDefaults.outlinedCardColors(),
@@ -420,6 +420,15 @@
* Contains the default values used by all card types.
*/
object CardDefaults {
+ // Shape Defaults
+ /** Default shape for a card. */
+ val Shape: Shape @Composable get() = FilledCardTokens.ContainerShape.toShape()
+
+ /** Default shape for an elevated card. */
+ val ElevatedShape: Shape @Composable get() = ElevatedCardTokens.ContainerShape.toShape()
+
+ /** Default shape for an outlined card. */
+ val OutlinedShape: Shape @Composable get() = OutlinedCardTokens.ContainerShape.toShape()
/**
* Creates a [CardElevation] that will animate between the provided values according to the
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt
index d8c7fc1..8f46b4a 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt
@@ -112,7 +112,7 @@
trailingIcon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ChipElevation? = AssistChipDefaults.assistChipElevation(),
- shape: Shape = AssistChipTokens.ContainerShape.toShape(),
+ shape: Shape = AssistChipDefaults.Shape,
border: ChipBorder? = AssistChipDefaults.assistChipBorder(),
colors: ChipColors = AssistChipDefaults.assistChipColors()
) = Chip(
@@ -184,7 +184,7 @@
trailingIcon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ChipElevation? = AssistChipDefaults.elevatedAssistChipElevation(),
- shape: Shape = AssistChipTokens.ContainerShape.toShape(),
+ shape: Shape = AssistChipDefaults.Shape,
border: ChipBorder? = null,
colors: ChipColors = AssistChipDefaults.elevatedAssistChipColors()
) = Chip(
@@ -267,7 +267,7 @@
trailingIcon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: SelectableChipElevation? = FilterChipDefaults.filterChipElevation(),
- shape: Shape = FilterChipTokens.ContainerShape.toShape(),
+ shape: Shape = FilterChipDefaults.Shape,
border: SelectableChipBorder? = FilterChipDefaults.filterChipBorder(),
colors: SelectableChipColors = FilterChipDefaults.filterChipColors()
) = SelectableChip(
@@ -348,7 +348,7 @@
trailingIcon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: SelectableChipElevation? = FilterChipDefaults.elevatedFilterChipElevation(),
- shape: Shape = FilterChipTokens.ContainerShape.toShape(),
+ shape: Shape = FilterChipDefaults.Shape,
border: SelectableChipBorder? = null,
colors: SelectableChipColors = FilterChipDefaults.elevatedFilterChipColors()
) = SelectableChip(
@@ -433,7 +433,7 @@
trailingIcon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: SelectableChipElevation? = InputChipDefaults.inputChipElevation(),
- shape: Shape = InputChipTokens.ContainerShape.toShape(),
+ shape: Shape = InputChipDefaults.Shape,
border: SelectableChipBorder? = InputChipDefaults.inputChipBorder(),
colors: SelectableChipColors = InputChipDefaults.inputChipColors()
) {
@@ -529,7 +529,7 @@
icon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ChipElevation? = SuggestionChipDefaults.suggestionChipElevation(),
- shape: Shape = SuggestionChipTokens.ContainerShape.toShape(),
+ shape: Shape = SuggestionChipDefaults.Shape,
border: ChipBorder? = SuggestionChipDefaults.suggestionChipBorder(),
colors: ChipColors = SuggestionChipDefaults.suggestionChipColors()
) = Chip(
@@ -598,7 +598,7 @@
icon: @Composable (() -> Unit)? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
elevation: ChipElevation? = SuggestionChipDefaults.elevatedSuggestionChipElevation(),
- shape: Shape = SuggestionChipTokens.ContainerShape.toShape(),
+ shape: Shape = SuggestionChipDefaults.Shape,
border: ChipBorder? = null,
colors: ChipColors = SuggestionChipDefaults.elevatedSuggestionChipColors()
) = Chip(
@@ -829,6 +829,9 @@
*/
@ExperimentalMaterial3Api
object AssistChipDefaults {
+ /** Default shape of an assist chip. */
+ val Shape: Shape @Composable get() = AssistChipTokens.ContainerShape.toShape()
+
/**
* The height applied for an assist chip.
* Note that you can override it by applying Modifier.height directly on a chip.
@@ -1028,6 +1031,8 @@
*/
@ExperimentalMaterial3Api
object FilterChipDefaults {
+ /** Default shape of a filter chip. */
+ val Shape: Shape @Composable get() = FilterChipTokens.ContainerShape.toShape()
/**
* The height applied for a filter chip.
@@ -1036,7 +1041,7 @@
val Height = FilterChipTokens.ContainerHeight
/**
- * The size of an filter chip leading icon.
+ * The size of a filter chip leading icon.
*/
val IconSize = FilterChipTokens.IconSize
@@ -1271,8 +1276,11 @@
*/
@ExperimentalMaterial3Api
object InputChipDefaults {
+ /** Default shape of an input chip. */
+ val Shape: Shape @Composable get() = InputChipTokens.ContainerShape.toShape()
+
/**
- * The height applied for a input chip.
+ * The height applied for an input chip.
* Note that you can override it by applying Modifier.height directly on a chip.
*/
val Height = InputChipTokens.ContainerHeight
@@ -1429,6 +1437,9 @@
*/
@ExperimentalMaterial3Api
object SuggestionChipDefaults {
+ /** Default shape of a suggestion chip. */
+ val Shape: Shape @Composable get() = SuggestionChipTokens.ContainerShape.toShape()
+
/**
* The height applied for a suggestion chip.
* Note that you can override it by applying Modifier.height directly on a chip.
@@ -1436,7 +1447,7 @@
val Height = SuggestionChipTokens.ContainerHeight
/**
- * The size of an suggestion chip icon.
+ * The size of a suggestion chip icon.
*/
// TODO(b/229778210): Read from the tokens when available.
val IconSize = 18.dp
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Divider.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Divider.kt
index 2ee204f..a0c39cc 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Divider.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Divider.kt
@@ -46,8 +46,8 @@
@Composable
fun Divider(
modifier: Modifier = Modifier,
- color: Color = DividerTokens.Color.toColor(),
- thickness: Dp = DividerTokens.Thickness,
+ color: Color = DividerDefaults.Color,
+ thickness: Dp = DividerDefaults.Thickness,
startIndent: Dp = 0.dp
) {
val indentMod = if (startIndent.value != 0f) {
@@ -67,3 +67,12 @@
.background(color = color)
)
}
+
+/** Default values for [Divider] */
+object DividerDefaults {
+ /** Default color of a divider. */
+ val Color: Color @Composable get() = DividerTokens.Color.toColor()
+
+ /** Default thickness of a divider. */
+ val Thickness: Dp = DividerTokens.Thickness
+}
\ No newline at end of file
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/FloatingActionButton.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/FloatingActionButton.kt
index bd8624b..dc56032 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/FloatingActionButton.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/FloatingActionButton.kt
@@ -93,8 +93,8 @@
onClick: () -> Unit,
modifier: Modifier = Modifier,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FabPrimaryTokens.ContainerShape.toShape(),
- containerColor: Color = FabPrimaryTokens.ContainerColor.toColor(),
+ shape: Shape = FloatingActionButtonDefaults.Shape,
+ containerColor: Color = FloatingActionButtonDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
content: @Composable () -> Unit,
@@ -161,8 +161,8 @@
onClick: () -> Unit,
modifier: Modifier = Modifier,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FabPrimarySmallTokens.ContainerShape.toShape(),
- containerColor: Color = FabPrimaryTokens.ContainerColor.toColor(),
+ shape: Shape = FloatingActionButtonDefaults.SmallShape,
+ containerColor: Color = FloatingActionButtonDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
content: @Composable () -> Unit,
@@ -213,8 +213,8 @@
onClick: () -> Unit,
modifier: Modifier = Modifier,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FabPrimaryLargeTokens.ContainerShape.toShape(),
- containerColor: Color = FabPrimaryLargeTokens.ContainerColor.toColor(),
+ shape: Shape = FloatingActionButtonDefaults.LargeShape,
+ containerColor: Color = FloatingActionButtonDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
content: @Composable () -> Unit,
@@ -268,8 +268,8 @@
onClick: () -> Unit,
modifier: Modifier = Modifier,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = ExtendedFabPrimaryTokens.ContainerShape.toShape(),
- containerColor: Color = ExtendedFabPrimaryTokens.ContainerColor.toColor(),
+ shape: Shape = FloatingActionButtonDefaults.ExtendedFabShape,
+ containerColor: Color = FloatingActionButtonDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
content: @Composable RowScope.() -> Unit,
@@ -332,8 +332,8 @@
modifier: Modifier = Modifier,
expanded: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = ExtendedFabPrimaryTokens.ContainerShape.toShape(),
- containerColor: Color = ExtendedFabPrimaryTokens.ContainerColor.toColor(),
+ shape: Shape = FloatingActionButtonDefaults.ExtendedFabShape,
+ containerColor: Color = FloatingActionButtonDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
) {
@@ -411,6 +411,22 @@
* Contains the default values used by [FloatingActionButton]
*/
object FloatingActionButtonDefaults {
+ /** Default shape for a floating action button. */
+ val Shape: Shape @Composable get() = FabPrimaryTokens.ContainerShape.toShape()
+
+ /** Default shape for a small floating action button. */
+ val SmallShape: Shape @Composable get() = FabPrimarySmallTokens.ContainerShape.toShape()
+
+ /** Default shape for a large floating action button. */
+ val LargeShape: Shape @Composable get() = FabPrimaryLargeTokens.ContainerShape.toShape()
+
+ /** Default shape for an extended floating action button. */
+ val ExtendedFabShape: Shape @Composable get() =
+ ExtendedFabPrimaryTokens.ContainerShape.toShape()
+
+ /** Default container color for a floating action button. */
+ val ContainerColor: Color @Composable get() = FabPrimaryTokens.ContainerColor.toColor()
+
/**
* The recommended size of the icon inside a [LargeFloatingActionButton].
*/
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
index 3521aef..fecaaaa 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
@@ -200,7 +200,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledIconButtonTokens.ContainerShape.toShape(),
+ shape: Shape = IconButtonDefaults.FilledShape,
colors: IconButtonColors = IconButtonDefaults.filledIconButtonColors(),
content: @Composable () -> Unit
) = Surface(
@@ -261,7 +261,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledIconButtonTokens.ContainerShape.toShape(),
+ shape: Shape = IconButtonDefaults.FilledShape,
colors: IconButtonColors = IconButtonDefaults.filledTonalIconButtonColors(),
content: @Composable () -> Unit
) = Surface(
@@ -319,7 +319,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledIconButtonTokens.ContainerShape.toShape(),
+ shape: Shape = IconButtonDefaults.FilledShape,
colors: IconToggleButtonColors = IconButtonDefaults.filledIconToggleButtonColors(),
content: @Composable () -> Unit
) = Surface(
@@ -383,7 +383,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledIconButtonTokens.ContainerShape.toShape(),
+ shape: Shape = IconButtonDefaults.FilledShape,
colors: IconToggleButtonColors = IconButtonDefaults.filledTonalIconToggleButtonColors(),
content: @Composable () -> Unit
) = Surface(
@@ -448,7 +448,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = OutlinedIconButtonTokens.ContainerShape.toShape(),
+ shape: Shape = IconButtonDefaults.OutlinedShape,
border: BorderStroke? = IconButtonDefaults.outlinedIconButtonBorder(enabled),
colors: IconButtonColors = IconButtonDefaults.outlinedIconButtonColors(),
content: @Composable () -> Unit
@@ -510,7 +510,7 @@
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = OutlinedIconButtonTokens.ContainerShape.toShape(),
+ shape: Shape = IconButtonDefaults.OutlinedShape,
border: BorderStroke? = IconButtonDefaults.outlinedIconToggleButtonBorder(enabled, checked),
colors: IconToggleButtonColors = IconButtonDefaults.outlinedIconToggleButtonColors(),
content: @Composable () -> Unit
@@ -596,6 +596,13 @@
* Contains the default values used by all icon button types.
*/
object IconButtonDefaults {
+ /** Default shape for a filled icon button. */
+ val FilledShape: Shape @Composable get() = FilledIconButtonTokens.ContainerShape.toShape()
+
+ /** Default shape for an outlined icon button. */
+ val OutlinedShape: Shape @Composable get() =
+ OutlinedIconButtonTokens.ContainerShape.toShape()
+
/**
* Creates a [IconButtonColors] that represents the default colors used in a [IconButton].
*
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
index 85fc603..c468caa 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
@@ -93,9 +93,9 @@
@Composable
fun NavigationBar(
modifier: Modifier = Modifier,
- containerColor: Color = NavigationBarTokens.ContainerColor.toColor(),
+ containerColor: Color = NavigationBarDefaults.ContainerColor,
contentColor: Color = MaterialTheme.colorScheme.contentColorFor(containerColor),
- tonalElevation: Dp = NavigationBarTokens.ContainerElevation,
+ tonalElevation: Dp = NavigationBarDefaults.Elevation,
content: @Composable RowScope.() -> Unit
) {
Surface(
@@ -241,8 +241,18 @@
}
}
+/** Defaults used in [NavigationBar]. */
+object NavigationBarDefaults {
+ /** Default color for a navigation bar. */
+ val ContainerColor: Color @Composable get() = NavigationBarTokens.ContainerColor.toColor()
+
+ /** Default elevation for a navigation bar. */
+ val Elevation: Dp = NavigationBarTokens.ContainerElevation
+}
+
/** Defaults used in [NavigationBarItem]. */
object NavigationBarItemDefaults {
+
/**
* Creates a [NavigationBarItemColors] with the provided colors according to the Material
* specification.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationDrawer.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationDrawer.kt
index d60fdbf..67fd8a8 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationDrawer.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationDrawer.kt
@@ -50,6 +50,7 @@
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.Layout
@@ -261,11 +262,11 @@
modifier: Modifier = Modifier,
drawerState: DrawerState = rememberDrawerState(DrawerValue.Closed),
gesturesEnabled: Boolean = true,
- drawerShape: Shape = NavigationDrawerTokens.ContainerShape.toShape(),
+ drawerShape: Shape = DrawerDefaults.Shape,
drawerTonalElevation: Dp = DrawerDefaults.ModalDrawerElevation,
- drawerContainerColor: Color = NavigationDrawerTokens.ContainerColor.toColor(),
+ drawerContainerColor: Color = DrawerDefaults.ContainerColor,
drawerContentColor: Color = contentColorFor(drawerContainerColor),
- scrimColor: Color = DrawerDefaults.scrimColor,
+ scrimColor: Color = DrawerDefaults.ScrimColor,
content: @Composable () -> Unit
) {
val scope = rememberCoroutineScope()
@@ -354,11 +355,11 @@
modifier: Modifier = Modifier,
drawerState: DrawerState = rememberDrawerState(DrawerValue.Closed),
gesturesEnabled: Boolean = true,
- drawerShape: Shape = NavigationDrawerTokens.ContainerShape.toShape(),
+ drawerShape: Shape = DrawerDefaults.Shape,
drawerTonalElevation: Dp = DrawerDefaults.ModalDrawerElevation,
- drawerContainerColor: Color = NavigationDrawerTokens.ContainerColor.toColor(),
+ drawerContainerColor: Color = DrawerDefaults.ContainerColor,
drawerContentColor: Color = contentColorFor(drawerContainerColor),
- scrimColor: Color = DrawerDefaults.scrimColor,
+ scrimColor: Color = DrawerDefaults.ScrimColor,
content: @Composable () -> Unit
) {
ModalNavigationDrawer(
@@ -411,7 +412,7 @@
modifier: Modifier = Modifier,
drawerState: DrawerState = rememberDrawerState(DrawerValue.Closed),
gesturesEnabled: Boolean = true,
- drawerShape: Shape = Shapes.None,
+ drawerShape: Shape = RectangleShape,
drawerTonalElevation: Dp = DrawerDefaults.DismissibleDrawerElevation,
drawerContainerColor: Color = MaterialTheme.colorScheme.surface,
drawerContentColor: Color = contentColorFor(drawerContainerColor),
@@ -510,7 +511,7 @@
fun PermanentNavigationDrawer(
drawerContent: @Composable ColumnScope.() -> Unit,
modifier: Modifier = Modifier,
- drawerShape: Shape = Shapes.None,
+ drawerShape: Shape = RectangleShape,
drawerTonalElevation: Dp = DrawerDefaults.PermanentDrawerElevation,
drawerContainerColor: Color = MaterialTheme.colorScheme.surface,
drawerContentColor: Color = contentColorFor(drawerContainerColor),
@@ -543,6 +544,8 @@
*/
@ExperimentalMaterial3Api
object DrawerDefaults {
+ /** Default shape for a navigation drawer. */
+ val Shape: Shape @Composable get() = NavigationDrawerTokens.ContainerShape.toShape()
/**
* Default Elevation for drawer container in the [ModalNavigationDrawer] as specified in the
@@ -562,9 +565,13 @@
*/
val DismissibleDrawerElevation = NavigationDrawerTokens.StandardContainerElevation
- val scrimColor: Color
+ /** Default color of the scrim that obscures content when the drawer is open */
+ val ScrimColor: Color
@Composable
get() = PaletteTokens.NeutralVariant0.copy(alpha = NavigationDrawerTokens.ScrimOpacity)
+
+ /** Default container color for a navigation drawer */
+ val ContainerColor: Color @Composable get() = NavigationDrawerTokens.ContainerColor.toColor()
}
/**
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt
index 8616b23..586d240 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt
@@ -94,7 +94,7 @@
@Composable
fun NavigationRail(
modifier: Modifier = Modifier,
- containerColor: Color = NavigationRailTokens.ContainerColor.toColor(),
+ containerColor: Color = NavigationRailDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
header: @Composable (ColumnScope.() -> Unit)? = null,
content: @Composable ColumnScope.() -> Unit
@@ -242,6 +242,12 @@
}
}
+/** Defaults used in [NavigationRail] */
+object NavigationRailDefaults {
+ /** Default container color of a navigation rail. */
+ val ContainerColor: Color @Composable get() = NavigationRailTokens.ContainerColor.toColor()
+}
+
/** Defaults used in [NavigationRailItem]. */
object NavigationRailItemDefaults {
/**
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt
index da196b7..bbdde55 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt
@@ -28,7 +28,6 @@
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.material3.tokens.OutlinedTextFieldTokens
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
@@ -145,7 +144,7 @@
singleLine: Boolean = false,
maxLines: Int = Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = OutlinedTextFieldTokens.ContainerShape.toShape(),
+ shape: Shape = TextFieldDefaults.OutlinedShape,
colors: TextFieldColors = TextFieldDefaults.outlinedTextFieldColors()
) {
// If color is not provided via the text style, use content color as a default
@@ -287,7 +286,7 @@
singleLine: Boolean = false,
maxLines: Int = Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = OutlinedTextFieldTokens.ContainerShape.toShape(),
+ shape: Shape = TextFieldDefaults.OutlinedShape,
colors: TextFieldColors = TextFieldDefaults.outlinedTextFieldColors()
) {
// If color is not provided via the text style, use content color as a default
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
index 3bc4ef1..6cc69449 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
@@ -73,8 +73,8 @@
fun LinearProgressIndicator(
progress: Float,
modifier: Modifier = Modifier,
- color: Color = LinearProgressIndicatorTokens.ActiveIndicatorColor.toColor(),
- trackColor: Color = LinearProgressIndicatorTokens.TrackColor.toColor(),
+ color: Color = ProgressIndicatorDefaults.LinearColor,
+ trackColor: Color = ProgressIndicatorDefaults.LinearTrackColor,
) {
Canvas(
modifier
@@ -105,8 +105,8 @@
@Composable
fun LinearProgressIndicator(
modifier: Modifier = Modifier,
- color: Color = LinearProgressIndicatorTokens.ActiveIndicatorColor.toColor(),
- trackColor: Color = LinearProgressIndicatorTokens.TrackColor.toColor(),
+ color: Color = ProgressIndicatorDefaults.LinearColor,
+ trackColor: Color = ProgressIndicatorDefaults.LinearTrackColor,
) {
val infiniteTransition = rememberInfiniteTransition()
// Fractional position of the 'head' and 'tail' of the two lines drawn, i.e. if the head is 0.8
@@ -230,8 +230,8 @@
fun CircularProgressIndicator(
progress: Float,
modifier: Modifier = Modifier,
- color: Color = CircularProgressIndicatorTokens.ActiveIndicatorColor.toColor(),
- strokeWidth: Dp = CircularProgressIndicatorTokens.ActiveIndicatorWidth
+ color: Color = ProgressIndicatorDefaults.CircularColor,
+ strokeWidth: Dp = ProgressIndicatorDefaults.CircularStrokeWidth
) {
val stroke = with(LocalDensity.current) {
Stroke(width = strokeWidth.toPx(), cap = StrokeCap.Butt)
@@ -265,8 +265,8 @@
@Composable
fun CircularProgressIndicator(
modifier: Modifier = Modifier,
- color: Color = CircularProgressIndicatorTokens.ActiveIndicatorColor.toColor(),
- strokeWidth: Dp = CircularProgressIndicatorTokens.ActiveIndicatorWidth
+ color: Color = ProgressIndicatorDefaults.CircularColor,
+ strokeWidth: Dp = ProgressIndicatorDefaults.CircularStrokeWidth
) {
val stroke = with(LocalDensity.current) {
Stroke(width = strokeWidth.toPx(), cap = StrokeCap.Square)
@@ -397,6 +397,21 @@
* Contains the default values used for [LinearProgressIndicator] and [CircularProgressIndicator].
*/
object ProgressIndicatorDefaults {
+ /** Default color for a linear progress indicator. */
+ val LinearColor: Color @Composable get() =
+ LinearProgressIndicatorTokens.ActiveIndicatorColor.toColor()
+
+ /** Default color for a circular progress indicator. */
+ val CircularColor: Color @Composable get() =
+ CircularProgressIndicatorTokens.ActiveIndicatorColor.toColor()
+
+ /** Default track color for a linear progress indicator. */
+ val LinearTrackColor: Color @Composable get() =
+ LinearProgressIndicatorTokens.TrackColor.toColor()
+
+ /** Default stroke width for a circular progress indicator. */
+ val CircularStrokeWidth = CircularProgressIndicatorTokens.ActiveIndicatorWidth
+
/**
* The default [AnimationSpec] that should be used when animating between progress in a
* determinate progress indicator.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt
index d659c08..1655707 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt
@@ -16,6 +16,7 @@
package androidx.compose.material3
+import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.material3.tokens.ShapeKeyTokens
@@ -24,6 +25,7 @@
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.unit.dp
/**
@@ -51,7 +53,7 @@
* To learn more about shapes, see [Material Design shapes](https://m3.material.io/styles/shape/overview).
*
* @param extraSmall A shape style with 4 same-sized corners whose size are bigger than
- * [Shapes.None] and smaller than [Shapes.small]. By default autocomplete menu, select menu,
+ * [RectangleShape] and smaller than [Shapes.small]. By default autocomplete menu, select menu,
* snackbars, standard menu, and text fields use this shape.
* @param small A shape style with 4 same-sized corners whose size are bigger than
* [Shapes.extraSmall] and smaller than [Shapes.medium]. By default chips use this shape.
@@ -61,24 +63,17 @@
* and smaller than [Shapes.extraLarge]. By default extended FABs, FABs, and navigation drawers use
* this shape.
* @param extraLarge A shape style with 4 same-sized corners whose size are bigger than
- * [Shapes.large] and smaller than [Shapes.Full]. By default large FABs use this shape.
+ * [Shapes.large] and smaller than [CircleShape]. By default large FABs use this shape.
*/
@Immutable
class Shapes(
- val extraSmall: CornerBasedShape = ShapeTokens.CornerExtraSmall,
- val small: CornerBasedShape = ShapeTokens.CornerSmall,
- val medium: CornerBasedShape = ShapeTokens.CornerMedium,
- val large: CornerBasedShape = ShapeTokens.CornerLarge,
- val extraLarge: CornerBasedShape = ShapeTokens.CornerExtraLarge,
+ // Shapes None and Full are omitted as None is a RectangleShape and Full is a CircleShape.
+ val extraSmall: CornerBasedShape = ShapeDefaults.ExtraSmall,
+ val small: CornerBasedShape = ShapeDefaults.Small,
+ val medium: CornerBasedShape = ShapeDefaults.Medium,
+ val large: CornerBasedShape = ShapeDefaults.Large,
+ val extraLarge: CornerBasedShape = ShapeDefaults.ExtraLarge,
) {
- companion object {
- /** A shape with no rounded corners (a rectangle shape). */
- val None = ShapeTokens.CornerNone
-
- /** A shape with fully extended rounded corners (a circular shape). */
- val Full = ShapeTokens.CornerFull
- }
-
/** Returns a copy of this Shapes, optionally overriding some of the values. */
fun copy(
extraSmall: CornerBasedShape = this.extraSmall,
@@ -124,6 +119,26 @@
}
}
+/**
+ * Contains the default values used by [Shapes]
+ */
+object ShapeDefaults {
+ /** Extra small sized corner shape */
+ val ExtraSmall: CornerBasedShape = ShapeTokens.CornerExtraSmall
+
+ /** Small sized corner shape */
+ val Small: CornerBasedShape = ShapeTokens.CornerSmall
+
+ /** Medium sized corner shape */
+ val Medium: CornerBasedShape = ShapeTokens.CornerMedium
+
+ /** Large sized corner shape */
+ val Large: CornerBasedShape = ShapeTokens.CornerLarge
+
+ /** Extra large sized corner shape */
+ val ExtraLarge: CornerBasedShape = ShapeTokens.CornerExtraLarge
+}
+
/** Helper function for component shape tokens. Used to grab the top values of a shape parameter. */
internal fun CornerBasedShape.top(): CornerBasedShape {
return copy(bottomStart = CornerSize(0.0.dp), bottomEnd = CornerSize(0.0.dp))
@@ -145,12 +160,12 @@
ShapeKeyTokens.CornerExtraLargeTop -> extraLarge.top()
ShapeKeyTokens.CornerExtraSmall -> extraSmall
ShapeKeyTokens.CornerExtraSmallTop -> extraSmall.top()
- ShapeKeyTokens.CornerFull -> Shapes.Full
+ ShapeKeyTokens.CornerFull -> CircleShape
ShapeKeyTokens.CornerLarge -> large
ShapeKeyTokens.CornerLargeEnd -> large.end()
ShapeKeyTokens.CornerLargeTop -> large.top()
ShapeKeyTokens.CornerMedium -> medium
- ShapeKeyTokens.CornerNone -> Shapes.None
+ ShapeKeyTokens.CornerNone -> RectangleShape
ShapeKeyTokens.CornerSmall -> small
}
}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Snackbar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Snackbar.kt
index 16dc463..6e6ef5e 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Snackbar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Snackbar.kt
@@ -94,11 +94,11 @@
action: @Composable (() -> Unit)? = null,
dismissAction: @Composable (() -> Unit)? = null,
actionOnNewLine: Boolean = false,
- shape: Shape = SnackbarTokens.ContainerShape.toShape(),
- containerColor: Color = SnackbarTokens.ContainerColor.toColor(),
- contentColor: Color = SnackbarTokens.SupportingTextColor.toColor(),
- actionContentColor: Color = SnackbarTokens.ActionLabelTextColor.toColor(),
- dismissActionContentColor: Color = SnackbarTokens.IconColor.toColor(),
+ shape: Shape = SnackbarDefaults.Shape,
+ containerColor: Color = SnackbarDefaults.Color,
+ contentColor: Color = SnackbarDefaults.ContentColor,
+ actionContentColor: Color = SnackbarDefaults.ActionContentColor,
+ dismissActionContentColor: Color = SnackbarDefaults.DismissActionContentColor,
content: @Composable () -> Unit
) {
Surface(
@@ -196,12 +196,12 @@
snackbarData: SnackbarData,
modifier: Modifier = Modifier,
actionOnNewLine: Boolean = false,
- shape: Shape = SnackbarTokens.ContainerShape.toShape(),
- containerColor: Color = SnackbarTokens.ContainerColor.toColor(),
- contentColor: Color = SnackbarTokens.SupportingTextColor.toColor(),
- actionColor: Color = SnackbarTokens.ActionLabelTextColor.toColor(),
- actionContentColor: Color = SnackbarTokens.ActionLabelTextColor.toColor(),
- dismissActionContentColor: Color = SnackbarTokens.IconColor.toColor(),
+ shape: Shape = SnackbarDefaults.Shape,
+ containerColor: Color = SnackbarDefaults.Color,
+ contentColor: Color = SnackbarDefaults.ContentColor,
+ actionColor: Color = SnackbarDefaults.ActionColor,
+ actionContentColor: Color = SnackbarDefaults.ActionContentColor,
+ dismissActionContentColor: Color = SnackbarDefaults.DismissActionContentColor,
) {
val actionLabel = snackbarData.visuals.actionLabel
val actionComposable: (@Composable () -> Unit)? = if (actionLabel != null) {
@@ -398,6 +398,29 @@
}
}
+/**
+ * Contains the default values used for [Snackbar].
+ */
+object SnackbarDefaults {
+ /** Default shape of a snackbar. */
+ val Shape: Shape @Composable get() = SnackbarTokens.ContainerShape.toShape()
+
+ /** Default color of a snackbar. */
+ val Color: Color @Composable get() = SnackbarTokens.ContainerColor.toColor()
+
+ /** Default content color of a snackbar. */
+ val ContentColor: Color @Composable get() = SnackbarTokens.SupportingTextColor.toColor()
+
+ /** Default action color of a snackbar. */
+ val ActionColor: Color @Composable get() = SnackbarTokens.ActionLabelTextColor.toColor()
+
+ /** Default action content color of a snackbar. */
+ val ActionContentColor: Color @Composable get() = SnackbarTokens.ActionLabelTextColor.toColor()
+
+ /** Default dismiss action content color of a snackbar. */
+ val DismissActionContentColor: Color @Composable get() = SnackbarTokens.IconColor.toColor()
+}
+
private val ContainerMaxWidth = 600.dp
private val HeightToFirstLine = 30.dp
private val HorizontalSpacing = 16.dp
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Surface.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Surface.kt
index 8bd40eb..3a03aa8 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Surface.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Surface.kt
@@ -36,6 +36,7 @@
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.semantics.Role
@@ -97,7 +98,7 @@
@NonRestartableComposable
fun Surface(
modifier: Modifier = Modifier,
- shape: Shape = Shapes.None,
+ shape: Shape = RectangleShape,
color: Color = MaterialTheme.colorScheme.surface,
contentColor: Color = contentColorFor(color),
tonalElevation: Dp = 0.dp,
@@ -201,7 +202,7 @@
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
- shape: Shape = Shapes.None,
+ shape: Shape = RectangleShape,
color: Color = MaterialTheme.colorScheme.surface,
contentColor: Color = contentColorFor(color),
tonalElevation: Dp = 0.dp,
@@ -313,7 +314,7 @@
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
- shape: Shape = Shapes.None,
+ shape: Shape = RectangleShape,
color: Color = MaterialTheme.colorScheme.surface,
contentColor: Color = contentColorFor(color),
tonalElevation: Dp = 0.dp,
@@ -426,7 +427,7 @@
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
- shape: Shape = Shapes.None,
+ shape: Shape = RectangleShape,
color: Color = MaterialTheme.colorScheme.surface,
contentColor: Color = contentColorFor(color),
tonalElevation: Dp = 0.dp,
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TabRow.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TabRow.kt
index c96e11a..ddc2e93 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TabRow.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TabRow.kt
@@ -126,10 +126,8 @@
fun TabRow(
selectedTabIndex: Int,
modifier: Modifier = Modifier,
- containerColor: Color =
- MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ContainerColor),
- contentColor: Color =
- MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ActiveLabelTextColor),
+ containerColor: Color = TabRowDefaults.Color,
+ contentColor: Color = TabRowDefaults.ContentColor,
indicator: @Composable (tabPositions: List<TabPosition>) -> Unit = @Composable { tabPositions ->
TabRowDefaults.Indicator(
Modifier.tabIndicatorOffset(tabPositions[selectedTabIndex])
@@ -216,10 +214,8 @@
fun ScrollableTabRow(
selectedTabIndex: Int,
modifier: Modifier = Modifier,
- containerColor: Color =
- MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ContainerColor),
- contentColor: Color =
- MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ActiveLabelTextColor),
+ containerColor: Color = TabRowDefaults.Color,
+ contentColor: Color = TabRowDefaults.ContentColor,
edgePadding: Dp = ScrollableTabRowPadding,
indicator: @Composable (tabPositions: List<TabPosition>) -> Unit = @Composable { tabPositions ->
TabRowDefaults.Indicator(
@@ -245,7 +241,8 @@
)
}
SubcomposeLayout(
- Modifier.fillMaxWidth()
+ Modifier
+ .fillMaxWidth()
.wrapContentSize(align = Alignment.CenterStart)
.horizontalScroll(scrollState)
.selectableGroup()
@@ -345,6 +342,13 @@
* Contains default implementations and values used for TabRow.
*/
object TabRowDefaults {
+ /** Default color of a tab row. */
+ val Color: Color @Composable get() = PrimaryNavigationTabTokens.ContainerColor.toColor()
+
+ /** Default content color of a tab row. */
+ val ContentColor: Color @Composable get() =
+ PrimaryNavigationTabTokens.ActiveLabelTextColor.toColor()
+
/**
* Default [Divider], which will be positioned at the bottom of the [TabRow], underneath the
* indicator.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextField.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextField.kt
index 883f5ad..6fa1036c 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextField.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextField.kt
@@ -30,7 +30,6 @@
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.TextFieldDefaults.indicatorLine
-import androidx.compose.material3.tokens.FilledTextFieldTokens
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
@@ -171,7 +170,7 @@
singleLine: Boolean = false,
maxLines: Int = Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledTextFieldTokens.ContainerShape.toShape(),
+ shape: Shape = TextFieldDefaults.FilledShape,
colors: TextFieldColors = TextFieldDefaults.textFieldColors()
) {
// If color is not provided via the text style, use content color as a default
@@ -303,7 +302,7 @@
singleLine: Boolean = false,
maxLines: Int = Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
- shape: Shape = FilledTextFieldTokens.ContainerShape.toShape(),
+ shape: Shape = TextFieldDefaults.FilledShape,
colors: TextFieldColors = TextFieldDefaults.textFieldColors()
) {
// If color is not provided via the text style, use content color as a default
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
index 29a500f..5d66ca1 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
@@ -156,6 +156,12 @@
*/
@Immutable
object TextFieldDefaults {
+ /** Default shape for an outlined text field. */
+ val OutlinedShape: Shape @Composable get() = OutlinedTextFieldTokens.ContainerShape.toShape()
+
+ /** Default shape for a filled text field. */
+ val FilledShape: Shape @Composable get() = FilledTextFieldTokens.ContainerShape.toShape()
+
/**
* The default min width applied for a [TextField] and [OutlinedTextField].
* Note that you can override it by applying Modifier.heightIn directly on a text field.
diff --git a/compose/runtime/runtime-saveable/samples/build.gradle b/compose/runtime/runtime-saveable/samples/build.gradle
index d1335e4..6636bac 100644
--- a/compose/runtime/runtime-saveable/samples/build.gradle
+++ b/compose/runtime/runtime-saveable/samples/build.gradle
@@ -31,8 +31,8 @@
compileOnly projectOrArtifact(":annotation:annotation-sampled")
- implementation "androidx.compose.foundation:foundation:1.2.0-rc01"
- implementation "androidx.compose.material:material:1.2.0-rc01"
+ implementation "androidx.compose.foundation:foundation:1.2.0-rc02"
+ implementation "androidx.compose.material:material:1.2.0-rc02"
implementation project(":compose:runtime:runtime")
implementation project(":compose:runtime:runtime-saveable")
}
diff --git a/compose/ui/ui-graphics/samples/build.gradle b/compose/ui/ui-graphics/samples/build.gradle
index 604e896..7540049 100644
--- a/compose/ui/ui-graphics/samples/build.gradle
+++ b/compose/ui/ui-graphics/samples/build.gradle
@@ -32,7 +32,7 @@
api(project(":compose:ui:ui-unit"))
implementation("androidx.compose.foundation:foundation:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation(project(":compose:ui:ui-graphics"))
implementation(project(":compose:ui:ui-util"))
}
diff --git a/compose/ui/ui-inspection/build.gradle b/compose/ui/ui-inspection/build.gradle
index 3da47da..15f27eb 100644
--- a/compose/ui/ui-inspection/build.gradle
+++ b/compose/ui/ui-inspection/build.gradle
@@ -33,7 +33,7 @@
// thus all its transitive dependencies will be present too.
compileOnly(libs.kotlinStdlib)
compileOnly("androidx.inspection:inspection:1.0.0")
- compileOnly("androidx.compose.runtime:runtime:1.2.0-rc01")
+ compileOnly("androidx.compose.runtime:runtime:1.2.0-rc02")
compileOnly(project(":compose:ui:ui"))
// we ignore its transitive dependencies, because ui-inspection should
// depend on them as "compile-only" deps.
diff --git a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/data/SlotTree.kt b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/data/SlotTree.kt
deleted file mode 100644
index 53368d9..0000000
--- a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/data/SlotTree.kt
+++ /dev/null
@@ -1,622 +0,0 @@
-/*
- * Copyright 2022 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.ui.inspection.data
-
-import androidx.annotation.VisibleForTesting
-import androidx.compose.runtime.tooling.CompositionData
-import androidx.compose.runtime.tooling.CompositionGroup
-import androidx.compose.ui.layout.LayoutInfo
-import androidx.compose.ui.layout.positionInWindow
-import androidx.compose.ui.unit.IntRect
-import java.lang.reflect.Field
-import kotlin.math.max
-import kotlin.math.min
-import kotlin.math.roundToInt
-
-/**
- * This is a excerpt of the file: androidx.compose.ui.tooling.data.SlotTree.kt
- *
- * Taken from the version in aosp/2065482/3.
- * That change cannot be merged into 1.2 since the API was frozen before the changes could be
- * finalized.
- *
- * TODO(b/230480839): Remove this file for compose 1.3 after the above change has been merged.
- */
-
-internal data class ParameterInformation(
- val name: String,
- val value: Any?,
- val fromDefault: Boolean,
- val static: Boolean,
- val compared: Boolean,
- val inlineClass: String?,
- val stable: Boolean
-)
-
-/**
- * Source location of the call that produced the call group.
- */
-internal data class SourceLocation(
- /**
- * A 0 offset line number of the source location.
- */
- val lineNumber: Int,
-
- /**
- * Offset into the file. The offset is calculated as the number of UTF-16 code units from
- * the beginning of the file to the first UTF-16 code unit of the call that produced the group.
- */
- val offset: Int,
-
- /**
- * The length of the source code. The length is calculated as the number of UTF-16 code units
- * that that make up the call expression.
- */
- val length: Int,
-
- /**
- * The file name (without path information) of the source file that contains the call that
- * produced the group. A source file names are not guaranteed to be unique, [packageHash] is
- * included to help disambiguate files with duplicate names.
- */
- val sourceFile: String?,
-
- /**
- * A hash code of the package name of the file. This hash is calculated by,
- *
- * `packageName.fold(0) { hash, current -> hash * 31 + current.toInt() }?.absoluteValue`
- *
- * where the package name is the dotted name of the package. This can be used to disambiguate
- * which file is referenced by [sourceFile]. This number is -1 if there was no package hash
- * information generated such as when the file does not contain a package declaration.
- */
- val packageHash: Int
-)
-
-private class CompositionCallStack<T>(
- private val factory: (CompositionGroup, SourceContext, List<T>) -> T?,
- private val contexts: MutableMap<String, Any?>
-) : SourceContext {
- private val stack = ArrayDeque<CompositionGroup>()
- private var currentCallIndex = 0
-
- fun convert(group: CompositionGroup, callIndex: Int, out: MutableList<T>): IntRect {
- val children = mutableListOf<T>()
- var box = emptyBox
- push(group)
- var childCallIndex = 0
- group.compositionGroups.forEach { child ->
- box = box.union(convert(child, childCallIndex, children))
- if (isCall(child)) {
- childCallIndex++
- }
- }
- box = (group.node as? LayoutInfo)?.let { boundsOfLayoutNode(it) } ?: box
- currentCallIndex = callIndex
- bounds = box
- factory(group, this, children)?.let { out.add(it) }
- pop()
- return box
- }
-
- override val name: String?
- get() {
- val info = current.sourceInfo ?: return null
- if (!info.startsWith("C(")) {
- return null
- }
- val endIndex = info.indexOf(')')
- return if (endIndex > 2) info.substring(2, endIndex) else null
- }
-
- override var bounds: IntRect = emptyBox
- private set
-
- override val location: SourceLocation?
- get() {
- val context = parentGroup(1)?.sourceInfo?.let { contextOf(it) } ?: return null
- var parentContext: SourceInformationContext? = context
- var index = 2
- while (index < stack.size && parentContext?.sourceFile == null) {
- parentContext = parentGroup(index++)?.sourceInfo?.let { contextOf(it) }
- }
- return context.sourceLocation(currentCallIndex, parentContext)
- }
-
- override val parameters: List<ParameterInformation>
- get() {
- val group = current
- val context = group.sourceInfo?.let { contextOf(it) } ?: return emptyList()
- val data = mutableListOf<Any?>()
- data.addAll(group.data)
- return extractParameterInfo(data, context)
- }
-
- override val depth: Int
- get() = stack.size
-
- private fun push(group: CompositionGroup) =
- stack.addLast(group)
-
- private fun pop() =
- stack.removeLast()
-
- private val current: CompositionGroup
- get() = stack.last()
-
- private fun parentGroup(parentDepth: Int): CompositionGroup? =
- if (stack.size > parentDepth) stack[stack.size - parentDepth - 1] else null
-
- private fun contextOf(information: String): SourceInformationContext? =
- contexts.getOrPut(information) { sourceInformationContextOf(information) }
- as? SourceInformationContext
-
- private fun isCall(group: CompositionGroup): Boolean =
- group.sourceInfo?.startsWith("C") ?: false
-}
-
-internal val emptyBox = IntRect(0, 0, 0, 0)
-
-private val tokenizer = Regex("(\\d+)|([,])|([*])|([:])|L|(P\\([^)]*\\))|(C(\\(([^)]*)\\))?)|@")
-
-private fun MatchResult.isNumber() = groups[1] != null
-private fun MatchResult.number() = groupValues[1].parseToInt()
-private val MatchResult.text get() = groupValues[0]
-private fun MatchResult.isChar(c: String) = text == c
-private fun MatchResult.isFileName() = groups[4] != null
-private fun MatchResult.isParameterInformation() = groups[5] != null
-private fun MatchResult.isCallWithName() = groups[6] != null
-
-private class SourceLocationInfo(val lineNumber: Int?, val offset: Int?, val length: Int?)
-
-private class SourceInformationContext(
- val sourceFile: String?,
- val packageHash: Int,
- val locations: List<SourceLocationInfo>,
- val repeatOffset: Int,
- val parameters: List<Parameter>?
-) {
- fun sourceLocation(callIndex: Int, parentContext: SourceInformationContext?): SourceLocation? {
- var locationIndex = callIndex
- if (locationIndex >= locations.size && repeatOffset >= 0 && repeatOffset < locations.size) {
- locationIndex =
- (callIndex - repeatOffset) % (locations.size - repeatOffset) + repeatOffset
- }
- if (locationIndex < locations.size) {
- val location = locations[locationIndex]
- return SourceLocation(
- location.lineNumber ?: -1,
- location.offset ?: -1,
- location.length ?: -1,
- sourceFile ?: parentContext?.sourceFile,
- (if (sourceFile == null) parentContext?.packageHash else packageHash) ?: -1
- )
- }
- return null
- }
-}
-
-private val parametersInformationTokenizer = Regex("(\\d+)|,|[!P()]|:([^,!)]+)")
-private val MatchResult.isANumber get() = groups[1] != null
-private val MatchResult.isClassName get() = groups[2] != null
-
-private class ParseError : Exception()
-
-private class Parameter(
- val sortedIndex: Int,
- val inlineClass: String? = null
-)
-
-private fun String.parseToInt(): Int =
- try {
- toInt()
- } catch (_: NumberFormatException) {
- throw ParseError()
- }
-
-private fun String.parseToInt(radix: Int): Int =
- try {
- toInt(radix)
- } catch (_: NumberFormatException) {
- throw ParseError()
- }
-
-// The parameter information follows the following grammar:
-//
-// parameters: (parameter|run) ("," parameter | run)*
-// parameter: sorted-index [":" inline-class]
-// sorted-index: <number>
-// inline-class: <chars not "," or "!">
-// run: "!" <number>
-//
-// The full description of this grammar can be found in the ComposableFunctionBodyTransformer of the
-// compose compiler plugin.
-private fun parseParameters(parameters: String): List<Parameter> {
- var currentResult = parametersInformationTokenizer.find(parameters)
- val expectedSortedIndex = mutableListOf(0, 1, 2, 3)
- var lastAdded = expectedSortedIndex.size - 1
- val result = mutableListOf<Parameter>()
- fun next(): MatchResult? {
- currentResult?.let { currentResult = it.next() }
- return currentResult
- }
-
- fun expectNumber(): Int {
- val mr = currentResult
- if (mr == null || !mr.isANumber) throw ParseError()
- next()
- return mr.text.parseToInt()
- }
-
- fun expectClassName(): String {
- val mr = currentResult
- if (mr == null || !mr.isClassName) throw ParseError()
- next()
- return mr.text
- .substring(1)
- .replacePrefix("c#", "androidx.compose.")
- }
-
- fun expect(value: String) {
- val mr = currentResult
- if (mr == null || mr.text != value) throw ParseError()
- next()
- }
-
- fun isChar(value: String): Boolean {
- val mr = currentResult
- return mr == null || mr.text == value
- }
-
- fun isClassName(): Boolean {
- val mr = currentResult
- return mr != null && mr.isClassName
- }
-
- fun ensureIndexes(index: Int) {
- val missing = index - lastAdded
- if (missing > 0) {
- val minAddAmount = 4
- val amountToAdd = if (missing < minAddAmount) minAddAmount else missing
- repeat(amountToAdd) {
- expectedSortedIndex.add(it + lastAdded + 1)
- }
- lastAdded += amountToAdd
- }
- }
-
- try {
- expect("P")
- expect("(")
- loop@ while (!isChar(")")) {
- when {
- isChar("!") -> {
- // run
- next()
- val count = expectNumber()
- ensureIndexes(result.size + count)
- repeat(count) {
- result.add(Parameter(expectedSortedIndex.first()))
- expectedSortedIndex.removeAt(0)
- }
- }
- isChar(",") -> next()
- else -> {
- val index = expectNumber()
- val inlineClass = if (isClassName()) {
- expectClassName()
- } else null
- result.add(Parameter(index, inlineClass))
- ensureIndexes(index)
- expectedSortedIndex.remove(index)
- }
- }
- }
- expect(")")
-
- // Ensure there are at least as many entries as the highest referenced index.
- while (expectedSortedIndex.size > 0) {
- result.add(Parameter(expectedSortedIndex.first()))
- expectedSortedIndex.removeAt(0)
- }
- return result
- } catch (_: ParseError) {
- return emptyList()
- } catch (_: NumberFormatException) {
- return emptyList()
- }
-}
-
-private fun sourceInformationContextOf(information: String): SourceInformationContext? {
- var currentResult = tokenizer.find(information)
-
- fun next(): MatchResult? {
- currentResult?.let { currentResult = it.next() }
- return currentResult
- }
-
- fun parseLocation(): SourceLocationInfo? {
- var lineNumber: Int? = null
- var offset: Int? = null
- var length: Int? = null
-
- try {
- var mr = currentResult
- if (mr != null && mr.isNumber()) {
- // Offsets are 0 based in the data, we need 1 based.
- lineNumber = mr.number() + 1
- mr = next()
- }
- if (mr != null && mr.isChar("@")) {
- // Offset
- mr = next()
- if (mr == null || !mr.isNumber()) {
- return null
- }
- offset = mr.number()
- mr = next()
- if (mr != null && mr.isChar("L")) {
- mr = next()
- if (mr == null || !mr.isNumber()) {
- return null
- }
- length = mr.number()
- }
- }
- if (lineNumber != null && offset != null && length != null)
- return SourceLocationInfo(lineNumber, offset, length)
- } catch (_: ParseError) {
- return null
- }
- return null
- }
- val sourceLocations = mutableListOf<SourceLocationInfo>()
- var repeatOffset = -1
- var parameters: List<Parameter>? = null
- var sourceFile: String? = null
- var packageHash = -1
- loop@ while (currentResult != null) {
- val mr = currentResult!!
- when {
- mr.isNumber() || mr.isChar("@") -> {
- parseLocation()?.let { sourceLocations.add(it) }
- }
- mr.isChar("C") -> {
- next()
- }
- mr.isCallWithName() -> {
- next()
- }
- mr.isParameterInformation() -> {
- parameters = parseParameters(mr.text)
- next()
- }
- mr.isChar("*") -> {
- repeatOffset = sourceLocations.size
- next()
- }
- mr.isChar(",") -> next()
- mr.isFileName() -> {
- sourceFile = information.substring(mr.range.last + 1)
- val hashText = sourceFile.substringAfterLast("#", "")
- if (hashText.isNotEmpty()) {
- // Remove the hash information
- sourceFile = sourceFile
- .substring(0 until sourceFile.length - hashText.length - 1)
- packageHash = try {
- hashText.parseToInt(36)
- } catch (_: NumberFormatException) {
- -1
- }
- }
- break@loop
- }
- else -> break@loop
- }
- if (mr == currentResult)
- return null
- }
-
- return SourceInformationContext(
- sourceFile = sourceFile,
- packageHash = if (sourceFile != null) packageHash else 0,
- locations = sourceLocations,
- repeatOffset = repeatOffset,
- parameters = parameters,
- )
-}
-
-@VisibleForTesting
-internal fun boundsOfLayoutNode(node: LayoutInfo): IntRect {
- if (!node.isAttached) {
- return IntRect(
- left = 0,
- top = 0,
- right = node.width,
- bottom = node.height
- )
- }
- val position = node.coordinates.positionInWindow()
- val size = node.coordinates.size
- val left = position.x.roundToInt()
- val top = position.y.roundToInt()
- val right = left + size.width
- val bottom = top + size.height
- return IntRect(left = left, top = top, right = right, bottom = bottom)
-}
-
-/**
- * A cache of [SourceInformationContext] that optionally can be specified when using [asLazyTree].
- */
-internal class ContextCache {
-
- /**
- * Clears the cache.
- */
- fun clear() = contexts.clear()
-
- internal val contexts = mutableMapOf<String, Any?>()
-}
-
-/**
- * Context with data for creating group nodes.
- *
- * See the factory argument of [asLazyTree].
- */
-internal interface SourceContext {
- /**
- * The name of the Composable or null if not applicable.
- */
- val name: String?
-
- /**
- * The bounds of the Composable if known.
- */
- val bounds: IntRect
-
- /**
- * The [SourceLocation] of where the Composable was called.
- */
- val location: SourceLocation?
-
- /**
- * The parameters of the Composable.
- */
- val parameters: List<ParameterInformation>
-
- /**
- * The current depth into the [CompositionGroup] tree.
- */
- val depth: Int
-}
-
-/**
- * Return a tree of custom nodes for the slot table.
- *
- * The [factory] method will be called for every [CompositionGroup] in the slot tree and can be
- * used to create custom nodes based on the passed arguments. The [SourceContext] argument gives
- * access to additional information encoded in the [CompositionGroup.sourceInfo].
- *
- * A [cache] can optionally be specified. If a client is calling [asLazyTree] multiple times,
- * this can save some time if the values of [CompositionGroup.sourceInfo] are not unique.
- */
-internal fun <T> CompositionData.asLazyTree(
- factory: (CompositionGroup, SourceContext, List<T>) -> T?,
- cache: ContextCache = ContextCache()
-): T? {
- val group = compositionGroups.firstOrNull() ?: return null
- val callStack = CompositionCallStack(factory, cache.contexts)
- val out = mutableListOf<T>()
- callStack.convert(group, 0, out)
- return out.firstOrNull()
-}
-
-internal fun IntRect.union(other: IntRect): IntRect {
- if (this == emptyBox) return other else if (other == emptyBox) return this
-
- return IntRect(
- left = min(left, other.left),
- top = min(top, other.top),
- bottom = max(bottom, other.bottom),
- right = max(right, other.right)
- )
-}
-
-private const val parameterPrefix = "${'$'}"
-private const val internalFieldPrefix = parameterPrefix + parameterPrefix
-private const val defaultFieldName = "${internalFieldPrefix}default"
-private const val changedFieldName = "${internalFieldPrefix}changed"
-private const val jacocoDataField = "${parameterPrefix}jacoco"
-private const val recomposeScopeNameSuffix = ".RecomposeScopeImpl"
-
-private fun extractParameterInfo(
- data: List<Any?>,
- context: SourceInformationContext?
-): List<ParameterInformation> {
- if (data.isNotEmpty()) {
- val recomposeScope = data.firstOrNull {
- it != null && it.javaClass.name.endsWith(recomposeScopeNameSuffix)
- }
- if (recomposeScope != null) {
- try {
- val blockField = recomposeScope.javaClass.accessibleField("block")
- if (blockField != null) {
- val block = blockField.get(recomposeScope)
- if (block != null) {
- val blockClass = block.javaClass
- val defaultsField = blockClass.accessibleField(defaultFieldName)
- val changedField = blockClass.accessibleField(changedFieldName)
- val default =
- if (defaultsField != null) defaultsField.get(block) as Int else 0
- val changed =
- if (changedField != null) changedField.get(block) as Int else 0
- val fields = blockClass.declaredFields
- .filter {
- it.name.startsWith(parameterPrefix) &&
- !it.name.startsWith(internalFieldPrefix) &&
- !it.name.startsWith(jacocoDataField)
- }.sortedBy { it.name }
- val parameters = mutableListOf<ParameterInformation>()
- val parametersMetadata = context?.parameters ?: emptyList()
- repeat(fields.size) { index ->
- val metadata = if (index < parametersMetadata.size)
- parametersMetadata[index] else Parameter(index)
- if (metadata.sortedIndex >= fields.size) return@repeat
- val field = fields[metadata.sortedIndex]
- field.isAccessible = true
- val value = field.get(block)
- val fromDefault = (1 shl index) and default != 0
- val changedOffset = index * BITS_PER_SLOT + 1
- val parameterChanged = (
- (SLOT_MASK shl changedOffset) and changed
- ) shr changedOffset
- val static = parameterChanged and STATIC_BITS == STATIC_BITS
- val compared = parameterChanged and STATIC_BITS == 0
- val stable = parameterChanged and STABLE_BITS == 0
- parameters.add(
- ParameterInformation(
- name = field.name.substring(1),
- value = value,
- fromDefault = fromDefault,
- static = static,
- compared = compared && !fromDefault,
- inlineClass = metadata.inlineClass,
- stable = stable
- )
- )
- }
- return parameters
- }
- }
- } catch (_: Throwable) {
- }
- }
- }
- return emptyList()
-}
-
-private const val BITS_PER_SLOT = 3
-private const val SLOT_MASK = 0b111
-private const val STATIC_BITS = 0b011
-private const val STABLE_BITS = 0b100
-
-private fun Class<*>.accessibleField(name: String): Field? = declaredFields.firstOrNull {
- it.name == name
-}?.apply { isAccessible = true }
-
-private fun String.replacePrefix(prefix: String, replacement: String) =
- if (startsWith(prefix)) replacement + substring(prefix.length) else this
diff --git a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
index c734c6d..62dd84e 100644
--- a/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
+++ b/compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
@@ -22,11 +22,6 @@
import androidx.compose.runtime.tooling.CompositionGroup
import androidx.compose.ui.R
import androidx.compose.ui.geometry.Offset
-import androidx.compose.ui.inspection.data.ContextCache
-import androidx.compose.ui.inspection.data.ParameterInformation
-import androidx.compose.ui.inspection.data.SourceContext
-import androidx.compose.ui.inspection.data.SourceLocation
-import androidx.compose.ui.inspection.data.asLazyTree
import androidx.compose.ui.layout.GraphicLayerInfo
import androidx.compose.ui.layout.LayoutInfo
import androidx.compose.ui.node.Ref
@@ -34,6 +29,12 @@
import androidx.compose.ui.platform.ViewRootForInspector
import androidx.compose.ui.semantics.SemanticsModifier
import androidx.compose.ui.semantics.getAllSemanticsNodes
+import androidx.compose.ui.tooling.data.ContextCache
+import androidx.compose.ui.tooling.data.ParameterInformation
+import androidx.compose.ui.tooling.data.SourceContext
+import androidx.compose.ui.tooling.data.SourceLocation
+import androidx.compose.ui.tooling.data.UiToolingDataApi
+import androidx.compose.ui.tooling.data.mapTree
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntRect
@@ -99,6 +100,7 @@
/**
* Generator of a tree for the Layout Inspector.
*/
+@OptIn(UiToolingDataApi::class)
class LayoutInspectorTree {
@Suppress("MemberVisibilityCanBePrivate")
var hideSystemNodes = true
@@ -372,13 +374,13 @@
private fun convert(view: View, table: CompositionData): MutableInspectorNode? {
val fakeParent = newNode()
- val group = table.asLazyTree(::convert, contextCache) ?: return null
+ val group = table.mapTree(::convert, contextCache) ?: return null
addToParent(fakeParent, listOf(group), buildFakeChildNodes = true)
return if (belongsToView(fakeParent.layoutNodes, view)) fakeParent else null
}
private fun findParameters(table: CompositionData): InspectorNode? {
- table.asLazyTree(::convert, contextCache) ?: return null
+ table.mapTree(::convert, contextCache) ?: return null
return foundNode
}
diff --git a/compose/ui/ui-test/api/public_plus_experimental_current.txt b/compose/ui/ui-test/api/public_plus_experimental_current.txt
index 719ee4f..6f8155d 100644
--- a/compose/ui/ui-test/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-test/api/public_plus_experimental_current.txt
@@ -266,15 +266,15 @@
method @androidx.compose.ui.test.ExperimentalTestApi public static boolean isFnDown(androidx.compose.ui.test.KeyInjectionScope);
method @androidx.compose.ui.test.ExperimentalTestApi public static boolean isMetaDown(androidx.compose.ui.test.KeyInjectionScope);
method @androidx.compose.ui.test.ExperimentalTestApi public static boolean isShiftDown(androidx.compose.ui.test.KeyInjectionScope);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void keysDown(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDuration);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void keysUp(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDuration);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void pressKey(androidx.compose.ui.test.KeyInjectionScope, long key, optional long pressDuration);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void pressKey(androidx.compose.ui.test.KeyInjectionScope, long key, int times, optional long pressDuration, optional long pauseDuration);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void pressKeys(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pressDuration, optional long pauseDuration);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeyDown(androidx.compose.ui.test.KeyInjectionScope, long key, optional long pauseDuration, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeyToggled(androidx.compose.ui.test.KeyInjectionScope, long key, optional long pauseDuration, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeysDown(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDuration, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
- method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeysToggled(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDuration, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void keysDown(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDurationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void keysUp(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDurationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void pressKey(androidx.compose.ui.test.KeyInjectionScope, long key, optional long pressDurationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void pressKey(androidx.compose.ui.test.KeyInjectionScope, long key, int times, optional long pressDurationMillis, optional long pauseDurationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void pressKeys(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pressDurationMillis, optional long pauseDurationMillis);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeyDown(androidx.compose.ui.test.KeyInjectionScope, long key, optional long pauseDurationMillis, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeyToggled(androidx.compose.ui.test.KeyInjectionScope, long key, optional long pauseDurationMillis, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeysDown(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDurationMillis, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
+ method @androidx.compose.ui.test.ExperimentalTestApi public static void withKeysToggled(androidx.compose.ui.test.KeyInjectionScope, java.util.List<androidx.compose.ui.input.key.Key> keys, optional long pauseDurationMillis, kotlin.jvm.functions.Function1<? super androidx.compose.ui.test.KeyInjectionScope,kotlin.Unit> block);
}
public final class KeyInputHelpersKt {
diff --git a/compose/ui/ui-test/samples/build.gradle b/compose/ui/ui-test/samples/build.gradle
index 1fe96d3..a42ade9 100644
--- a/compose/ui/ui-test/samples/build.gradle
+++ b/compose/ui/ui-test/samples/build.gradle
@@ -34,7 +34,7 @@
implementation(project(":compose:ui:ui-test"))
implementation(project(":compose:ui:ui-test-junit4"))
- implementation("androidx.compose.animation:animation:1.2.0-rc01")
+ implementation("androidx.compose.animation:animation:1.2.0-rc02")
implementation("androidx.compose.material:material:1.1.0")
}
diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/KeyInjectionScope.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/KeyInjectionScope.kt
index f2fc7eb..c0758f4 100644
--- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/KeyInjectionScope.kt
+++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/KeyInjectionScope.kt
@@ -23,14 +23,12 @@
/**
* Default duration of a key press in milliseconds (duration between key down and key up).
*/
-@ExperimentalTestApi
-private const val DefaultKeyPressDuration = 50L // milliseconds
+private const val DefaultKeyPressDurationMillis = 50L
/**
* Default duration of the pause between sequential key presses in milliseconds.
*/
-@ExperimentalTestApi
-private const val DefaultPauseDurationBetweenKeyPresses = 50L // milliseconds
+private const val DefaultPauseDurationBetweenKeyPressesMillis = 50L
/**
* The receiver scope of the key input injection lambda from [performKeyInput].
@@ -138,209 +136,212 @@
}
/**
- * Depresses each of the given [keys] sequentially, with [pauseDuration] milliseconds separating
- * each successive call to [KeyInjectionScope.keyDown].
+ * Depresses each of the given [keys] sequentially, with [pauseDurationMillis] milliseconds
+ * separating each successive call to [KeyInjectionScope.keyDown].
*
* If [keys] contains any duplicate elements, an [IllegalArgumentException] will be thrown.
* If any of the given [keys] is already down, an [IllegalStateException] will be thrown.
*
* @param keys The keys to be depressed.
- * @param pauseDuration The duration separating each key down event in milliseconds.
+ * @param pauseDurationMillis The duration separating each key down event in milliseconds.
*/
// TODO(b/234011835): Refactor this and all functions that take List<Keys> to use vararg instead.
@ExperimentalTestApi
fun KeyInjectionScope.keysDown(
keys: List<Key>,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis
) {
require(keys.size == keys.distinct().size) {
"List of keys must not contain any duplicates."
}
keys.forEachIndexed { idx: Int, key: Key ->
- if (idx != 0) advanceEventTime(pauseDuration)
+ if (idx != 0) advanceEventTime(pauseDurationMillis)
keyDown(key)
}
}
/**
- * Releases each of the given [keys] sequentially, with [pauseDuration] milliseconds separating
- * each successive call to [KeyInjectionScope.keyUp].
+ * Releases each of the given [keys] sequentially, with [pauseDurationMillis] milliseconds
+ * separating each successive call to [KeyInjectionScope.keyUp].
*
* If [keys] contains any duplicate elements, an [IllegalArgumentException] will be thrown.
* If any of the given [keys] is not down, an [IllegalStateException] will be thrown.
*
* @param keys The keys to be released.
- * @param pauseDuration The duration separating each key up event in milliseconds.
+ * @param pauseDurationMillis The duration separating each key up event in milliseconds.
*/
@ExperimentalTestApi
fun KeyInjectionScope.keysUp(
keys: List<Key>,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis
) {
require(keys.size == keys.distinct().size) {
"List of keys must not contain any duplicates."
}
keys.forEachIndexed { idx: Int, key: Key ->
- if (idx != 0) advanceEventTime(pauseDuration)
+ if (idx != 0) advanceEventTime(pauseDurationMillis)
keyUp(key)
}
}
/**
- * Holds down the given [key] for the given [pressDuration] by sending a key down event,
+ * Holds down the given [key] for the given [pressDurationMillis] by sending a key down event,
* advancing the event time and sending a key up event.
*
* If the given key is already down, an [IllegalStateException] will be thrown.
*
* @param key The key to be pressed down.
- * @param pressDuration Duration of press in milliseconds.
+ * @param pressDurationMillis Duration of press in milliseconds.
*/
@ExperimentalTestApi
-fun KeyInjectionScope.pressKey(key: Key, pressDuration: Long = DefaultKeyPressDuration) {
+fun KeyInjectionScope.pressKey(
+ key: Key,
+ pressDurationMillis: Long = DefaultKeyPressDurationMillis
+) {
keyDown(key)
- advanceEventTime(pressDuration)
+ advanceEventTime(pressDurationMillis)
keyUp(key)
}
/**
- * Presses the given [key] the given number of [times], for [pressDuration] milliseconds each time.
- * Pauses for [pauseDuration] milliseconds in between each key press.
+ * Presses the given [key] the given number of [times], for [pressDurationMillis] milliseconds each
+ * time. Pauses for [pauseDurationMillis] milliseconds in between each key press.
*
* If the given [key] is already down an [IllegalStateException] is thrown.
*
* @param key The key to be pressed.
* @param times The number of times to press the given key.
- * @param pressDuration The length of time for which to hold each key press.
- * @param pauseDuration The duration of the pause in between presses.
+ * @param pressDurationMillis The length of time for which to hold each key press.
+ * @param pauseDurationMillis The duration of the pause in between presses.
*/
@ExperimentalTestApi
fun KeyInjectionScope.pressKey(
key: Key,
times: Int,
- pressDuration: Long = DefaultKeyPressDuration,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses
+ pressDurationMillis: Long = DefaultKeyPressDurationMillis,
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis
) = (0 until times).forEach { idx ->
- if (idx != 0) advanceEventTime(pauseDuration)
- pressKey(key, pressDuration)
+ if (idx != 0) advanceEventTime(pauseDurationMillis)
+ pressKey(key, pressDurationMillis)
}
/**
- * Holds down the key each of the given [keys] for the given [pressDuration] in sequence, with
- * [pauseDuration] milliseconds between each press.
+ * Holds down the key each of the given [keys] for the given [pressDurationMillis] in sequence, with
+ * [pauseDurationMillis] milliseconds between each press.
*
* If one of the keys is already down, an [IllegalStateException] will be thrown.
*
* @param keys The list of keys to be pressed down.
- * @param pressDuration Duration of press in milliseconds.
- * @param pauseDuration The duration between presses.
+ * @param pressDurationMillis Duration of press in milliseconds.
+ * @param pauseDurationMillis The duration between presses.
*/
@ExperimentalTestApi
fun KeyInjectionScope.pressKeys(
keys: List<Key>,
- pressDuration: Long = DefaultKeyPressDuration,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses
+ pressDurationMillis: Long = DefaultKeyPressDurationMillis,
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis
) = keys.forEachIndexed { idx: Int, key: Key ->
- if (idx != 0) advanceEventTime(pauseDuration)
- pressKey(key, pressDuration)
+ if (idx != 0) advanceEventTime(pauseDurationMillis)
+ pressKey(key, pressDurationMillis)
}
/**
* Executes the keyboard sequence specified in the given [block], whilst holding down the
- * given [key]. This key must not be used within the [block]. Waits for [pauseDuration]
+ * given [key]. This key must not be used within the [block]. Waits for [pauseDurationMillis]
* milliseconds after pressing the [key] down before it injects the [block]. Waits for the same
* duration after injecting the [block] before it releases the [key].
*
* If the given [key] is already down, an [IllegalStateException] will be thrown.
*
* @param key The key to be held down during injection of the [block].
- * @param pauseDuration The pause in ms after the initial key down and before the final key up.
+ * @param pauseDurationMillis The pause after the initial key down and before the final key up.
* @param block Sequence of KeyInjectionScope methods to be injected with the given key down.
*/
@ExperimentalTestApi
fun KeyInjectionScope.withKeyDown(
key: Key,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses,
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis,
block: KeyInjectionScope.() -> Unit
) {
keyDown(key)
- advanceEventTime(pauseDuration)
+ advanceEventTime(pauseDurationMillis)
block.invoke(this)
- advanceEventTime(pauseDuration)
+ advanceEventTime(pauseDurationMillis)
keyUp(key)
}
/**
* Executes the keyboard sequence specified in the given [block], whilst holding down the each of
- * the given [keys]. These keys must not be used within the [block]. Waits for [pauseDuration]
+ * the given [keys]. These keys must not be used within the [block]. Waits for [pauseDurationMillis]
* milliseconds in between each key down and each key up event.
*
* If [keys] contains any duplicate elements, an [IllegalArgumentException] will be thrown.
* If any of the given [keys] are already down, an [IllegalStateException] will be thrown.
*
* @param keys List of keys to be held down during injection of the [block].
- * @param pauseDuration The pause in milliseconds between each key down and key up event.
+ * @param pauseDurationMillis The pause in milliseconds between each key down and key up event.
* @param block Sequence of KeyInjectionScope methods to be injected with the given keys down.
*/
@ExperimentalTestApi
fun KeyInjectionScope.withKeysDown(
keys: List<Key>,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses,
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis,
block: KeyInjectionScope.() -> Unit
) {
- keysDown(keys, pauseDuration)
- advanceEventTime(pauseDuration)
+ keysDown(keys, pauseDurationMillis)
+ advanceEventTime(pauseDurationMillis)
block.invoke(this)
- advanceEventTime(pauseDuration)
- keysUp(keys, pauseDuration)
+ advanceEventTime(pauseDurationMillis)
+ keysUp(keys, pauseDurationMillis)
}
/**
* Executes the keyboard sequence specified in the given [block], in between presses to the
* given [key]. This key can also be used within the [block], as long as it is not down at the end
- * of the block. There will be [pauseDuration] milliseconds after the initial press and before the
- * final press.
+ * of the block. There will be [pauseDurationMillis] milliseconds after the initial press and before
+ * the final press.
*
* If the given [key] is already down, an [IllegalStateException] will be thrown.
*
* @param key The key to be toggled around the injection of the [block].
- * @param pauseDuration The pause after the initial and before the final key presses.
+ * @param pauseDurationMillis The pause after the initial and before the final key presses.
* @param block Sequence of KeyInjectionScope methods to be injected with the given key down.
*/
@ExperimentalTestApi
fun KeyInjectionScope.withKeyToggled(
key: Key,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses,
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis,
block: KeyInjectionScope.() -> Unit
) {
pressKey(key)
- advanceEventTime(pauseDuration)
+ advanceEventTime(pauseDurationMillis)
block.invoke(this)
- advanceEventTime(pauseDuration)
+ advanceEventTime(pauseDurationMillis)
pressKey(key)
}
/**
* Executes the keyboard sequence specified in the given [block], in between presses to the
* given [keys]. These keys can also be used within the [block], as long as they are not down at
- * the end of the block. There will be [pauseDuration] milliseconds after the initial press and
- * before the final press.
+ * the end of the block. There will be [pauseDurationMillis] milliseconds after the initial press
+ * and before the final press.
*
* If any of the given [keys] are already down, an [IllegalStateException] will be thrown.
*
* @param keys The keys to be toggled around the injection of the [block].
- * @param pauseDuration The pause after the initial and before the final key presses.
+ * @param pauseDurationMillis The pause after the initial and before the final key presses.
* @param block Sequence of KeyInjectionScope methods to be injected with the given keys down.
*/
@ExperimentalTestApi
fun KeyInjectionScope.withKeysToggled(
keys: List<Key>,
- pauseDuration: Long = DefaultPauseDurationBetweenKeyPresses,
+ pauseDurationMillis: Long = DefaultPauseDurationBetweenKeyPressesMillis,
block: KeyInjectionScope.() -> Unit
) {
pressKeys(keys)
- advanceEventTime(pauseDuration)
+ advanceEventTime(pauseDurationMillis)
block.invoke(this)
- advanceEventTime(pauseDuration)
+ advanceEventTime(pauseDurationMillis)
pressKeys(keys)
}
diff --git a/compose/ui/ui-text-google-fonts/build.gradle b/compose/ui/ui-text-google-fonts/build.gradle
index 5f637d7..a28ab48 100644
--- a/compose/ui/ui-text-google-fonts/build.gradle
+++ b/compose/ui/ui-text-google-fonts/build.gradle
@@ -29,7 +29,7 @@
implementation(libs.kotlinStdlib)
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation(project(":compose:ui:ui-text"))
implementation("androidx.core:core:1.8.0")
diff --git a/compose/ui/ui-text/build.gradle b/compose/ui/ui-text/build.gradle
index 485e041..2a8df57 100644
--- a/compose/ui/ui-text/build.gradle
+++ b/compose/ui/ui-text/build.gradle
@@ -40,8 +40,8 @@
api("androidx.annotation:annotation:1.1.0")
// when updating the runtime version please also update the runtime-saveable version
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
- implementation("androidx.compose.runtime:runtime-saveable:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
+ implementation("androidx.compose.runtime:runtime-saveable:1.2.0-rc02")
implementation(project(":compose:ui:ui-util"))
implementation(libs.kotlinStdlib)
diff --git a/compose/ui/ui-text/samples/build.gradle b/compose/ui/ui-text/samples/build.gradle
index 4d1e039..e831541 100644
--- a/compose/ui/ui-text/samples/build.gradle
+++ b/compose/ui/ui-text/samples/build.gradle
@@ -32,7 +32,7 @@
implementation("androidx.compose.foundation:foundation:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation(project(":compose:ui:ui"))
implementation(project(":compose:ui:ui-text"))
}
diff --git a/compose/ui/ui-tooling-data/api/public_plus_experimental_current.txt b/compose/ui/ui-tooling-data/api/public_plus_experimental_current.txt
index f8fb257..7ff92d0 100644
--- a/compose/ui/ui-tooling-data/api/public_plus_experimental_current.txt
+++ b/compose/ui/ui-tooling-data/api/public_plus_experimental_current.txt
@@ -6,6 +6,11 @@
property public java.util.List<androidx.compose.ui.tooling.data.ParameterInformation> parameters;
}
+ @androidx.compose.ui.tooling.data.UiToolingDataApi public final class ContextCache {
+ ctor public ContextCache();
+ method public void clear();
+ }
+
@androidx.compose.ui.tooling.data.UiToolingDataApi public abstract sealed class Group {
method public final androidx.compose.ui.unit.IntRect getBox();
method public final java.util.Collection<androidx.compose.ui.tooling.data.Group> getChildren();
@@ -74,6 +79,20 @@
public final class SlotTreeKt {
method @androidx.compose.ui.tooling.data.UiToolingDataApi public static androidx.compose.ui.tooling.data.Group asTree(androidx.compose.runtime.tooling.CompositionData);
method @androidx.compose.ui.tooling.data.UiToolingDataApi public static String? getPosition(androidx.compose.ui.tooling.data.Group);
+ method @androidx.compose.ui.tooling.data.UiToolingDataApi public static <T> T? mapTree(androidx.compose.runtime.tooling.CompositionData, kotlin.jvm.functions.Function3<? super androidx.compose.runtime.tooling.CompositionGroup,? super androidx.compose.ui.tooling.data.SourceContext,? super java.util.List<? extends T>,? extends T> factory, optional androidx.compose.ui.tooling.data.ContextCache cache);
+ }
+
+ @androidx.compose.ui.tooling.data.UiToolingDataApi public interface SourceContext {
+ method public androidx.compose.ui.unit.IntRect getBounds();
+ method public int getDepth();
+ method public androidx.compose.ui.tooling.data.SourceLocation? getLocation();
+ method public String? getName();
+ method public java.util.List<androidx.compose.ui.tooling.data.ParameterInformation> getParameters();
+ property public abstract androidx.compose.ui.unit.IntRect bounds;
+ property public abstract int depth;
+ property public abstract androidx.compose.ui.tooling.data.SourceLocation? location;
+ property public abstract String? name;
+ property public abstract java.util.List<androidx.compose.ui.tooling.data.ParameterInformation> parameters;
}
@androidx.compose.ui.tooling.data.UiToolingDataApi public final class SourceLocation {
diff --git a/compose/ui/ui-tooling-data/build.gradle b/compose/ui/ui-tooling-data/build.gradle
index 54054bf..b549688 100644
--- a/compose/ui/ui-tooling-data/build.gradle
+++ b/compose/ui/ui-tooling-data/build.gradle
@@ -31,7 +31,7 @@
api "androidx.annotation:annotation:1.1.0"
- api("androidx.compose.runtime:runtime:1.2.0-rc01")
+ api("androidx.compose.runtime:runtime:1.2.0-rc02")
api(project(":compose:ui:ui"))
androidTestImplementation project(":compose:ui:ui-test-junit4")
diff --git a/compose/ui/ui-tooling-data/src/androidTest/java/androidx/compose/ui/tooling/data/BoundsTest.kt b/compose/ui/ui-tooling-data/src/androidTest/java/androidx/compose/ui/tooling/data/BoundsTest.kt
index 39ad39e..eb44e3a 100644
--- a/compose/ui/ui-tooling-data/src/androidTest/java/androidx/compose/ui/tooling/data/BoundsTest.kt
+++ b/compose/ui/ui-tooling-data/src/androidTest/java/androidx/compose/ui/tooling/data/BoundsTest.kt
@@ -28,10 +28,12 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.MediumTest
+import com.google.common.truth.Truth.assertThat
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
@@ -89,6 +91,35 @@
}
@Test
+ fun testBoundsWithoutParsingParameters() {
+ val lefts = mutableMapOf<String, Dp>()
+ val slotTableRecord = CompositionDataRecord.create()
+ show {
+ Inspectable(slotTableRecord) {
+ Box {
+ Column(Modifier.padding(10.dp)) {
+ Text("Hello", Modifier.padding(5.dp))
+ }
+ }
+ }
+ }
+
+ activityTestRule.runOnUiThread {
+ slotTableRecord.store.first().mapTree<Any>({ _, context, _ ->
+ if (context.location?.sourceFile == "BoundsTest.kt") {
+ with(Density(activityTestRule.activity)) {
+ lefts[context.name!!] = context.bounds.left.toDp()
+ }
+ }
+ })
+
+ assertThat(lefts["Box"]?.value).isWithin(1f).of(0f)
+ assertThat(lefts["Column"]?.value).isWithin(1f).of(10f)
+ assertThat(lefts["Text"]?.value).isWithin(0.5f).of(15f)
+ }
+ }
+
+ @Test
fun testBoundWithConstraints() {
val slotTableRecord = CompositionDataRecord.create()
show {
diff --git a/compose/ui/ui-tooling-data/src/main/java/androidx/compose/ui/tooling/data/SlotTree.kt b/compose/ui/ui-tooling-data/src/main/java/androidx/compose/ui/tooling/data/SlotTree.kt
index 3544c66..17e2f7c 100644
--- a/compose/ui/ui-tooling-data/src/main/java/androidx/compose/ui/tooling/data/SlotTree.kt
+++ b/compose/ui/ui-tooling-data/src/main/java/androidx/compose/ui/tooling/data/SlotTree.kt
@@ -222,6 +222,25 @@
}
return null
}
+
+ fun sourceLocation(callIndex: Int, parentContext: SourceInformationContext?): SourceLocation? {
+ var locationIndex = callIndex
+ if (locationIndex >= locations.size && repeatOffset >= 0 && repeatOffset < locations.size) {
+ locationIndex =
+ (callIndex - repeatOffset) % (locations.size - repeatOffset) + repeatOffset
+ }
+ if (locationIndex < locations.size) {
+ val location = locations[locationIndex]
+ return SourceLocation(
+ location.lineNumber ?: -1,
+ location.offset ?: -1,
+ location.length ?: -1,
+ sourceFile ?: parentContext?.sourceFile,
+ (if (sourceFile == null) parentContext?.packageHash else packageHash) ?: -1
+ )
+ }
+ return null
+ }
}
private val parametersInformationTokenizer = Regex("(\\d+)|,|[!P()]|:([^,!)]+)")
@@ -358,7 +377,7 @@
@UiToolingDataApi
private fun sourceInformationContextOf(
information: String,
- parent: SourceInformationContext?
+ parent: SourceInformationContext? = null
): SourceInformationContext? {
var currentResult = tokenizer.find(information)
@@ -538,6 +557,160 @@
return IntRect(left = left, top = top, right = right, bottom = bottom)
}
+@UiToolingDataApi
+private class CompositionCallStack<T>(
+ private val factory: (CompositionGroup, SourceContext, List<T>) -> T?,
+ private val contexts: MutableMap<String, Any?>
+) : SourceContext {
+ private val stack = ArrayDeque<CompositionGroup>()
+ private var currentCallIndex = 0
+
+ fun convert(group: CompositionGroup, callIndex: Int, out: MutableList<T>): IntRect {
+ val children = mutableListOf<T>()
+ var box = emptyBox
+ push(group)
+ var childCallIndex = 0
+ group.compositionGroups.forEach { child ->
+ box = box.union(convert(child, childCallIndex, children))
+ if (isCall(child)) {
+ childCallIndex++
+ }
+ }
+ box = (group.node as? LayoutInfo)?.let { boundsOfLayoutNode(it) } ?: box
+ currentCallIndex = callIndex
+ bounds = box
+ factory(group, this, children)?.let { out.add(it) }
+ pop()
+ return box
+ }
+
+ override val name: String?
+ get() {
+ val info = current.sourceInfo ?: return null
+ if (!info.startsWith("C(")) {
+ return null
+ }
+ val endIndex = info.indexOf(')')
+ return if (endIndex > 2) info.substring(2, endIndex) else null
+ }
+
+ override var bounds: IntRect = emptyBox
+ private set
+
+ override val location: SourceLocation?
+ get() {
+ val context = parentGroup(1)?.sourceInfo?.let { contextOf(it) } ?: return null
+ var parentContext: SourceInformationContext? = context
+ var index = 2
+ while (index < stack.size && parentContext?.sourceFile == null) {
+ parentContext = parentGroup(index++)?.sourceInfo?.let { contextOf(it) }
+ }
+ return context.sourceLocation(currentCallIndex, parentContext)
+ }
+
+ override val parameters: List<ParameterInformation>
+ get() {
+ val group = current
+ val context = group.sourceInfo?.let { contextOf(it) } ?: return emptyList()
+ val data = mutableListOf<Any?>()
+ data.addAll(group.data)
+ return extractParameterInfo(data, context)
+ }
+
+ override val depth: Int
+ get() = stack.size
+
+ private fun push(group: CompositionGroup) =
+ stack.addLast(group)
+
+ private fun pop() =
+ stack.removeLast()
+
+ private val current: CompositionGroup
+ get() = stack.last()
+
+ private fun parentGroup(parentDepth: Int): CompositionGroup? =
+ if (stack.size > parentDepth) stack[stack.size - parentDepth - 1] else null
+
+ private fun contextOf(information: String): SourceInformationContext? =
+ contexts.getOrPut(information) { sourceInformationContextOf(information) }
+ as? SourceInformationContext
+
+ private fun isCall(group: CompositionGroup): Boolean =
+ group.sourceInfo?.startsWith("C") ?: false
+}
+
+/**
+ * A cache of [SourceInformationContext] that optionally can be specified when using [mapTree].
+ */
+@UiToolingDataApi
+class ContextCache {
+ /**
+ * Clears the cache.
+ */
+ fun clear() {
+ contexts.clear()
+ }
+
+ internal val contexts = mutableMapOf<String, Any?>()
+}
+
+/**
+ * Context with data for creating group nodes.
+ *
+ * See the factory argument of [mapTree].
+ */
+@UiToolingDataApi
+interface SourceContext {
+ /**
+ * The name of the Composable or null if not applicable.
+ */
+ val name: String?
+
+ /**
+ * The bounds of the Composable if known.
+ */
+ val bounds: IntRect
+
+ /**
+ * The [SourceLocation] of where the Composable was called.
+ */
+ val location: SourceLocation?
+
+ /**
+ * The parameters of the Composable.
+ */
+ val parameters: List<ParameterInformation>
+
+ /**
+ * The current depth into the [CompositionGroup] tree.
+ */
+ val depth: Int
+}
+
+/**
+ * Return a tree of custom nodes for the slot table.
+ *
+ * The [factory] method will be called for every [CompositionGroup] in the slot tree and can be
+ * used to create custom nodes based on the passed arguments. The [SourceContext] argument gives
+ * access to additional information encoded in the [CompositionGroup.sourceInfo].
+ * A return of null from [factory] means that the entire subtree will be ignored.
+ *
+ * A [cache] can optionally be specified. If a client is calling [mapTree] multiple times,
+ * this can save some time if the values of [CompositionGroup.sourceInfo] are not unique.
+ */
+@UiToolingDataApi
+fun <T> CompositionData.mapTree(
+ factory: (CompositionGroup, SourceContext, List<T>) -> T?,
+ cache: ContextCache = ContextCache()
+): T? {
+ val group = compositionGroups.firstOrNull() ?: return null
+ val callStack = CompositionCallStack(factory, cache.contexts)
+ val out = mutableListOf<T>()
+ callStack.convert(group, 0, out)
+ return out.firstOrNull()
+}
+
/**
* Return a group tree for for the slot table that represents the entire content of the slot
* table.
diff --git a/compose/ui/ui-unit/samples/build.gradle b/compose/ui/ui-unit/samples/build.gradle
index 253a1ed..323456e 100644
--- a/compose/ui/ui-unit/samples/build.gradle
+++ b/compose/ui/ui-unit/samples/build.gradle
@@ -30,7 +30,7 @@
compileOnly(project(":annotation:annotation-sampled"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation(project(":compose:ui:ui"))
implementation(project(":compose:ui:ui-unit"))
}
diff --git a/compose/ui/ui-viewbinding/samples/build.gradle b/compose/ui/ui-viewbinding/samples/build.gradle
index 626cf9b..720d3895 100644
--- a/compose/ui/ui-viewbinding/samples/build.gradle
+++ b/compose/ui/ui-viewbinding/samples/build.gradle
@@ -28,7 +28,7 @@
implementation(libs.kotlinStdlib)
compileOnly(project(":annotation:annotation-sampled"))
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation(project(":compose:ui:ui"))
implementation(project(":compose:ui:ui-viewbinding"))
// Used when creating layouts that contain a FragmentContainerView
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index a5c8c94..8485112 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -40,8 +40,8 @@
implementation(libs.kotlinCoroutinesCore)
// when updating the runtime version please also update the runtime-saveable version
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
- api("androidx.compose.runtime:runtime-saveable:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
+ api("androidx.compose.runtime:runtime-saveable:1.2.0-rc02")
api(project(":compose:ui:ui-geometry"))
api(project(":compose:ui:ui-graphics"))
diff --git a/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/recyclerview/RecyclerViewInteropDemoFragment.kt b/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/recyclerview/RecyclerViewInteropDemoFragment.kt
index bbf07df..08b683d 100644
--- a/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/recyclerview/RecyclerViewInteropDemoFragment.kt
+++ b/compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/recyclerview/RecyclerViewInteropDemoFragment.kt
@@ -58,7 +58,8 @@
super.onViewCreated(view, savedInstanceState)
recyclerView = view.findViewById(R.id.recyclerView)
recyclerView.adapter = MainAdapter()
- recyclerView.layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
+ recyclerView.layoutManager =
+ LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false)
if (!interopOn) {
recyclerView.isPoolingContainer = false
}
@@ -93,7 +94,10 @@
Text("Row #${index + 1}", Modifier.padding(horizontal = 8.dp))
LazyRow {
items(25) { colIdx ->
- Column(Modifier.padding(8.dp).size(96.dp, 144.dp)) {
+ Column(
+ Modifier
+ .padding(8.dp)
+ .size(96.dp, 144.dp)) {
Box(
Modifier
.fillMaxWidth()
diff --git a/compose/ui/ui/samples/build.gradle b/compose/ui/ui/samples/build.gradle
index 6db2727..53329b8 100644
--- a/compose/ui/ui/samples/build.gradle
+++ b/compose/ui/ui/samples/build.gradle
@@ -32,10 +32,10 @@
compileOnly(project(":annotation:annotation-sampled"))
- implementation("androidx.compose.animation:animation-core:1.2.0-rc01")
+ implementation("androidx.compose.animation:animation-core:1.2.0-rc02")
implementation("androidx.compose.foundation:foundation-layout:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
- implementation("androidx.compose.runtime:runtime:1.2.0-rc01")
+ implementation("androidx.compose.runtime:runtime:1.2.0-rc02")
implementation(project(":compose:ui:ui"))
}
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/BlurTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/BlurTest.kt
index a4a5d75..f4f5968 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/BlurTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/BlurTest.kt
@@ -39,7 +39,9 @@
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.unit.dp
import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
+import androidx.test.filters.SmallTest
import androidx.test.screenshot.matchers.MSSIMMatcher
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
@@ -55,6 +57,7 @@
val rule = createComposeRule()
@Test
+ @SmallTest
fun testNoopBlur() {
// If we are blurring with a 0 pixel radius and we are not clipping
// the blurred result, this should return the default Modifier
@@ -135,6 +138,7 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.S)
@Test
+ @MediumTest
fun testRectBoundedBlur() {
// Any bounded edge treatment should clip the underlying graphicsLayer and use
// TileMode.Clamp in the corresponding BlurEffect
@@ -148,6 +152,7 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.S)
@Test
+ @MediumTest
fun testUnboundedBlur() {
// Any unbounded edge treatment should not clip the underlying graphicsLayer and use
// TileMode.Decal in the corresponding BlurEffect
@@ -161,6 +166,7 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.S)
@Test
+ @MediumTest
fun testCircleBoundedBlur() {
testBlurEdgeTreatment(
BlurredEdgeTreatment(CircleShape),
@@ -171,11 +177,13 @@
}
@Test
+ @SmallTest
fun testRectangleBlurredEdgeTreatmentHasShape() {
assertNotNull(BlurredEdgeTreatment.Rectangle.shape)
}
@Test
+ @SmallTest
fun testUnboundedBlurredEdgeTreatmentDoesNotHaveShape() {
assertNull(BlurredEdgeTreatment.Unbounded.shape)
}
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/TempListUtils.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/TempListUtils.kt
index d5c4d7c..1036bb6 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/TempListUtils.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/TempListUtils.kt
@@ -32,6 +32,7 @@
* access in an efficient way, and this method may actually be a lot slower. Only use for
* collections that are created by code we control and are known to support random access.
*/
+@Suppress("BanInlineOptIn")
@OptIn(ExperimentalContracts::class)
internal inline fun <T, R> List<T>.fastZipWithNext(transform: (T, T) -> R): List<R> {
contract { callsInPlace(transform) }
@@ -61,6 +62,7 @@
* @param [operation] function that takes current accumulator value and an element,
* and calculates the next accumulator value.
*/
+@Suppress("BanInlineOptIn")
@OptIn(ExperimentalContracts::class)
internal inline fun <S, T : S> List<T>.fastReduce(operation: (acc: S, T) -> S): S {
contract { callsInPlace(operation) }
@@ -84,6 +86,7 @@
* access in an efficient way, and this method may actually be a lot slower. Only use for
* collections that are created by code we control and are known to support random access.
*/
+@Suppress("BanInlineOptIn")
@OptIn(ExperimentalContracts::class)
internal inline fun <T, K, V> List<T>.fastAssociate(transform: (T) -> Pair<K, V>): Map<K, V> {
contract { callsInPlace(transform) }
@@ -103,6 +106,7 @@
* access in an efficient way, and this method may actually be a lot slower. Only use for
* collections that are created by code we control and are known to support random access.
*/
+@Suppress("BanInlineOptIn")
@OptIn(ExperimentalContracts::class)
internal inline fun <T, R, V> List<T>.fastZip(
other: List<R>,
@@ -125,6 +129,7 @@
* access in an efficient way, and this method may actually be a lot slower. Only use for
* collections that are created by code we control and are known to support random access.
*/
+@Suppress("BanInlineOptIn")
@OptIn(ExperimentalContracts::class)
internal inline fun <T, R> List<T>.fastMapNotNull(transform: (T) -> R?): List<R> {
contract { callsInPlace(transform) }
diff --git a/concurrent/concurrent-futures/src/main/java/androidx/concurrent/futures/CallbackToFutureAdapter.java b/concurrent/concurrent-futures/src/main/java/androidx/concurrent/futures/CallbackToFutureAdapter.java
index 67ed8ae..fa73e01 100644
--- a/concurrent/concurrent-futures/src/main/java/androidx/concurrent/futures/CallbackToFutureAdapter.java
+++ b/concurrent/concurrent-futures/src/main/java/androidx/concurrent/futures/CallbackToFutureAdapter.java
@@ -358,6 +358,7 @@
super(message);
}
+ @SuppressWarnings("BanSynchronizedMethods")
@Override
public synchronized Throwable fillInStackTrace() {
return this; // no stack trace, wouldn't be useful anyway
diff --git a/development/update_studio.sh b/development/update_studio.sh
index b4abf8f..f17e998 100755
--- a/development/update_studio.sh
+++ b/development/update_studio.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Get versions
-AGP_VERSION=${1:-7.4.0-alpha01}
-STUDIO_VERSION_STRING=${2:-"Android Studio Electric Eel (2022.1.1) Canary 1"}
+AGP_VERSION=${1:-7.4.0-alpha05}
+STUDIO_VERSION_STRING=${2:-"Android Studio Electric Eel (2022.1.1) Canary 5"}
STUDIO_IFRAME_LINK=`curl "https://developer.android.com/studio/archive.html" | grep iframe | sed "s/.*src=\"\([a-zA-Z0-9\/\._]*\)\".*/https:\/\/android-dot-devsite-v2-prod.appspot.com\1/g"`
STUDIO_LINK=`curl -s $STUDIO_IFRAME_LINK | grep -C30 "$STUDIO_VERSION_STRING" | grep Linux | tail -n 1 | sed 's/.*a href="\(.*\).*"/\1/g'`
STUDIO_VERSION=`echo $STUDIO_LINK | sed "s/.*ide-zips\/\(.*\)\/android-studio-.*/\1/g"`
@@ -36,7 +36,7 @@
| tail -n +3 \
| head -n -1)
-ATP_VERSION=${4:-0.0.8-alpha07}
+ATP_VERSION=${4:-0.0.8-alpha08}
ARTIFACTS_TO_DOWNLOAD+="com.google.testing.platform:android-test-plugin:$ATP_VERSION,"
ARTIFACTS_TO_DOWNLOAD+="com.google.testing.platform:launcher:$ATP_VERSION,"
ARTIFACTS_TO_DOWNLOAD+="com.google.testing.platform:android-driver-instrumentation:$ATP_VERSION,"
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index b4fb2e8..1f6319c 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,13 +2,13 @@
# -----------------------------------------------------------------------------
# All of the following should be updated in sync.
# -----------------------------------------------------------------------------
-androidGradlePlugin = "7.4.0-alpha01"
+androidGradlePlugin = "7.4.0-alpha05"
# NOTE: When updating the lint version we also need to update the `api` version
# supported by `IssueRegistry`'s.' For e.g. r.android.com/1331903
-androidLint = "30.4.0-alpha01"
+androidLint = "30.4.0-alpha05"
# Once you have a chosen version of AGP to upgrade to, go to
# https://developer.android.com/studio/archive and find the matching version of Studio.
-androidStudio = "2022.1.1.1"
+androidStudio = "2022.1.1.5"
# -----------------------------------------------------------------------------
androidGradlePluginMin = "7.0.4"
diff --git a/leanback/leanback/api/current.txt b/leanback/leanback/api/current.txt
index bdf0261..fb9da3f 100644
--- a/leanback/leanback/api/current.txt
+++ b/leanback/leanback/api/current.txt
@@ -456,7 +456,7 @@
method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
method @Deprecated protected void onProvideFragmentTransitions();
method @Deprecated public int onProvideTheme();
method @Deprecated public void onResume();
@@ -479,26 +479,26 @@
public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment {
ctor public GuidedStepSupportFragment();
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!, int);
- method public static int addAsRoot(androidx.fragment.app.FragmentActivity!, androidx.leanback.app.GuidedStepSupportFragment!, int);
+ method public static int add(androidx.fragment.app.FragmentManager, androidx.leanback.app.GuidedStepSupportFragment);
+ method public static int add(androidx.fragment.app.FragmentManager, androidx.leanback.app.GuidedStepSupportFragment, int);
+ method public static int addAsRoot(androidx.fragment.app.FragmentActivity, androidx.leanback.app.GuidedStepSupportFragment, int);
method public void collapseAction(boolean);
method public void collapseSubActions();
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public void expandSubActions(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.GuidedAction! findActionById(long);
+ method public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+ method public void expandSubActions(androidx.leanback.widget.GuidedAction);
+ method public androidx.leanback.widget.GuidedAction? findActionById(long);
method public int findActionPositionById(long);
- method public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
+ method public androidx.leanback.widget.GuidedAction? findButtonActionById(long);
method public int findButtonActionPositionById(long);
method public void finishGuidedStepSupportFragments();
- method public android.view.View! getActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction!>! getActions();
- method public android.view.View! getButtonActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction!>! getButtonActions();
- method public static androidx.leanback.app.GuidedStepSupportFragment! getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager!);
- method public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
+ method public android.view.View? getActionItemView(int);
+ method public java.util.List<androidx.leanback.widget.GuidedAction!> getActions();
+ method public android.view.View? getButtonActionItemView(int);
+ method public java.util.List<androidx.leanback.widget.GuidedAction!> getButtonActions();
+ method public static androidx.leanback.app.GuidedStepSupportFragment? getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager);
+ method public androidx.leanback.widget.GuidanceStylist getGuidanceStylist();
+ method public androidx.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
+ method public androidx.leanback.widget.GuidedActionsStylist getGuidedButtonActionsStylist();
method public int getSelectedActionPosition();
method public int getSelectedButtonActionPosition();
method public int getUiStyle();
@@ -508,27 +508,27 @@
method public boolean isSubActionsExpanded();
method public void notifyActionChanged(int);
method public void notifyButtonActionChanged(int);
- method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
- method public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
- method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
- method public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
+ method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction, androidx.leanback.app.GuidedStepSupportFragment);
+ method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle);
+ method public androidx.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
+ method public android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
+ method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle);
+ method public androidx.leanback.widget.GuidedActionsStylist onCreateButtonActionsStylist();
+ method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle);
+ method public androidx.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
+ method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+ method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction);
+ method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
method protected void onProvideFragmentTransitions();
method public int onProvideTheme();
- method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
- method public void popBackStackToGuidedStepSupportFragment(Class<?>!, int);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
- method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>!);
- method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
+ method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+ method public void openInEditMode(androidx.leanback.widget.GuidedAction?);
+ method public void popBackStackToGuidedStepSupportFragment(Class<?>, int);
+ method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
+ method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>?);
+ method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
method public void setSelectedActionPosition(int);
method public void setSelectedButtonActionPosition(int);
method public void setUiStyle(int);
@@ -1909,11 +1909,11 @@
public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
ctor public GuidedActionsStylist();
method public void collapseAction(boolean);
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public androidx.leanback.widget.VerticalGridView! getActionsGridView();
- method public androidx.leanback.widget.GuidedAction! getExpandedAction();
- method public int getItemViewType(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.VerticalGridView! getSubActionsGridView();
+ method public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+ method public androidx.leanback.widget.VerticalGridView? getActionsGridView();
+ method public androidx.leanback.widget.GuidedAction? getExpandedAction();
+ method public int getItemViewType(androidx.leanback.widget.GuidedAction);
+ method public androidx.leanback.widget.VerticalGridView? getSubActionsGridView();
method public final boolean isBackKeyToCollapseActivatorView();
method public final boolean isBackKeyToCollapseSubActions();
method public boolean isButtonActions();
@@ -1921,53 +1921,53 @@
method public boolean isExpanded();
method public boolean isInExpandTransition();
method public boolean isSubActionsExpanded();
- method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
+ method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder);
+ method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup);
+ method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup);
+ method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup, int);
method public void onDestroyView();
method @Deprecated protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
- method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean, boolean);
+ method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean, boolean);
method public void onImeAppearing(java.util.List<android.animation.Animator!>);
method public void onImeDisappearing(java.util.List<android.animation.Animator!>);
method public int onProvideItemLayoutId();
method public int onProvideItemLayoutId(int);
method public int onProvideLayoutId();
- method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
+ method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder?);
+ method public void openInEditMode(androidx.leanback.widget.GuidedAction);
method public void setAsButtonActions();
method public final void setBackKeyToCollapseActivatorView(boolean);
method public final void setBackKeyToCollapseSubActions(boolean);
method @Deprecated public void setEditingMode(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
method @Deprecated public void setExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
+ method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
method @Deprecated public void startExpandedTransition(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
field public static final int VIEW_TYPE_DATE_PICKER = 1; // 0x1
field public static final int VIEW_TYPE_DEFAULT = 0; // 0x0
}
public static class GuidedActionsStylist.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.leanback.widget.FacetProvider {
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!);
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!, boolean);
- method public androidx.leanback.widget.GuidedAction! getAction();
- method public android.widget.ImageView! getCheckmarkView();
- method public android.widget.ImageView! getChevronView();
- method public android.view.View! getContentView();
- method public android.widget.TextView! getDescriptionView();
- method public android.widget.EditText! getEditableDescriptionView();
- method public android.widget.EditText! getEditableTitleView();
- method public android.view.View! getEditingView();
- method public Object! getFacet(Class<?>!);
- method public android.widget.ImageView! getIconView();
- method public android.widget.TextView! getTitleView();
+ ctor public GuidedActionsStylist.ViewHolder(android.view.View);
+ ctor public GuidedActionsStylist.ViewHolder(android.view.View, boolean);
+ method public androidx.leanback.widget.GuidedAction? getAction();
+ method public android.widget.ImageView? getCheckmarkView();
+ method public android.widget.ImageView? getChevronView();
+ method public android.view.View? getContentView();
+ method public android.widget.TextView? getDescriptionView();
+ method public android.widget.EditText? getEditableDescriptionView();
+ method public android.widget.EditText? getEditableTitleView();
+ method public android.view.View? getEditingView();
+ method public Object? getFacet(Class<?>);
+ method public android.widget.ImageView? getIconView();
+ method public android.widget.TextView? getTitleView();
method public boolean isInEditing();
method public boolean isInEditingActivatorView();
method public boolean isInEditingDescription();
diff --git a/leanback/leanback/api/public_plus_experimental_current.txt b/leanback/leanback/api/public_plus_experimental_current.txt
index bdf0261..fb9da3f 100644
--- a/leanback/leanback/api/public_plus_experimental_current.txt
+++ b/leanback/leanback/api/public_plus_experimental_current.txt
@@ -456,7 +456,7 @@
method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
method @Deprecated protected void onProvideFragmentTransitions();
method @Deprecated public int onProvideTheme();
method @Deprecated public void onResume();
@@ -479,26 +479,26 @@
public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment {
ctor public GuidedStepSupportFragment();
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!, int);
- method public static int addAsRoot(androidx.fragment.app.FragmentActivity!, androidx.leanback.app.GuidedStepSupportFragment!, int);
+ method public static int add(androidx.fragment.app.FragmentManager, androidx.leanback.app.GuidedStepSupportFragment);
+ method public static int add(androidx.fragment.app.FragmentManager, androidx.leanback.app.GuidedStepSupportFragment, int);
+ method public static int addAsRoot(androidx.fragment.app.FragmentActivity, androidx.leanback.app.GuidedStepSupportFragment, int);
method public void collapseAction(boolean);
method public void collapseSubActions();
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public void expandSubActions(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.GuidedAction! findActionById(long);
+ method public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+ method public void expandSubActions(androidx.leanback.widget.GuidedAction);
+ method public androidx.leanback.widget.GuidedAction? findActionById(long);
method public int findActionPositionById(long);
- method public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
+ method public androidx.leanback.widget.GuidedAction? findButtonActionById(long);
method public int findButtonActionPositionById(long);
method public void finishGuidedStepSupportFragments();
- method public android.view.View! getActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction!>! getActions();
- method public android.view.View! getButtonActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction!>! getButtonActions();
- method public static androidx.leanback.app.GuidedStepSupportFragment! getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager!);
- method public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
+ method public android.view.View? getActionItemView(int);
+ method public java.util.List<androidx.leanback.widget.GuidedAction!> getActions();
+ method public android.view.View? getButtonActionItemView(int);
+ method public java.util.List<androidx.leanback.widget.GuidedAction!> getButtonActions();
+ method public static androidx.leanback.app.GuidedStepSupportFragment? getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager);
+ method public androidx.leanback.widget.GuidanceStylist getGuidanceStylist();
+ method public androidx.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
+ method public androidx.leanback.widget.GuidedActionsStylist getGuidedButtonActionsStylist();
method public int getSelectedActionPosition();
method public int getSelectedButtonActionPosition();
method public int getUiStyle();
@@ -508,27 +508,27 @@
method public boolean isSubActionsExpanded();
method public void notifyActionChanged(int);
method public void notifyButtonActionChanged(int);
- method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
- method public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
- method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
- method public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
+ method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction, androidx.leanback.app.GuidedStepSupportFragment);
+ method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle);
+ method public androidx.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
+ method public android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
+ method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle);
+ method public androidx.leanback.widget.GuidedActionsStylist onCreateButtonActionsStylist();
+ method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle);
+ method public androidx.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
+ method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+ method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction);
+ method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
method protected void onProvideFragmentTransitions();
method public int onProvideTheme();
- method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
- method public void popBackStackToGuidedStepSupportFragment(Class<?>!, int);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
- method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>!);
- method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
+ method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+ method public void openInEditMode(androidx.leanback.widget.GuidedAction?);
+ method public void popBackStackToGuidedStepSupportFragment(Class<?>, int);
+ method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
+ method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>?);
+ method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
method public void setSelectedActionPosition(int);
method public void setSelectedButtonActionPosition(int);
method public void setUiStyle(int);
@@ -1909,11 +1909,11 @@
public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
ctor public GuidedActionsStylist();
method public void collapseAction(boolean);
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public androidx.leanback.widget.VerticalGridView! getActionsGridView();
- method public androidx.leanback.widget.GuidedAction! getExpandedAction();
- method public int getItemViewType(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.VerticalGridView! getSubActionsGridView();
+ method public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+ method public androidx.leanback.widget.VerticalGridView? getActionsGridView();
+ method public androidx.leanback.widget.GuidedAction? getExpandedAction();
+ method public int getItemViewType(androidx.leanback.widget.GuidedAction);
+ method public androidx.leanback.widget.VerticalGridView? getSubActionsGridView();
method public final boolean isBackKeyToCollapseActivatorView();
method public final boolean isBackKeyToCollapseSubActions();
method public boolean isButtonActions();
@@ -1921,53 +1921,53 @@
method public boolean isExpanded();
method public boolean isInExpandTransition();
method public boolean isSubActionsExpanded();
- method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
+ method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder);
+ method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup);
+ method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup);
+ method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup, int);
method public void onDestroyView();
method @Deprecated protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
- method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean, boolean);
+ method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean, boolean);
method public void onImeAppearing(java.util.List<android.animation.Animator!>);
method public void onImeDisappearing(java.util.List<android.animation.Animator!>);
method public int onProvideItemLayoutId();
method public int onProvideItemLayoutId(int);
method public int onProvideLayoutId();
- method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
+ method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder?);
+ method public void openInEditMode(androidx.leanback.widget.GuidedAction);
method public void setAsButtonActions();
method public final void setBackKeyToCollapseActivatorView(boolean);
method public final void setBackKeyToCollapseSubActions(boolean);
method @Deprecated public void setEditingMode(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
method @Deprecated public void setExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
+ method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
method @Deprecated public void startExpandedTransition(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
field public static final int VIEW_TYPE_DATE_PICKER = 1; // 0x1
field public static final int VIEW_TYPE_DEFAULT = 0; // 0x0
}
public static class GuidedActionsStylist.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.leanback.widget.FacetProvider {
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!);
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!, boolean);
- method public androidx.leanback.widget.GuidedAction! getAction();
- method public android.widget.ImageView! getCheckmarkView();
- method public android.widget.ImageView! getChevronView();
- method public android.view.View! getContentView();
- method public android.widget.TextView! getDescriptionView();
- method public android.widget.EditText! getEditableDescriptionView();
- method public android.widget.EditText! getEditableTitleView();
- method public android.view.View! getEditingView();
- method public Object! getFacet(Class<?>!);
- method public android.widget.ImageView! getIconView();
- method public android.widget.TextView! getTitleView();
+ ctor public GuidedActionsStylist.ViewHolder(android.view.View);
+ ctor public GuidedActionsStylist.ViewHolder(android.view.View, boolean);
+ method public androidx.leanback.widget.GuidedAction? getAction();
+ method public android.widget.ImageView? getCheckmarkView();
+ method public android.widget.ImageView? getChevronView();
+ method public android.view.View? getContentView();
+ method public android.widget.TextView? getDescriptionView();
+ method public android.widget.EditText? getEditableDescriptionView();
+ method public android.widget.EditText? getEditableTitleView();
+ method public android.view.View? getEditingView();
+ method public Object? getFacet(Class<?>);
+ method public android.widget.ImageView? getIconView();
+ method public android.widget.TextView? getTitleView();
method public boolean isInEditing();
method public boolean isInEditingActivatorView();
method public boolean isInEditingDescription();
diff --git a/leanback/leanback/api/restricted_current.txt b/leanback/leanback/api/restricted_current.txt
index cfa193a..c42b7de 100644
--- a/leanback/leanback/api/restricted_current.txt
+++ b/leanback/leanback/api/restricted_current.txt
@@ -478,7 +478,7 @@
method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
method @Deprecated protected void onProvideFragmentTransitions();
method @Deprecated public int onProvideTheme();
method @Deprecated public void onResume();
@@ -509,26 +509,26 @@
public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
ctor public GuidedStepSupportFragment();
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!, int);
- method public static int addAsRoot(androidx.fragment.app.FragmentActivity!, androidx.leanback.app.GuidedStepSupportFragment!, int);
+ method public static int add(androidx.fragment.app.FragmentManager, androidx.leanback.app.GuidedStepSupportFragment);
+ method public static int add(androidx.fragment.app.FragmentManager, androidx.leanback.app.GuidedStepSupportFragment, int);
+ method public static int addAsRoot(androidx.fragment.app.FragmentActivity, androidx.leanback.app.GuidedStepSupportFragment, int);
method public void collapseAction(boolean);
method public void collapseSubActions();
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public void expandSubActions(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.GuidedAction! findActionById(long);
+ method public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+ method public void expandSubActions(androidx.leanback.widget.GuidedAction);
+ method public androidx.leanback.widget.GuidedAction? findActionById(long);
method public int findActionPositionById(long);
- method public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
+ method public androidx.leanback.widget.GuidedAction? findButtonActionById(long);
method public int findButtonActionPositionById(long);
method public void finishGuidedStepSupportFragments();
- method public android.view.View! getActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction!>! getActions();
- method public android.view.View! getButtonActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction!>! getButtonActions();
- method public static androidx.leanback.app.GuidedStepSupportFragment! getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager!);
- method public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
+ method public android.view.View? getActionItemView(int);
+ method public java.util.List<androidx.leanback.widget.GuidedAction!> getActions();
+ method public android.view.View? getButtonActionItemView(int);
+ method public java.util.List<androidx.leanback.widget.GuidedAction!> getButtonActions();
+ method public static androidx.leanback.app.GuidedStepSupportFragment? getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager);
+ method public androidx.leanback.widget.GuidanceStylist getGuidanceStylist();
+ method public androidx.leanback.widget.GuidedActionsStylist getGuidedActionsStylist();
+ method public androidx.leanback.widget.GuidedActionsStylist getGuidedButtonActionsStylist();
method public int getSelectedActionPosition();
method public int getSelectedButtonActionPosition();
method public int getUiStyle();
@@ -538,27 +538,27 @@
method public boolean isSubActionsExpanded();
method public void notifyActionChanged(int);
method public void notifyButtonActionChanged(int);
- method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
- method public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
- method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
- method public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
+ method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction, androidx.leanback.app.GuidedStepSupportFragment);
+ method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle);
+ method public androidx.leanback.widget.GuidedActionsStylist onCreateActionsStylist();
+ method public android.view.View? onCreateBackgroundView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
+ method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>, android.os.Bundle);
+ method public androidx.leanback.widget.GuidedActionsStylist onCreateButtonActionsStylist();
+ method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle);
+ method public androidx.leanback.widget.GuidanceStylist onCreateGuidanceStylist();
+ method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+ method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction);
+ method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
method protected void onProvideFragmentTransitions();
method public int onProvideTheme();
- method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
- method public void popBackStackToGuidedStepSupportFragment(Class<?>!, int);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
- method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>!);
- method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>!);
+ method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction);
+ method public void openInEditMode(androidx.leanback.widget.GuidedAction?);
+ method public void popBackStackToGuidedStepSupportFragment(Class<?>, int);
+ method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
+ method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction!>?);
+ method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction!>);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEntranceTransitionType(int);
method public void setSelectedActionPosition(int);
method public void setSelectedButtonActionPosition(int);
@@ -2069,14 +2069,14 @@
}
public static interface GuidedActionAdapter.EditListener {
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
+ method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction);
+ method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction);
method public void onImeClose();
method public void onImeOpen();
}
public static interface GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
+ method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction);
}
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GuidedActionAdapterGroup {
@@ -2116,11 +2116,11 @@
public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
ctor public GuidedActionsStylist();
method public void collapseAction(boolean);
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public androidx.leanback.widget.VerticalGridView! getActionsGridView();
- method public androidx.leanback.widget.GuidedAction! getExpandedAction();
- method public int getItemViewType(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.VerticalGridView! getSubActionsGridView();
+ method public void expandAction(androidx.leanback.widget.GuidedAction, boolean);
+ method public androidx.leanback.widget.VerticalGridView? getActionsGridView();
+ method public androidx.leanback.widget.GuidedAction? getExpandedAction();
+ method public int getItemViewType(androidx.leanback.widget.GuidedAction);
+ method public androidx.leanback.widget.VerticalGridView? getSubActionsGridView();
method public final boolean isBackKeyToCollapseActivatorView();
method public final boolean isBackKeyToCollapseSubActions();
method public boolean isButtonActions();
@@ -2128,54 +2128,54 @@
method public boolean isExpanded();
method public boolean isInExpandTransition();
method public boolean isSubActionsExpanded();
- method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
+ method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean);
+ method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder);
+ method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public android.view.View onCreateView(android.view.LayoutInflater, android.view.ViewGroup);
+ method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup);
+ method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder onCreateViewHolder(android.view.ViewGroup, int);
method public void onDestroyView();
method @Deprecated protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
- method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean, boolean);
+ method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, boolean, boolean);
method public void onImeAppearing(java.util.List<android.animation.Animator!>);
method public void onImeDisappearing(java.util.List<android.animation.Animator!>);
method public int onProvideItemLayoutId();
method public int onProvideItemLayoutId(int);
method public int onProvideLayoutId();
- method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
+ method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
+ method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder?);
+ method public void openInEditMode(androidx.leanback.widget.GuidedAction);
method public void setAsButtonActions();
method public final void setBackKeyToCollapseActivatorView(boolean);
method public final void setBackKeyToCollapseSubActions(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener);
method @Deprecated public void setEditingMode(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
method @Deprecated public void setExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
+ method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder, androidx.leanback.widget.GuidedAction);
method @Deprecated public void startExpandedTransition(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
field public static final int VIEW_TYPE_DATE_PICKER = 1; // 0x1
field public static final int VIEW_TYPE_DEFAULT = 0; // 0x0
}
public static class GuidedActionsStylist.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.leanback.widget.FacetProvider {
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!);
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!, boolean);
- method public androidx.leanback.widget.GuidedAction! getAction();
- method public android.widget.ImageView! getCheckmarkView();
- method public android.widget.ImageView! getChevronView();
- method public android.view.View! getContentView();
- method public android.widget.TextView! getDescriptionView();
- method public android.widget.EditText! getEditableDescriptionView();
- method public android.widget.EditText! getEditableTitleView();
- method public android.view.View! getEditingView();
- method public Object! getFacet(Class<?>!);
- method public android.widget.ImageView! getIconView();
- method public android.widget.TextView! getTitleView();
+ ctor public GuidedActionsStylist.ViewHolder(android.view.View);
+ ctor public GuidedActionsStylist.ViewHolder(android.view.View, boolean);
+ method public androidx.leanback.widget.GuidedAction? getAction();
+ method public android.widget.ImageView? getCheckmarkView();
+ method public android.widget.ImageView? getChevronView();
+ method public android.view.View? getContentView();
+ method public android.widget.TextView? getDescriptionView();
+ method public android.widget.EditText? getEditableDescriptionView();
+ method public android.widget.EditText? getEditableTitleView();
+ method public android.view.View? getEditingView();
+ method public Object? getFacet(Class<?>);
+ method public android.widget.ImageView? getIconView();
+ method public android.widget.TextView? getTitleView();
method public boolean isInEditing();
method public boolean isInEditingActivatorView();
method public boolean isInEditingDescription();
diff --git a/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestFragment.java b/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestFragment.java
index dc93ff5..4843b0a 100644
--- a/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestFragment.java
+++ b/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestFragment.java
@@ -24,6 +24,8 @@
import android.app.Activity;
import android.app.FragmentManager;
+
+import androidx.annotation.NonNull;
import androidx.leanback.widget.GuidanceStylist.Guidance;
import androidx.leanback.widget.GuidedAction;
@@ -151,6 +153,7 @@
mProvider.onSaveInstanceState(outState);
}
+ @NonNull
@Override
public Guidance onCreateGuidance(Bundle savedInstanceState) {
Guidance g = mProvider.onCreateGuidance(savedInstanceState);
@@ -161,12 +164,15 @@
}
@Override
- public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+ public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
mProvider.onCreateActions(actions, savedInstanceState);
}
@Override
- public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+ public void onCreateButtonActions(
+ @NonNull List<GuidedAction> actions,
+ Bundle savedInstanceState
+ ) {
mProvider.onCreateButtonActions(actions, savedInstanceState);
}
diff --git a/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestSupportFragment.java b/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestSupportFragment.java
index 6ae0145..f5175c7 100644
--- a/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestSupportFragment.java
+++ b/leanback/leanback/src/androidTest/java/androidx/leanback/app/GuidedStepTestSupportFragment.java
@@ -19,6 +19,7 @@
import android.view.View;
import android.view.ViewGroup;
+import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.leanback.widget.GuidanceStylist.Guidance;
@@ -148,8 +149,9 @@
mProvider.onSaveInstanceState(outState);
}
+ @NonNull
@Override
- public Guidance onCreateGuidance(Bundle savedInstanceState) {
+ public Guidance onCreateGuidance(@NonNull Bundle savedInstanceState) {
Guidance g = mProvider.onCreateGuidance(savedInstanceState);
if (g == null) {
g = new Guidance("", "", "", null);
@@ -158,27 +160,33 @@
}
@Override
- public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+ public void onCreateActions(
+ @NonNull List<GuidedAction> actions,
+ @NonNull Bundle savedInstanceState
+ ) {
mProvider.onCreateActions(actions, savedInstanceState);
}
@Override
- public void onCreateButtonActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+ public void onCreateButtonActions(
+ @NonNull List<GuidedAction> actions,
+ @NonNull Bundle savedInstanceState
+ ) {
mProvider.onCreateButtonActions(actions, savedInstanceState);
}
@Override
- public void onGuidedActionClicked(GuidedAction action) {
+ public void onGuidedActionClicked(@NonNull GuidedAction action) {
mProvider.onGuidedActionClicked(action);
}
@Override
- public boolean onSubGuidedActionClicked(GuidedAction action) {
+ public boolean onSubGuidedActionClicked(@NonNull GuidedAction action) {
return mProvider.onSubGuidedActionClicked(action);
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle state) {
View view = super.onCreateView(inflater, container, state);
mProvider.onCreateView(inflater, container, state, view);
return view;
diff --git a/leanback/leanback/src/androidTest/java/androidx/leanback/app/wizard/GuidedStepAttributesTestFragment.java b/leanback/leanback/src/androidTest/java/androidx/leanback/app/wizard/GuidedStepAttributesTestFragment.java
index 5dbad85..292b542 100644
--- a/leanback/leanback/src/androidTest/java/androidx/leanback/app/wizard/GuidedStepAttributesTestFragment.java
+++ b/leanback/leanback/src/androidTest/java/androidx/leanback/app/wizard/GuidedStepAttributesTestFragment.java
@@ -16,6 +16,7 @@
import android.os.Bundle;
+import androidx.annotation.NonNull;
import androidx.leanback.app.GuidedStepFragment;
import androidx.leanback.widget.GuidanceStylist;
import androidx.leanback.widget.GuidedAction;
@@ -53,7 +54,7 @@
}
@Override
- public void onGuidedActionClicked(GuidedAction action) {
+ public void onGuidedActionClicked(@NonNull GuidedAction action) {
super.onGuidedActionFocused(action);
Callback callback = sCallbacks.get(action.getId());
if (callback != null) {
@@ -64,7 +65,7 @@
}
@Override
- public void onGuidedActionFocused(GuidedAction action) {
+ public void onGuidedActionFocused(@NonNull GuidedAction action) {
super.onGuidedActionFocused(action);
LAST_SELECTED_ACTION_ID = action.getId();
}
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
index 0430f95..e1e2b2f 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
@@ -427,7 +427,7 @@
* Callback invoked when an action is focused (made to be the current selection) by the user.
*/
@Override
- public void onGuidedActionFocused(GuidedAction action) {
+ public void onGuidedActionFocused(@NonNull GuidedAction action) {
}
/**
diff --git a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
index d2c2c6a..927e8a3 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
@@ -31,6 +31,7 @@
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
@@ -245,9 +246,13 @@
*/
@RestrictTo(LIBRARY_GROUP_PREFIX)
public static class DummyFragment extends Fragment {
+ @NonNull
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
+ public View onCreateView(
+ @NonNull LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState
+ ) {
final View v = new View(inflater.getContext());
v.setVisibility(View.GONE);
return v;
@@ -275,6 +280,7 @@
* a basic GuidanceStylist.
* @return The GuidanceStylist used in this fragment.
*/
+ @NonNull
public GuidanceStylist onCreateGuidanceStylist() {
return new GuidanceStylist();
}
@@ -284,6 +290,7 @@
* returns a basic GuidedActionsStylist.
* @return The GuidedActionsStylist used in this fragment.
*/
+ @NonNull
public GuidedActionsStylist onCreateActionsStylist() {
return new GuidedActionsStylist();
}
@@ -293,6 +300,7 @@
* The default implementation returns a basic GuidedActionsStylist.
* @return The GuidedActionsStylist used in this fragment.
*/
+ @NonNull
public GuidedActionsStylist onCreateButtonActionsStylist() {
GuidedActionsStylist stylist = new GuidedActionsStylist();
stylist.setAsButtonActions();
@@ -317,7 +325,7 @@
* @param savedInstanceState The saved instance state from onCreateView.
* @return The Guidance object representing the information used to guide the user.
*/
- public @NonNull Guidance onCreateGuidance(Bundle savedInstanceState) {
+ public @NonNull Guidance onCreateGuidance(@NonNull Bundle savedInstanceState) {
return new Guidance("", "", "", null);
}
@@ -327,7 +335,10 @@
* @param actions A non-null, empty list ready to be populated.
* @param savedInstanceState The saved instance state from onCreate.
*/
- public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
+ public void onCreateActions(
+ @NonNull List<GuidedAction> actions,
+ @NonNull Bundle savedInstanceState
+ ) {
}
/**
@@ -336,8 +347,10 @@
* @param actions A non-null, empty list ready to be populated.
* @param savedInstanceState The saved instance state from onCreate.
*/
- public void onCreateButtonActions(@NonNull List<GuidedAction> actions,
- Bundle savedInstanceState) {
+ public void onCreateButtonActions(
+ @NonNull List<GuidedAction> actions,
+ @NonNull Bundle savedInstanceState
+ ) {
}
/**
@@ -345,7 +358,7 @@
* order to act on the user's decisions.
* @param action The chosen action.
*/
- public void onGuidedActionClicked(GuidedAction action) {
+ public void onGuidedActionClicked(@NonNull GuidedAction action) {
}
/**
@@ -355,7 +368,7 @@
* @param action The chosen action.
* @return true to collapse the sub actions list, false to keep it expanded.
*/
- public boolean onSubGuidedActionClicked(GuidedAction action) {
+ public boolean onSubGuidedActionClicked(@NonNull GuidedAction action) {
return true;
}
@@ -379,7 +392,7 @@
* @param action GuidedAction to expand.
* @see #expandAction(GuidedAction, boolean)
*/
- public void expandSubActions(GuidedAction action) {
+ public void expandSubActions(@NonNull GuidedAction action) {
if (!action.hasSubActions()) {
return;
}
@@ -394,7 +407,7 @@
* @param action GuidedAction to expand.
* @param withTransition True to run transition animation, false otherwise.
*/
- public void expandAction(GuidedAction action, boolean withTransition) {
+ public void expandAction(@NonNull GuidedAction action, boolean withTransition) {
mActionsStylist.expandAction(action, withTransition);
}
@@ -422,7 +435,7 @@
* Callback invoked when an action is focused (made to be the current selection) by the user.
*/
@Override
- public void onGuidedActionFocused(GuidedAction action) {
+ public void onGuidedActionFocused(@NonNull GuidedAction action) {
}
/**
@@ -441,7 +454,7 @@
* {@link #onGuidedActionEdited(GuidedAction)}.
* @param action The action which has been canceled editing.
*/
- public void onGuidedActionEditCanceled(GuidedAction action) {
+ public void onGuidedActionEditCanceled(@NonNull GuidedAction action) {
onGuidedActionEdited(action);
}
@@ -454,7 +467,7 @@
* @return ID of the action will be focused or {@link GuidedAction#ACTION_ID_NEXT},
* {@link GuidedAction#ACTION_ID_CURRENT}.
*/
- public long onGuidedActionEditedAndProceed(GuidedAction action) {
+ public long onGuidedActionEditedAndProceed(@NonNull GuidedAction action) {
onGuidedActionEdited(action);
return GuidedAction.ACTION_ID_NEXT;
}
@@ -481,7 +494,9 @@
* @param fragment The GuidedStepSupportFragment to be inserted into the fragment stack.
* @return The ID returned by the call FragmentTransaction.commit.
*/
- public static int add(FragmentManager fragmentManager, GuidedStepSupportFragment fragment) {
+ public static int add(
+ @NonNull FragmentManager fragmentManager,
+ @NonNull GuidedStepSupportFragment fragment) {
return add(fragmentManager, fragment, android.R.id.content);
}
@@ -510,7 +525,11 @@
* @param id The id of container to add GuidedStepSupportFragment, can be android.R.id.content.
* @return The ID returned by the call FragmentTransaction.commit.
*/
- public static int add(FragmentManager fragmentManager, GuidedStepSupportFragment fragment, int id) {
+ public static int add(
+ @NonNull FragmentManager fragmentManager,
+ @NonNull GuidedStepSupportFragment fragment,
+ int id
+ ) {
GuidedStepSupportFragment current = getCurrentGuidedStepSupportFragment(fragmentManager);
boolean inGuidedStep = current != null;
if (IS_FRAMEWORK_FRAGMENT && Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT < 23
@@ -543,8 +562,10 @@
* @param ft The FragmentTransaction to add shared element.
* @param disappearing The disappearing fragment.
*/
- protected void onAddSharedElementTransition(FragmentTransaction ft, GuidedStepSupportFragment
- disappearing) {
+ protected void onAddSharedElementTransition(
+ @NonNull FragmentTransaction ft,
+ @NonNull GuidedStepSupportFragment disappearing
+ ) {
View fragmentView = disappearing.getView();
addNonNullSharedElementTransition(ft, fragmentView.findViewById(
R.id.action_fragment_root), "action_fragment_root");
@@ -650,7 +671,11 @@
* @return The ID returned by the call FragmentTransaction.commit, or -1 there is already
* GuidedStepSupportFragment.
*/
- public static int addAsRoot(FragmentActivity activity, GuidedStepSupportFragment fragment, int id) {
+ public static int addAsRoot(
+ @NonNull FragmentActivity activity,
+ @NonNull GuidedStepSupportFragment fragment,
+ int id
+ ) {
// Workaround b/23764120: call getDecorView() to force requestFeature of ActivityTransition.
activity.getWindow().getDecorView();
FragmentManager fragmentManager = activity.getSupportFragmentManager();
@@ -668,7 +693,10 @@
* Returns the current GuidedStepSupportFragment on the fragment transaction stack.
* @return The current GuidedStepSupportFragment, if any, on the fragment transaction stack.
*/
- public static GuidedStepSupportFragment getCurrentGuidedStepSupportFragment(FragmentManager fm) {
+ @Nullable
+ public static GuidedStepSupportFragment getCurrentGuidedStepSupportFragment(
+ @NonNull FragmentManager fm
+ ) {
Fragment f = fm.findFragmentByTag(TAG_LEAN_BACK_ACTIONS_FRAGMENT);
if (f instanceof GuidedStepSupportFragment) {
return (GuidedStepSupportFragment) f;
@@ -680,6 +708,7 @@
* Returns the GuidanceStylist that displays guidance information for the user.
* @return The GuidanceStylist for this fragment.
*/
+ @NonNull
public GuidanceStylist getGuidanceStylist() {
return mGuidanceStylist;
}
@@ -688,6 +717,7 @@
* Returns the GuidedActionsStylist that displays the actions the user may take.
* @return The GuidedActionsStylist for this fragment.
*/
+ @NonNull
public GuidedActionsStylist getGuidedActionsStylist() {
return mActionsStylist;
}
@@ -696,6 +726,7 @@
* Returns the list of button GuidedActions that the user may take in this fragment.
* @return The list of button GuidedActions for this fragment.
*/
+ @NonNull
public List<GuidedAction> getButtonActions() {
return mButtonActions;
}
@@ -705,6 +736,7 @@
* @param id Id of the button action to search.
* @return GuidedAction object or null if not found.
*/
+ @Nullable
public GuidedAction findButtonActionById(long id) {
int index = findButtonActionPositionById(id);
return index >= 0 ? mButtonActions.get(index) : null;
@@ -730,6 +762,7 @@
* Returns the GuidedActionsStylist that displays the button actions the user may take.
* @return The GuidedActionsStylist for this fragment.
*/
+ @NonNull
public GuidedActionsStylist getGuidedButtonActionsStylist() {
return mButtonActionsStylist;
}
@@ -738,7 +771,7 @@
* Sets the list of button GuidedActions that the user may take in this fragment.
* @param actions The list of button GuidedActions for this fragment.
*/
- public void setButtonActions(List<GuidedAction> actions) {
+ public void setButtonActions(@NonNull List<GuidedAction> actions) {
mButtonActions = actions;
if (mButtonAdapter != null) {
mButtonAdapter.setActions(mButtonActions);
@@ -762,6 +795,7 @@
* @return The View corresponding to the button action at the indicated position, or null if
* that action is not currently onscreen.
*/
+ @Nullable
public View getButtonActionItemView(int position) {
final RecyclerView.ViewHolder holder = mButtonActionsStylist.getActionsGridView()
.findViewHolderForPosition(position);
@@ -788,6 +822,7 @@
* Returns the list of GuidedActions that the user may take in this fragment.
* @return The list of GuidedActions for this fragment.
*/
+ @NonNull
public List<GuidedAction> getActions() {
return mActions;
}
@@ -797,6 +832,7 @@
* @param id Id of the action to search.
* @return GuidedAction object or null if not found.
*/
+ @Nullable
public GuidedAction findActionById(long id) {
int index = findActionPositionById(id);
return index >= 0 ? mActions.get(index) : null;
@@ -824,7 +860,7 @@
*
* @param actions The list of GuidedActions for this fragment.
*/
- public void setActions(List<GuidedAction> actions) {
+ public void setActions(@NonNull List<GuidedAction> actions) {
mActions = actions;
if (mAdapter != null) {
mAdapter.setActions(mActions);
@@ -839,7 +875,7 @@
*
* @param diffCallback DiffCallback used in {@link #setActions(List)}.
*/
- public void setActionsDiffCallback(DiffCallback<GuidedAction> diffCallback) {
+ public void setActionsDiffCallback(@Nullable DiffCallback<GuidedAction> diffCallback) {
mAdapter.setDiffCallback(diffCallback);
}
@@ -860,6 +896,7 @@
* @return The View corresponding to the action at the indicated position, or null if that
* action is not currently onscreen.
*/
+ @Nullable
public View getActionItemView(int position) {
final RecyclerView.ViewHolder holder = mActionsStylist.getActionsGridView()
.findViewHolderForPosition(position);
@@ -969,8 +1006,12 @@
* @param savedInstanceState
* @return Created background view or null if no background.
*/
- public View onCreateBackgroundView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
+ @Nullable
+ public View onCreateBackgroundView(
+ @NonNull LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState
+ ) {
return inflater.inflate(R.layout.lb_guidedstep_background, container, false);
}
@@ -1023,7 +1064,7 @@
* {@inheritDoc}
*/
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (DEBUG) Log.v(TAG, "onCreate");
@@ -1067,9 +1108,12 @@
/**
* {@inheritDoc}
*/
+ @Nullable
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
+ public View onCreateView(
+ @NonNull LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
if (DEBUG) Log.v(TAG, "onCreateView");
resolveTheme();
@@ -1260,7 +1304,7 @@
* {@inheritDoc}
*/
@Override
- public void onSaveInstanceState(Bundle outState) {
+ public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
onSaveActions(mActions, outState);
onSaveButtonActions(mButtonActions, outState);
@@ -1306,8 +1350,10 @@
* @param guidedStepFragmentClass Name of the Class of GuidedStepSupportFragment to pop to.
* @param flags Either 0 or {@link FragmentManager#POP_BACK_STACK_INCLUSIVE}.
*/
- public void popBackStackToGuidedStepSupportFragment(Class<?> guidedStepFragmentClass,
- int flags) {
+ public void popBackStackToGuidedStepSupportFragment(
+ @NonNull Class<?> guidedStepFragmentClass,
+ int flags
+ ) {
if (!GuidedStepSupportFragment.class.isAssignableFrom(guidedStepFragmentClass)) {
return;
}
@@ -1369,7 +1415,7 @@
* used to programmatically skip the extra click required to go into edit mode. This method
* can be invoked in {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
*/
- public void openInEditMode(GuidedAction action) {
+ public void openInEditMode(@Nullable GuidedAction action) {
mActionsStylist.openInEditMode(action);
}
diff --git a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
index fa28365..a568b46 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
@@ -25,6 +25,7 @@
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.recyclerview.widget.DiffUtil;
@@ -69,7 +70,7 @@
/**
* Called when the user focuses on an action.
*/
- void onGuidedActionFocused(GuidedAction action);
+ void onGuidedActionFocused(@NonNull GuidedAction action);
}
/**
@@ -80,12 +81,12 @@
/**
* Called when the user exits edit mode on an action.
*/
- void onGuidedActionEditCanceled(GuidedAction action);
+ void onGuidedActionEditCanceled(@NonNull GuidedAction action);
/**
* Called when the user exits edit mode on an action and process confirm button in IME.
*/
- long onGuidedActionEditedAndProceed(GuidedAction action);
+ long onGuidedActionEditedAndProceed(@NonNull GuidedAction action);
/**
* Called when Ime Open
diff --git a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java
index 5c09223..3c0abab 100644
--- a/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java
+++ b/leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java
@@ -49,6 +49,8 @@
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.core.content.ContextCompat;
import androidx.leanback.R;
@@ -212,14 +214,14 @@
/**
* Constructs an ViewHolder and caches the relevant subviews.
*/
- public ViewHolder(View v) {
+ public ViewHolder(@NonNull View v) {
this(v, false);
}
/**
* Constructs an ViewHolder for sub action and caches the relevant subviews.
*/
- public ViewHolder(View v, boolean isSubAction) {
+ public ViewHolder(@NonNull View v, boolean isSubAction) {
super(v);
mContentView = v.findViewById(R.id.guidedactions_item_content);
@@ -238,6 +240,7 @@
* Returns the content view within this view holder's view, where title and description are
* shown.
*/
+ @Nullable
public View getContentView() {
return mContentView;
}
@@ -245,6 +248,7 @@
/**
* Returns the title view within this view holder's view.
*/
+ @Nullable
public TextView getTitleView() {
return mTitleView;
}
@@ -253,6 +257,7 @@
* Convenience method to return an editable version of the title, if possible,
* or null if the title view isn't an EditText.
*/
+ @Nullable
public EditText getEditableTitleView() {
return (mTitleView instanceof EditText) ? (EditText)mTitleView : null;
}
@@ -260,6 +265,7 @@
/**
* Returns the description view within this view holder's view.
*/
+ @Nullable
public TextView getDescriptionView() {
return mDescriptionView;
}
@@ -268,6 +274,7 @@
* Convenience method to return an editable version of the description, if possible,
* or null if the description view isn't an EditText.
*/
+ @Nullable
public EditText getEditableDescriptionView() {
return (mDescriptionView instanceof EditText) ? (EditText)mDescriptionView : null;
}
@@ -275,6 +282,7 @@
/**
* Returns the icon view within this view holder's view.
*/
+ @Nullable
public ImageView getIconView() {
return mIconView;
}
@@ -282,6 +290,7 @@
/**
* Returns the checkmark view within this view holder's view.
*/
+ @Nullable
public ImageView getCheckmarkView() {
return mCheckmarkView;
}
@@ -289,6 +298,7 @@
/**
* Returns the chevron view within this view holder's view.
*/
+ @Nullable
public ImageView getChevronView() {
return mChevronView;
}
@@ -334,6 +344,7 @@
* @return Current editing title view or description view or activator view or null if not
* in editing.
*/
+ @Nullable
public View getEditingView() {
switch(mEditingMode) {
case EDITING_TITLE:
@@ -359,6 +370,7 @@
/**
* @return Currently bound action.
*/
+ @Nullable
public GuidedAction getAction() {
return mAction;
}
@@ -370,8 +382,9 @@
}
}
+ @Nullable
@Override
- public Object getFacet(Class<?> facetClass) {
+ public Object getFacet(@NonNull Class<?> facetClass) {
if (facetClass == ItemAlignmentFacet.class) {
return sGuidedActionItemAlignFacet;
}
@@ -444,8 +457,9 @@
* <code>LayoutInflater.inflate</code>.
* @return The view to be added to the caller's view hierarchy.
*/
+ @NonNull
@SuppressWarnings("deprecation") /* defaultDisplay */
- public View onCreateView(LayoutInflater inflater, final ViewGroup container) {
+ public View onCreateView(@NonNull LayoutInflater inflater, final @NonNull ViewGroup container) {
TypedArray ta = inflater.getContext().getTheme().obtainStyledAttributes(
R.styleable.LeanbackGuidedStepTheme);
float keylinePercent = ta.getFloat(R.styleable.LeanbackGuidedStepTheme_guidedStepKeyline,
@@ -555,6 +569,7 @@
* Returns the VerticalGridView that displays the list of GuidedActions.
* @return The VerticalGridView for this presenter.
*/
+ @Nullable
public VerticalGridView getActionsGridView() {
return mActionsGridView;
}
@@ -563,6 +578,7 @@
* Returns the VerticalGridView that displays the sub actions list of an expanded action.
* @return The VerticalGridView that displays the sub actions list of an expanded action.
*/
+ @Nullable
public VerticalGridView getSubActionsGridView() {
return mSubActionsGridView;
}
@@ -589,7 +605,7 @@
* @param action The action object.
* @return View type that used in {@link #onProvideItemLayoutId(int)}.
*/
- public int getItemViewType(GuidedAction action) {
+ public int getItemViewType(@NonNull GuidedAction action) {
if (action instanceof GuidedDatePickerAction) {
return VIEW_TYPE_DATE_PICKER;
}
@@ -653,7 +669,8 @@
* @param parent The view group to be used as the parent of the new view.
* @return The view to be added to the caller's view hierarchy.
*/
- public ViewHolder onCreateViewHolder(ViewGroup parent) {
+ @NonNull
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View v = inflater.inflate(onProvideItemLayoutId(), parent, false);
return new ViewHolder(v, parent == mSubActionsGridView);
@@ -669,7 +686,8 @@
* @param viewType The viewType returned by {@link #getItemViewType(GuidedAction)}
* @return The view to be added to the caller's view hierarchy.
*/
- public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ @NonNull
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (viewType == VIEW_TYPE_DEFAULT) {
return onCreateViewHolder(parent);
}
@@ -684,7 +702,7 @@
* @param action The guided action to be displayed by the view holder's view.
* @return The view to be added to the caller's view hierarchy.
*/
- public void onBindViewHolder(ViewHolder vh, GuidedAction action) {
+ public void onBindViewHolder(@NonNull ViewHolder vh, @NonNull GuidedAction action) {
vh.mAction = action;
if (vh.mTitleView != null) {
vh.mTitleView.setInputType(action.getInputType());
@@ -695,13 +713,13 @@
vh.mTitleView.setLongClickable(false);
if (Build.VERSION.SDK_INT >= 28) {
if (action.isEditable()) {
- vh.mTitleView.setAutofillHints(action.getAutofillHints());
+ Api26Impl.setAutofillHints(vh.mTitleView, action.getAutofillHints());
} else {
- vh.mTitleView.setAutofillHints((String[]) null);
+ Api26Impl.setAutofillHints(vh.mTitleView, (String[]) null);
}
} else if (VERSION.SDK_INT >= 26) {
// disable autofill below P as dpad/keyboard is not supported
- vh.mTitleView.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);
+ Api26Impl.setImportantForAutofill(vh.mTitleView, View.IMPORTANT_FOR_AUTOFILL_NO);
}
}
if (vh.mDescriptionView != null) {
@@ -716,13 +734,13 @@
vh.mDescriptionView.setLongClickable(false);
if (Build.VERSION.SDK_INT >= 28) {
if (action.isDescriptionEditable()) {
- vh.mDescriptionView.setAutofillHints(action.getAutofillHints());
+ Api26Impl.setAutofillHints(vh.mDescriptionView, action.getAutofillHints());
} else {
- vh.mDescriptionView.setAutofillHints((String[]) null);
+ Api26Impl.setAutofillHints(vh.mDescriptionView, (String[]) null);
}
} else if (VERSION.SDK_INT >= 26) {
// disable autofill below P as dpad/keyboard is not supported
- vh.mTitleView.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);
+ Api26Impl.setImportantForAutofill(vh.mTitleView, View.IMPORTANT_FOR_AUTOFILL_NO);
}
}
// Clients might want the check mark view to be gone entirely, in which case, ignore it.
@@ -769,7 +787,7 @@
/**
* Switches action to edit mode and pops up the keyboard.
*/
- public void openInEditMode(GuidedAction action) {
+ public void openInEditMode(@NonNull GuidedAction action) {
final GuidedActionAdapter guidedActionAdapter =
(GuidedActionAdapter) getActionsGridView().getAdapter();
int actionIndex = guidedActionAdapter.getActions().indexOf(action);
@@ -779,7 +797,7 @@
getActionsGridView().setSelectedPosition(actionIndex, new ViewHolderTask() {
@Override
- public void run(RecyclerView.ViewHolder viewHolder) {
+ public void run(@NonNull RecyclerView.ViewHolder viewHolder) {
ViewHolder vh = (ViewHolder) viewHolder;
guidedActionAdapter.mGroup.openIme(guidedActionAdapter, vh);
}
@@ -803,7 +821,7 @@
* @param vh The view holder to be associated with the given action.
* @param action The guided action to be displayed by the view holder's view.
*/
- protected void setupImeOptions(ViewHolder vh, GuidedAction action) {
+ protected void setupImeOptions(@NonNull ViewHolder vh, @NonNull GuidedAction action) {
setupNextImeOptions(vh.getEditableTitleView());
setupNextImeOptions(vh.getEditableDescriptionView());
}
@@ -851,7 +869,10 @@
* @param withTransition True to run expand transiiton, false otherwise.
*/
@CallSuper
- protected void onEditingModeChange(ViewHolder vh, boolean editing, boolean withTransition) {
+ protected void onEditingModeChange(
+ @NonNull ViewHolder vh,
+ boolean editing,
+ boolean withTransition) {
GuidedAction action = vh.getAction();
TextView titleView = vh.getTitleView();
TextView descriptionView = vh.getDescriptionView();
@@ -915,7 +936,7 @@
* @param vh The view holder associated with the relevant action.
* @param focused True if the action has become focused, false if it has lost focus.
*/
- public void onAnimateItemFocused(ViewHolder vh, boolean focused) {
+ public void onAnimateItemFocused(@NonNull ViewHolder vh, boolean focused) {
// No animations for this, currently, because the animation is done on
// mSelectorView
}
@@ -926,7 +947,7 @@
* @param vh The view holder associated with the relevant action.
* @param pressed True if the action has been pressed, false if it has been unpressed.
*/
- public void onAnimateItemPressed(ViewHolder vh, boolean pressed) {
+ public void onAnimateItemPressed(@NonNull ViewHolder vh, boolean pressed) {
vh.press(pressed);
}
@@ -934,7 +955,7 @@
* Resets the view holder's view to unpressed state.
* @param vh The view holder associated with the relevant action.
*/
- public void onAnimateItemPressedCancelled(ViewHolder vh) {
+ public void onAnimateItemPressedCancelled(@NonNull ViewHolder vh) {
vh.press(false);
}
@@ -947,7 +968,7 @@
* @param checked True if the action has become checked, false if it has become unchecked.
* @see #onBindCheckMarkView(ViewHolder, GuidedAction)
*/
- public void onAnimateItemChecked(ViewHolder vh, boolean checked) {
+ public void onAnimateItemChecked(@NonNull ViewHolder vh, boolean checked) {
if (vh.mCheckmarkView instanceof Checkable) {
((Checkable) vh.mCheckmarkView).setChecked(checked);
}
@@ -968,7 +989,7 @@
* @param action The GuidedAction object to bind to.
* @see #onAnimateItemChecked(ViewHolder, boolean)
*/
- public void onBindCheckMarkView(ViewHolder vh, GuidedAction action) {
+ public void onBindCheckMarkView(@NonNull ViewHolder vh, @NonNull GuidedAction action) {
if (action.getCheckSetId() != GuidedAction.NO_CHECK_SET) {
vh.mCheckmarkView.setVisibility(View.VISIBLE);
int attrId = action.getCheckSetId() == GuidedAction.CHECKBOX_CHECK_SET_ID
@@ -995,7 +1016,7 @@
* @param vh ViewHolder of activator view.
* @param action GuidedAction to bind.
*/
- public void onBindActivatorView(ViewHolder vh, GuidedAction action) {
+ public void onBindActivatorView(@NonNull ViewHolder vh, @NonNull GuidedAction action) {
if (action instanceof GuidedDatePickerAction) {
GuidedDatePickerAction dateAction = (GuidedDatePickerAction) action;
DatePicker dateView = (DatePicker) vh.mActivatorView;
@@ -1020,7 +1041,7 @@
* @param action GuidedAction to update.
* @return True if value has been updated, false otherwise.
*/
- public boolean onUpdateActivatorView(ViewHolder vh, GuidedAction action) {
+ public boolean onUpdateActivatorView(@NonNull ViewHolder vh, @NonNull GuidedAction action) {
if (action instanceof GuidedDatePickerAction) {
GuidedDatePickerAction dateAction = (GuidedDatePickerAction) action;
DatePicker dateView = (DatePicker) vh.mActivatorView;
@@ -1037,7 +1058,7 @@
* @hide
*/
@RestrictTo(LIBRARY_GROUP_PREFIX)
- public void setEditListener(EditListener listener) {
+ public void setEditListener(@NonNull EditListener listener) {
mEditListener = listener;
}
@@ -1076,7 +1097,7 @@
* @param vh The view holder associated with the relevant action.
* @param action The GuidedAction object to bind to.
*/
- public void onBindChevronView(ViewHolder vh, GuidedAction action) {
+ public void onBindChevronView(@NonNull ViewHolder vh, @NonNull GuidedAction action) {
final boolean hasNext = action.hasNext();
final boolean hasSubActions = action.hasSubActions();
if (hasNext || hasSubActions) {
@@ -1191,7 +1212,7 @@
* @param action Action to expand.
* @param withTransition True to run transition animation, false otherwsie.
*/
- public void expandAction(GuidedAction action, final boolean withTransition) {
+ public void expandAction(@NonNull GuidedAction action, final boolean withTransition) {
if (isInExpandTransition() || mExpandedAction != null) {
return;
}
@@ -1388,6 +1409,7 @@
/**
* @return Current expanded GuidedAction or null if not expanded.
*/
+ @Nullable
public GuidedAction getExpandedAction() {
return mExpandedAction;
}
@@ -1397,7 +1419,7 @@
* @param avh When not null, the GuidedActionStylist expands the sub actions of avh. When null
* the GuidedActionStylist will collapse sub actions.
*/
- public void onUpdateExpandedViewHolder(ViewHolder avh) {
+ public void onUpdateExpandedViewHolder(@Nullable ViewHolder avh) {
// Note about setting the prune child flag back & forth here: without this, the actions that
// go off the screen from the top or bottom become invisible forever. This is because once
@@ -1555,4 +1577,23 @@
return (int)(mDisplayHeight - 2*mVerticalPadding - 2*mTitleMaxLines*title.getLineHeight());
}
+ @RequiresApi(26)
+ static class Api26Impl {
+ private Api26Impl() {
+ // This class is not instantiable.
+ }
+
+ @androidx.annotation.DoNotInline
+ static void setAutofillHints(View view, String... autofillHints) {
+ view.setAutofillHints(autofillHints);
+ }
+
+ @androidx.annotation.DoNotInline
+ static void setImportantForAutofill(
+ View view,
+ @SuppressWarnings("SameParameterValue") int mode
+ ) {
+ view.setImportantForAutofill(mode);
+ }
+ }
}
diff --git a/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaLibraryServiceTest.java b/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaLibraryServiceTest.java
index 78dd71b..7e8518b 100644
--- a/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaLibraryServiceTest.java
+++ b/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaLibraryServiceTest.java
@@ -55,6 +55,7 @@
import androidx.annotation.NonNull;
import androidx.media2.session.MediaLibraryService;
import androidx.media2.test.common.TestUtils;
+import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import org.junit.Ignore;
@@ -657,6 +658,7 @@
}
// TODO: Add test for onCustomCommand() in MediaLibrarySessionLegacyCallbackTest.
+ @FlakyTest(bugId = 236961183)
@Test
public void customAction() throws InterruptedException {
final Bundle testArgs = new Bundle();
@@ -677,6 +679,7 @@
}
// TODO: Add test for onCustomCommand() in MediaLibrarySessionLegacyCallbackTest.
+ @FlakyTest(bugId = 236961183)
@Test
public void customAction_rejected() throws InterruptedException {
// This action will not be allowed by the library session.
diff --git a/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaSessionServiceTest.java b/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaSessionServiceTest.java
index 07fd59f..00b9b13 100644
--- a/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaSessionServiceTest.java
+++ b/media2/media2-session/version-compat-tests/previous/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatWithMediaSessionServiceTest.java
@@ -27,6 +27,7 @@
import android.support.v4.media.session.MediaControllerCompat;
import androidx.media2.session.MediaSessionService;
+import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import org.junit.After;
@@ -78,6 +79,7 @@
BROWSER_COMPAT_CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS));
}
+ @FlakyTest(bugId = 236961183)
@Test
public void connect() throws InterruptedException {
connectAndWait();
diff --git a/mediarouter/OWNERS b/mediarouter/OWNERS
index 5ac7be6..32622fd 100644
--- a/mediarouter/OWNERS
+++ b/mediarouter/OWNERS
@@ -1,13 +1,8 @@
# Bug component: 461042
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
diff --git a/paging/paging-runtime/src/androidTest/java/androidx/paging/StateRestorationTest.kt b/paging/paging-runtime/src/androidTest/java/androidx/paging/StateRestorationTest.kt
index 54f0b86..338644c 100644
--- a/paging/paging-runtime/src/androidTest/java/androidx/paging/StateRestorationTest.kt
+++ b/paging/paging-runtime/src/androidTest/java/androidx/paging/StateRestorationTest.kt
@@ -322,7 +322,7 @@
private fun saveAndRestore() {
val state = recyclerView.saveState()
createRecyclerView()
- recyclerView.restoreState(state)
+ recyclerView.restoreState(state!!)
measureAndLayout()
}
@@ -513,7 +513,7 @@
* RecyclerView class that allows saving and restoring state.
*/
class TestRecyclerView(context: Context) : RecyclerView(context) {
- fun restoreState(state: Parcelable?) {
+ fun restoreState(state: Parcelable) {
super.onRestoreInstanceState(state)
}
@@ -527,7 +527,7 @@
*/
class RestoreAwareLayoutManager(context: Context) : LinearLayoutManager(context) {
var restoredState = false
- override fun onRestoreInstanceState(state: Parcelable?) {
+ override fun onRestoreInstanceState(state: Parcelable) {
super.onRestoreInstanceState(state)
restoredState = true
}
diff --git a/preference/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java b/preference/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java
index 689c634..2c96f07 100644
--- a/preference/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java
+++ b/preference/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java
@@ -18,6 +18,7 @@
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
@@ -172,6 +173,7 @@
*
* @return The {@link DialogPreference} associated with this dialog
*/
+ @SuppressLint("UnknownNullness")
@SuppressWarnings("deprecation")
public DialogPreference getPreference() {
if (mPreference == null) {
diff --git a/preference/preference/src/main/java/androidx/preference/PreferenceViewHolder.java b/preference/preference/src/main/java/androidx/preference/PreferenceViewHolder.java
index 9ab1222..8d57a15 100644
--- a/preference/preference/src/main/java/androidx/preference/PreferenceViewHolder.java
+++ b/preference/preference/src/main/java/androidx/preference/PreferenceViewHolder.java
@@ -74,6 +74,7 @@
* @param id Resource ID of the view to find
* @return The view, or {@code null} if no view with the requested ID is found
*/
+ @Nullable
public View findViewById(@IdRes int id) {
final View cachedView = mCachedViews.get(id);
if (cachedView != null) {
diff --git a/recyclerview/recyclerview/api/current.txt b/recyclerview/recyclerview/api/current.txt
index 8b75972..77b3014 100644
--- a/recyclerview/recyclerview/api/current.txt
+++ b/recyclerview/recyclerview/api/current.txt
@@ -17,7 +17,7 @@
public static final class AsyncDifferConfig.Builder<T> {
ctor public AsyncDifferConfig.Builder(androidx.recyclerview.widget.DiffUtil.ItemCallback<T!>);
method public androidx.recyclerview.widget.AsyncDifferConfig<T!> build();
- method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T!> setBackgroundThreadExecutor(java.util.concurrent.Executor!);
+ method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T!> setBackgroundThreadExecutor(java.util.concurrent.Executor?);
}
public class AsyncListDiffer<T> {
@@ -64,7 +64,7 @@
public class BatchingListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
ctor public BatchingListUpdateCallback(androidx.recyclerview.widget.ListUpdateCallback);
method public void dispatchLastEvent();
- method public void onChanged(int, int, Object!);
+ method public void onChanged(int, int, Object?);
method public void onInserted(int, int);
method public void onMoved(int, int);
method public void onRemoved(int, int);
@@ -272,16 +272,16 @@
}
public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- ctor public LinearLayoutManager(android.content.Context!);
- ctor public LinearLayoutManager(android.content.Context!, int, boolean);
- ctor public LinearLayoutManager(android.content.Context!, android.util.AttributeSet!, int, int);
+ ctor public LinearLayoutManager(android.content.Context);
+ ctor public LinearLayoutManager(android.content.Context, int, boolean);
+ ctor public LinearLayoutManager(android.content.Context, android.util.AttributeSet?, int, int);
method protected void calculateExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State, int[]);
- method public android.graphics.PointF! computeScrollVectorForPosition(int);
+ method public android.graphics.PointF? computeScrollVectorForPosition(int);
method public int findFirstCompletelyVisibleItemPosition();
method public int findFirstVisibleItemPosition();
method public int findLastCompletelyVisibleItemPosition();
method public int findLastVisibleItemPosition();
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
+ method public androidx.recyclerview.widget.RecyclerView.LayoutParams generateDefaultLayoutParams();
method @Deprecated protected int getExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State!);
method public int getInitialPrefetchItemCount();
method public int getOrientation();
@@ -646,7 +646,7 @@
method public void addView(android.view.View!);
method public void addView(android.view.View!, int);
method public void assertInLayoutOrScroll(String!);
- method public void assertNotInLayoutOrScroll(String!);
+ method public void assertNotInLayoutOrScroll(String?);
method public void attachView(android.view.View, int, androidx.recyclerview.widget.RecyclerView.LayoutParams!);
method public void attachView(android.view.View, int);
method public void attachView(android.view.View);
@@ -655,8 +655,8 @@
method public boolean canScrollVertically();
method public boolean checkLayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
method public static int chooseSize(int, int, int);
- method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State!, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
- method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
+ method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry);
+ method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry);
method public int computeHorizontalScrollExtent(androidx.recyclerview.widget.RecyclerView.State);
method public int computeHorizontalScrollOffset(androidx.recyclerview.widget.RecyclerView.State);
method public int computeHorizontalScrollRange(androidx.recyclerview.widget.RecyclerView.State);
@@ -671,7 +671,7 @@
method public void endAnimation(android.view.View!);
method public android.view.View? findContainingItemView(android.view.View);
method public android.view.View? findViewByPosition(int);
- method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
+ method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams generateDefaultLayoutParams();
method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.content.Context!, android.util.AttributeSet!);
method public int getBaseline();
@@ -734,7 +734,7 @@
method public boolean onAddFocusables(androidx.recyclerview.widget.RecyclerView, java.util.ArrayList<android.view.View!>, int, int);
method @CallSuper public void onAttachedToWindow(androidx.recyclerview.widget.RecyclerView!);
method @Deprecated public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!);
- method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.Recycler!);
+ method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.Recycler);
method public android.view.View? onFocusSearchFailed(android.view.View, int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
method public void onInitializeAccessibilityEvent(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, android.view.accessibility.AccessibilityEvent);
@@ -747,12 +747,12 @@
method public void onItemsRemoved(androidx.recyclerview.widget.RecyclerView, int, int);
method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int);
method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int, Object?);
- method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
- method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State!);
+ method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
+ method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State);
method public void onMeasure(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, int);
method @Deprecated public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, android.view.View, android.view.View?);
method public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, android.view.View, android.view.View?);
- method public void onRestoreInstanceState(android.os.Parcelable!);
+ method public void onRestoreInstanceState(android.os.Parcelable);
method public android.os.Parcelable? onSaveInstanceState();
method public void onScrollStateChanged(int);
method public boolean performAccessibilityAction(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, android.os.Bundle?);
@@ -770,15 +770,15 @@
method public boolean requestChildRectangleOnScreen(androidx.recyclerview.widget.RecyclerView, android.view.View, android.graphics.Rect, boolean, boolean);
method public void requestLayout();
method public void requestSimpleAnimationsInNextLayout();
- method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
+ method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method public void scrollToPosition(int);
- method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
+ method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method @Deprecated public void setAutoMeasureEnabled(boolean);
method public final void setItemPrefetchEnabled(boolean);
method public void setMeasuredDimension(android.graphics.Rect!, int, int);
method public void setMeasuredDimension(int, int);
method public void setMeasurementCacheEnabled(boolean);
- method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.State!, int);
+ method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, int);
method public void startSmoothScroll(androidx.recyclerview.widget.RecyclerView.SmoothScroller!);
method public void stopIgnoringView(android.view.View);
method public boolean supportsPredictiveItemAnimations();
diff --git a/recyclerview/recyclerview/api/public_plus_experimental_current.txt b/recyclerview/recyclerview/api/public_plus_experimental_current.txt
index 8b75972..77b3014 100644
--- a/recyclerview/recyclerview/api/public_plus_experimental_current.txt
+++ b/recyclerview/recyclerview/api/public_plus_experimental_current.txt
@@ -17,7 +17,7 @@
public static final class AsyncDifferConfig.Builder<T> {
ctor public AsyncDifferConfig.Builder(androidx.recyclerview.widget.DiffUtil.ItemCallback<T!>);
method public androidx.recyclerview.widget.AsyncDifferConfig<T!> build();
- method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T!> setBackgroundThreadExecutor(java.util.concurrent.Executor!);
+ method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T!> setBackgroundThreadExecutor(java.util.concurrent.Executor?);
}
public class AsyncListDiffer<T> {
@@ -64,7 +64,7 @@
public class BatchingListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
ctor public BatchingListUpdateCallback(androidx.recyclerview.widget.ListUpdateCallback);
method public void dispatchLastEvent();
- method public void onChanged(int, int, Object!);
+ method public void onChanged(int, int, Object?);
method public void onInserted(int, int);
method public void onMoved(int, int);
method public void onRemoved(int, int);
@@ -272,16 +272,16 @@
}
public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- ctor public LinearLayoutManager(android.content.Context!);
- ctor public LinearLayoutManager(android.content.Context!, int, boolean);
- ctor public LinearLayoutManager(android.content.Context!, android.util.AttributeSet!, int, int);
+ ctor public LinearLayoutManager(android.content.Context);
+ ctor public LinearLayoutManager(android.content.Context, int, boolean);
+ ctor public LinearLayoutManager(android.content.Context, android.util.AttributeSet?, int, int);
method protected void calculateExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State, int[]);
- method public android.graphics.PointF! computeScrollVectorForPosition(int);
+ method public android.graphics.PointF? computeScrollVectorForPosition(int);
method public int findFirstCompletelyVisibleItemPosition();
method public int findFirstVisibleItemPosition();
method public int findLastCompletelyVisibleItemPosition();
method public int findLastVisibleItemPosition();
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
+ method public androidx.recyclerview.widget.RecyclerView.LayoutParams generateDefaultLayoutParams();
method @Deprecated protected int getExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State!);
method public int getInitialPrefetchItemCount();
method public int getOrientation();
@@ -646,7 +646,7 @@
method public void addView(android.view.View!);
method public void addView(android.view.View!, int);
method public void assertInLayoutOrScroll(String!);
- method public void assertNotInLayoutOrScroll(String!);
+ method public void assertNotInLayoutOrScroll(String?);
method public void attachView(android.view.View, int, androidx.recyclerview.widget.RecyclerView.LayoutParams!);
method public void attachView(android.view.View, int);
method public void attachView(android.view.View);
@@ -655,8 +655,8 @@
method public boolean canScrollVertically();
method public boolean checkLayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
method public static int chooseSize(int, int, int);
- method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State!, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
- method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
+ method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry);
+ method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry);
method public int computeHorizontalScrollExtent(androidx.recyclerview.widget.RecyclerView.State);
method public int computeHorizontalScrollOffset(androidx.recyclerview.widget.RecyclerView.State);
method public int computeHorizontalScrollRange(androidx.recyclerview.widget.RecyclerView.State);
@@ -671,7 +671,7 @@
method public void endAnimation(android.view.View!);
method public android.view.View? findContainingItemView(android.view.View);
method public android.view.View? findViewByPosition(int);
- method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
+ method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams generateDefaultLayoutParams();
method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.content.Context!, android.util.AttributeSet!);
method public int getBaseline();
@@ -734,7 +734,7 @@
method public boolean onAddFocusables(androidx.recyclerview.widget.RecyclerView, java.util.ArrayList<android.view.View!>, int, int);
method @CallSuper public void onAttachedToWindow(androidx.recyclerview.widget.RecyclerView!);
method @Deprecated public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!);
- method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.Recycler!);
+ method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.Recycler);
method public android.view.View? onFocusSearchFailed(android.view.View, int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
method public void onInitializeAccessibilityEvent(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, android.view.accessibility.AccessibilityEvent);
@@ -747,12 +747,12 @@
method public void onItemsRemoved(androidx.recyclerview.widget.RecyclerView, int, int);
method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int);
method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int, Object?);
- method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
- method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State!);
+ method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
+ method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State);
method public void onMeasure(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, int);
method @Deprecated public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, android.view.View, android.view.View?);
method public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, android.view.View, android.view.View?);
- method public void onRestoreInstanceState(android.os.Parcelable!);
+ method public void onRestoreInstanceState(android.os.Parcelable);
method public android.os.Parcelable? onSaveInstanceState();
method public void onScrollStateChanged(int);
method public boolean performAccessibilityAction(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, android.os.Bundle?);
@@ -770,15 +770,15 @@
method public boolean requestChildRectangleOnScreen(androidx.recyclerview.widget.RecyclerView, android.view.View, android.graphics.Rect, boolean, boolean);
method public void requestLayout();
method public void requestSimpleAnimationsInNextLayout();
- method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
+ method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method public void scrollToPosition(int);
- method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
+ method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method @Deprecated public void setAutoMeasureEnabled(boolean);
method public final void setItemPrefetchEnabled(boolean);
method public void setMeasuredDimension(android.graphics.Rect!, int, int);
method public void setMeasuredDimension(int, int);
method public void setMeasurementCacheEnabled(boolean);
- method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.State!, int);
+ method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, int);
method public void startSmoothScroll(androidx.recyclerview.widget.RecyclerView.SmoothScroller!);
method public void stopIgnoringView(android.view.View);
method public boolean supportsPredictiveItemAnimations();
diff --git a/recyclerview/recyclerview/api/restricted_current.txt b/recyclerview/recyclerview/api/restricted_current.txt
index fcd6383..53a8406 100644
--- a/recyclerview/recyclerview/api/restricted_current.txt
+++ b/recyclerview/recyclerview/api/restricted_current.txt
@@ -17,7 +17,7 @@
public static final class AsyncDifferConfig.Builder<T> {
ctor public AsyncDifferConfig.Builder(androidx.recyclerview.widget.DiffUtil.ItemCallback<T!>);
method public androidx.recyclerview.widget.AsyncDifferConfig<T!> build();
- method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T!> setBackgroundThreadExecutor(java.util.concurrent.Executor!);
+ method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T!> setBackgroundThreadExecutor(java.util.concurrent.Executor?);
}
public class AsyncListDiffer<T> {
@@ -64,7 +64,7 @@
public class BatchingListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
ctor public BatchingListUpdateCallback(androidx.recyclerview.widget.ListUpdateCallback);
method public void dispatchLastEvent();
- method public void onChanged(int, int, Object!);
+ method public void onChanged(int, int, Object?);
method public void onInserted(int, int);
method public void onMoved(int, int);
method public void onRemoved(int, int);
@@ -272,16 +272,16 @@
}
public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- ctor public LinearLayoutManager(android.content.Context!);
- ctor public LinearLayoutManager(android.content.Context!, @androidx.recyclerview.widget.RecyclerView.Orientation int, boolean);
- ctor public LinearLayoutManager(android.content.Context!, android.util.AttributeSet!, int, int);
+ ctor public LinearLayoutManager(android.content.Context);
+ ctor public LinearLayoutManager(android.content.Context, @androidx.recyclerview.widget.RecyclerView.Orientation int, boolean);
+ ctor public LinearLayoutManager(android.content.Context, android.util.AttributeSet?, int, int);
method protected void calculateExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State, int[]);
- method public android.graphics.PointF! computeScrollVectorForPosition(int);
+ method public android.graphics.PointF? computeScrollVectorForPosition(int);
method public int findFirstCompletelyVisibleItemPosition();
method public int findFirstVisibleItemPosition();
method public int findLastCompletelyVisibleItemPosition();
method public int findLastVisibleItemPosition();
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
+ method public androidx.recyclerview.widget.RecyclerView.LayoutParams generateDefaultLayoutParams();
method @Deprecated protected int getExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State!);
method public int getInitialPrefetchItemCount();
method @androidx.recyclerview.widget.RecyclerView.Orientation public int getOrientation();
@@ -646,7 +646,7 @@
method public void addView(android.view.View!);
method public void addView(android.view.View!, int);
method public void assertInLayoutOrScroll(String!);
- method public void assertNotInLayoutOrScroll(String!);
+ method public void assertNotInLayoutOrScroll(String?);
method public void attachView(android.view.View, int, androidx.recyclerview.widget.RecyclerView.LayoutParams!);
method public void attachView(android.view.View, int);
method public void attachView(android.view.View);
@@ -655,8 +655,8 @@
method public boolean canScrollVertically();
method public boolean checkLayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
method public static int chooseSize(int, int, int);
- method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State!, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
- method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
+ method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry);
+ method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry);
method public int computeHorizontalScrollExtent(androidx.recyclerview.widget.RecyclerView.State);
method public int computeHorizontalScrollOffset(androidx.recyclerview.widget.RecyclerView.State);
method public int computeHorizontalScrollRange(androidx.recyclerview.widget.RecyclerView.State);
@@ -671,7 +671,7 @@
method public void endAnimation(android.view.View!);
method public android.view.View? findContainingItemView(android.view.View);
method public android.view.View? findViewByPosition(int);
- method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
+ method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams generateDefaultLayoutParams();
method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.content.Context!, android.util.AttributeSet!);
method public int getBaseline();
@@ -734,7 +734,7 @@
method public boolean onAddFocusables(androidx.recyclerview.widget.RecyclerView, java.util.ArrayList<android.view.View!>, int, int);
method @CallSuper public void onAttachedToWindow(androidx.recyclerview.widget.RecyclerView!);
method @Deprecated public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!);
- method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.Recycler!);
+ method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.Recycler);
method public android.view.View? onFocusSearchFailed(android.view.View, int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
method public void onInitializeAccessibilityEvent(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, android.view.accessibility.AccessibilityEvent);
@@ -747,12 +747,12 @@
method public void onItemsRemoved(androidx.recyclerview.widget.RecyclerView, int, int);
method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int);
method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int, Object?);
- method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
- method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State!);
+ method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
+ method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State);
method public void onMeasure(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, int);
method @Deprecated public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, android.view.View, android.view.View?);
method public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, android.view.View, android.view.View?);
- method public void onRestoreInstanceState(android.os.Parcelable!);
+ method public void onRestoreInstanceState(android.os.Parcelable);
method public android.os.Parcelable? onSaveInstanceState();
method public void onScrollStateChanged(int);
method public boolean performAccessibilityAction(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, android.os.Bundle?);
@@ -770,15 +770,15 @@
method public boolean requestChildRectangleOnScreen(androidx.recyclerview.widget.RecyclerView, android.view.View, android.graphics.Rect, boolean, boolean);
method public void requestLayout();
method public void requestSimpleAnimationsInNextLayout();
- method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
+ method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method public void scrollToPosition(int);
- method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
+ method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
method @Deprecated public void setAutoMeasureEnabled(boolean);
method public final void setItemPrefetchEnabled(boolean);
method public void setMeasuredDimension(android.graphics.Rect!, int, int);
method public void setMeasuredDimension(int, int);
method public void setMeasurementCacheEnabled(boolean);
- method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.State!, int);
+ method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, int);
method public void startSmoothScroll(androidx.recyclerview.widget.RecyclerView.SmoothScroller!);
method public void stopIgnoringView(android.view.View);
method public boolean supportsPredictiveItemAnimations();
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityLifecycleTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityLifecycleTest.java
index 9000986..0843578 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityLifecycleTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityLifecycleTest.java
@@ -478,12 +478,13 @@
};
recyclerView.setAccessibilityDelegateCompat(
new RecyclerViewAccessibilityDelegate(recyclerView) {
+ @NonNull
@Override
public AccessibilityDelegateCompat getItemDelegate() {
return new RecyclerViewAccessibilityDelegate.ItemDelegate(this) {
@Override
- public void onInitializeAccessibilityNodeInfo(View host,
- AccessibilityNodeInfoCompat info) {
+ public void onInitializeAccessibilityNodeInfo(@NonNull View host,
+ @NonNull AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setChecked(true);
}
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java
index 82b203c..ccd9cfa 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java
@@ -89,7 +89,7 @@
* If provided, defines the main thread executor used to dispatch adapter update
* notifications on the main thread.
* <p>
- * If not provided, it will default to the main thread.
+ * If not provided or null, it will default to the main thread.
*
* @param executor The executor which can run tasks in the UI thread.
* @return this
@@ -98,7 +98,7 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
@NonNull
- public Builder<T> setMainThreadExecutor(Executor executor) {
+ public Builder<T> setMainThreadExecutor(@Nullable Executor executor) {
mMainThreadExecutor = executor;
return this;
}
@@ -107,14 +107,15 @@
* If provided, defines the background executor used to calculate the diff between an old
* and a new list.
* <p>
- * If not provided, defaults to two thread pool executor, shared by all ListAdapterConfigs.
+ * If not provided or null, defaults to two thread pool executor, shared by all
+ * ListAdapterConfigs.
*
* @param executor The background executor to run list diffing.
* @return this
*/
@SuppressWarnings({"unused", "WeakerAccess"})
@NonNull
- public Builder<T> setBackgroundThreadExecutor(Executor executor) {
+ public Builder<T> setBackgroundThreadExecutor(@Nullable Executor executor) {
mBackgroundThreadExecutor = executor;
return this;
}
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/BatchingListUpdateCallback.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/BatchingListUpdateCallback.java
index f49451f..f227a02 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/BatchingListUpdateCallback.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/BatchingListUpdateCallback.java
@@ -16,6 +16,7 @@
package androidx.recyclerview.widget;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
/**
* Wraps a {@link ListUpdateCallback} callback and batches operations that can be merged.
@@ -106,7 +107,7 @@
}
@Override
- public void onChanged(int position, int count, Object payload) {
+ public void onChanged(int position, int count, @Nullable Object payload) {
if (mLastEventType == TYPE_CHANGE &&
!(position > mLastEventPosition + mLastEventCount
|| position + count < mLastEventPosition || mLastEventPayload != payload)) {
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java
index e8f2912..8386fcf 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java
@@ -30,6 +30,7 @@
import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.os.TraceCompat;
import androidx.core.view.ViewCompat;
@@ -155,7 +156,7 @@
*
* @param context Current context, will be used to access resources.
*/
- public LinearLayoutManager(Context context) {
+ public LinearLayoutManager(@NonNull Context context) {
this(context, RecyclerView.DEFAULT_ORIENTATION, false);
}
@@ -165,7 +166,7 @@
* #VERTICAL}.
* @param reverseLayout When set to true, layouts from end to start.
*/
- public LinearLayoutManager(Context context, @RecyclerView.Orientation int orientation,
+ public LinearLayoutManager(@NonNull Context context, @RecyclerView.Orientation int orientation,
boolean reverseLayout) {
setOrientation(orientation);
setReverseLayout(reverseLayout);
@@ -179,8 +180,12 @@
* {@link androidx.recyclerview.R.attr#reverseLayout}
* {@link androidx.recyclerview.R.attr#stackFromEnd}
*/
- public LinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr,
- int defStyleRes) {
+ public LinearLayoutManager(
+ @NonNull Context context,
+ @Nullable AttributeSet attrs,
+ int defStyleAttr,
+ int defStyleRes
+ ) {
Properties properties = getProperties(context, attrs, defStyleAttr, defStyleRes);
setOrientation(properties.orientation);
setReverseLayout(properties.reverseLayout);
@@ -195,6 +200,7 @@
/**
* {@inheritDoc}
*/
+ @NonNull
@Override
public RecyclerView.LayoutParams generateDefaultLayoutParams() {
return new RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
@@ -230,7 +236,10 @@
}
@Override
- public void onDetachedFromWindow(RecyclerView view, RecyclerView.Recycler recycler) {
+ public void onDetachedFromWindow(
+ @NonNull RecyclerView view,
+ @NonNull RecyclerView.Recycler recycler
+ ) {
super.onDetachedFromWindow(view, recycler);
if (mRecycleChildrenOnDetach) {
removeAndRecycleAllViews(recycler);
@@ -239,7 +248,7 @@
}
@Override
- public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
+ public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (getChildCount() > 0) {
event.setFromIndex(findFirstVisibleItemPosition());
@@ -247,6 +256,7 @@
}
}
+ @Nullable
@Override
public Parcelable onSaveInstanceState() {
if (mPendingSavedState != null) {
@@ -275,7 +285,7 @@
}
@Override
- public void onRestoreInstanceState(Parcelable state) {
+ public void onRestoreInstanceState(@NonNull Parcelable state) {
if (state instanceof SavedState) {
mPendingSavedState = (SavedState) state;
if (mPendingScrollPosition != RecyclerView.NO_POSITION) {
@@ -405,6 +415,7 @@
/**
* {@inheritDoc}
*/
+ @Nullable
@Override
public View findViewByPosition(int position) {
final int childCount = getChildCount();
@@ -500,14 +511,18 @@
}
@Override
- public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
- int position) {
+ public void smoothScrollToPosition(
+ @NonNull RecyclerView recyclerView,
+ @NonNull RecyclerView.State state,
+ int position
+ ) {
LinearSmoothScroller linearSmoothScroller =
new LinearSmoothScroller(recyclerView.getContext());
linearSmoothScroller.setTargetPosition(position);
startSmoothScroll(linearSmoothScroller);
}
+ @Nullable
@Override
public PointF computeScrollVectorForPosition(int targetPosition) {
if (getChildCount() == 0) {
@@ -526,7 +541,10 @@
* {@inheritDoc}
*/
@Override
- public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
+ public void onLayoutChildren(
+ @NonNull RecyclerView.Recycler recycler,
+ @NonNull RecyclerView.State state
+ ) {
// layout algorithm:
// 1) by checking children and other variables, find an anchor coordinate and an anchor
// item position.
@@ -724,7 +742,7 @@
}
@Override
- public void onLayoutCompleted(RecyclerView.State state) {
+ public void onLayoutCompleted(@NonNull RecyclerView.State state) {
super.onLayoutCompleted(state);
mPendingSavedState = null; // we don't need this anymore
mPendingScrollPosition = RecyclerView.NO_POSITION;
@@ -1116,8 +1134,8 @@
* {@inheritDoc}
*/
@Override
- public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler,
- RecyclerView.State state) {
+ public int scrollHorizontallyBy(int dx, @NonNull RecyclerView.Recycler recycler,
+ @NonNull RecyclerView.State state) {
if (mOrientation == VERTICAL) {
return 0;
}
@@ -1128,8 +1146,8 @@
* {@inheritDoc}
*/
@Override
- public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler,
- RecyclerView.State state) {
+ public int scrollVerticallyBy(int dy, @NonNull RecyclerView.Recycler recycler,
+ @NonNull RecyclerView.State state) {
if (mOrientation == HORIZONTAL) {
return 0;
}
@@ -1137,32 +1155,32 @@
}
@Override
- public int computeHorizontalScrollOffset(RecyclerView.State state) {
+ public int computeHorizontalScrollOffset(@NonNull RecyclerView.State state) {
return computeScrollOffset(state);
}
@Override
- public int computeVerticalScrollOffset(RecyclerView.State state) {
+ public int computeVerticalScrollOffset(@NonNull RecyclerView.State state) {
return computeScrollOffset(state);
}
@Override
- public int computeHorizontalScrollExtent(RecyclerView.State state) {
+ public int computeHorizontalScrollExtent(@NonNull RecyclerView.State state) {
return computeScrollExtent(state);
}
@Override
- public int computeVerticalScrollExtent(RecyclerView.State state) {
+ public int computeVerticalScrollExtent(@NonNull RecyclerView.State state) {
return computeScrollExtent(state);
}
@Override
- public int computeHorizontalScrollRange(RecyclerView.State state) {
+ public int computeHorizontalScrollRange(@NonNull RecyclerView.State state) {
return computeScrollRange(state);
}
@Override
- public int computeVerticalScrollRange(RecyclerView.State state) {
+ public int computeVerticalScrollRange(@NonNull RecyclerView.State state) {
return computeScrollRange(state);
}
@@ -1288,7 +1306,7 @@
@Override
public void collectInitialPrefetchPositions(int adapterItemCount,
- LayoutPrefetchRegistry layoutPrefetchRegistry) {
+ @NonNull LayoutPrefetchRegistry layoutPrefetchRegistry) {
final boolean fromEnd;
final int anchorPos;
if (mPendingSavedState != null && mPendingSavedState.hasValidAnchor()) {
@@ -1367,8 +1385,8 @@
}
@Override
- public void collectAdjacentPrefetchPositions(int dx, int dy, RecyclerView.State state,
- LayoutPrefetchRegistry layoutPrefetchRegistry) {
+ public void collectAdjacentPrefetchPositions(int dx, int dy, @NonNull RecyclerView.State state,
+ @NonNull LayoutPrefetchRegistry layoutPrefetchRegistry) {
int delta = (mOrientation == HORIZONTAL) ? dx : dy;
if (getChildCount() == 0 || delta == 0) {
// can't support this scroll, so don't bother prefetching
@@ -1409,7 +1427,7 @@
}
@Override
- public void assertNotInLayoutOrScroll(String message) {
+ public void assertNotInLayoutOrScroll(@Nullable String message) {
if (mPendingSavedState == null) {
super.assertNotInLayoutOrScroll(message);
}
@@ -2062,9 +2080,10 @@
acceptableBoundsFlag);
}
+ @Nullable
@Override
- public View onFocusSearchFailed(View focused, int direction,
- RecyclerView.Recycler recycler, RecyclerView.State state) {
+ public View onFocusSearchFailed(@NonNull View focused, int direction,
+ @NonNull RecyclerView.Recycler recycler, @NonNull RecyclerView.State state) {
resolveShouldLayoutReverse();
if (getChildCount() == 0) {
return null;
@@ -2429,7 +2448,7 @@
mAnchorLayoutFromEnd = in.readInt() == 1;
}
- public SavedState(SavedState other) {
+ public SavedState(@NonNull SavedState other) {
mAnchorPosition = other.mAnchorPosition;
mAnchorOffset = other.mAnchorOffset;
mAnchorLayoutFromEnd = other.mAnchorLayoutFromEnd;
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
index 226d7a4..919e32c 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
@@ -8626,7 +8626,7 @@
* @param message The message for the exception. Can be null.
* @see #assertInLayoutOrScroll(String)
*/
- public void assertNotInLayoutOrScroll(String message) {
+ public void assertNotInLayoutOrScroll(@Nullable String message) {
if (mRecyclerView != null) {
mRecyclerView.assertNotInLayoutOrScroll(message);
}
@@ -8805,8 +8805,8 @@
* @see #isItemPrefetchEnabled()
* @see #collectInitialPrefetchPositions(int, LayoutPrefetchRegistry)
*/
- public void collectAdjacentPrefetchPositions(int dx, int dy, State state,
- LayoutPrefetchRegistry layoutPrefetchRegistry) {
+ public void collectAdjacentPrefetchPositions(int dx, int dy, @NonNull State state,
+ @NonNull LayoutPrefetchRegistry layoutPrefetchRegistry) {
}
/**
@@ -8834,7 +8834,7 @@
* @see #collectAdjacentPrefetchPositions(int, int, State, LayoutPrefetchRegistry)
*/
public void collectInitialPrefetchPositions(int adapterItemCount,
- LayoutPrefetchRegistry layoutPrefetchRegistry) {
+ @NonNull LayoutPrefetchRegistry layoutPrefetchRegistry) {
}
void dispatchAttachedToWindow(RecyclerView view) {
@@ -8940,7 +8940,7 @@
* @see #onAttachedToWindow(RecyclerView)
*/
@CallSuper
- public void onDetachedFromWindow(RecyclerView view, Recycler recycler) {
+ public void onDetachedFromWindow(@NonNull RecyclerView view, @NonNull Recycler recycler) {
onDetachedFromWindow(view);
}
@@ -9004,7 +9004,7 @@
* position
* @param state Transient state of RecyclerView
*/
- public void onLayoutChildren(Recycler recycler, State state) {
+ public void onLayoutChildren(@NonNull Recycler recycler, @NonNull State state) {
Log.e(TAG, "You must override onLayoutChildren(Recycler recycler, State state) ");
}
@@ -9019,7 +9019,7 @@
*
* @param state Transient state of RecyclerView
*/
- public void onLayoutCompleted(State state) {
+ public void onLayoutCompleted(@NonNull State state) {
}
/**
@@ -9037,6 +9037,7 @@
*
* @return A new LayoutParams for a child view
*/
+ @NonNull
public abstract LayoutParams generateDefaultLayoutParams();
/**
@@ -9107,7 +9108,7 @@
* negative and scrolling proceeeded in that direction.
* <code>Math.abs(result)</code> may be less than dx if a boundary was reached.
*/
- public int scrollHorizontallyBy(int dx, Recycler recycler, State state) {
+ public int scrollHorizontallyBy(int dx, @NonNull Recycler recycler, @NonNull State state) {
return 0;
}
@@ -9124,7 +9125,7 @@
* negative and scrolling proceeeded in that direction.
* <code>Math.abs(result)</code> may be less than dy if a boundary was reached.
*/
- public int scrollVerticallyBy(int dy, Recycler recycler, State state) {
+ public int scrollVerticallyBy(int dy, @NonNull Recycler recycler, @NonNull State state) {
return 0;
}
@@ -9171,8 +9172,11 @@
* @param state Current State of RecyclerView
* @param position Scroll to this adapter position.
*/
- public void smoothScrollToPosition(RecyclerView recyclerView, State state,
- int position) {
+ public void smoothScrollToPosition(
+ @NonNull RecyclerView recyclerView,
+ @NonNull State state,
+ int position
+ ) {
Log.e(TAG, "You must override smoothScrollToPosition to support smooth scrolling");
}
@@ -11005,7 +11009,7 @@
* @param state The parcelable that was returned by the previous LayoutManager's
* {@link #onSaveInstanceState()} method.
*/
- public void onRestoreInstanceState(Parcelable state) {
+ public void onRestoreInstanceState(@NonNull Parcelable state) {
}
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerViewAccessibilityDelegate.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerViewAccessibilityDelegate.java
index ea9fe93..fd9d86c 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerViewAccessibilityDelegate.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerViewAccessibilityDelegate.java
@@ -16,6 +16,7 @@
package androidx.recyclerview.widget;
+import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
@@ -40,7 +41,6 @@
final RecyclerView mRecyclerView;
private final ItemDelegate mItemDelegate;
-
public RecyclerViewAccessibilityDelegate(@NonNull RecyclerView recyclerView) {
mRecyclerView = recyclerView;
AccessibilityDelegateCompat itemDelegate = getItemDelegate();
@@ -56,7 +56,11 @@
}
@Override
- public boolean performAccessibilityAction(View host, int action, Bundle args) {
+ public boolean performAccessibilityAction(
+ @SuppressLint("InvalidNullabilityOverride") @NonNull View host,
+ int action,
+ @SuppressLint("InvalidNullabilityOverride") @Nullable Bundle args
+ ) {
if (super.performAccessibilityAction(host, action, args)) {
return true;
}
@@ -68,7 +72,10 @@
}
@Override
- public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
+ public void onInitializeAccessibilityNodeInfo(
+ @SuppressLint("InvalidNullabilityOverride") @NonNull View host,
+ @SuppressLint("InvalidNullabilityOverride") @NonNull AccessibilityNodeInfoCompat info
+ ) {
super.onInitializeAccessibilityNodeInfo(host, info);
if (!shouldIgnore() && mRecyclerView.getLayoutManager() != null) {
mRecyclerView.getLayoutManager().onInitializeAccessibilityNodeInfo(info);
@@ -76,7 +83,10 @@
}
@Override
- public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
+ public void onInitializeAccessibilityEvent(
+ @SuppressLint("InvalidNullabilityOverride") @NonNull View host,
+ @SuppressLint("InvalidNullabilityOverride") @NonNull AccessibilityEvent event
+ ) {
super.onInitializeAccessibilityEvent(host, event);
if (host instanceof RecyclerView && !shouldIgnore()) {
RecyclerView rv = (RecyclerView) host;
@@ -139,7 +149,11 @@
}
@Override
- public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
+ public void onInitializeAccessibilityNodeInfo(
+ @SuppressLint("InvalidNullabilityOverride") @NonNull View host,
+ @SuppressLint("InvalidNullabilityOverride") @NonNull
+ AccessibilityNodeInfoCompat info
+ ) {
if (!mRecyclerViewDelegate.shouldIgnore()
&& mRecyclerViewDelegate.mRecyclerView.getLayoutManager() != null) {
mRecyclerViewDelegate.mRecyclerView.getLayoutManager()
@@ -156,7 +170,11 @@
}
@Override
- public boolean performAccessibilityAction(View host, int action, Bundle args) {
+ public boolean performAccessibilityAction(
+ @SuppressLint("InvalidNullabilityOverride") @NonNull View host,
+ int action,
+ @SuppressLint("InvalidNullabilityOverride") @Nullable Bundle args
+ ) {
if (!mRecyclerViewDelegate.shouldIgnore()
&& mRecyclerViewDelegate.mRecyclerView.getLayoutManager() != null) {
AccessibilityDelegateCompat originalDelegate = mOriginalItemDelegates.get(host);
diff --git a/recyclerview/recyclerview/src/test/java/androidx/recyclerview/widget/DiffUtilTest.kt b/recyclerview/recyclerview/src/test/java/androidx/recyclerview/widget/DiffUtilTest.kt
index 5114f04..8aa135a 100644
--- a/recyclerview/recyclerview/src/test/java/androidx/recyclerview/widget/DiffUtilTest.kt
+++ b/recyclerview/recyclerview/src/test/java/androidx/recyclerview/widget/DiffUtilTest.kt
@@ -500,7 +500,7 @@
item.newItem,
`is`(true)
)
- } else if (duplicateDiffs.getOrDefault(after[index].id, 0) > 0 && item.newItem) {
+ } else if (duplicateDiffs.getOrElse(after[index].id) { 0 } > 0 && item.newItem) {
// a duplicated item might come as a new item, be OK with it
duplicateDiffs[after[index].id] = duplicateDiffs[after[index].id]!! - 1
} else if (after[index].changed) {
@@ -546,10 +546,10 @@
// we might create list w/ duplicates.
val duplicateDiffs = mutableMapOf<Long, Int>() // id to count
after.filterNot { it.newItem }.forEach {
- duplicateDiffs[it.id] = 1 + duplicateDiffs.getOrDefault(it.id, 1)
+ duplicateDiffs[it.id] = 1 + duplicateDiffs.getOrElse(it.id) { 1 }
}
before.forEach {
- duplicateDiffs[it.id] = -1 + duplicateDiffs.getOrDefault(it.id, 0)
+ duplicateDiffs[it.id] = -1 + duplicateDiffs.getOrElse(it.id) { 0 }
}
return duplicateDiffs
}
diff --git a/test/uiautomator/uiautomator/api/current.txt b/test/uiautomator/uiautomator/api/current.txt
index 58ac424..6b15918 100644
--- a/test/uiautomator/uiautomator/api/current.txt
+++ b/test/uiautomator/uiautomator/api/current.txt
@@ -2,77 +2,77 @@
package androidx.test.uiautomator {
public class By {
- method public static androidx.test.uiautomator.BySelector! checkable(boolean);
- method public static androidx.test.uiautomator.BySelector! checked(boolean);
- method public static androidx.test.uiautomator.BySelector! clazz(String!);
- method public static androidx.test.uiautomator.BySelector! clazz(String!, String!);
- method public static androidx.test.uiautomator.BySelector! clazz(Class!);
- method public static androidx.test.uiautomator.BySelector! clazz(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! clickable(boolean);
- method public static androidx.test.uiautomator.BySelector! copy(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! depth(int);
- method public static androidx.test.uiautomator.BySelector! desc(String!);
- method public static androidx.test.uiautomator.BySelector! desc(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! descContains(String!);
- method public static androidx.test.uiautomator.BySelector! descEndsWith(String!);
- method public static androidx.test.uiautomator.BySelector! descStartsWith(String!);
- method public static androidx.test.uiautomator.BySelector! enabled(boolean);
- method public static androidx.test.uiautomator.BySelector! focusable(boolean);
- method public static androidx.test.uiautomator.BySelector! focused(boolean);
- method public static androidx.test.uiautomator.BySelector! hasChild(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!, int);
- method public static androidx.test.uiautomator.BySelector! longClickable(boolean);
- method public static androidx.test.uiautomator.BySelector! pkg(String!);
- method public static androidx.test.uiautomator.BySelector! pkg(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! res(String!);
- method public static androidx.test.uiautomator.BySelector! res(String!, String!);
- method public static androidx.test.uiautomator.BySelector! res(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! scrollable(boolean);
- method public static androidx.test.uiautomator.BySelector! selected(boolean);
- method public static androidx.test.uiautomator.BySelector! text(String!);
- method public static androidx.test.uiautomator.BySelector! text(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! textContains(String!);
- method public static androidx.test.uiautomator.BySelector! textEndsWith(String!);
- method public static androidx.test.uiautomator.BySelector! textStartsWith(String!);
+ method public static androidx.test.uiautomator.BySelector checkable(boolean);
+ method public static androidx.test.uiautomator.BySelector checked(boolean);
+ method public static androidx.test.uiautomator.BySelector clazz(String);
+ method public static androidx.test.uiautomator.BySelector clazz(String, String);
+ method public static androidx.test.uiautomator.BySelector clazz(Class);
+ method public static androidx.test.uiautomator.BySelector clazz(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector clickable(boolean);
+ method public static androidx.test.uiautomator.BySelector copy(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector depth(int);
+ method public static androidx.test.uiautomator.BySelector desc(String);
+ method public static androidx.test.uiautomator.BySelector desc(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector descContains(String);
+ method public static androidx.test.uiautomator.BySelector descEndsWith(String);
+ method public static androidx.test.uiautomator.BySelector descStartsWith(String);
+ method public static androidx.test.uiautomator.BySelector enabled(boolean);
+ method public static androidx.test.uiautomator.BySelector focusable(boolean);
+ method public static androidx.test.uiautomator.BySelector focused(boolean);
+ method public static androidx.test.uiautomator.BySelector hasChild(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector, int);
+ method public static androidx.test.uiautomator.BySelector longClickable(boolean);
+ method public static androidx.test.uiautomator.BySelector pkg(String);
+ method public static androidx.test.uiautomator.BySelector pkg(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector res(String);
+ method public static androidx.test.uiautomator.BySelector res(String, String);
+ method public static androidx.test.uiautomator.BySelector res(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector scrollable(boolean);
+ method public static androidx.test.uiautomator.BySelector selected(boolean);
+ method public static androidx.test.uiautomator.BySelector text(String);
+ method public static androidx.test.uiautomator.BySelector text(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector textContains(String);
+ method public static androidx.test.uiautomator.BySelector textEndsWith(String);
+ method public static androidx.test.uiautomator.BySelector textStartsWith(String);
}
public class BySelector {
- method public androidx.test.uiautomator.BySelector! checkable(boolean);
- method public androidx.test.uiautomator.BySelector! checked(boolean);
- method public androidx.test.uiautomator.BySelector! clazz(String!);
- method public androidx.test.uiautomator.BySelector! clazz(String!, String!);
- method public androidx.test.uiautomator.BySelector! clazz(Class!);
- method public androidx.test.uiautomator.BySelector! clazz(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! clickable(boolean);
- method public androidx.test.uiautomator.BySelector! depth(int);
- method public androidx.test.uiautomator.BySelector! depth(int, int);
- method public androidx.test.uiautomator.BySelector! desc(String!);
- method public androidx.test.uiautomator.BySelector! desc(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! descContains(String!);
- method public androidx.test.uiautomator.BySelector! descEndsWith(String!);
- method public androidx.test.uiautomator.BySelector! descStartsWith(String!);
- method public androidx.test.uiautomator.BySelector! enabled(boolean);
- method public androidx.test.uiautomator.BySelector! focusable(boolean);
- method public androidx.test.uiautomator.BySelector! focused(boolean);
- method public androidx.test.uiautomator.BySelector! hasChild(androidx.test.uiautomator.BySelector!);
- method public androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!);
- method public androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!, int);
- method public androidx.test.uiautomator.BySelector! longClickable(boolean);
- method public androidx.test.uiautomator.BySelector! maxDepth(int);
- method public androidx.test.uiautomator.BySelector! minDepth(int);
- method public androidx.test.uiautomator.BySelector! pkg(String!);
- method public androidx.test.uiautomator.BySelector! pkg(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! res(String!);
- method public androidx.test.uiautomator.BySelector! res(String!, String!);
- method public androidx.test.uiautomator.BySelector! res(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! scrollable(boolean);
- method public androidx.test.uiautomator.BySelector! selected(boolean);
- method public androidx.test.uiautomator.BySelector! text(String!);
- method public androidx.test.uiautomator.BySelector! text(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! textContains(String!);
- method public androidx.test.uiautomator.BySelector! textEndsWith(String!);
- method public androidx.test.uiautomator.BySelector! textStartsWith(String!);
+ method public androidx.test.uiautomator.BySelector checkable(boolean);
+ method public androidx.test.uiautomator.BySelector checked(boolean);
+ method public androidx.test.uiautomator.BySelector clazz(String);
+ method public androidx.test.uiautomator.BySelector clazz(String, String);
+ method public androidx.test.uiautomator.BySelector clazz(Class);
+ method public androidx.test.uiautomator.BySelector clazz(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector clickable(boolean);
+ method public androidx.test.uiautomator.BySelector depth(int);
+ method public androidx.test.uiautomator.BySelector depth(int, int);
+ method public androidx.test.uiautomator.BySelector desc(String);
+ method public androidx.test.uiautomator.BySelector desc(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector descContains(String);
+ method public androidx.test.uiautomator.BySelector descEndsWith(String);
+ method public androidx.test.uiautomator.BySelector descStartsWith(String);
+ method public androidx.test.uiautomator.BySelector enabled(boolean);
+ method public androidx.test.uiautomator.BySelector focusable(boolean);
+ method public androidx.test.uiautomator.BySelector focused(boolean);
+ method public androidx.test.uiautomator.BySelector hasChild(androidx.test.uiautomator.BySelector);
+ method public androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector);
+ method public androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector, int);
+ method public androidx.test.uiautomator.BySelector longClickable(boolean);
+ method public androidx.test.uiautomator.BySelector maxDepth(int);
+ method public androidx.test.uiautomator.BySelector minDepth(int);
+ method public androidx.test.uiautomator.BySelector pkg(String);
+ method public androidx.test.uiautomator.BySelector pkg(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector res(String);
+ method public androidx.test.uiautomator.BySelector res(String, String);
+ method public androidx.test.uiautomator.BySelector res(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector scrollable(boolean);
+ method public androidx.test.uiautomator.BySelector selected(boolean);
+ method public androidx.test.uiautomator.BySelector text(String);
+ method public androidx.test.uiautomator.BySelector text(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector textContains(String);
+ method public androidx.test.uiautomator.BySelector textEndsWith(String);
+ method public androidx.test.uiautomator.BySelector textStartsWith(String);
}
public final class Configurator {
diff --git a/test/uiautomator/uiautomator/api/public_plus_experimental_current.txt b/test/uiautomator/uiautomator/api/public_plus_experimental_current.txt
index 58ac424..6b15918 100644
--- a/test/uiautomator/uiautomator/api/public_plus_experimental_current.txt
+++ b/test/uiautomator/uiautomator/api/public_plus_experimental_current.txt
@@ -2,77 +2,77 @@
package androidx.test.uiautomator {
public class By {
- method public static androidx.test.uiautomator.BySelector! checkable(boolean);
- method public static androidx.test.uiautomator.BySelector! checked(boolean);
- method public static androidx.test.uiautomator.BySelector! clazz(String!);
- method public static androidx.test.uiautomator.BySelector! clazz(String!, String!);
- method public static androidx.test.uiautomator.BySelector! clazz(Class!);
- method public static androidx.test.uiautomator.BySelector! clazz(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! clickable(boolean);
- method public static androidx.test.uiautomator.BySelector! copy(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! depth(int);
- method public static androidx.test.uiautomator.BySelector! desc(String!);
- method public static androidx.test.uiautomator.BySelector! desc(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! descContains(String!);
- method public static androidx.test.uiautomator.BySelector! descEndsWith(String!);
- method public static androidx.test.uiautomator.BySelector! descStartsWith(String!);
- method public static androidx.test.uiautomator.BySelector! enabled(boolean);
- method public static androidx.test.uiautomator.BySelector! focusable(boolean);
- method public static androidx.test.uiautomator.BySelector! focused(boolean);
- method public static androidx.test.uiautomator.BySelector! hasChild(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!, int);
- method public static androidx.test.uiautomator.BySelector! longClickable(boolean);
- method public static androidx.test.uiautomator.BySelector! pkg(String!);
- method public static androidx.test.uiautomator.BySelector! pkg(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! res(String!);
- method public static androidx.test.uiautomator.BySelector! res(String!, String!);
- method public static androidx.test.uiautomator.BySelector! res(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! scrollable(boolean);
- method public static androidx.test.uiautomator.BySelector! selected(boolean);
- method public static androidx.test.uiautomator.BySelector! text(String!);
- method public static androidx.test.uiautomator.BySelector! text(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! textContains(String!);
- method public static androidx.test.uiautomator.BySelector! textEndsWith(String!);
- method public static androidx.test.uiautomator.BySelector! textStartsWith(String!);
+ method public static androidx.test.uiautomator.BySelector checkable(boolean);
+ method public static androidx.test.uiautomator.BySelector checked(boolean);
+ method public static androidx.test.uiautomator.BySelector clazz(String);
+ method public static androidx.test.uiautomator.BySelector clazz(String, String);
+ method public static androidx.test.uiautomator.BySelector clazz(Class);
+ method public static androidx.test.uiautomator.BySelector clazz(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector clickable(boolean);
+ method public static androidx.test.uiautomator.BySelector copy(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector depth(int);
+ method public static androidx.test.uiautomator.BySelector desc(String);
+ method public static androidx.test.uiautomator.BySelector desc(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector descContains(String);
+ method public static androidx.test.uiautomator.BySelector descEndsWith(String);
+ method public static androidx.test.uiautomator.BySelector descStartsWith(String);
+ method public static androidx.test.uiautomator.BySelector enabled(boolean);
+ method public static androidx.test.uiautomator.BySelector focusable(boolean);
+ method public static androidx.test.uiautomator.BySelector focused(boolean);
+ method public static androidx.test.uiautomator.BySelector hasChild(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector, int);
+ method public static androidx.test.uiautomator.BySelector longClickable(boolean);
+ method public static androidx.test.uiautomator.BySelector pkg(String);
+ method public static androidx.test.uiautomator.BySelector pkg(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector res(String);
+ method public static androidx.test.uiautomator.BySelector res(String, String);
+ method public static androidx.test.uiautomator.BySelector res(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector scrollable(boolean);
+ method public static androidx.test.uiautomator.BySelector selected(boolean);
+ method public static androidx.test.uiautomator.BySelector text(String);
+ method public static androidx.test.uiautomator.BySelector text(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector textContains(String);
+ method public static androidx.test.uiautomator.BySelector textEndsWith(String);
+ method public static androidx.test.uiautomator.BySelector textStartsWith(String);
}
public class BySelector {
- method public androidx.test.uiautomator.BySelector! checkable(boolean);
- method public androidx.test.uiautomator.BySelector! checked(boolean);
- method public androidx.test.uiautomator.BySelector! clazz(String!);
- method public androidx.test.uiautomator.BySelector! clazz(String!, String!);
- method public androidx.test.uiautomator.BySelector! clazz(Class!);
- method public androidx.test.uiautomator.BySelector! clazz(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! clickable(boolean);
- method public androidx.test.uiautomator.BySelector! depth(int);
- method public androidx.test.uiautomator.BySelector! depth(int, int);
- method public androidx.test.uiautomator.BySelector! desc(String!);
- method public androidx.test.uiautomator.BySelector! desc(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! descContains(String!);
- method public androidx.test.uiautomator.BySelector! descEndsWith(String!);
- method public androidx.test.uiautomator.BySelector! descStartsWith(String!);
- method public androidx.test.uiautomator.BySelector! enabled(boolean);
- method public androidx.test.uiautomator.BySelector! focusable(boolean);
- method public androidx.test.uiautomator.BySelector! focused(boolean);
- method public androidx.test.uiautomator.BySelector! hasChild(androidx.test.uiautomator.BySelector!);
- method public androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!);
- method public androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!, int);
- method public androidx.test.uiautomator.BySelector! longClickable(boolean);
- method public androidx.test.uiautomator.BySelector! maxDepth(int);
- method public androidx.test.uiautomator.BySelector! minDepth(int);
- method public androidx.test.uiautomator.BySelector! pkg(String!);
- method public androidx.test.uiautomator.BySelector! pkg(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! res(String!);
- method public androidx.test.uiautomator.BySelector! res(String!, String!);
- method public androidx.test.uiautomator.BySelector! res(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! scrollable(boolean);
- method public androidx.test.uiautomator.BySelector! selected(boolean);
- method public androidx.test.uiautomator.BySelector! text(String!);
- method public androidx.test.uiautomator.BySelector! text(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! textContains(String!);
- method public androidx.test.uiautomator.BySelector! textEndsWith(String!);
- method public androidx.test.uiautomator.BySelector! textStartsWith(String!);
+ method public androidx.test.uiautomator.BySelector checkable(boolean);
+ method public androidx.test.uiautomator.BySelector checked(boolean);
+ method public androidx.test.uiautomator.BySelector clazz(String);
+ method public androidx.test.uiautomator.BySelector clazz(String, String);
+ method public androidx.test.uiautomator.BySelector clazz(Class);
+ method public androidx.test.uiautomator.BySelector clazz(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector clickable(boolean);
+ method public androidx.test.uiautomator.BySelector depth(int);
+ method public androidx.test.uiautomator.BySelector depth(int, int);
+ method public androidx.test.uiautomator.BySelector desc(String);
+ method public androidx.test.uiautomator.BySelector desc(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector descContains(String);
+ method public androidx.test.uiautomator.BySelector descEndsWith(String);
+ method public androidx.test.uiautomator.BySelector descStartsWith(String);
+ method public androidx.test.uiautomator.BySelector enabled(boolean);
+ method public androidx.test.uiautomator.BySelector focusable(boolean);
+ method public androidx.test.uiautomator.BySelector focused(boolean);
+ method public androidx.test.uiautomator.BySelector hasChild(androidx.test.uiautomator.BySelector);
+ method public androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector);
+ method public androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector, int);
+ method public androidx.test.uiautomator.BySelector longClickable(boolean);
+ method public androidx.test.uiautomator.BySelector maxDepth(int);
+ method public androidx.test.uiautomator.BySelector minDepth(int);
+ method public androidx.test.uiautomator.BySelector pkg(String);
+ method public androidx.test.uiautomator.BySelector pkg(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector res(String);
+ method public androidx.test.uiautomator.BySelector res(String, String);
+ method public androidx.test.uiautomator.BySelector res(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector scrollable(boolean);
+ method public androidx.test.uiautomator.BySelector selected(boolean);
+ method public androidx.test.uiautomator.BySelector text(String);
+ method public androidx.test.uiautomator.BySelector text(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector textContains(String);
+ method public androidx.test.uiautomator.BySelector textEndsWith(String);
+ method public androidx.test.uiautomator.BySelector textStartsWith(String);
}
public final class Configurator {
diff --git a/test/uiautomator/uiautomator/api/restricted_current.txt b/test/uiautomator/uiautomator/api/restricted_current.txt
index 58ac424..6b15918 100644
--- a/test/uiautomator/uiautomator/api/restricted_current.txt
+++ b/test/uiautomator/uiautomator/api/restricted_current.txt
@@ -2,77 +2,77 @@
package androidx.test.uiautomator {
public class By {
- method public static androidx.test.uiautomator.BySelector! checkable(boolean);
- method public static androidx.test.uiautomator.BySelector! checked(boolean);
- method public static androidx.test.uiautomator.BySelector! clazz(String!);
- method public static androidx.test.uiautomator.BySelector! clazz(String!, String!);
- method public static androidx.test.uiautomator.BySelector! clazz(Class!);
- method public static androidx.test.uiautomator.BySelector! clazz(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! clickable(boolean);
- method public static androidx.test.uiautomator.BySelector! copy(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! depth(int);
- method public static androidx.test.uiautomator.BySelector! desc(String!);
- method public static androidx.test.uiautomator.BySelector! desc(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! descContains(String!);
- method public static androidx.test.uiautomator.BySelector! descEndsWith(String!);
- method public static androidx.test.uiautomator.BySelector! descStartsWith(String!);
- method public static androidx.test.uiautomator.BySelector! enabled(boolean);
- method public static androidx.test.uiautomator.BySelector! focusable(boolean);
- method public static androidx.test.uiautomator.BySelector! focused(boolean);
- method public static androidx.test.uiautomator.BySelector! hasChild(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!);
- method public static androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!, int);
- method public static androidx.test.uiautomator.BySelector! longClickable(boolean);
- method public static androidx.test.uiautomator.BySelector! pkg(String!);
- method public static androidx.test.uiautomator.BySelector! pkg(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! res(String!);
- method public static androidx.test.uiautomator.BySelector! res(String!, String!);
- method public static androidx.test.uiautomator.BySelector! res(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! scrollable(boolean);
- method public static androidx.test.uiautomator.BySelector! selected(boolean);
- method public static androidx.test.uiautomator.BySelector! text(String!);
- method public static androidx.test.uiautomator.BySelector! text(java.util.regex.Pattern!);
- method public static androidx.test.uiautomator.BySelector! textContains(String!);
- method public static androidx.test.uiautomator.BySelector! textEndsWith(String!);
- method public static androidx.test.uiautomator.BySelector! textStartsWith(String!);
+ method public static androidx.test.uiautomator.BySelector checkable(boolean);
+ method public static androidx.test.uiautomator.BySelector checked(boolean);
+ method public static androidx.test.uiautomator.BySelector clazz(String);
+ method public static androidx.test.uiautomator.BySelector clazz(String, String);
+ method public static androidx.test.uiautomator.BySelector clazz(Class);
+ method public static androidx.test.uiautomator.BySelector clazz(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector clickable(boolean);
+ method public static androidx.test.uiautomator.BySelector copy(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector depth(int);
+ method public static androidx.test.uiautomator.BySelector desc(String);
+ method public static androidx.test.uiautomator.BySelector desc(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector descContains(String);
+ method public static androidx.test.uiautomator.BySelector descEndsWith(String);
+ method public static androidx.test.uiautomator.BySelector descStartsWith(String);
+ method public static androidx.test.uiautomator.BySelector enabled(boolean);
+ method public static androidx.test.uiautomator.BySelector focusable(boolean);
+ method public static androidx.test.uiautomator.BySelector focused(boolean);
+ method public static androidx.test.uiautomator.BySelector hasChild(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector);
+ method public static androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector, int);
+ method public static androidx.test.uiautomator.BySelector longClickable(boolean);
+ method public static androidx.test.uiautomator.BySelector pkg(String);
+ method public static androidx.test.uiautomator.BySelector pkg(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector res(String);
+ method public static androidx.test.uiautomator.BySelector res(String, String);
+ method public static androidx.test.uiautomator.BySelector res(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector scrollable(boolean);
+ method public static androidx.test.uiautomator.BySelector selected(boolean);
+ method public static androidx.test.uiautomator.BySelector text(String);
+ method public static androidx.test.uiautomator.BySelector text(java.util.regex.Pattern);
+ method public static androidx.test.uiautomator.BySelector textContains(String);
+ method public static androidx.test.uiautomator.BySelector textEndsWith(String);
+ method public static androidx.test.uiautomator.BySelector textStartsWith(String);
}
public class BySelector {
- method public androidx.test.uiautomator.BySelector! checkable(boolean);
- method public androidx.test.uiautomator.BySelector! checked(boolean);
- method public androidx.test.uiautomator.BySelector! clazz(String!);
- method public androidx.test.uiautomator.BySelector! clazz(String!, String!);
- method public androidx.test.uiautomator.BySelector! clazz(Class!);
- method public androidx.test.uiautomator.BySelector! clazz(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! clickable(boolean);
- method public androidx.test.uiautomator.BySelector! depth(int);
- method public androidx.test.uiautomator.BySelector! depth(int, int);
- method public androidx.test.uiautomator.BySelector! desc(String!);
- method public androidx.test.uiautomator.BySelector! desc(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! descContains(String!);
- method public androidx.test.uiautomator.BySelector! descEndsWith(String!);
- method public androidx.test.uiautomator.BySelector! descStartsWith(String!);
- method public androidx.test.uiautomator.BySelector! enabled(boolean);
- method public androidx.test.uiautomator.BySelector! focusable(boolean);
- method public androidx.test.uiautomator.BySelector! focused(boolean);
- method public androidx.test.uiautomator.BySelector! hasChild(androidx.test.uiautomator.BySelector!);
- method public androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!);
- method public androidx.test.uiautomator.BySelector! hasDescendant(androidx.test.uiautomator.BySelector!, int);
- method public androidx.test.uiautomator.BySelector! longClickable(boolean);
- method public androidx.test.uiautomator.BySelector! maxDepth(int);
- method public androidx.test.uiautomator.BySelector! minDepth(int);
- method public androidx.test.uiautomator.BySelector! pkg(String!);
- method public androidx.test.uiautomator.BySelector! pkg(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! res(String!);
- method public androidx.test.uiautomator.BySelector! res(String!, String!);
- method public androidx.test.uiautomator.BySelector! res(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! scrollable(boolean);
- method public androidx.test.uiautomator.BySelector! selected(boolean);
- method public androidx.test.uiautomator.BySelector! text(String!);
- method public androidx.test.uiautomator.BySelector! text(java.util.regex.Pattern!);
- method public androidx.test.uiautomator.BySelector! textContains(String!);
- method public androidx.test.uiautomator.BySelector! textEndsWith(String!);
- method public androidx.test.uiautomator.BySelector! textStartsWith(String!);
+ method public androidx.test.uiautomator.BySelector checkable(boolean);
+ method public androidx.test.uiautomator.BySelector checked(boolean);
+ method public androidx.test.uiautomator.BySelector clazz(String);
+ method public androidx.test.uiautomator.BySelector clazz(String, String);
+ method public androidx.test.uiautomator.BySelector clazz(Class);
+ method public androidx.test.uiautomator.BySelector clazz(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector clickable(boolean);
+ method public androidx.test.uiautomator.BySelector depth(int);
+ method public androidx.test.uiautomator.BySelector depth(int, int);
+ method public androidx.test.uiautomator.BySelector desc(String);
+ method public androidx.test.uiautomator.BySelector desc(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector descContains(String);
+ method public androidx.test.uiautomator.BySelector descEndsWith(String);
+ method public androidx.test.uiautomator.BySelector descStartsWith(String);
+ method public androidx.test.uiautomator.BySelector enabled(boolean);
+ method public androidx.test.uiautomator.BySelector focusable(boolean);
+ method public androidx.test.uiautomator.BySelector focused(boolean);
+ method public androidx.test.uiautomator.BySelector hasChild(androidx.test.uiautomator.BySelector);
+ method public androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector);
+ method public androidx.test.uiautomator.BySelector hasDescendant(androidx.test.uiautomator.BySelector, int);
+ method public androidx.test.uiautomator.BySelector longClickable(boolean);
+ method public androidx.test.uiautomator.BySelector maxDepth(int);
+ method public androidx.test.uiautomator.BySelector minDepth(int);
+ method public androidx.test.uiautomator.BySelector pkg(String);
+ method public androidx.test.uiautomator.BySelector pkg(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector res(String);
+ method public androidx.test.uiautomator.BySelector res(String, String);
+ method public androidx.test.uiautomator.BySelector res(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector scrollable(boolean);
+ method public androidx.test.uiautomator.BySelector selected(boolean);
+ method public androidx.test.uiautomator.BySelector text(String);
+ method public androidx.test.uiautomator.BySelector text(java.util.regex.Pattern);
+ method public androidx.test.uiautomator.BySelector textContains(String);
+ method public androidx.test.uiautomator.BySelector textEndsWith(String);
+ method public androidx.test.uiautomator.BySelector textStartsWith(String);
}
public final class Configurator {
diff --git a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/By.java b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/By.java
index 5a77230..65efa1f 100644
--- a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/By.java
+++ b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/By.java
@@ -16,6 +16,8 @@
package androidx.test.uiautomator;
+import androidx.annotation.NonNull;
+
import java.util.regex.Pattern;
/**
@@ -36,7 +38,7 @@
/**
* Constructs a new {@link BySelector} and copies the criteria from {@code original}.
*/
- public static BySelector copy(BySelector original) {
+ public static @NonNull BySelector copy(@NonNull BySelector original) {
return new BySelector(original);
}
@@ -45,7 +47,7 @@
*
* @see BySelector#clazz(String)
*/
- public static BySelector clazz(String className) {
+ public static @NonNull BySelector clazz(@NonNull String className) {
return new BySelector().clazz(className);
}
@@ -54,7 +56,8 @@
*
* @see BySelector#clazz(String, String)
*/
- public static BySelector clazz(String packageName, String className) {
+ public static @NonNull BySelector clazz(@NonNull String packageName,
+ @NonNull String className) {
return new BySelector().clazz(packageName, className);
}
@@ -63,7 +66,7 @@
*
* @see BySelector#clazz(Class)
*/
- public static BySelector clazz(Class clazz) {
+ public static @NonNull BySelector clazz(@NonNull Class clazz) {
return new BySelector().clazz(clazz);
}
@@ -72,7 +75,7 @@
*
* @see BySelector#clazz(Pattern)
*/
- public static BySelector clazz(Pattern className) {
+ public static @NonNull BySelector clazz(@NonNull Pattern className) {
return new BySelector().clazz(className);
}
@@ -81,7 +84,7 @@
*
* @see BySelector#desc(String)
*/
- public static BySelector desc(String contentDescription) {
+ public static @NonNull BySelector desc(@NonNull String contentDescription) {
return new BySelector().desc(contentDescription);
}
@@ -90,7 +93,7 @@
*
* @see BySelector#descContains(String)
*/
- public static BySelector descContains(String substring) {
+ public static @NonNull BySelector descContains(@NonNull String substring) {
return new BySelector().descContains(substring);
}
@@ -99,7 +102,7 @@
*
* @see BySelector#descStartsWith(String)
*/
- public static BySelector descStartsWith(String substring) {
+ public static @NonNull BySelector descStartsWith(@NonNull String substring) {
return new BySelector().descStartsWith(substring);
}
@@ -108,7 +111,7 @@
*
* @see BySelector#descEndsWith(String)
*/
- public static BySelector descEndsWith(String substring) {
+ public static @NonNull BySelector descEndsWith(@NonNull String substring) {
return new BySelector().descEndsWith(substring);
}
@@ -117,7 +120,7 @@
*
* @see BySelector#desc(Pattern)
*/
- public static BySelector desc(Pattern contentDescription) {
+ public static @NonNull BySelector desc(@NonNull Pattern contentDescription) {
return new BySelector().desc(contentDescription);
}
@@ -126,7 +129,7 @@
*
* @see BySelector#pkg(String)
*/
- public static BySelector pkg(String applicationPackage) {
+ public static @NonNull BySelector pkg(@NonNull String applicationPackage) {
return new BySelector().pkg(applicationPackage);
}
@@ -135,7 +138,7 @@
*
* @see BySelector#pkg(Pattern)
*/
- public static BySelector pkg(Pattern applicationPackage) {
+ public static @NonNull BySelector pkg(@NonNull Pattern applicationPackage) {
return new BySelector().pkg(applicationPackage);
}
@@ -144,7 +147,7 @@
*
* @see BySelector#res(String)
*/
- public static BySelector res(String resourceName) {
+ public static @NonNull BySelector res(@NonNull String resourceName) {
return new BySelector().res(resourceName);
}
@@ -153,7 +156,8 @@
*
* @see BySelector#res(String, String)
*/
- public static BySelector res(String resourcePackage, String resourceId) {
+ public static @NonNull BySelector res(@NonNull String resourcePackage,
+ @NonNull String resourceId) {
return new BySelector().res(resourcePackage, resourceId);
}
@@ -162,7 +166,7 @@
*
* @see BySelector#res(Pattern)
*/
- public static BySelector res(Pattern resourceName) {
+ public static @NonNull BySelector res(@NonNull Pattern resourceName) {
return new BySelector().res(resourceName);
}
@@ -171,7 +175,7 @@
*
* @see BySelector#text(String)
*/
- public static BySelector text(String text) {
+ public static @NonNull BySelector text(@NonNull String text) {
return new BySelector().text(text);
}
@@ -180,7 +184,7 @@
*
* @see BySelector#textContains(String)
*/
- public static BySelector textContains(String substring) {
+ public static @NonNull BySelector textContains(@NonNull String substring) {
return new BySelector().textContains(substring);
}
@@ -189,7 +193,7 @@
*
* @see BySelector#textStartsWith(String)
*/
- public static BySelector textStartsWith(String substring) {
+ public static @NonNull BySelector textStartsWith(@NonNull String substring) {
return new BySelector().textStartsWith(substring);
}
@@ -198,7 +202,7 @@
*
* @see BySelector#textEndsWith(String)
*/
- public static BySelector textEndsWith(String substring) {
+ public static @NonNull BySelector textEndsWith(@NonNull String substring) {
return new BySelector().textEndsWith(substring);
}
@@ -207,7 +211,7 @@
*
* @see BySelector#text(Pattern)
*/
- public static BySelector text(Pattern regex) {
+ public static @NonNull BySelector text(@NonNull Pattern regex) {
return new BySelector().text(regex);
}
@@ -216,7 +220,7 @@
*
* @see BySelector#checkable(boolean)
*/
- public static BySelector checkable(boolean isCheckable) {
+ public static @NonNull BySelector checkable(boolean isCheckable) {
return new BySelector().checkable(isCheckable);
}
@@ -225,7 +229,7 @@
*
* @see BySelector#checked(boolean)
*/
- public static BySelector checked(boolean isChecked) {
+ public static @NonNull BySelector checked(boolean isChecked) {
return new BySelector().checked(isChecked);
}
@@ -234,7 +238,7 @@
*
* @see BySelector#clickable(boolean)
*/
- public static BySelector clickable(boolean isClickable) {
+ public static @NonNull BySelector clickable(boolean isClickable) {
return new BySelector().clickable(isClickable);
}
@@ -243,7 +247,7 @@
*
* @see BySelector#enabled(boolean)
*/
- public static BySelector enabled(boolean isEnabled) {
+ public static @NonNull BySelector enabled(boolean isEnabled) {
return new BySelector().enabled(isEnabled);
}
@@ -252,7 +256,7 @@
*
* @see BySelector#focusable(boolean)
*/
- public static BySelector focusable(boolean isFocusable) {
+ public static @NonNull BySelector focusable(boolean isFocusable) {
return new BySelector().focusable(isFocusable);
}
@@ -261,7 +265,7 @@
*
* @see BySelector#focused(boolean)
*/
- public static BySelector focused(boolean isFocused) {
+ public static @NonNull BySelector focused(boolean isFocused) {
return new BySelector().focused(isFocused);
}
@@ -270,7 +274,7 @@
*
* @see BySelector#longClickable(boolean)
*/
- public static BySelector longClickable(boolean isLongClickable) {
+ public static @NonNull BySelector longClickable(boolean isLongClickable) {
return new BySelector().longClickable(isLongClickable);
}
@@ -279,7 +283,7 @@
*
* @see BySelector#scrollable(boolean)
*/
- public static BySelector scrollable(boolean isScrollable) {
+ public static @NonNull BySelector scrollable(boolean isScrollable) {
return new BySelector().scrollable(isScrollable);
}
@@ -288,14 +292,14 @@
*
* @see BySelector#selected(boolean)
*/
- public static BySelector selected(boolean isSelected) {
+ public static @NonNull BySelector selected(boolean isSelected) {
return new BySelector().selected(isSelected);
}
/**
* Constructs a new {@link BySelector} and sets the depth criteria.
*/
- public static BySelector depth(int depth) {
+ public static @NonNull BySelector depth(int depth) {
return new BySelector().depth(depth);
}
@@ -304,7 +308,7 @@
*
* @see BySelector#hasChild(BySelector)
*/
- public static BySelector hasChild(BySelector childSelector) {
+ public static @NonNull BySelector hasChild(@NonNull BySelector childSelector) {
return new BySelector().hasChild(childSelector);
}
@@ -313,7 +317,7 @@
*
* @see BySelector#hasDescendant(BySelector)
*/
- public static BySelector hasDescendant(BySelector descendantSelector) {
+ public static @NonNull BySelector hasDescendant(@NonNull BySelector descendantSelector) {
return new BySelector().hasDescendant(descendantSelector);
}
@@ -322,7 +326,8 @@
*
* @see BySelector#hasDescendant(BySelector, int)
*/
- public static BySelector hasDescendant(BySelector descendantSelector, int maxDepth) {
+ public static @NonNull BySelector hasDescendant(@NonNull BySelector descendantSelector,
+ int maxDepth) {
return new BySelector().hasDescendant(descendantSelector, maxDepth);
}
diff --git a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
index a7bd8f01..d987cee 100644
--- a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
+++ b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
@@ -18,6 +18,8 @@
import android.view.accessibility.AccessibilityNodeInfo;
+import androidx.annotation.NonNull;
+
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Pattern;
@@ -93,7 +95,7 @@
* @param className The full class name value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector clazz(String className) {
+ public @NonNull BySelector clazz(@NonNull String className) {
checkNotNull(className, "className cannot be null");
// If className starts with a period, assume the package is 'android.widget'
@@ -113,7 +115,7 @@
* @param className The class name value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector clazz(String packageName, String className) {
+ public @NonNull BySelector clazz(@NonNull String packageName, @NonNull String className) {
checkNotNull(packageName, "packageName cannot be null");
checkNotNull(className, "className cannot be null");
@@ -128,7 +130,7 @@
* @param clazz The class to match.
* @return A reference to this {@link BySelector}
*/
- public BySelector clazz(Class clazz) {
+ public @NonNull BySelector clazz(@NonNull Class clazz) {
checkNotNull(clazz, "clazz cannot be null");
return clazz(Pattern.compile(Pattern.quote(clazz.getName())));
@@ -142,7 +144,7 @@
* @param className The {@link Pattern} to be used for matching.
* @return A reference to this {@link BySelector}.
*/
- public BySelector clazz(Pattern className) {
+ public @NonNull BySelector clazz(@NonNull Pattern className) {
checkNotNull(className, "className cannot be null");
if (mClazz != null) {
@@ -160,7 +162,7 @@
* @param contentDescription The exact value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector desc(String contentDescription) {
+ public @NonNull BySelector desc(@NonNull String contentDescription) {
checkNotNull(contentDescription, "contentDescription cannot be null");
return desc(Pattern.compile(Pattern.quote(contentDescription)));
@@ -174,7 +176,7 @@
* @param substring The substring to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector descContains(String substring) {
+ public @NonNull BySelector descContains(@NonNull String substring) {
checkNotNull(substring, "substring cannot be null");
return desc(Pattern.compile(String.format("^.*%s.*$", Pattern.quote(substring))));
@@ -188,7 +190,7 @@
* @param substring The substring to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector descStartsWith(String substring) {
+ public @NonNull BySelector descStartsWith(@NonNull String substring) {
checkNotNull(substring, "substring cannot be null");
return desc(Pattern.compile(String.format("^%s.*$", Pattern.quote(substring))));
@@ -202,7 +204,7 @@
* @param substring The substring to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector descEndsWith(String substring) {
+ public @NonNull BySelector descEndsWith(@NonNull String substring) {
checkNotNull(substring, "substring cannot be null");
return desc(Pattern.compile(String.format("^.*%s$", Pattern.quote(substring))));
@@ -216,7 +218,7 @@
* @param contentDescription The {@link Pattern} to be used for matching.
* @return A reference to this {@link BySelector}.
*/
- public BySelector desc(Pattern contentDescription) {
+ public @NonNull BySelector desc(@NonNull Pattern contentDescription) {
checkNotNull(contentDescription, "contentDescription cannot be null");
if (mDesc != null) {
@@ -234,7 +236,7 @@
* @param applicationPackage The exact value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector pkg(String applicationPackage) {
+ public @NonNull BySelector pkg(@NonNull String applicationPackage) {
checkNotNull(applicationPackage, "applicationPackage cannot be null");
return pkg(Pattern.compile(Pattern.quote(applicationPackage)));
@@ -248,7 +250,7 @@
* @param applicationPackage The {@link Pattern} to be used for matching.
* @return A reference to this {@link BySelector}.
*/
- public BySelector pkg(Pattern applicationPackage) {
+ public @NonNull BySelector pkg(@NonNull Pattern applicationPackage) {
checkNotNull(applicationPackage, "applicationPackage cannot be null");
if (mPkg != null) {
@@ -266,7 +268,7 @@
* @param resourceName The exact value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector res(String resourceName) {
+ public @NonNull BySelector res(@NonNull String resourceName) {
checkNotNull(resourceName, "resourceName cannot be null");
return res(Pattern.compile(Pattern.quote(resourceName)));
@@ -281,7 +283,7 @@
* @param resourceId The resouce-id value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector res(String resourcePackage, String resourceId) {
+ public @NonNull BySelector res(@NonNull String resourcePackage, @NonNull String resourceId) {
checkNotNull(resourcePackage, "resourcePackage cannot be null");
checkNotNull(resourceId, "resourceId cannot be null");
@@ -297,7 +299,7 @@
* @param resourceName The {@link Pattern} to be used for matching.
* @return A reference to this {@link BySelector}.
*/
- public BySelector res(Pattern resourceName) {
+ public @NonNull BySelector res(@NonNull Pattern resourceName) {
checkNotNull(resourceName, "resourceName cannot be null");
if (mRes != null) {
@@ -315,7 +317,7 @@
* @param textValue The exact value to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector text(String textValue) {
+ public @NonNull BySelector text(@NonNull String textValue) {
checkNotNull(textValue, "textValue cannot be null");
return text(Pattern.compile(Pattern.quote(textValue)));
@@ -329,7 +331,7 @@
* @param substring The substring to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector textContains(String substring) {
+ public @NonNull BySelector textContains(@NonNull String substring) {
checkNotNull(substring, "substring cannot be null");
return text(Pattern.compile(String.format("^.*%s.*$", Pattern.quote(substring))));
@@ -343,7 +345,7 @@
* @param substring The substring to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector textStartsWith(String substring) {
+ public @NonNull BySelector textStartsWith(@NonNull String substring) {
checkNotNull(substring, "substring cannot be null");
return text(Pattern.compile(String.format("^%s.*$", Pattern.quote(substring))));
@@ -357,7 +359,7 @@
* @param substring The substring to match.
* @return A reference to this {@link BySelector}.
*/
- public BySelector textEndsWith(String substring) {
+ public @NonNull BySelector textEndsWith(@NonNull String substring) {
checkNotNull(substring, "substring cannot be null");
return text(Pattern.compile(String.format("^.*%s$", Pattern.quote(substring))));
@@ -370,7 +372,7 @@
* @param textValue The {@link Pattern} to be used for matching.
* @return A reference to this {@link BySelector}.
*/
- public BySelector text(Pattern textValue) {
+ public @NonNull BySelector text(@NonNull Pattern textValue) {
checkNotNull(textValue, "textValue cannot be null");
if (mText != null) {
@@ -388,7 +390,7 @@
* checkable.
* @return A reference to this {@link BySelector}.
*/
- public BySelector checkable(boolean isCheckable) {
+ public @NonNull BySelector checkable(boolean isCheckable) {
if (mCheckable != null) {
throw new IllegalStateException("Checkable selector is already defined");
}
@@ -402,7 +404,7 @@
* @param isChecked Whether to match elements that are checked or elements that are unchecked.
* @return A reference to this {@link BySelector}.
*/
- public BySelector checked(boolean isChecked) {
+ public @NonNull BySelector checked(boolean isChecked) {
if (mChecked != null) {
throw new IllegalStateException("Checked selector is already defined");
}
@@ -417,7 +419,7 @@
* clickable.
* @return A reference to this {@link BySelector}.
*/
- public BySelector clickable(boolean isClickable) {
+ public @NonNull BySelector clickable(boolean isClickable) {
if (mClickable != null) {
throw new IllegalStateException("Clickable selector is already defined");
}
@@ -430,7 +432,7 @@
* @param isEnabled Whether to match elements that are enabled or elements that are disabled.
* @return A reference to this {@link BySelector}.
*/
- public BySelector enabled(boolean isEnabled) {
+ public @NonNull BySelector enabled(boolean isEnabled) {
if (mEnabled != null) {
throw new IllegalStateException("Enabled selector is already defined");
}
@@ -445,7 +447,7 @@
* focusable.
* @return A reference to this {@link BySelector}.
*/
- public BySelector focusable(boolean isFocusable) {
+ public @NonNull BySelector focusable(boolean isFocusable) {
if (mFocusable != null) {
throw new IllegalStateException("Focusable selector is already defined");
}
@@ -459,7 +461,7 @@
* @param isFocused Whether to match elements that are focused or elements that are unfocused.
* @return A reference to this {@link BySelector}.
*/
- public BySelector focused(boolean isFocused) {
+ public @NonNull BySelector focused(boolean isFocused) {
if (mFocused != null) {
throw new IllegalStateException("Focused selector is already defined");
}
@@ -474,7 +476,7 @@
* not long clickable.
* @return A reference to this {@link BySelector}.
*/
- public BySelector longClickable(boolean isLongClickable) {
+ public @NonNull BySelector longClickable(boolean isLongClickable) {
if (mLongClickable != null) {
throw new IllegalStateException("Long Clickable selector is already defined");
}
@@ -489,7 +491,7 @@
* scrollable.
* @return A reference to this {@link BySelector}.
*/
- public BySelector scrollable(boolean isScrollable) {
+ public @NonNull BySelector scrollable(boolean isScrollable) {
if (mScrollable != null) {
throw new IllegalStateException("Scrollable selector is already defined");
}
@@ -504,7 +506,7 @@
* selected.
* @return A reference to this {@link BySelector}.
*/
- public BySelector selected(boolean isSelected) {
+ public @NonNull BySelector selected(boolean isSelected) {
if (mSelected != null) {
throw new IllegalStateException("Selected selector is already defined");
}
@@ -513,12 +515,12 @@
}
/** Sets the search criteria to match elements that are at a certain depth. */
- public BySelector depth(int exactDepth) {
+ public @NonNull BySelector depth(int exactDepth) {
return depth(exactDepth, exactDepth);
}
/** Sets the search criteria to match elements that are in a range of depths. */
- public BySelector depth(int min, int max) {
+ public @NonNull BySelector depth(int min, int max) {
if (min < 0) {
throw new IllegalArgumentException("min cannot be negative");
}
@@ -537,7 +539,7 @@
}
/** Sets the search criteria to match elements that are at least a certain depth. */
- public BySelector minDepth(int min) {
+ public @NonNull BySelector minDepth(int min) {
if (min < 0) {
throw new IllegalArgumentException("min cannot be negative");
}
@@ -549,7 +551,7 @@
}
/** Sets the search criteria to match elements that are no more than a certain depth. */
- public BySelector maxDepth(int max) {
+ public @NonNull BySelector maxDepth(int max) {
if (max < 0) {
throw new IllegalArgumentException("max cannot be negative");
}
@@ -569,7 +571,7 @@
* @param childSelector The selector used to find a matching child element.
* @return A reference to this {@link BySelector}.
*/
- public BySelector hasChild(BySelector childSelector) {
+ public @NonNull BySelector hasChild(@NonNull BySelector childSelector) {
checkNotNull(childSelector, "childSelector cannot be null");
return hasDescendant(childSelector, 1);
@@ -584,7 +586,7 @@
* @param descendantSelector The selector used to find a matching descendant element.
* @return A reference to this {@link BySelector}.
*/
- public BySelector hasDescendant(BySelector descendantSelector) {
+ public @NonNull BySelector hasDescendant(@NonNull BySelector descendantSelector) {
checkNotNull(descendantSelector, "descendantSelector cannot be null");
mChildSelectors.add(descendantSelector);
@@ -601,7 +603,7 @@
* @param maxDepth The maximum depth under the element to search the descendant.
* @return A reference to this {@link BySelector}.
*/
- public BySelector hasDescendant(BySelector descendantSelector, int maxDepth) {
+ public @NonNull BySelector hasDescendant(@NonNull BySelector descendantSelector, int maxDepth) {
checkNotNull(descendantSelector, "descendantSelector cannot be null");
descendantSelector.mMaxDepth = maxDepth;
@@ -667,7 +669,7 @@
return builder.toString();
}
- private static <T> T checkNotNull(T value, String message) {
+ private static <T> T checkNotNull(T value, @NonNull String message) {
if (value == null) {
throw new NullPointerException(message);
}
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
index 1369185..d8236dd 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
@@ -26,7 +26,6 @@
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
@@ -56,8 +55,6 @@
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.Button
-import androidx.wear.compose.material.ChipDefaults
-import androidx.wear.compose.material.CompactChip
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.Picker
@@ -267,6 +264,10 @@
initialNumberOfOptions = 60,
initiallySelectedOption = time.minute
)
+ val periodState = rememberPickerState(
+ initialNumberOfOptions = 2,
+ initiallySelectedOption = time[ChronoField.AMPM_OF_DAY]
+ )
val hoursContentDescription by remember {
derivedStateOf { "${hourState.selectedOption + 1} hours" }
}
@@ -274,43 +275,38 @@
derivedStateOf { "${minuteState.selectedOption} minutes" }
}
- var amPm by remember { mutableStateOf(time[ChronoField.AMPM_OF_DAY]) }
val amString = remember {
LocalTime.of(6, 0).format(DateTimeFormatter.ofPattern("a"))
}
val pmString = remember {
LocalTime.of(18, 0).format(DateTimeFormatter.ofPattern("a"))
}
+ val periodContentDescription by remember {
+ derivedStateOf { if (periodState.selectedOption == 0) amString else pmString }
+ }
MaterialTheme(typography = typography) {
var selectedColumn by remember { mutableStateOf(0) }
- val textStyle = MaterialTheme.typography.display1
+ val textStyle = MaterialTheme.typography.display3
val focusRequester1 = remember { FocusRequester() }
val focusRequester2 = remember { FocusRequester() }
+ val focusRequester3 = remember { FocusRequester() }
Column(
modifier = modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
- Spacer(Modifier.height(8.dp))
- CompactChip(
- onClick = { amPm = 1 - amPm },
- modifier = Modifier.size(width = 50.dp, height = 24.dp),
- label = {
- Row(
- modifier = Modifier.fillMaxWidth(),
- horizontalArrangement = Arrangement.Center
- ) {
- Text(
- text = if (amPm == 0) amString else pmString,
- color = MaterialTheme.colors.onPrimary,
- style = MaterialTheme.typography.button,
- )
- }
+ Spacer(Modifier.height(12.dp))
+ Text(
+ text = when (selectedColumn) {
+ 0 -> "Hour"
+ 1 -> "Minute"
+ else -> ""
},
- colors = ChipDefaults.chipColors(backgroundColor = MaterialTheme.colors.secondary),
- contentPadding = PaddingValues(vertical = 0.dp),
+ color = MaterialTheme.colors.secondary,
+ style = MaterialTheme.typography.button,
+ maxLines = 1,
)
Spacer(
Modifier
@@ -327,8 +323,7 @@
readOnly = selectedColumn != 0,
state = hourState,
focusRequester = focusRequester1,
- modifier = Modifier.size(64.dp, 100.dp),
- readOnlyLabel = { LabelText("Hour") },
+ modifier = Modifier.size(48.dp, 100.dp),
onSelected = { selectedColumn = 0 },
contentDescription = hoursContentDescription,
) { hour: Int ->
@@ -339,14 +334,12 @@
style = textStyle,
)
}
- Separator(8.dp, textStyle)
-
+ Separator(2.dp, textStyle)
PickerWithRSB(
readOnly = selectedColumn != 1,
state = minuteState,
focusRequester = focusRequester2,
- modifier = Modifier.size(64.dp, 100.dp),
- readOnlyLabel = { LabelText("Min") },
+ modifier = Modifier.size(48.dp, 100.dp),
onSelected = { selectedColumn = 1 },
contentDescription = minutesContentDescription,
) { minute: Int ->
@@ -357,7 +350,22 @@
style = textStyle,
)
}
- Spacer(Modifier.width(8.dp))
+ Spacer(Modifier.width(6.dp))
+ PickerWithRSB(
+ readOnly = selectedColumn != 2,
+ state = periodState,
+ focusRequester = focusRequester3,
+ modifier = Modifier.size(64.dp, 100.dp),
+ onSelected = { selectedColumn = 2 },
+ contentDescription = periodContentDescription,
+ ) { period: Int ->
+ TimePiece(
+ selected = selectedColumn == 2,
+ onSelected = { selectedColumn = 2 },
+ text = if (period == 0) amString else pmString,
+ style = textStyle,
+ )
+ }
}
Spacer(
Modifier
@@ -369,7 +377,7 @@
hourState.selectedOption + 1,
minuteState.selectedOption,
0
- ).with(ChronoField.AMPM_OF_DAY, amPm.toLong())
+ ).with(ChronoField.AMPM_OF_DAY, periodState.selectedOption.toLong())
onTimeConfirm(confirmedTime)
}) {
Icon(
@@ -382,7 +390,8 @@
}
Spacer(Modifier.height(8.dp))
LaunchedEffect(selectedColumn) {
- listOf(focusRequester1, focusRequester2)[selectedColumn].requestFocus()
+ listOf(focusRequester1, focusRequester2, focusRequester3)[selectedColumn]
+ .requestFocus()
}
}
}
@@ -459,7 +468,7 @@
"${yearState.selectedOption + 1}"
} }
val monthContentDescription by remember { derivedStateOf {
- "${monthNames[monthState.selectedOption]}"
+ monthNames[monthState.selectedOption]
} }
val dayContentDescription by remember { derivedStateOf {
"${dayState.selectedOption + 1}"
@@ -629,18 +638,6 @@
}
@Composable
-private fun BoxScope.LabelText(text: String) {
- Text(
- text = text,
- style = MaterialTheme.typography.caption1,
- color = MaterialTheme.colors.onSurfaceVariant,
- modifier = Modifier
- .align(Alignment.TopCenter)
- .offset(y = 8.dp)
- )
-}
-
-@Composable
private fun Separator(width: Dp, textStyle: TextStyle) {
Spacer(Modifier.width(width))
Text(
diff --git a/work/work-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java b/work/work-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
index b635682..83f6878 100644
--- a/work/work-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
+++ b/work/work-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
@@ -30,6 +30,7 @@
import androidx.test.filters.LargeTest;
import androidx.work.Configuration;
import androidx.work.Constraints;
+import androidx.work.ExistingWorkPolicy;
import androidx.work.NetworkType;
import androidx.work.OneTimeWorkRequest;
import androidx.work.PeriodicWorkRequest;
@@ -220,6 +221,28 @@
mTestDriver.setInitialDelayMet(request.getId());
}
+ @Test
+ public void testWorkerUnique()
+ throws InterruptedException, ExecutionException {
+ WorkManager workManager = WorkManager.getInstance(mContext);
+ OneTimeWorkRequest request1 = createWorkRequestWithInitialDelay();
+ workManager.enqueueUniqueWork("name", ExistingWorkPolicy.REPLACE, request1)
+ .getResult().get();
+
+ OneTimeWorkRequest request2 = createWorkRequestWithInitialDelay();
+ workManager.enqueueUniqueWork("name", ExistingWorkPolicy.REPLACE, request2)
+ .getResult().get();
+ try {
+ mTestDriver.setInitialDelayMet(request1.getId());
+ throw new AssertionError();
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ mTestDriver.setInitialDelayMet(request2.getId());
+ WorkInfo requestStatus = workManager.getWorkInfoById(request2.getId()).get();
+ assertThat(requestStatus.getState().isFinished(), is(true));
+ }
+
@Test(expected = IllegalArgumentException.class)
public void testWorker_afterSuccessfulRun_throwsExceptionWhenSetPeriodDelayMet()
throws InterruptedException, ExecutionException {
diff --git a/work/work-testing/src/main/java/androidx/work/testing/TestScheduler.kt b/work/work-testing/src/main/java/androidx/work/testing/TestScheduler.kt
index f3b53c5..1fce4d0 100644
--- a/work/work-testing/src/main/java/androidx/work/testing/TestScheduler.kt
+++ b/work/work-testing/src/main/java/androidx/work/testing/TestScheduler.kt
@@ -80,16 +80,14 @@
val tokens = mStartStopTokens.remove(workSpecId)
tokens.forEach { WorkManagerImpl.getInstance(context).stopWork(it) }
synchronized(lock) {
- tokens.forEach { token ->
- val internalWorkState = pendingWorkStates[token.id.workSpecId]
- if (internalWorkState != null && !internalWorkState.isPeriodic) {
- // Don't remove PeriodicWorkRequests from the list of pending work states.
- // This is because we keep track of mPeriodDelayMet for PeriodicWorkRequests.
- // `mPeriodDelayMet` is set to `false` when `onExecuted()` is called as a result of a
- // successful run or a cancellation. That way subsequent calls to schedule() no-op
- // until a developer explicitly calls setPeriodDelayMet().
- pendingWorkStates.remove(token.id.workSpecId)
- }
+ val internalWorkState = pendingWorkStates[workSpecId]
+ if (internalWorkState != null && !internalWorkState.isPeriodic) {
+ // Don't remove PeriodicWorkRequests from the list of pending work states.
+ // This is because we keep track of mPeriodDelayMet for PeriodicWorkRequests.
+ // `mPeriodDelayMet` is set to `false` when `onExecuted()` is called as a result of a
+ // successful run or a cancellation. That way subsequent calls to schedule() no-op
+ // until a developer explicitly calls setPeriodDelayMet().
+ pendingWorkStates.remove(workSpecId)
}
}
}