From dc1a1f398e6c4310258358bab8a07f9cd3aa6fe2 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 30 Jul 2024 13:58:07 +0200 Subject: [PATCH 01/12] Commonize `:window:window-core` module and configure publication. --- MULTIPLATFORM.md | 2 +- gradle.properties | 2 + libraryversions.toml | 1 + mpp/build.gradle.kts | 3 ++ settings.gradle | 1 + .../window-core/api/desktop/window-core.api | 46 +++++++++++++++++ window/window-core/build.gradle | 51 ++++++++++++++++--- window/window-core/gradle.properties | 18 +++++++ .../window/core/layout/WindowSizeClass.kt | 2 +- 9 files changed, 118 insertions(+), 8 deletions(-) create mode 100644 window/window-core/api/desktop/window-core.api create mode 100644 window/window-core/gradle.properties diff --git a/MULTIPLATFORM.md b/MULTIPLATFORM.md index ee1bf1aa11236..62ae2bd6973cd 100644 --- a/MULTIPLATFORM.md +++ b/MULTIPLATFORM.md @@ -71,7 +71,7 @@ Compose Multiplatform core libraries can be published to local Maven with the fo The default value for the version is `0.0.0-SNAPSHOT` And library groups: -`-Pjetbrains.publication.libraries=CORE_BUNDLE,COMPOSE,LIFECYCLE,NAVIGATION,SAVEDSTATE` +`-Pjetbrains.publication.libraries=CORE_BUNDLE,COMPOSE,LIFECYCLE,NAVIGATION,SAVEDSTATE,WINDOW` The default value includes all libraries. diff --git a/gradle.properties b/gradle.properties index bacf0979afe77..7687e62557130 100644 --- a/gradle.properties +++ b/gradle.properties @@ -114,6 +114,8 @@ artifactRedirecting.androidx.annotation.version=1.8.0 artifactRedirecting.androidx.lifecycle.version=2.8.0 artifactRedirecting.androidx.navigation.version=2.8.0-beta05 artifactRedirecting.androidx.savedstate.version=1.2.1 +# Look for `WINDOW` in libraryversions.toml +artifactRedirecting.androidx.window.core.version=1.3.0-alpha01 # For the purpose of substituteForRedirectedPublishedDependencies (look for it in the code) artifactRedirecting.modules-for-knative-manifest=\ diff --git a/libraryversions.toml b/libraryversions.toml index 5cf14b71cfaad..6eadcf5bbce87 100644 --- a/libraryversions.toml +++ b/libraryversions.toml @@ -292,6 +292,7 @@ WEAR_TILES = { group = "androidx.wear.tiles", atomicGroupVersion = "versions.WEA WEAR_WATCHFACE = { group = "androidx.wear.watchface", atomicGroupVersion = "versions.WEAR_WATCHFACE" } WEBKIT = { group = "androidx.webkit", atomicGroupVersion = "versions.WEBKIT" } WINDOW = { group = "androidx.window", atomicGroupVersion = "versions.WINDOW" } +WINDOW_CORE = { group = "org.jetbrains.window.core", atomicGroupVersion = "versions.WINDOW", overrideInclude = [ ":window:window-core" ] } WINDOW_EXTENSIONS = { group = "androidx.window.extensions", atomicGroupVersion = "versions.WINDOW_EXTENSIONS" } WINDOW_EXTENSIONS_CORE = { group = "androidx.window.extensions.core", atomicGroupVersion = "versions.WINDOW_EXTENSIONS_CORE" } WINDOW_SIDECAR = { group = "androidx.window.sidecar", atomicGroupVersion = "versions.WINDOW_SIDECAR" } diff --git a/mpp/build.gradle.kts b/mpp/build.gradle.kts index 97f6bef8c530b..d387353c03362 100644 --- a/mpp/build.gradle.kts +++ b/mpp/build.gradle.kts @@ -107,6 +107,9 @@ val libraryToComponents = mapOf( "SAVEDSTATE" to listOf( ComposeComponent(":savedstate:savedstate", viewModelPlatforms), ), + "WINDOW" to listOf( + ComposeComponent(":window:window-core", viewModelPlatforms), + ), ) val libraryToTasks = mapOf( diff --git a/settings.gradle b/settings.gradle index 254eb95ede37b..0582b757a51f5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -256,3 +256,4 @@ includeProject(":internal-testutils-mockito", "testutils/testutils-mockito") includeBuild("placeholder") includeProject(":mpp") +includeProject(":window:window-core") diff --git a/window/window-core/api/desktop/window-core.api b/window/window-core/api/desktop/window-core.api new file mode 100644 index 0000000000000..5ddf074d4c345 --- /dev/null +++ b/window/window-core/api/desktop/window-core.api @@ -0,0 +1,46 @@ +public abstract interface annotation class androidx/window/core/ExperimentalWindowCoreApi : java/lang/annotation/Annotation { +} + +public final class androidx/window/core/layout/WindowHeightSizeClass { + public static final field COMPACT Landroidx/window/core/layout/WindowHeightSizeClass; + public static final field Companion Landroidx/window/core/layout/WindowHeightSizeClass$Companion; + public static final field EXPANDED Landroidx/window/core/layout/WindowHeightSizeClass; + public static final field MEDIUM Landroidx/window/core/layout/WindowHeightSizeClass; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/window/core/layout/WindowHeightSizeClass$Companion { +} + +public final class androidx/window/core/layout/WindowSizeClass { + public static final field Companion Landroidx/window/core/layout/WindowSizeClass$Companion; + public synthetic fun (Landroidx/window/core/layout/WindowWidthSizeClass;Landroidx/window/core/layout/WindowHeightSizeClass;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public static final fun compute (FF)Landroidx/window/core/layout/WindowSizeClass; + public static final fun compute (IIF)Landroidx/window/core/layout/WindowSizeClass; + public fun equals (Ljava/lang/Object;)Z + public final fun getWindowHeightSizeClass ()Landroidx/window/core/layout/WindowHeightSizeClass; + public final fun getWindowWidthSizeClass ()Landroidx/window/core/layout/WindowWidthSizeClass; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/window/core/layout/WindowSizeClass$Companion { + public final fun compute (FF)Landroidx/window/core/layout/WindowSizeClass; + public final fun compute (IIF)Landroidx/window/core/layout/WindowSizeClass; +} + +public final class androidx/window/core/layout/WindowWidthSizeClass { + public static final field COMPACT Landroidx/window/core/layout/WindowWidthSizeClass; + public static final field Companion Landroidx/window/core/layout/WindowWidthSizeClass$Companion; + public static final field EXPANDED Landroidx/window/core/layout/WindowWidthSizeClass; + public static final field MEDIUM Landroidx/window/core/layout/WindowWidthSizeClass; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/window/core/layout/WindowWidthSizeClass$Companion { +} + diff --git a/window/window-core/build.gradle b/window/window-core/build.gradle index b4060735b4993..940af1556d29c 100644 --- a/window/window-core/build.gradle +++ b/window/window-core/build.gradle @@ -21,25 +21,52 @@ * Please use that script when creating a new project, rather than copying an existing project and * modifying its settings. */ + +import androidx.build.JetbrainsAndroidXPlugin import androidx.build.LibraryType import androidx.build.PlatformIdentifier +import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType plugins { id("AndroidXPlugin") id("com.android.library") + id("JetbrainsAndroidXPlugin") } +JetbrainsAndroidXPlugin.applyAndConfigure(project) + androidXMultiplatform { - jvm() + desktop() android() + mac() + linux() + ios() + js() + wasm() + + defaultPlatform(PlatformIdentifier.ANDROID) +} + +kotlin { + js { + browser() + } + wasmJs() - defaultPlatform(PlatformIdentifier.JVM) + watchosArm64() + watchosArm32() + watchosX64() + watchosSimulatorArm64() + tvosArm64() + tvosX64() + tvosSimulatorArm64() + mingwX64() sourceSets { commonMain { dependencies { api(libs.kotlinStdlib) - api("androidx.annotation:annotation:1.7.0") + api(project(":annotation:annotation")) } } @@ -54,9 +81,16 @@ androidXMultiplatform { } } - androidInstrumentedTest { - dependencies { - implementation(libs.testRunner) + jvmMain.dependsOn(commonMain) + androidMain.dependsOn(jvmMain) + desktopMain.dependsOn(jvmMain) + nonJvmMain.dependsOn(commonMain) + + targets.all { target -> + if (target.platformType !in [KotlinPlatformType.jvm, KotlinPlatformType.androidJvm, KotlinPlatformType.common]) { + target.compilations["main"].defaultSourceSet { + dependsOn(nonJvmMain) + } } } } @@ -72,3 +106,8 @@ androidx { inceptionYear = "2022" description = "WindowManager Core Library." } + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} diff --git a/window/window-core/gradle.properties b/window/window-core/gradle.properties new file mode 100644 index 0000000000000..3b97aadaeb661 --- /dev/null +++ b/window/window-core/gradle.properties @@ -0,0 +1,18 @@ +# +# Copyright 2024 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. +# + +# TODO Determine redirection group based on package and remove explicit config +artifactRedirecting.androidx.groupId=androidx.window.core \ No newline at end of file diff --git a/window/window-core/src/commonMain/kotlin/androidx/window/core/layout/WindowSizeClass.kt b/window/window-core/src/commonMain/kotlin/androidx/window/core/layout/WindowSizeClass.kt index 8d61d8a1b0ce1..1b4502874433f 100644 --- a/window/window-core/src/commonMain/kotlin/androidx/window/core/layout/WindowSizeClass.kt +++ b/window/window-core/src/commonMain/kotlin/androidx/window/core/layout/WindowSizeClass.kt @@ -64,7 +64,7 @@ class WindowSizeClass private constructor( override fun equals(other: Any?): Boolean { if (this === other) return true - if (javaClass != other?.javaClass) return false + if (other == null || this::class != other::class) return false other as WindowSizeClass From a1c08b54ce822e395d2d1e8f5bcd26e62ed0ecb4 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 30 Jul 2024 14:08:04 +0200 Subject: [PATCH 02/12] Commonize `:compose:material3:adaptive:adaptive` module and configure publication. --- .../adaptive/api/desktop/adaptive.api | 51 +++++++++++++++++++ .../material3/adaptive/adaptive/build.gradle | 51 ++++++++++++++----- .../adaptive/WindowAdaptiveInfo.skiko.kt} | 14 ++++- gradle.properties | 2 + libraryversions.toml | 2 +- mpp/build.gradle.kts | 1 + settings.gradle | 2 +- 7 files changed, 108 insertions(+), 15 deletions(-) create mode 100644 compose/material3/adaptive/adaptive/api/desktop/adaptive.api rename compose/material3/adaptive/adaptive/src/{desktopMain/kotlin/androidx/compose/material3/adaptive/DesktopWindowInfo.desktop.kt => skikoMain/kotlin/androidx/compose/material3/adaptive/WindowAdaptiveInfo.skiko.kt} (55%) diff --git a/compose/material3/adaptive/adaptive/api/desktop/adaptive.api b/compose/material3/adaptive/adaptive/api/desktop/adaptive.api new file mode 100644 index 0000000000000..9dcdd36621bf1 --- /dev/null +++ b/compose/material3/adaptive/adaptive/api/desktop/adaptive.api @@ -0,0 +1,51 @@ +public abstract interface annotation class androidx/compose/material3/adaptive/ExperimentalMaterial3AdaptiveApi : java/lang/annotation/Annotation { +} + +public final class androidx/compose/material3/adaptive/HingeInfo { + public static final field $stable I + public fun (Landroidx/compose/ui/geometry/Rect;ZZZZ)V + public fun equals (Ljava/lang/Object;)Z + public final fun getBounds ()Landroidx/compose/ui/geometry/Rect; + public fun hashCode ()I + public final fun isFlat ()Z + public final fun isOccluding ()Z + public final fun isSeparating ()Z + public final fun isVertical ()Z + public fun toString ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/Posture { + public static final field $stable I + public fun ()V + public fun (ZLjava/util/List;)V + public synthetic fun (ZLjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun equals (Ljava/lang/Object;)Z + public final fun getHingeList ()Ljava/util/List; + public fun hashCode ()I + public final fun isTabletop ()Z + public fun toString ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/PostureKt { + public static final fun getAllHorizontalHingeBounds (Landroidx/compose/material3/adaptive/Posture;)Ljava/util/List; + public static final fun getAllVerticalHingeBounds (Landroidx/compose/material3/adaptive/Posture;)Ljava/util/List; + public static final fun getOccludingHorizontalHingeBounds (Landroidx/compose/material3/adaptive/Posture;)Ljava/util/List; + public static final fun getOccludingVerticalHingeBounds (Landroidx/compose/material3/adaptive/Posture;)Ljava/util/List; + public static final fun getSeparatingHorizontalHingeBounds (Landroidx/compose/material3/adaptive/Posture;)Ljava/util/List; + public static final fun getSeparatingVerticalHingeBounds (Landroidx/compose/material3/adaptive/Posture;)Ljava/util/List; +} + +public final class androidx/compose/material3/adaptive/WindowAdaptiveInfo { + public static final field $stable I + public fun (Landroidx/window/core/layout/WindowSizeClass;Landroidx/compose/material3/adaptive/Posture;)V + public fun equals (Ljava/lang/Object;)Z + public final fun getWindowPosture ()Landroidx/compose/material3/adaptive/Posture; + public final fun getWindowSizeClass ()Landroidx/window/core/layout/WindowSizeClass; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/WindowAdaptiveInfo_skikoKt { + public static final fun currentWindowAdaptiveInfo (Landroidx/compose/runtime/Composer;I)Landroidx/compose/material3/adaptive/WindowAdaptiveInfo; +} + diff --git a/compose/material3/adaptive/adaptive/build.gradle b/compose/material3/adaptive/adaptive/build.gradle index 269c3844ac05d..bfdaf08af4816 100644 --- a/compose/material3/adaptive/adaptive/build.gradle +++ b/compose/material3/adaptive/adaptive/build.gradle @@ -21,29 +21,38 @@ * Please use that script when creating a new project, rather than copying an existing project and * modifying its settings. */ + +import androidx.build.AndroidXComposePlugin +import androidx.build.JetbrainsAndroidXPlugin import androidx.build.LibraryType -import androidx.build.PlatformIdentifier import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("AndroidXPlugin") id("com.android.library") id("AndroidXComposePlugin") + id("JetbrainsAndroidXPlugin") } -androidXMultiplatform { +AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) +JetbrainsAndroidXPlugin.applyAndConfigure(project) + +androidXComposeMultiplatform { android() desktop() + darwin() + wasm() + js() +} - defaultPlatform(PlatformIdentifier.ANDROID) - +kotlin { sourceSets { commonMain { dependencies { implementation(libs.kotlinStdlibCommon) - api("androidx.compose.foundation:foundation:1.6.5") - api("androidx.compose.ui:ui-geometry:1.6.5") - api("androidx.window:window-core:1.3.0-rc01") + api(project(":compose:foundation:foundation")) + api(project(":compose:ui:ui-geometry")) + api(project(":window:window-core")) } } @@ -62,9 +71,10 @@ androidXMultiplatform { androidMain { dependsOn(jvmMain) dependencies { - api("androidx.annotation:annotation:1.1.0") - api("androidx.annotation:annotation-experimental:1.4.0") - api("androidx.window:window:1.3.0-rc01") + api(project(":annotation:annotation")) + //dependencies are not available in JB fork + //api(project(":annotation:annotation-experimental")) + //api(project(":window:window")) } } @@ -89,7 +99,8 @@ androidXMultiplatform { dependencies { implementation(project(":compose:material3:material3")) implementation(project(":compose:test-utils")) - implementation(project(":window:window-testing")) + //dependency is not available in JB fork + //implementation(project(":window:window-testing")) implementation(libs.junit) implementation(libs.testRunner) implementation(libs.truth) @@ -104,6 +115,22 @@ androidXMultiplatform { implementation(libs.truth) } } + + skikoMain.dependsOn(commonMain) + desktopMain.dependsOn(skikoMain) + nonJvmMain.dependsOn(skikoMain) + webMain.dependsOn(nonJvmMain) + jsMain.dependsOn(webMain) + wasmJsMain.dependsOn(webMain) + nativeMain.dependsOn(nonJvmMain) + + skikoTest.dependsOn(commonTest) + desktopTest.dependsOn(skikoTest) + nonJvmTest.dependsOn(skikoTest) + webTest.dependsOn(nonJvmTest) + jsTest.dependsOn(webTest) + wasmJsTest.dependsOn(webTest) + nativeTest.dependsOn(nonJvmTest) } } @@ -113,7 +140,7 @@ android { androidx { name = "Material Adaptive" - type = LibraryType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS + type = LibraryType.PUBLISHED_LIBRARY inceptionYear = "2023" description = "Compose Material Design Adaptive Library" legacyDisableKotlinStrictApiMode = true diff --git a/compose/material3/adaptive/adaptive/src/desktopMain/kotlin/androidx/compose/material3/adaptive/DesktopWindowInfo.desktop.kt b/compose/material3/adaptive/adaptive/src/skikoMain/kotlin/androidx/compose/material3/adaptive/WindowAdaptiveInfo.skiko.kt similarity index 55% rename from compose/material3/adaptive/adaptive/src/desktopMain/kotlin/androidx/compose/material3/adaptive/DesktopWindowInfo.desktop.kt rename to compose/material3/adaptive/adaptive/src/skikoMain/kotlin/androidx/compose/material3/adaptive/WindowAdaptiveInfo.skiko.kt index a32d0d4249a96..1fd4eaa7cbb0e 100644 --- a/compose/material3/adaptive/adaptive/src/desktopMain/kotlin/androidx/compose/material3/adaptive/DesktopWindowInfo.desktop.kt +++ b/compose/material3/adaptive/adaptive/src/skikoMain/kotlin/androidx/compose/material3/adaptive/WindowAdaptiveInfo.skiko.kt @@ -17,8 +17,20 @@ package androidx.compose.material3.adaptive import androidx.compose.runtime.Composable +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalWindowInfo +import androidx.compose.ui.unit.toSize +import androidx.window.core.layout.WindowSizeClass +@OptIn(ExperimentalComposeUiApi::class) @Composable actual fun currentWindowAdaptiveInfo(): WindowAdaptiveInfo { - TODO("Not yet implemented") + val density = LocalDensity.current + val windowInfo = LocalWindowInfo.current + val size = with(density) { windowInfo.containerSize.toSize().toDpSize() } + return WindowAdaptiveInfo( + WindowSizeClass.compute(size.width.value, size.height.value), + Posture() //postures and hinges are relevant to android devices only + ) } diff --git a/gradle.properties b/gradle.properties index 7687e62557130..2c57e1f4699b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -108,6 +108,8 @@ artifactRedirecting.androidx.compose.foundation.version=1.7.0-beta06 artifactRedirecting.androidx.compose.material.version=1.7.0-beta06 # Look for `COMPOSE_MATERIAL3_COMMON` in libraryversions.toml artifactRedirecting.androidx.compose.material3.common.version=1.0.0-alpha01 +# Look for `COMPOSE_MATERIAL3_ADAPTIVE` in libraryversions.toml +artifactRedirecting.androidx.compose.material3.adaptive.version=1.0.0-alpha01 # We use artifactRedirecting not only for Compose libs: artifactRedirecting.androidx.collection.version=1.4.0 artifactRedirecting.androidx.annotation.version=1.8.0 diff --git a/libraryversions.toml b/libraryversions.toml index 6eadcf5bbce87..8358072efcd14 100644 --- a/libraryversions.toml +++ b/libraryversions.toml @@ -197,7 +197,7 @@ COMPOSE_FOUNDATION = { group = "org.jetbrains.compose.foundation", atomicGroupVe COMPOSE_MATERIAL = { group = "org.jetbrains.compose.material", atomicGroupVersion = "versions.COMPOSE" } COMPOSE_MATERIAL3 = { group = "org.jetbrains.compose.material3", atomicGroupVersion = "versions.COMPOSE_MATERIAL3" } COMPOSE_MATERIAL3_COMMON = { group = "org.jetbrains.compose.material3.common", atomicGroupVersion = "versions.COMPOSE_MATERIAL3_COMMON", overrideInclude = [ ":compose:material3:material3-common" ] } -COMPOSE_MATERIAL3_ADAPTIVE = { group = "androidx.compose.material3.material3-adaptive", atomicGroupVersion = "versions.COMPOSE_MATERIAL3_ADAPTIVE" } +COMPOSE_MATERIAL3_ADAPTIVE = { group = "org.jetbrains.compose.material3.adaptive", atomicGroupVersion = "versions.COMPOSE_MATERIAL3_ADAPTIVE" } COMPOSE_RUNTIME = { group = "org.jetbrains.compose.runtime", atomicGroupVersion = "versions.COMPOSE" } COMPOSE_UI = { group = "org.jetbrains.compose.ui", atomicGroupVersion = "versions.COMPOSE" } CONCURRENT = { group = "androidx.concurrent", atomicGroupVersion = "versions.FUTURES" } diff --git a/mpp/build.gradle.kts b/mpp/build.gradle.kts index d387353c03362..918cfce7a67be 100644 --- a/mpp/build.gradle.kts +++ b/mpp/build.gradle.kts @@ -54,6 +54,7 @@ val libraryToComponents = mapOf( ComposeComponent(":compose:material:material-icons-core"), ComposeComponent(":compose:material:material-ripple"), ComposeComponent(":compose:material3:material3-window-size-class"), + ComposeComponent(":compose:material3:adaptive:adaptive"), ComposeComponent(":compose:runtime:runtime", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:runtime:runtime-saveable", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:ui:ui"), diff --git a/settings.gradle b/settings.gradle index 0582b757a51f5..b89ecd80cf5de 100644 --- a/settings.gradle +++ b/settings.gradle @@ -157,7 +157,7 @@ includeProject(":compose:lint:common-test") includeProject(":compose:material") includeProject(":compose:material3:material3") includeProject(":compose:material3:material3-common") -//includeProject(":compose:material3:material3-adaptive") +includeProject(":compose:material3:adaptive:adaptive") includeProject(":compose:material3:material3-lint") includeProject(":compose:material3:material3-window-size-class") includeProject(":compose:material3:material3-window-size-class:material3-window-size-class-samples", "compose/material3/material3-window-size-class/samples") From 717e7e92905405ccd7f4933e84f3d40dca884140 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 30 Jul 2024 16:32:24 +0200 Subject: [PATCH 03/12] Add an usage of `material3:adaptive:adaptive` to the MPP demo --- compose/mpp/demo/build.gradle.kts | 1 + .../compose/mpp/demo/components/Adaptive.kt | 39 +++++++++++++++++++ .../compose/mpp/demo/components/Components.kt | 1 + 3 files changed, 41 insertions(+) create mode 100644 compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Adaptive.kt diff --git a/compose/mpp/demo/build.gradle.kts b/compose/mpp/demo/build.gradle.kts index 5ef3e6e5d97ad..5c64969eea7d7 100644 --- a/compose/mpp/demo/build.gradle.kts +++ b/compose/mpp/demo/build.gradle.kts @@ -154,6 +154,7 @@ kotlin { implementation(project(":compose:foundation:foundation-layout")) implementation(project(":compose:material3:material3")) implementation(project(":compose:material3:material3-window-size-class")) + implementation(project(":compose:material3:adaptive:adaptive")) implementation(project(":compose:material:material")) implementation(project(":compose:mpp")) implementation(project(":compose:runtime:runtime")) diff --git a/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Adaptive.kt b/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Adaptive.kt new file mode 100644 index 0000000000000..6d3972ff78f07 --- /dev/null +++ b/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Adaptive.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2024 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.mpp.demo.components + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Text +import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp + +@Composable +fun AdaptiveExample() { + Box(modifier = Modifier.fillMaxSize().padding(40.dp), contentAlignment = Alignment.Center) { + val adaptiveInfo = currentWindowAdaptiveInfo() + Text("WindowAdaptiveInfo\n" + + "WidthSizeClass=${adaptiveInfo.windowSizeClass.windowWidthSizeClass}\n" + + "HeightSizeClass=${adaptiveInfo.windowSizeClass.windowHeightSizeClass}\n" + + "isTabletop=${adaptiveInfo.windowPosture.isTabletop}\n" + + "hingeList=${adaptiveInfo.windowPosture.hingeList}") + } +} \ No newline at end of file diff --git a/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Components.kt b/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Components.kt index e9c1784bd08ad..29179ac9f232d 100644 --- a/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Components.kt +++ b/compose/mpp/demo/src/commonMain/kotlin/androidx/compose/mpp/demo/components/Components.kt @@ -60,4 +60,5 @@ val Components = Screen.Selection( Screen.Example("NestedScroll") { NestedScrollExample() }, Screen.Example("Selection") { SelectionExample() }, Screen.Example("Pager") { PagerExample() }, + Screen.Example("WindowAdaptiveInfo") { AdaptiveExample() }, ) From 6aceeea386a07fc8d0a38a8db9059efd49295da1 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Wed, 31 Jul 2024 15:23:34 +0200 Subject: [PATCH 04/12] Commonize `:compose:material3:adaptive:adaptive-layout` module and configure publication. --- .../adaptive/adaptive-layout/build.gradle | 60 +++++++--- .../adaptive/layout/PaneAdaptedValue.kt | 1 + .../adaptive/layout/ThreePaneMotion.kt | 1 + .../adaptive/layout/PaneMotionTest.kt | 0 .../layout/PaneScaffoldDirectiveTest.kt | 104 +++++++++--------- .../adaptive/layout/ThreePaneMotionTest.kt | 37 +++---- .../layout/ThreePaneScaffoldValueTest.kt | 9 +- .../layout/PaneExpansionDragHandle.skiko.kt} | 0 mpp/build.gradle.kts | 1 + settings.gradle | 1 + 10 files changed, 118 insertions(+), 96 deletions(-) rename compose/material3/adaptive/adaptive-layout/src/{androidUnitTest => commonTest}/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt (100%) rename compose/material3/adaptive/adaptive-layout/src/{androidUnitTest => commonTest}/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt (64%) rename compose/material3/adaptive/adaptive-layout/src/{androidUnitTest => commonTest}/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt (90%) rename compose/material3/adaptive/adaptive-layout/src/{androidUnitTest => commonTest}/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt (97%) rename compose/material3/adaptive/adaptive-layout/src/{desktopMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionDragHandle.desktop.kt => skikoMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionDragHandle.skiko.kt} (100%) diff --git a/compose/material3/adaptive/adaptive-layout/build.gradle b/compose/material3/adaptive/adaptive-layout/build.gradle index d61114c242933..9fa627c0f0ed5 100644 --- a/compose/material3/adaptive/adaptive-layout/build.gradle +++ b/compose/material3/adaptive/adaptive-layout/build.gradle @@ -21,40 +21,52 @@ * Please use that script when creating a new project, rather than copying an existing project and * modifying its settings. */ + +import androidx.build.AndroidXComposePlugin +import androidx.build.JetbrainsAndroidXPlugin import androidx.build.LibraryType -import androidx.build.PlatformIdentifier import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("AndroidXPlugin") id("com.android.library") id("AndroidXComposePlugin") + id("JetbrainsAndroidXPlugin") } -androidXMultiplatform { +AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) +JetbrainsAndroidXPlugin.applyAndConfigure(project) + +androidXComposeMultiplatform { android() desktop() + darwin() + wasm() + js() +} - defaultPlatform(PlatformIdentifier.ANDROID) - +kotlin { sourceSets { commonMain { dependencies { implementation(libs.kotlinStdlibCommon) api(project(":compose:material3:adaptive:adaptive")) - api("androidx.compose.animation:animation-core:1.7.0-beta04") - api("androidx.compose.ui:ui:1.7.0-beta04") - implementation("androidx.compose.animation:animation:1.7.0-beta04") - implementation("androidx.compose.foundation:foundation:1.6.5") - implementation("androidx.compose.foundation:foundation-layout:1.6.5") - implementation("androidx.compose.ui:ui-geometry:1.6.5") - implementation("androidx.compose.ui:ui-util:1.6.5") - implementation("androidx.window:window-core:1.3.0-rc01") + api(project(":compose:animation:animation-core")) + api(project(":compose:ui:ui")) + implementation(project(":compose:animation:animation")) + implementation(project(":compose:foundation:foundation")) + implementation(project(":compose:foundation:foundation-layout")) + implementation(project(":compose:ui:ui-geometry")) + implementation(project(":compose:ui:ui-util")) + implementation(project(":window:window-core")) + implementation(project(":collection:collection")) } } commonTest { dependencies { + implementation(libs.kotlinTest) + api(project(":annotation:annotation")) } } @@ -68,8 +80,6 @@ androidXMultiplatform { androidMain { dependsOn(jvmMain) dependencies { - api("androidx.annotation:annotation:1.1.0") - api("androidx.annotation:annotation-experimental:1.4.0") } } @@ -94,7 +104,7 @@ androidXMultiplatform { dependencies { implementation(project(":compose:material3:material3")) implementation(project(":compose:test-utils")) - implementation(project(":window:window-testing")) +// implementation(project(":window:window-testing")) implementation(libs.junit) implementation(libs.testRunner) implementation(libs.truth) @@ -109,6 +119,22 @@ androidXMultiplatform { implementation(libs.truth) } } + + skikoMain.dependsOn(commonMain) + desktopMain.dependsOn(skikoMain) + nonJvmMain.dependsOn(skikoMain) + webMain.dependsOn(nonJvmMain) + jsMain.dependsOn(webMain) + wasmJsMain.dependsOn(webMain) + nativeMain.dependsOn(nonJvmMain) + + skikoTest.dependsOn(commonTest) + desktopTest.dependsOn(skikoTest) + nonJvmTest.dependsOn(skikoTest) + webTest.dependsOn(nonJvmTest) + jsTest.dependsOn(webTest) + wasmJsTest.dependsOn(webTest) + nativeTest.dependsOn(nonJvmTest) } } @@ -118,11 +144,11 @@ android { androidx { name = "Material Adaptive" - type = LibraryType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS + type = LibraryType.PUBLISHED_LIBRARY inceptionYear = "2023" description = "Compose Material Design Adaptive Library" legacyDisableKotlinStrictApiMode = true - samples(project(":compose:material3:adaptive:adaptive-samples")) +// samples(project(":compose:material3:adaptive:adaptive-samples")) } tasks.withType(KotlinCompile).configureEach { diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt index 00deed0daf2ae..e09a1473b547d 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt @@ -17,6 +17,7 @@ package androidx.compose.material3.adaptive.layout import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi +import kotlin.jvm.JvmInline /** * The adapted state of a pane. It gives clues to pane scaffolds about if a certain pane should be diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotion.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotion.kt index 28ecdc360aa30..f5ec399a5e659 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotion.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotion.kt @@ -33,6 +33,7 @@ import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi import androidx.compose.runtime.Immutable import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntSize +import kotlin.jvm.JvmStatic /** Holds the transitions that can be applied to the different panes. */ @ExperimentalMaterial3AdaptiveApi diff --git a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt similarity index 100% rename from compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt rename to compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt diff --git a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt similarity index 64% rename from compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt rename to compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt index ea192858d4cab..2b2d5184b13be 100644 --- a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt @@ -23,13 +23,11 @@ import androidx.compose.material3.adaptive.WindowAdaptiveInfo import androidx.compose.ui.geometry.Rect import androidx.compose.ui.unit.dp import androidx.window.core.layout.WindowSizeClass -import com.google.common.truth.Truth.assertThat -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue @OptIn(ExperimentalMaterial3AdaptiveApi::class) -@RunWith(JUnit4::class) class PaneScaffoldDirectiveTest { @Test fun test_calculateStandardPaneScaffoldDirective_compactWidth() { @@ -38,11 +36,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(400f, 800f), Posture()) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(1, scaffoldDirective.maxHorizontalPartitions) + assertEquals(1, scaffoldDirective.maxVerticalPartitions) + assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -52,11 +50,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(750f, 900f), Posture()) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(1, scaffoldDirective.maxHorizontalPartitions) + assertEquals(1, scaffoldDirective.maxVerticalPartitions) + assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -66,11 +64,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(1200f, 800f), Posture()) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(2, scaffoldDirective.maxHorizontalPartitions) + assertEquals(1, scaffoldDirective.maxVerticalPartitions) + assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -80,11 +78,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(700f, 800f), Posture(isTabletop = true)) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(2) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(24.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(1, scaffoldDirective.maxHorizontalPartitions) + assertEquals(2, scaffoldDirective.maxVerticalPartitions) + assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(24.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -94,11 +92,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(400f, 800f), Posture()) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(1, scaffoldDirective.maxHorizontalPartitions) + assertEquals(1, scaffoldDirective.maxVerticalPartitions) + assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -108,11 +106,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(750f, 900f), Posture()) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(2, scaffoldDirective.maxHorizontalPartitions) + assertEquals(1, scaffoldDirective.maxVerticalPartitions) + assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -122,11 +120,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(1200f, 800f), Posture()) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(2, scaffoldDirective.maxHorizontalPartitions) + assertEquals(1, scaffoldDirective.maxVerticalPartitions) + assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -136,11 +134,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(700f, 800f), Posture(isTabletop = true)) ) - assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) - assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(2) - assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) - assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(24.dp) - assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) + assertEquals(2, scaffoldDirective.maxHorizontalPartitions) + assertEquals(2, scaffoldDirective.maxVerticalPartitions) + assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) + assertEquals(24.dp, scaffoldDirective.verticalPartitionSpacerSize) + assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) } @Test @@ -154,7 +152,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AlwaysAvoid ) - assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.getBounds()) + assertEquals(hingeList.getBounds(), scaffoldDirective.excludedBounds) } @Test @@ -168,7 +166,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidOccluding ) - assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(0, 2).getBounds()) + assertEquals(hingeList.subList(0, 2).getBounds(), scaffoldDirective.excludedBounds) } @Test @@ -182,7 +180,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidSeparating ) - assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(2, 3).getBounds()) + assertEquals(hingeList.subList(2, 3).getBounds(), scaffoldDirective.excludedBounds) } @Test @@ -196,7 +194,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.NeverAvoid ) - assertThat(scaffoldDirective.excludedBounds).isEmpty() + assertTrue { scaffoldDirective.excludedBounds.isEmpty() } } @Test @@ -210,7 +208,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AlwaysAvoid ) - assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.getBounds()) + assertEquals(hingeList.getBounds(), scaffoldDirective.excludedBounds) } @Test @@ -224,7 +222,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidOccluding ) - assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(0, 2).getBounds()) + assertEquals(hingeList.subList(0, 2).getBounds(), scaffoldDirective.excludedBounds) } @Test @@ -238,7 +236,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidSeparating ) - assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(2, 3).getBounds()) + assertEquals(hingeList.subList(2, 3).getBounds(), scaffoldDirective.excludedBounds) } @Test @@ -252,7 +250,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.NeverAvoid ) - assertThat(scaffoldDirective.excludedBounds).isEmpty() + assertTrue { scaffoldDirective.excludedBounds.isEmpty() } } } diff --git a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt similarity index 90% rename from compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt rename to compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt index 39bfd7d5a8559..4aefe7ad3bf91 100644 --- a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt @@ -21,13 +21,10 @@ import androidx.compose.animation.core.VectorConverter import androidx.compose.animation.core.VectorizedAnimationSpec import androidx.compose.animation.core.spring import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi -import com.google.common.truth.Truth.assertThat -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 +import kotlin.test.Test +import kotlin.test.assertEquals @OptIn(ExperimentalMaterial3AdaptiveApi::class) -@RunWith(JUnit4::class) class ThreePaneMotionTest { @Test fun noPane_noMotion() { @@ -46,7 +43,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(ThreePaneMotion.NoMotion) + assertEquals(ThreePaneMotion.NoMotion, motions) } @Test @@ -66,7 +63,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) + assertEquals(MovePanesToLeftMotion(SpacerSize), motions) } @Test @@ -86,7 +83,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) + assertEquals(MovePanesToLeftMotion(SpacerSize), motions) } @Test @@ -106,7 +103,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) + assertEquals(MovePanesToLeftMotion(SpacerSize), motions) } @Test @@ -126,7 +123,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) + assertEquals(MovePanesToRightMotion(SpacerSize), motions) } @Test @@ -146,7 +143,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) + assertEquals(MovePanesToRightMotion(SpacerSize), motions) } @Test @@ -166,7 +163,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) + assertEquals(MovePanesToRightMotion(SpacerSize), motions) } @Test @@ -186,7 +183,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) + assertEquals(MovePanesToLeftMotion(SpacerSize), motions) } @Test @@ -206,7 +203,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) + assertEquals(MovePanesToRightMotion(SpacerSize), motions) } @Test @@ -226,7 +223,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(SwitchRightTwoPanesMotion(SpacerSize)) + assertEquals(SwitchRightTwoPanesMotion(SpacerSize), motions) } @Test @@ -246,7 +243,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(SwitchRightTwoPanesMotion(SpacerSize)) + assertEquals(SwitchRightTwoPanesMotion(SpacerSize), motions) } @Test @@ -266,7 +263,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(SwitchLeftTwoPanesMotion(SpacerSize)) + assertEquals(SwitchLeftTwoPanesMotion(SpacerSize), motions) } @Test @@ -286,7 +283,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(SwitchLeftTwoPanesMotion(SpacerSize)) + assertEquals(SwitchLeftTwoPanesMotion(SpacerSize), motions) } @Test @@ -307,7 +304,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertThat(motions).isEqualTo(ThreePaneMotion.NoMotion) + assertEquals(ThreePaneMotion.NoMotion, motions) } @Test @@ -353,7 +350,7 @@ class ThreePaneMotionTest { ): Float = getValueFromNanos(playTimeNanos, InitialValue, TargetValue, InitialVelocity).value private fun assertValuesAreEqual(value1: Float, value2: Float) { - assertThat(value1 - value2).isWithin(Tolerance) + assertEquals(value1, value2, Tolerance) } companion object { diff --git a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt similarity index 97% rename from compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt rename to compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt index b24879e175394..8b9de60be4125 100644 --- a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt @@ -17,13 +17,10 @@ package androidx.compose.material3.adaptive.layout import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi -import com.google.common.truth.Truth.assertThat -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 +import kotlin.test.Test +import kotlin.test.assertEquals @OptIn(ExperimentalMaterial3AdaptiveApi::class) -@RunWith(JUnit4::class) class ThreePaneScaffoldValueTest { @Test fun calculateWithoutHistory_onePaneLayout_noDestination() { @@ -163,7 +160,7 @@ class ThreePaneScaffoldValueTest { role: ThreePaneScaffoldRole, state: PaneAdaptedValue ) { - assertThat(this[role]).isEqualTo(state) + assertEquals(state, this[role]) } companion object { diff --git a/compose/material3/adaptive/adaptive-layout/src/desktopMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionDragHandle.desktop.kt b/compose/material3/adaptive/adaptive-layout/src/skikoMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionDragHandle.skiko.kt similarity index 100% rename from compose/material3/adaptive/adaptive-layout/src/desktopMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionDragHandle.desktop.kt rename to compose/material3/adaptive/adaptive-layout/src/skikoMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionDragHandle.skiko.kt diff --git a/mpp/build.gradle.kts b/mpp/build.gradle.kts index 918cfce7a67be..b480429f9e9e8 100644 --- a/mpp/build.gradle.kts +++ b/mpp/build.gradle.kts @@ -55,6 +55,7 @@ val libraryToComponents = mapOf( ComposeComponent(":compose:material:material-ripple"), ComposeComponent(":compose:material3:material3-window-size-class"), ComposeComponent(":compose:material3:adaptive:adaptive"), + ComposeComponent(":compose:material3:adaptive:adaptive-layout"), ComposeComponent(":compose:runtime:runtime", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:runtime:runtime-saveable", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:ui:ui"), diff --git a/settings.gradle b/settings.gradle index b89ecd80cf5de..acf8980e4db8c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -158,6 +158,7 @@ includeProject(":compose:material") includeProject(":compose:material3:material3") includeProject(":compose:material3:material3-common") includeProject(":compose:material3:adaptive:adaptive") +includeProject(":compose:material3:adaptive:adaptive-layout") includeProject(":compose:material3:material3-lint") includeProject(":compose:material3:material3-window-size-class") includeProject(":compose:material3:material3-window-size-class:material3-window-size-class-samples", "compose/material3/material3-window-size-class/samples") From 64dc6ffa96ff52dc63eb0efaf34abd489d60d7e7 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Wed, 31 Jul 2024 18:34:00 +0200 Subject: [PATCH 05/12] Restore original `:compose:material3:adaptive:adaptive-layout` test checks. --- .../adaptive/adaptive-layout/build.gradle | 1 + .../layout/PaneScaffoldDirectiveTest.kt | 99 +++++++++---------- .../adaptive/layout/ThreePaneMotionTest.kt | 39 ++++---- .../layout/ThreePaneScaffoldValueTest.kt | 38 +++---- 4 files changed, 89 insertions(+), 88 deletions(-) diff --git a/compose/material3/adaptive/adaptive-layout/build.gradle b/compose/material3/adaptive/adaptive-layout/build.gradle index 9fa627c0f0ed5..e31d9df3a986c 100644 --- a/compose/material3/adaptive/adaptive-layout/build.gradle +++ b/compose/material3/adaptive/adaptive-layout/build.gradle @@ -67,6 +67,7 @@ kotlin { dependencies { implementation(libs.kotlinTest) api(project(":annotation:annotation")) + implementation(project(":kruth:kruth")) } } diff --git a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt index 2b2d5184b13be..624c9c8ec36c6 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveTest.kt @@ -22,10 +22,9 @@ import androidx.compose.material3.adaptive.Posture import androidx.compose.material3.adaptive.WindowAdaptiveInfo import androidx.compose.ui.geometry.Rect import androidx.compose.ui.unit.dp +import androidx.kruth.assertThat import androidx.window.core.layout.WindowSizeClass import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertTrue @OptIn(ExperimentalMaterial3AdaptiveApi::class) class PaneScaffoldDirectiveTest { @@ -36,11 +35,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(400f, 800f), Posture()) ) - assertEquals(1, scaffoldDirective.maxHorizontalPartitions) - assertEquals(1, scaffoldDirective.maxVerticalPartitions) - assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -50,11 +49,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(750f, 900f), Posture()) ) - assertEquals(1, scaffoldDirective.maxHorizontalPartitions) - assertEquals(1, scaffoldDirective.maxVerticalPartitions) - assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -64,11 +63,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(1200f, 800f), Posture()) ) - assertEquals(2, scaffoldDirective.maxHorizontalPartitions) - assertEquals(1, scaffoldDirective.maxVerticalPartitions) - assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -78,11 +77,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(700f, 800f), Posture(isTabletop = true)) ) - assertEquals(1, scaffoldDirective.maxHorizontalPartitions) - assertEquals(2, scaffoldDirective.maxVerticalPartitions) - assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(24.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(2) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(24.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -92,11 +91,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(400f, 800f), Posture()) ) - assertEquals(1, scaffoldDirective.maxHorizontalPartitions) - assertEquals(1, scaffoldDirective.maxVerticalPartitions) - assertEquals(0.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -106,11 +105,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(750f, 900f), Posture()) ) - assertEquals(2, scaffoldDirective.maxHorizontalPartitions) - assertEquals(1, scaffoldDirective.maxVerticalPartitions) - assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -120,11 +119,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(1200f, 800f), Posture()) ) - assertEquals(2, scaffoldDirective.maxHorizontalPartitions) - assertEquals(1, scaffoldDirective.maxVerticalPartitions) - assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(0.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(1) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(0.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -134,11 +133,11 @@ class PaneScaffoldDirectiveTest { WindowAdaptiveInfo(WindowSizeClass.compute(700f, 800f), Posture(isTabletop = true)) ) - assertEquals(2, scaffoldDirective.maxHorizontalPartitions) - assertEquals(2, scaffoldDirective.maxVerticalPartitions) - assertEquals(24.dp, scaffoldDirective.horizontalPartitionSpacerSize) - assertEquals(24.dp, scaffoldDirective.verticalPartitionSpacerSize) - assertEquals(360.dp, scaffoldDirective.defaultPanePreferredWidth) + assertThat(scaffoldDirective.maxHorizontalPartitions).isEqualTo(2) + assertThat(scaffoldDirective.maxVerticalPartitions).isEqualTo(2) + assertThat(scaffoldDirective.horizontalPartitionSpacerSize).isEqualTo(24.dp) + assertThat(scaffoldDirective.verticalPartitionSpacerSize).isEqualTo(24.dp) + assertThat(scaffoldDirective.defaultPanePreferredWidth).isEqualTo(360.dp) } @Test @@ -152,7 +151,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AlwaysAvoid ) - assertEquals(hingeList.getBounds(), scaffoldDirective.excludedBounds) + assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.getBounds()) } @Test @@ -166,7 +165,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidOccluding ) - assertEquals(hingeList.subList(0, 2).getBounds(), scaffoldDirective.excludedBounds) + assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(0, 2).getBounds()) } @Test @@ -180,7 +179,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidSeparating ) - assertEquals(hingeList.subList(2, 3).getBounds(), scaffoldDirective.excludedBounds) + assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(2, 3).getBounds()) } @Test @@ -194,7 +193,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.NeverAvoid ) - assertTrue { scaffoldDirective.excludedBounds.isEmpty() } + assertThat(scaffoldDirective.excludedBounds).isEmpty() } @Test @@ -208,7 +207,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AlwaysAvoid ) - assertEquals(hingeList.getBounds(), scaffoldDirective.excludedBounds) + assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.getBounds()) } @Test @@ -222,7 +221,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidOccluding ) - assertEquals(hingeList.subList(0, 2).getBounds(), scaffoldDirective.excludedBounds) + assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(0, 2).getBounds()) } @Test @@ -236,7 +235,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.AvoidSeparating ) - assertEquals(hingeList.subList(2, 3).getBounds(), scaffoldDirective.excludedBounds) + assertThat(scaffoldDirective.excludedBounds).isEqualTo(hingeList.subList(2, 3).getBounds()) } @Test @@ -250,7 +249,7 @@ class PaneScaffoldDirectiveTest { HingePolicy.NeverAvoid ) - assertTrue { scaffoldDirective.excludedBounds.isEmpty() } + assertThat(scaffoldDirective.excludedBounds).isEmpty() } } diff --git a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt index 4aefe7ad3bf91..6076a670bdd45 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt @@ -21,6 +21,7 @@ import androidx.compose.animation.core.VectorConverter import androidx.compose.animation.core.VectorizedAnimationSpec import androidx.compose.animation.core.spring import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi +import androidx.kruth.assertThat import kotlin.test.Test import kotlin.test.assertEquals @@ -43,7 +44,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(ThreePaneMotion.NoMotion, motions) + assertThat(motions).isEqualTo(ThreePaneMotion.NoMotion) } @Test @@ -63,7 +64,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToLeftMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) } @Test @@ -83,7 +84,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToLeftMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) } @Test @@ -103,7 +104,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToLeftMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) } @Test @@ -123,7 +124,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToRightMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) } @Test @@ -143,7 +144,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToRightMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) } @Test @@ -163,7 +164,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToRightMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) } @Test @@ -183,7 +184,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToLeftMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToLeftMotion(SpacerSize)) } @Test @@ -203,7 +204,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(MovePanesToRightMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(MovePanesToRightMotion(SpacerSize)) } @Test @@ -223,7 +224,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(SwitchRightTwoPanesMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(SwitchRightTwoPanesMotion(SpacerSize)) } @Test @@ -243,7 +244,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(SwitchRightTwoPanesMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(SwitchRightTwoPanesMotion(SpacerSize)) } @Test @@ -263,7 +264,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(SwitchLeftTwoPanesMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(SwitchLeftTwoPanesMotion(SpacerSize)) } @Test @@ -283,7 +284,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(SwitchLeftTwoPanesMotion(SpacerSize), motions) + assertThat(motions).isEqualTo(SwitchLeftTwoPanesMotion(SpacerSize)) } @Test @@ -304,7 +305,7 @@ class ThreePaneMotionTest { PaneOrder, SpacerSize ) - assertEquals(ThreePaneMotion.NoMotion, motions) + assertThat(motions).isEqualTo(ThreePaneMotion.NoMotion) } @Test @@ -317,11 +318,11 @@ class ThreePaneMotionTest { val delayedSpec = DelayedSpringSpec( - dampingRatio = 0.7f, - stiffness = 500f, - visibilityThreshold = 0.1f, - delayedRatio = delayedRatio, - ) + dampingRatio = 0.7f, + stiffness = 500f, + visibilityThreshold = 0.1f, + delayedRatio = delayedRatio, + ) .vectorize(Float.VectorConverter) val originalDurationNanos = originalSpec.getDurationNanos() diff --git a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt index 8b9de60be4125..e1d0d98ecc5e1 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt @@ -17,8 +17,8 @@ package androidx.compose.material3.adaptive.layout import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi +import androidx.kruth.assertThat import kotlin.test.Test -import kotlin.test.assertEquals @OptIn(ExperimentalMaterial3AdaptiveApi::class) class ThreePaneScaffoldValueTest { @@ -55,7 +55,7 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 1, adaptStrategies = MockAdaptStrategies, currentDestination = - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PrimaryPaneAdaptedState) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, PaneAdaptedValue.Expanded) @@ -69,10 +69,10 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 1, adaptStrategies = MockAdaptStrategies, destinationHistory = - listOf( - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) - ) + listOf( + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) + ) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PrimaryPaneAdaptedState) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, PaneAdaptedValue.Expanded) @@ -112,7 +112,7 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 2, adaptStrategies = MockAdaptStrategies, currentDestination = - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PaneAdaptedValue.Expanded) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, SecondaryPaneAdaptedState) @@ -126,10 +126,10 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 2, adaptStrategies = MockAdaptStrategies, destinationHistory = - listOf( - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) - ) + listOf( + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) + ) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PrimaryPaneAdaptedState) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, PaneAdaptedValue.Expanded) @@ -143,13 +143,13 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 2, adaptStrategies = MockAdaptStrategies, destinationHistory = - listOf( - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) - ) + listOf( + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) + ) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PaneAdaptedValue.Expanded) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, SecondaryPaneAdaptedState) @@ -160,7 +160,7 @@ class ThreePaneScaffoldValueTest { role: ThreePaneScaffoldRole, state: PaneAdaptedValue ) { - assertEquals(state, this[role]) + assertThat(this[role]).isEqualTo(state) } companion object { From d9927f2244ff0855e12187480a3143b8d3f3bbc4 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 13 Aug 2024 12:44:20 +0200 Subject: [PATCH 06/12] Fix PaneMotionTest imports --- .../compose/material3/adaptive/layout/PaneMotionTest.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt index 1c455bf906300..d40099a4710c2 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt @@ -47,13 +47,10 @@ import androidx.compose.ui.layout.LayoutCoordinates import androidx.compose.ui.layout.Placeable import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntSize -import com.google.common.truth.Truth.assertWithMessage -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 +import androidx.kruth.assertWithMessage +import kotlin.test.Test @OptIn(ExperimentalMaterial3AdaptiveApi::class) -@RunWith(JUnit4::class) class PaneMotionTest { @Test fun test_allThreePaneMotions() { From 5c1f3f55650c06bd4db8df047942ca51e7c44caa Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Wed, 31 Jul 2024 15:52:47 +0200 Subject: [PATCH 07/12] Commonize `:compose:material3:adaptive:adaptive-navigation` module and configure publication. --- .../adaptive/adaptive-navigation/build.gradle | 41 +++++++++++++++---- .../navigation/BackNavigationBehavior.kt | 1 + mpp/build.gradle.kts | 1 + settings.gradle | 1 + 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/compose/material3/adaptive/adaptive-navigation/build.gradle b/compose/material3/adaptive/adaptive-navigation/build.gradle index e7f9947512310..67a4b86cb92b4 100644 --- a/compose/material3/adaptive/adaptive-navigation/build.gradle +++ b/compose/material3/adaptive/adaptive-navigation/build.gradle @@ -21,29 +21,38 @@ * Please use that script when creating a new project, rather than copying an existing project and * modifying its settings. */ + +import androidx.build.AndroidXComposePlugin +import androidx.build.JetbrainsAndroidXPlugin import androidx.build.LibraryType -import androidx.build.PlatformIdentifier import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("AndroidXPlugin") id("com.android.library") id("AndroidXComposePlugin") + id("JetbrainsAndroidXPlugin") } -androidXMultiplatform { +AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) +JetbrainsAndroidXPlugin.applyAndConfigure(project) + +androidXComposeMultiplatform { android() desktop() + darwin() + wasm() + js() +} - defaultPlatform(PlatformIdentifier.ANDROID) - +kotlin { sourceSets { commonMain { dependencies { implementation(libs.kotlinStdlibCommon) api(project(":compose:material3:adaptive:adaptive-layout")) - implementation("androidx.compose.foundation:foundation:1.6.5") - implementation("androidx.compose.ui:ui-util:1.6.5") + implementation(project(":compose:foundation:foundation")) + implementation(project(":compose:ui:ui-util")) } } @@ -89,7 +98,7 @@ androidXMultiplatform { dependencies { implementation(project(":compose:material3:material3")) implementation(project(":compose:test-utils")) - implementation(project(":window:window-testing")) +// implementation(project(":window:window-testing")) implementation(libs.junit) implementation(libs.testRunner) implementation(libs.truth) @@ -104,6 +113,22 @@ androidXMultiplatform { implementation(libs.truth) } } + + skikoMain.dependsOn(commonMain) + desktopMain.dependsOn(skikoMain) + nonJvmMain.dependsOn(skikoMain) + webMain.dependsOn(nonJvmMain) + jsMain.dependsOn(webMain) + wasmJsMain.dependsOn(webMain) + nativeMain.dependsOn(nonJvmMain) + + skikoTest.dependsOn(commonTest) + desktopTest.dependsOn(skikoTest) + nonJvmTest.dependsOn(skikoTest) + webTest.dependsOn(nonJvmTest) + jsTest.dependsOn(webTest) + wasmJsTest.dependsOn(webTest) + nativeTest.dependsOn(nonJvmTest) } } @@ -113,7 +138,7 @@ android { androidx { name = "Material Adaptive" - type = LibraryType.PUBLISHED_LIBRARY_ONLY_USED_BY_KOTLIN_CONSUMERS + type = LibraryType.PUBLISHED_LIBRARY inceptionYear = "2023" description = "Compose Material Design Adaptive Library" legacyDisableKotlinStrictApiMode = true diff --git a/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt b/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt index e3ba0c414e995..07c722a037945 100644 --- a/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt +++ b/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt @@ -20,6 +20,7 @@ import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi import androidx.compose.material3.adaptive.layout.PaneAdaptedValue import androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem import androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole +import kotlin.jvm.JvmInline /** A class to control how back navigation should behave in a [ThreePaneScaffoldNavigator]. */ @ExperimentalMaterial3AdaptiveApi diff --git a/mpp/build.gradle.kts b/mpp/build.gradle.kts index b480429f9e9e8..8e59c51a36759 100644 --- a/mpp/build.gradle.kts +++ b/mpp/build.gradle.kts @@ -56,6 +56,7 @@ val libraryToComponents = mapOf( ComposeComponent(":compose:material3:material3-window-size-class"), ComposeComponent(":compose:material3:adaptive:adaptive"), ComposeComponent(":compose:material3:adaptive:adaptive-layout"), + ComposeComponent(":compose:material3:adaptive:adaptive-navigation"), ComposeComponent(":compose:runtime:runtime", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:runtime:runtime-saveable", supportedPlatforms = ComposePlatforms.ALL), ComposeComponent(":compose:ui:ui"), diff --git a/settings.gradle b/settings.gradle index acf8980e4db8c..535a0e03a4dd9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -159,6 +159,7 @@ includeProject(":compose:material3:material3") includeProject(":compose:material3:material3-common") includeProject(":compose:material3:adaptive:adaptive") includeProject(":compose:material3:adaptive:adaptive-layout") +includeProject(":compose:material3:adaptive:adaptive-navigation") includeProject(":compose:material3:material3-lint") includeProject(":compose:material3:material3-window-size-class") includeProject(":compose:material3:material3-window-size-class:material3-window-size-class-samples", "compose/material3/material3-window-size-class/samples") From 506c484d0f091a2a1c9ab7b746ceace70415855c Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 13 Aug 2024 12:45:50 +0200 Subject: [PATCH 08/12] Dump `:compose:material3:adaptive:adaptive-layout` and `:compose:material3:adaptive:adaptive-navigation` API. --- .../api/desktop/adaptive-layout.api | 180 ++++++++++++++++++ .../api/desktop/adaptive-navigation.api | 41 ++++ 2 files changed, 221 insertions(+) create mode 100644 compose/material3/adaptive/adaptive-layout/api/desktop/adaptive-layout.api create mode 100644 compose/material3/adaptive/adaptive-navigation/api/desktop/adaptive-navigation.api diff --git a/compose/material3/adaptive/adaptive-layout/api/desktop/adaptive-layout.api b/compose/material3/adaptive/adaptive-layout/api/desktop/adaptive-layout.api new file mode 100644 index 0000000000000..7edfecf0f45f1 --- /dev/null +++ b/compose/material3/adaptive/adaptive-layout/api/desktop/adaptive-layout.api @@ -0,0 +1,180 @@ +public abstract interface class androidx/compose/material3/adaptive/layout/AdaptStrategy { + public static final field Companion Landroidx/compose/material3/adaptive/layout/AdaptStrategy$Companion; + public abstract fun adapt-z8rX67Q ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/layout/AdaptStrategy$Companion { + public final fun getHide ()Landroidx/compose/material3/adaptive/layout/AdaptStrategy; +} + +public abstract interface class androidx/compose/material3/adaptive/layout/AnimatedPaneScope : androidx/compose/animation/AnimatedVisibilityScope { +} + +public final class androidx/compose/material3/adaptive/layout/HingePolicy { + public static final field Companion Landroidx/compose/material3/adaptive/layout/HingePolicy$Companion; + public static final synthetic fun box-impl (I)Landroidx/compose/material3/adaptive/layout/HingePolicy; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (ILjava/lang/Object;)Z + public static final fun equals-impl0 (II)Z + public fun hashCode ()I + public static fun hashCode-impl (I)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (I)Ljava/lang/String; + public final synthetic fun unbox-impl ()I +} + +public final class androidx/compose/material3/adaptive/layout/HingePolicy$Companion { + public final fun getAlwaysAvoid-u6eov6g ()I + public final fun getAvoidOccluding-u6eov6g ()I + public final fun getAvoidSeparating-u6eov6g ()I + public final fun getNeverAvoid-u6eov6g ()I +} + +public final class androidx/compose/material3/adaptive/layout/ListDetailPaneScaffoldDefaults { + public static final field $stable I + public static final field INSTANCE Landroidx/compose/material3/adaptive/layout/ListDetailPaneScaffoldDefaults; + public final fun adaptStrategies (Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies; + public static synthetic fun adaptStrategies$default (Landroidx/compose/material3/adaptive/layout/ListDetailPaneScaffoldDefaults;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;ILjava/lang/Object;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies; +} + +public final class androidx/compose/material3/adaptive/layout/ListDetailPaneScaffoldKt { + public static final fun ListDetailPaneScaffold (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V +} + +public final class androidx/compose/material3/adaptive/layout/ListDetailPaneScaffoldRole { + public static final field $stable I + public static final field INSTANCE Landroidx/compose/material3/adaptive/layout/ListDetailPaneScaffoldRole; + public final fun getDetail ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public final fun getExtra ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public final fun getList ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; +} + +public final class androidx/compose/material3/adaptive/layout/PaneAdaptedValue { + public static final field Companion Landroidx/compose/material3/adaptive/layout/PaneAdaptedValue$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Landroidx/compose/material3/adaptive/layout/PaneAdaptedValue; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z + public fun hashCode ()I + public static fun hashCode-impl (Ljava/lang/String;)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/layout/PaneAdaptedValue$Companion { + public final fun getExpanded-z8rX67Q ()Ljava/lang/String; + public final fun getHidden-z8rX67Q ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/layout/PaneKt { + public static final fun AnimatedPane (Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldScope;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V +} + +public final class androidx/compose/material3/adaptive/layout/PaneScaffoldDirective { + public static final field $stable I + public static final field Companion Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective$Companion; + public synthetic fun (IFIFFLjava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy-7PwrCCA (IFIFFLjava/util/List;)Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; + public static synthetic fun copy-7PwrCCA$default (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;IFIFFLjava/util/List;ILjava/lang/Object;)Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; + public fun equals (Ljava/lang/Object;)Z + public final fun getDefaultPanePreferredWidth-D9Ej5fM ()F + public final fun getExcludedBounds ()Ljava/util/List; + public final fun getHorizontalPartitionSpacerSize-D9Ej5fM ()F + public final fun getMaxHorizontalPartitions ()I + public final fun getMaxVerticalPartitions ()I + public final fun getVerticalPartitionSpacerSize-D9Ej5fM ()F + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/layout/PaneScaffoldDirective$Companion { + public final fun getDefault ()Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; +} + +public final class androidx/compose/material3/adaptive/layout/PaneScaffoldDirectiveKt { + public static final fun calculatePaneScaffoldDirective-A-ymEG0 (Landroidx/compose/material3/adaptive/WindowAdaptiveInfo;I)Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; + public static synthetic fun calculatePaneScaffoldDirective-A-ymEG0$default (Landroidx/compose/material3/adaptive/WindowAdaptiveInfo;IILjava/lang/Object;)Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; + public static final fun calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth-A-ymEG0 (Landroidx/compose/material3/adaptive/WindowAdaptiveInfo;I)Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; + public static synthetic fun calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth-A-ymEG0$default (Landroidx/compose/material3/adaptive/WindowAdaptiveInfo;IILjava/lang/Object;)Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; +} + +public abstract interface class androidx/compose/material3/adaptive/layout/PaneScaffoldScope { + public abstract fun preferredWidth-3ABfNKs (Landroidx/compose/ui/Modifier;F)Landroidx/compose/ui/Modifier; +} + +public final class androidx/compose/material3/adaptive/layout/SupportingPaneScaffoldDefaults { + public static final field $stable I + public static final field INSTANCE Landroidx/compose/material3/adaptive/layout/SupportingPaneScaffoldDefaults; + public final fun adaptStrategies (Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies; + public static synthetic fun adaptStrategies$default (Landroidx/compose/material3/adaptive/layout/SupportingPaneScaffoldDefaults;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;ILjava/lang/Object;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies; +} + +public final class androidx/compose/material3/adaptive/layout/SupportingPaneScaffoldKt { + public static final fun SupportingPaneScaffold (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V +} + +public final class androidx/compose/material3/adaptive/layout/SupportingPaneScaffoldRole { + public static final field $stable I + public static final field INSTANCE Landroidx/compose/material3/adaptive/layout/SupportingPaneScaffoldRole; + public final fun getExtra ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public final fun getMain ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public final fun getSupporting ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; +} + +public final class androidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies { + public static final field $stable I + public fun (Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;Landroidx/compose/material3/adaptive/layout/AdaptStrategy;)V + public fun equals (Ljava/lang/Object;)Z + public final fun get (Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole;)Landroidx/compose/material3/adaptive/layout/AdaptStrategy; + public fun hashCode ()I +} + +public final class androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem { + public static final field $stable I + public fun (Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole;Ljava/lang/Object;)V + public synthetic fun (Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole;Ljava/lang/Object;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun equals (Ljava/lang/Object;)Z + public final fun getContent ()Ljava/lang/Object; + public final fun getPane ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole : java/lang/Enum { + public static final field Primary Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public static final field Secondary Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public static final field Tertiary Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public static fun values ()[Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; +} + +public abstract interface class androidx/compose/material3/adaptive/layout/ThreePaneScaffoldScope : androidx/compose/material3/adaptive/layout/PaneScaffoldScope, androidx/compose/ui/layout/LookaheadScope { + public abstract fun getEnterTransition ()Landroidx/compose/animation/EnterTransition; + public abstract fun getExitTransition ()Landroidx/compose/animation/ExitTransition; + public abstract fun getPositionAnimationSpec ()Landroidx/compose/animation/core/FiniteAnimationSpec; + public abstract fun getRole ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole; + public abstract fun getScaffoldStateTransition ()Landroidx/compose/animation/core/Transition; + public abstract fun getScaffoldStateTransitionFraction ()F + public abstract fun getSizeAnimationSpec ()Landroidx/compose/animation/core/FiniteAnimationSpec; +} + +public final class androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue : androidx/compose/material3/adaptive/layout/PaneScaffoldValue { + public static final field $stable I + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun equals (Ljava/lang/Object;)Z + public fun get-KvVKflc (Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole;)Ljava/lang/String; + public synthetic fun get-KvVKflc (Ljava/lang/Object;)Ljava/lang/String; + public final fun getPrimary-z8rX67Q ()Ljava/lang/String; + public final fun getSecondary-z8rX67Q ()Ljava/lang/String; + public final fun getTertiary-z8rX67Q ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueKt { + public static final fun calculateThreePaneScaffoldValue (ILandroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue; + public static final fun calculateThreePaneScaffoldValue (ILandroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies;Ljava/util/List;)Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue; +} + diff --git a/compose/material3/adaptive/adaptive-navigation/api/desktop/adaptive-navigation.api b/compose/material3/adaptive/adaptive-navigation/api/desktop/adaptive-navigation.api new file mode 100644 index 0000000000000..253d7f67d91f3 --- /dev/null +++ b/compose/material3/adaptive/adaptive-navigation/api/desktop/adaptive-navigation.api @@ -0,0 +1,41 @@ +public final class androidx/compose/material3/adaptive/navigation/BackNavigationBehavior { + public static final field Companion Landroidx/compose/material3/adaptive/navigation/BackNavigationBehavior$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Landroidx/compose/material3/adaptive/navigation/BackNavigationBehavior; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z + public fun hashCode ()I + public static fun hashCode-impl (Ljava/lang/String;)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Ljava/lang/String; +} + +public final class androidx/compose/material3/adaptive/navigation/BackNavigationBehavior$Companion { + public final fun getPopLatest-pSECbL4 ()Ljava/lang/String; + public final fun getPopUntilContentChange-pSECbL4 ()Ljava/lang/String; + public final fun getPopUntilCurrentDestinationChange-pSECbL4 ()Ljava/lang/String; + public final fun getPopUntilScaffoldValueChange-pSECbL4 ()Ljava/lang/String; +} + +public abstract interface class androidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator { + public abstract fun canNavigateBack--pgVGNs (Ljava/lang/String;)Z + public static synthetic fun canNavigateBack--pgVGNs$default (Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator;Ljava/lang/String;ILjava/lang/Object;)Z + public abstract fun getCurrentDestination ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem; + public abstract fun getScaffoldDirective ()Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective; + public abstract fun getScaffoldValue ()Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue; + public abstract fun isDestinationHistoryAware ()Z + public abstract fun navigateBack--pgVGNs (Ljava/lang/String;)Z + public static synthetic fun navigateBack--pgVGNs$default (Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator;Ljava/lang/String;ILjava/lang/Object;)Z + public abstract fun navigateTo (Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole;Ljava/lang/Object;)V + public static synthetic fun navigateTo$default (Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldRole;Ljava/lang/Object;ILjava/lang/Object;)V + public abstract fun setDestinationHistoryAware (Z)V +} + +public final class androidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigatorKt { + public static final fun rememberListDetailPaneScaffoldNavigator (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies;ZLandroidx/compose/runtime/Composer;II)Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator; + public static final fun rememberListDetailPaneScaffoldNavigator (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies;ZLjava/util/List;Landroidx/compose/runtime/Composer;II)Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator; + public static final fun rememberSupportingPaneScaffoldNavigator (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies;ZLandroidx/compose/runtime/Composer;II)Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator; + public static final fun rememberSupportingPaneScaffoldNavigator (Landroidx/compose/material3/adaptive/layout/PaneScaffoldDirective;Landroidx/compose/material3/adaptive/layout/ThreePaneScaffoldAdaptStrategies;ZLjava/util/List;Landroidx/compose/runtime/Composer;II)Landroidx/compose/material3/adaptive/navigation/ThreePaneScaffoldNavigator; +} + From 2bc5542008310b16024785b2a80863225a60e04b Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Fri, 2 Aug 2024 15:49:37 +0200 Subject: [PATCH 09/12] Restore files formatting. --- .../adaptive/layout/ThreePaneMotionTest.kt | 10 +++--- .../layout/ThreePaneScaffoldValueTest.kt | 34 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt index 6076a670bdd45..a8ca0d8bf616e 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneMotionTest.kt @@ -318,11 +318,11 @@ class ThreePaneMotionTest { val delayedSpec = DelayedSpringSpec( - dampingRatio = 0.7f, - stiffness = 500f, - visibilityThreshold = 0.1f, - delayedRatio = delayedRatio, - ) + dampingRatio = 0.7f, + stiffness = 500f, + visibilityThreshold = 0.1f, + delayedRatio = delayedRatio, + ) .vectorize(Float.VectorConverter) val originalDurationNanos = originalSpec.getDurationNanos() diff --git a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt index e1d0d98ecc5e1..7b3989c8be1d8 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValueTest.kt @@ -55,7 +55,7 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 1, adaptStrategies = MockAdaptStrategies, currentDestination = - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PrimaryPaneAdaptedState) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, PaneAdaptedValue.Expanded) @@ -69,10 +69,10 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 1, adaptStrategies = MockAdaptStrategies, destinationHistory = - listOf( - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) - ) + listOf( + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) + ) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PrimaryPaneAdaptedState) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, PaneAdaptedValue.Expanded) @@ -112,7 +112,7 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 2, adaptStrategies = MockAdaptStrategies, currentDestination = - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PaneAdaptedValue.Expanded) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, SecondaryPaneAdaptedState) @@ -126,10 +126,10 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 2, adaptStrategies = MockAdaptStrategies, destinationHistory = - listOf( - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) - ) + listOf( + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null) + ) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PrimaryPaneAdaptedState) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, PaneAdaptedValue.Expanded) @@ -143,13 +143,13 @@ class ThreePaneScaffoldValueTest { maxHorizontalPartitions = 2, adaptStrategies = MockAdaptStrategies, destinationHistory = - listOf( - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), - ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) - ) + listOf( + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Secondary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Primary, null), + ThreePaneScaffoldDestinationItem(ThreePaneScaffoldRole.Tertiary, null) + ) ) scaffoldState.assertState(ThreePaneScaffoldRole.Primary, PaneAdaptedValue.Expanded) scaffoldState.assertState(ThreePaneScaffoldRole.Secondary, SecondaryPaneAdaptedState) From a986c98bc4bd4eb1dbd349256e81e5f681503f1d Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Thu, 1 Aug 2024 15:16:36 +0200 Subject: [PATCH 10/12] Change `androidx.window.core` redirect version to `1.3.0-beta02`. It was pinned in the original `androidx.compose.material3.adaptive` module dependencies --- gradle.properties | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2c57e1f4699b5..e8b9a31e77f67 100644 --- a/gradle.properties +++ b/gradle.properties @@ -116,8 +116,7 @@ artifactRedirecting.androidx.annotation.version=1.8.0 artifactRedirecting.androidx.lifecycle.version=2.8.0 artifactRedirecting.androidx.navigation.version=2.8.0-beta05 artifactRedirecting.androidx.savedstate.version=1.2.1 -# Look for `WINDOW` in libraryversions.toml -artifactRedirecting.androidx.window.core.version=1.3.0-alpha01 +artifactRedirecting.androidx.window.core.version=1.3.0-beta02 # For the purpose of substituteForRedirectedPublishedDependencies (look for it in the code) artifactRedirecting.modules-for-knative-manifest=\ From 220a05aa488397c1498423aad1daeea5e18c8913 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 13 Aug 2024 13:58:53 +0200 Subject: [PATCH 11/12] Update redirecting versions. --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e8b9a31e77f67..94330d1fe32c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -109,14 +109,14 @@ artifactRedirecting.androidx.compose.material.version=1.7.0-beta06 # Look for `COMPOSE_MATERIAL3_COMMON` in libraryversions.toml artifactRedirecting.androidx.compose.material3.common.version=1.0.0-alpha01 # Look for `COMPOSE_MATERIAL3_ADAPTIVE` in libraryversions.toml -artifactRedirecting.androidx.compose.material3.adaptive.version=1.0.0-alpha01 +artifactRedirecting.androidx.compose.material3.adaptive.version=1.0.0-beta04 # We use artifactRedirecting not only for Compose libs: artifactRedirecting.androidx.collection.version=1.4.0 artifactRedirecting.androidx.annotation.version=1.8.0 artifactRedirecting.androidx.lifecycle.version=2.8.0 artifactRedirecting.androidx.navigation.version=2.8.0-beta05 artifactRedirecting.androidx.savedstate.version=1.2.1 -artifactRedirecting.androidx.window.core.version=1.3.0-beta02 +artifactRedirecting.androidx.window.core.version=1.3.0 # For the purpose of substituteForRedirectedPublishedDependencies (look for it in the code) artifactRedirecting.modules-for-knative-manifest=\ From 48ed8cd8dd525d6fe9b21d835991a381ce176400 Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 13 Aug 2024 14:25:40 +0200 Subject: [PATCH 12/12] Fix import. --- .../androidx/compose/material3/adaptive/layout/PaneMotion.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt index e151d69d54f37..f965e74f6d261 100644 --- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt +++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt @@ -30,6 +30,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.layout.LookaheadScope import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntSize +import kotlin.jvm.JvmInline import kotlin.math.max import kotlin.math.min