From b75ae9a2139c9baa7c4f67cd8be5dbec447d1ac7 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Thu, 7 Nov 2024 16:29:22 +0000 Subject: [PATCH] Add rememberResponsiveColumnPadding (#2450) This change introduces a new composable function, `rememberResponsiveColumnPadding`, to calculate and remember padding values for Wear columns based on screen size and item types. It also adds a `ColumnItemType` interface with default implementations for common item types to determine padding, improving responsive design for Wear OS columns. Finally, it updates `rememberResponsiveColumnState` to use `rememberResponsiveColumnPadding` for content padding and includes tests with screenshots to validate padding behavior. --------- Co-authored-by: yschimke --- compose-layout/api/current.api | 29 ++++- compose-layout/build.gradle.kts | 1 + .../layout/ScalingLazyColumnDefaults.kt | 39 ++++++- .../compose/layout/ScalingLazyColumnState.kt | 10 +- .../layout/TransformingLazyColumnDefaults.kt | 97 ++++++++++++++++ .../TransformingLazyColumnDefaultsTest.kt | 104 ++++++++++++++++++ ...gLazyColumnDefaultsTest_galaxy_watch_5.png | 3 + ...yColumnDefaultsTest_galaxy_watch_5_end.png | 3 + ...gLazyColumnDefaultsTest_galaxy_watch_6.png | 3 + ...yColumnDefaultsTest_galaxy_watch_6_end.png | 3 + ...DefaultsTest_galaxy_watch_6_small_font.png | 3 + ...ultsTest_galaxy_watch_6_small_font_end.png | 3 + ...mingLazyColumnDefaultsTest_large_round.png | 3 + ...LazyColumnDefaultsTest_large_round_end.png | 3 + ...mingLazyColumnDefaultsTest_pixel_watch.png | 3 + ...LazyColumnDefaultsTest_pixel_watch_end.png | 3 + ...umnDefaultsTest_pixel_watch_large_font.png | 3 + ...efaultsTest_pixel_watch_large_font_end.png | 3 + ...mingLazyColumnDefaultsTest_small_round.png | 3 + ...LazyColumnDefaultsTest_small_round_end.png | 3 + ...gLazyColumnDefaultsTest_ticwatch_pro_5.png | 3 + ...yColumnDefaultsTest_ticwatch_pro_5_end.png | 3 + gradle/libs.versions.toml | 2 + 23 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 compose-layout/src/main/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaults.kt create mode 100644 compose-layout/src/test/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaultsTest.kt create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round_end.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5.png create mode 100644 compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5_end.png diff --git a/compose-layout/api/current.api b/compose-layout/api/current.api index a484db0eca..cd882e6759 100644 --- a/compose-layout/api/current.api +++ b/compose-layout/api/current.api @@ -43,6 +43,27 @@ package com.google.android.horologist.compose.layout { method @androidx.compose.runtime.Composable public static void AppScaffold(optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0 timeText, kotlin.jvm.functions.Function1 content); } + public interface ColumnItemType { + method @androidx.compose.runtime.Composable public float bottomPadding(float horizontalPercent); + method @androidx.compose.runtime.Composable public float topPadding(float horizontalPercent); + field public static final com.google.android.horologist.compose.layout.ColumnItemType.Companion Companion; + } + + public static final class ColumnItemType.Companion { + method public com.google.android.horologist.compose.layout.ColumnItemType getBodyText(); + method public com.google.android.horologist.compose.layout.ColumnItemType getButton(); + method public com.google.android.horologist.compose.layout.ColumnItemType getButtonRow(); + method public com.google.android.horologist.compose.layout.ColumnItemType getCard(); + method public com.google.android.horologist.compose.layout.ColumnItemType getIconButton(); + method public com.google.android.horologist.compose.layout.ColumnItemType getListHeader(); + property public final com.google.android.horologist.compose.layout.ColumnItemType BodyText; + property public final com.google.android.horologist.compose.layout.ColumnItemType Button; + property public final com.google.android.horologist.compose.layout.ColumnItemType ButtonRow; + property public final com.google.android.horologist.compose.layout.ColumnItemType Card; + property public final com.google.android.horologist.compose.layout.ColumnItemType IconButton; + property public final com.google.android.horologist.compose.layout.ColumnItemType ListHeader; + } + public final class FillMaxRectangleKt { method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier fillMaxRectangle(androidx.compose.ui.Modifier); } @@ -73,10 +94,12 @@ package com.google.android.horologist.compose.layout { field public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults INSTANCE; } - public enum ScalingLazyColumnDefaults.ItemType { + public enum ScalingLazyColumnDefaults.ItemType implements com.google.android.horologist.compose.layout.ColumnItemType { + method @androidx.compose.runtime.Composable public float bottomPadding(float horizontalPercent); method public final float getBottomPaddingPct(); method public final float getPaddingCorrection(); method public final float getTopPaddingPct(); + method @androidx.compose.runtime.Composable public float topPadding(float horizontalPercent); method public static com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType valueOf(String value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException; method public static com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType[] values(); property public final float bottomPaddingPct; @@ -173,6 +196,10 @@ package com.google.android.horologist.compose.layout { method public static androidx.compose.ui.Modifier scrollAway(androidx.compose.ui.Modifier, kotlin.jvm.functions.Function0 scrollableState); } + public final class TransformingLazyColumnDefaultsKt { + method @androidx.compose.runtime.Composable public static androidx.compose.foundation.layout.PaddingValues rememberResponsiveColumnPadding(optional com.google.android.horologist.compose.layout.ColumnItemType first, optional com.google.android.horologist.compose.layout.ColumnItemType last, optional float horizontalPercent); + } + } package com.google.android.horologist.compose.nav { diff --git a/compose-layout/build.gradle.kts b/compose-layout/build.gradle.kts index a9c545d5ac..71fae14d7a 100644 --- a/compose-layout/build.gradle.kts +++ b/compose-layout/build.gradle.kts @@ -107,6 +107,7 @@ dependencies { debugImplementation(libs.androidx.activity.compose) debugImplementation(libs.compose.ui.test.manifest) + testImplementation(libs.androidx.wear.compose.material3) testImplementation(libs.junit) testImplementation(libs.truth) testImplementation(libs.compose.ui.test.junit4) diff --git a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnDefaults.kt b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnDefaults.kt index 7dd082b641..abdf4d1ee0 100644 --- a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnDefaults.kt +++ b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnDefaults.kt @@ -230,7 +230,7 @@ public object ScalingLazyColumnDefaults { val topPaddingPct: Float, val bottomPaddingPct: Float, val paddingCorrection: Dp = 0.dp, - ) { + ) : ColumnItemType { Card(Padding21Pct, Padding31Pct), Chip(Padding21Pct, Padding31Pct), CompactChip( @@ -245,6 +245,43 @@ public object ScalingLazyColumnDefaults { BodyText(Padding21Pct, Padding31Pct), Dialog(Padding14Pct, Padding20Pct), Unspecified(0f, 0f), + ; + + @Composable + override fun topPadding(horizontalPercent: Float): Dp { + val configuration = LocalConfiguration.current + val screenWidthDp = configuration.screenWidthDp.dp + val screenHeightDp = configuration.screenHeightDp.dp + + return if (this != Unspecified) { + topPaddingPct * screenHeightDp + paddingCorrection + } else { + if (configuration.isScreenRound) { + calculateVerticalOffsetForChip(screenWidthDp.value, horizontalPercent) + } else { + 32.dp + } + } + } + + @Composable + override fun bottomPadding(horizontalPercent: Float): Dp { + val configuration = LocalConfiguration.current + val screenWidthDp = configuration.screenWidthDp.dp + val screenHeightDp = configuration.screenHeightDp.dp + return if (this != Unspecified) { + bottomPaddingPct * screenHeightDp + paddingCorrection + } else { + if (configuration.isScreenRound) { + calculateVerticalOffsetForChip( + screenWidthDp.value, + horizontalPercent, + ) + 10.dp + } else { + 0.dp + } + } + } } @Composable diff --git a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt index def7d8d355..b604b56152 100644 --- a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt +++ b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt @@ -166,10 +166,12 @@ public fun rememberResponsiveColumnState( @Composable public fun rememberResponsiveColumnState( - contentPadding: @Composable () -> PaddingValues = ScalingLazyColumnDefaults.padding( - first = ItemType.Unspecified, - last = ItemType.Unspecified, - ), + contentPadding: @Composable () -> PaddingValues = { + rememberResponsiveColumnPadding( + first = ItemType.Unspecified, + last = ItemType.Unspecified, + ) + }, verticalArrangement: Arrangement.Vertical = Arrangement.spacedBy( space = 4.dp, diff --git a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaults.kt b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaults.kt new file mode 100644 index 0000000000..1ab6fc2a35 --- /dev/null +++ b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaults.kt @@ -0,0 +1,97 @@ +/* + * 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 + * + * https://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 com.google.android.horologist.compose.layout + +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType + +/** + * Calculates and remembers padding values for a Wear column based on screen size and item types. + * + * This function is designed to provide responsive padding for columns, specifically in Wear OS, + * taking into account the screen shape (round or rectangular) and the types of items + * at the beginning and end of the column. + * + * @param first The type of the first item in the column. Used to determine top padding. + * Defaults to a safe value of [ItemType.Unspecified]. + * @param last The type of the last item in the column. Used to determine bottom padding. + * Defaults to a safe value of [ItemType.Unspecified]. + * @param horizontalPercent The percentage of the screen width to use for horizontal padding. + * Defaults to 5.2%. + * + * @return A [PaddingValues] object containing the calculated padding values. + */ +@Composable +public fun rememberResponsiveColumnPadding( + first: ColumnItemType = ItemType.Unspecified, + last: ColumnItemType = ItemType.Unspecified, + horizontalPercent: Float = 0.052f, +): PaddingValues { + val configuration = LocalConfiguration.current + val screenWidthDp = configuration.screenWidthDp.dp + + val horizontalPadding = screenWidthDp * horizontalPercent + + return PaddingValues( + top = first.topPadding(horizontalPercent), + bottom = last.bottomPadding(horizontalPercent), + start = horizontalPadding, + end = horizontalPadding, + ) +} + +/** + * Represents the types of items that can be placed in a Wear column and how to calculate an + * optimal or safe padding. + */ +public interface ColumnItemType { + /** + * Calculates the padding for the top of the Column based on the provided horizontal padding. + */ + @Composable + public fun topPadding(horizontalPercent: Float): Dp + + /** + * Calculates the padding for the bottom of the Column based on the provided horizontal padding. + */ + @Composable + public fun bottomPadding(horizontalPercent: Float): Dp + + companion object { + val Button: ColumnItemType + get() = ItemType.Chip + + val ListHeader: ColumnItemType + get() = ItemType.Text + + val BodyText: ColumnItemType + get() = ItemType.BodyText + + val Card: ColumnItemType + get() = ItemType.Card + + val IconButton: ColumnItemType + get() = ItemType.SingleButton + + val ButtonRow: ColumnItemType + get() = ItemType.MultiButton + } +} diff --git a/compose-layout/src/test/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaultsTest.kt b/compose-layout/src/test/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaultsTest.kt new file mode 100644 index 0000000000..3b799f7c69 --- /dev/null +++ b/compose-layout/src/test/java/com/google/android/horologist/compose/layout/TransformingLazyColumnDefaultsTest.kt @@ -0,0 +1,104 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://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 com.google.android.horologist.compose.layout + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.wear.compose.foundation.lazy.TransformingLazyColumn +import androidx.wear.compose.foundation.lazy.TransformingLazyColumnState +import androidx.wear.compose.foundation.lazy.rememberTransformingLazyColumnState +import androidx.wear.compose.material3.AppScaffold +import androidx.wear.compose.material3.ListHeader +import androidx.wear.compose.material3.MaterialTheme +import androidx.wear.compose.material3.ScreenScaffold +import androidx.wear.compose.material3.Text +import androidx.wear.compose.material3.TimeText +import androidx.wear.compose.material3.TitleCard +import androidx.wear.compose.material3.lazy.scrollTransform +import com.google.android.horologist.screenshots.rng.WearDevice +import com.google.android.horologist.screenshots.rng.WearScreenshotTest +import kotlinx.coroutines.runBlocking +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.ParameterizedRobolectricTestRunner + +@RunWith(ParameterizedRobolectricTestRunner::class) +class TransformingLazyColumnDefaultsTest(override val device: WearDevice) : WearScreenshotTest() { + @Composable + override fun TestScaffold(content: @Composable (() -> Unit)) { + content() + } + + @Test + fun TitleAndCard() { + lateinit var columnState: TransformingLazyColumnState + runTest { + AppScaffold( + timeText = { + TimeText { + text("10:10") + } + }, + // Why black needed here + modifier = Modifier.background(MaterialTheme.colorScheme.background), + ) { + columnState = rememberTransformingLazyColumnState() + ScreenScaffold(scrollState = columnState) { + TransformingLazyColumn( + state = columnState, + contentPadding = rememberResponsiveColumnPadding( + first = ColumnItemType.ListHeader, + last = ColumnItemType.Card, + ), + modifier = Modifier.fillMaxSize().testTag("TransformingLazyColumn"), + ) { + item { + ListHeader(modifier = Modifier.scrollTransform(this)) { + Text("Title") + } + } + items(3) { + TitleCard( + modifier = Modifier.scrollTransform(this), + onClick = { /* Do something */ }, + title = { Text("Title card") }, + time = { Text("now") }, + ) { Text("Card content") } + } + } + } + } + } + + composeRule.waitForIdle() + + runBlocking { + columnState.scrollToItem(5) + } + + captureScreenshot("_end") + } + + companion object { + @JvmStatic + @ParameterizedRobolectricTestRunner.Parameters + fun devices() = WearDevice.entries + } +} diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5.png new file mode 100644 index 0000000000..e9081f2f71 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c76bc797e3acc47ccc33c3d499a9116a6df8c276fdccde90333bef4adb1eb42d +size 25715 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5_end.png new file mode 100644 index 0000000000..6031e94e96 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_5_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce2bb606cb4f903ac50a69707d7f35c68a09dc2fb12de018254b42684a239c93 +size 27225 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6.png new file mode 100644 index 0000000000..9126a22c68 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af75e961f73bcce59839931fc2a4a5e86624b866f963350f3972d06808be96b6 +size 29246 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_end.png new file mode 100644 index 0000000000..ee36772b9d --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17ad33155527290454c7fba306ed5bb1e70908dc5882e9a8a0db782f88bb3cd4 +size 30171 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font.png new file mode 100644 index 0000000000..81e566df13 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0a9ed6c045fb32e575638a00fe4fabbe966701a276a0c4c5afe3cf538876fdb +size 28492 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font_end.png new file mode 100644 index 0000000000..6450b0fa30 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_galaxy_watch_6_small_font_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ee8d409608972c635e498b35223262da96c836ce5d43b9a5d4dcad02a9d319f +size 28888 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round.png new file mode 100644 index 0000000000..2a4dc137b4 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c00b11d5f34f2af248495815ebe85a9aae7ad715320fcad00cf2e7ab28e36dd5 +size 29379 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round_end.png new file mode 100644 index 0000000000..e798cc0f5e --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_large_round_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:809c863e75221644f75a730f5db9eee16299df2bf8fe688c15a8cd535bec11bb +size 30456 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch.png new file mode 100644 index 0000000000..3e93311323 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:738c0e7a8e94d65c3cee4f25b6f6f4f34fde2474c12a898f4f50fa7de14c491d +size 24647 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_end.png new file mode 100644 index 0000000000..99f037f8c8 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8444bd6092724632db416ebdefb896bf674effbe50344d1e5be25bc29f9c48bc +size 27379 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font.png new file mode 100644 index 0000000000..290abc6989 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f5c4cd34c826674ae7f63a8573b92d147f9813e0cfc2e374307b63d0cf02fd3 +size 23966 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font_end.png new file mode 100644 index 0000000000..d899cfdb9e --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_pixel_watch_large_font_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15df1dc63d0a371bb43a37b26afe9e6214b03e401b1e9439d8560320b15de491 +size 27835 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round.png new file mode 100644 index 0000000000..3e93311323 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:738c0e7a8e94d65c3cee4f25b6f6f4f34fde2474c12a898f4f50fa7de14c491d +size 24647 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round_end.png new file mode 100644 index 0000000000..99f037f8c8 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_small_round_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8444bd6092724632db416ebdefb896bf674effbe50344d1e5be25bc29f9c48bc +size 27379 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5.png new file mode 100644 index 0000000000..5f7776e516 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3809fec4de6cb7909f96d47cb7f848f6be8447758b63307374a9f6f7f628433e +size 30284 diff --git a/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5_end.png b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5_end.png new file mode 100644 index 0000000000..4ef8434437 --- /dev/null +++ b/compose-layout/src/test/screenshots/TransformingLazyColumnDefaultsTest_ticwatch_pro_5_end.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4b1b3c75c767d677d65b68b01fca7528bbe69bd891f353bc0ba79db809a8401 +size 30692 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 150dd2f700..21e532587e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -32,6 +32,7 @@ appcompat = "1.7.0" com-squareup-okhttp3 = "5.0.0-alpha.14" com-squareup-retrofit2 = "2.11.0" compose-material3 = "1.3.1" +wearComposeMaterial3 = "1.0.0-alpha28" composesnapshot = "-" dependencyAnalysis = "2.4.2" dokka = "1.9.20" @@ -78,6 +79,7 @@ androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro androidx-complications-data = { module = "androidx.wear.watchface:watchface-complications-data", version.ref = "androidx-complications-data" } androidx-complications-datasource-ktx = { module = "androidx.wear.watchface:watchface-complications-data-source-ktx", version.ref = "androidx-wear-watchface" } androidx-complications-rendering = { module = "androidx.wear.watchface:watchface-complications-rendering", version.ref = "androidx-wear-watchface" } +androidx-wear-compose-material3 = { module = "androidx.wear.compose:compose-material3", version.ref = "wearComposeMaterial3" } androidx-concurrent-future = { module = "androidx.concurrent:concurrent-futures", version.ref = "androidx-concurrent" } androidx-concurrent-future-ktx = { module = "androidx.concurrent:concurrent-futures-ktx", version.ref = "androidx-concurrent" } androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "androidx-constraintlayout-compose" }