From e141b87a5d3161340e67d2211c4d9c7c23b4b93f Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Wed, 28 Feb 2024 17:13:45 +0000 Subject: [PATCH 1/3] Text sample --- .../compose/layout/ScalingLazyColumnDefaults.kt | 17 +++++++++++++++-- .../android/horologist/spec/UiComponents.kt | 12 +++++++++--- ...st_bottomOtherText[0]_mobvoiticwatchpro5.png | 4 ++-- ...t_bottomOtherText[1]_samsunggalaxywatch5.png | 4 ++-- ...tomOtherText[2]_samsunggalaxywatch6large.png | 4 ++-- ...Test_bottomOtherText[3]_googlepixelwatch.png | 4 ++-- ...est_bottomOtherText[4]_genericsmallround.png | 4 ++-- ...est_bottomOtherText[5]_genericlargeround.png | 4 ++-- ...t_bottomOtherText[6]_smalldevicebigfonts.png | 4 ++-- ...bottomOtherText[7]_largedevicesmallfonts.png | 4 ++-- ...mplesTest_sideText[0]_mobvoiticwatchpro5.png | 4 ++-- ...plesTest_sideText[1]_samsunggalaxywatch5.png | 4 ++-- ...est_sideText[2]_samsunggalaxywatch6large.png | 4 ++-- ...xamplesTest_sideText[3]_googlepixelwatch.png | 4 ++-- ...amplesTest_sideText[4]_genericsmallround.png | 4 ++-- ...amplesTest_sideText[5]_genericlargeround.png | 4 ++-- ...plesTest_sideText[6]_smalldevicebigfonts.png | 4 ++-- ...esTest_sideText[7]_largedevicesmallfonts.png | 4 ++-- ...est_titleOtherText[0]_mobvoiticwatchpro5.png | 4 ++-- ...st_titleOtherText[1]_samsunggalaxywatch5.png | 4 ++-- ...tleOtherText[2]_samsunggalaxywatch6large.png | 4 ++-- ...sTest_titleOtherText[3]_googlepixelwatch.png | 4 ++-- ...Test_titleOtherText[4]_genericsmallround.png | 4 ++-- ...Test_titleOtherText[5]_genericlargeround.png | 4 ++-- ...st_titleOtherText[6]_smalldevicebigfonts.png | 4 ++-- ..._titleOtherText[7]_largedevicesmallfonts.png | 4 ++-- 26 files changed, 72 insertions(+), 53 deletions(-) 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 be1ec16d97..1b2aa53bf4 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 @@ -20,9 +20,11 @@ package com.google.android.horologist.compose.layout import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Dp @@ -264,10 +266,18 @@ public object ScalingLazyColumnDefaults { internal val Padding21Pct = 0.2188f internal val Padding31Pct = 0.3646f - enum class ItemType(val topPaddingDp: Float, val bottomPaddingDp: Float, val paddingCorrection: Dp = 0.dp) { + enum class ItemType( + val topPaddingDp: Float, + val bottomPaddingDp: Float, + val paddingCorrection: Dp = 0.dp + ) { Card(Padding21Pct, Padding31Pct), Chip(Padding21Pct, Padding31Pct), - CompactChip(topPaddingDp = Padding12Pct, bottomPaddingDp = Padding20Pct, paddingCorrection = (-8).dp), + CompactChip( + topPaddingDp = Padding12Pct, + bottomPaddingDp = Padding20Pct, + paddingCorrection = (-8).dp + ), Icon(Padding12Pct, Padding21Pct), MultiButton(Padding21Pct, Padding20Pct), SingleButton(Padding12Pct, Padding20Pct), @@ -292,4 +302,7 @@ public object ScalingLazyColumnDefaults { ) } } + + @Composable + fun Modifier.listTextPadding() = this.padding(horizontal = 0.052f * LocalConfiguration.current.screenWidthDp.dp) } diff --git a/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt b/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt index d37eb7a78c..25d6a56f5b 100644 --- a/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt +++ b/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt @@ -25,9 +25,11 @@ import androidx.compose.material.icons.filled.Schedule import androidx.compose.material.icons.outlined.Badge import androidx.compose.material.icons.outlined.Cloud import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.wear.compose.foundation.lazy.ScalingLazyListScope import androidx.wear.compose.material.AppCard import androidx.wear.compose.material.Text +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.listTextPadding import com.google.android.horologist.compose.material.Button import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.CompactChip @@ -56,13 +58,17 @@ val text = "We posted a payment for your credit card ending in 5555. " + fun WarningText() { Text( text, + modifier = Modifier.listTextPadding() ) } fun ScalingLazyListScope.warningTextItems() { - text.split(". ").forEach { - item { - Text("$it.") + text.split(".").forEach { + val textLine = it.trim() + if (textLine.isNotBlank()) { + item { + Text(textLine, modifier = Modifier.listTextPadding()) + } } } } diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[0]_mobvoiticwatchpro5.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[0]_mobvoiticwatchpro5.png index 3ae8f03ab6..0d5cdde155 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[0]_mobvoiticwatchpro5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[0]_mobvoiticwatchpro5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bacecea3a1d4509e5f33c6448f1b35bfffda80b0b04f62635d28085c7b9c457e -size 50139 +oid sha256:d699a32e3cee14e5dc22d182491a8e609b5dccc3368f2a26375c424dc22953f1 +size 42786 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[1]_samsunggalaxywatch5.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[1]_samsunggalaxywatch5.png index da37eb9f05..bae55e7bdb 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[1]_samsunggalaxywatch5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[1]_samsunggalaxywatch5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:80dc8460a8de81545490f1504dbf052843b698a0a7483dfdc2621511a188fd8f -size 36167 +oid sha256:32ddee8c5f54b33a904f5d140519e86a4e6f513b986c822546d95e5896f14c4f +size 35205 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[2]_samsunggalaxywatch6large.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[2]_samsunggalaxywatch6large.png index f450a6b541..bdcda9697b 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[2]_samsunggalaxywatch6large.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[2]_samsunggalaxywatch6large.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3af3c569c2b6edba07cb13163dae93443d8c7aee1a46e8b901f044f743fe1248 -size 49816 +oid sha256:f58fff806063cd208298257a84b21711cb4e6a37fd0e82b9abd6212773e7957e +size 44002 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[3]_googlepixelwatch.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[3]_googlepixelwatch.png index 952436fc85..f58c13d357 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[3]_googlepixelwatch.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[3]_googlepixelwatch.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d473a1a6920061a8cbc027114d8b51c6fd298c4fe683764c9fd953f8ff9a7819 -size 34953 +oid sha256:063cd5d0ab5bbfcb5a8decfad54fc1c41e197609a9a4fd31425cced431832403 +size 33485 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[4]_genericsmallround.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[4]_genericsmallround.png index 952436fc85..f58c13d357 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[4]_genericsmallround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[4]_genericsmallround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d473a1a6920061a8cbc027114d8b51c6fd298c4fe683764c9fd953f8ff9a7819 -size 34953 +oid sha256:063cd5d0ab5bbfcb5a8decfad54fc1c41e197609a9a4fd31425cced431832403 +size 33485 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[5]_genericlargeround.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[5]_genericlargeround.png index e71b73f8e4..e219d13619 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[5]_genericlargeround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[5]_genericlargeround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:52ddd6f29b45a9a1fc93f1f0fabdea0b67076b331713724bd85f7dcb9a0ffe29 -size 47504 +oid sha256:b06dbaf5b2c297d04295acd5611a71c30b5374211c81b03c33178c1fd70da24d +size 41451 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[6]_smalldevicebigfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[6]_smalldevicebigfonts.png index 5dc3e99c42..840e30b7fa 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[6]_smalldevicebigfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[6]_smalldevicebigfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a96530f74182bb32716a5cf9825efd0039a33c5a3bb0848426eac7dfc0d2039b -size 32638 +oid sha256:5cf62e738e240d8cf7f2b11d18b7d2f9af1685d765db877d60c4caa1bebf48da +size 30986 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[7]_largedevicesmallfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[7]_largedevicesmallfonts.png index f032c78f90..14484dc60f 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[7]_largedevicesmallfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_bottomOtherText[7]_largedevicesmallfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a3f3d04274327848552d9b4e2a16b68f523d884905df074e2b5423c19a187c5d -size 49918 +oid sha256:3705d6464305f1b8801c6dfdd9349de06fa603678f6b6429022157ca218c0536 +size 42768 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[0]_mobvoiticwatchpro5.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[0]_mobvoiticwatchpro5.png index 23d988f338..01173ad21d 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[0]_mobvoiticwatchpro5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[0]_mobvoiticwatchpro5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f45194654c4d32f326287b60aa1ac035eb1d9b1872aee82070f6fd5135724038 -size 54649 +oid sha256:355e69d835bfc8900c979ddf0c85782e1159bbde60ac533d33038c579738bf1c +size 51197 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[1]_samsunggalaxywatch5.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[1]_samsunggalaxywatch5.png index efa07eadc5..b72c98cc0d 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[1]_samsunggalaxywatch5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[1]_samsunggalaxywatch5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:962c7ce945f48825b4dac622e95dc49542369fefa2d2ffe7b0c12c5be0da2eb2 -size 45031 +oid sha256:c6a3d9c0b63556f02766d3661eb0b47909dce65d39498c200bfe6fca46df61e3 +size 41112 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[2]_samsunggalaxywatch6large.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[2]_samsunggalaxywatch6large.png index a93b8c8c92..a9803aa865 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[2]_samsunggalaxywatch6large.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[2]_samsunggalaxywatch6large.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0dae3336c608dcd5bfa15eab5aa8d7f62f36498b6d39b44c8f8b2206bc30da41 -size 53471 +oid sha256:81411a5df466ee283bba78b6a8a87762162efa548e7f175356770811d2794752 +size 53707 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[3]_googlepixelwatch.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[3]_googlepixelwatch.png index 60277652d9..db86db092f 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[3]_googlepixelwatch.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[3]_googlepixelwatch.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b871e3973ecf353e3ae235d41f7c7e5c23a1bf6944e5fb37f954b5bde31c3843 -size 43285 +oid sha256:a7c0c32fec3fba5707e7c9eee2f56128aaefd22068194e3549005047c7eaebe4 +size 38892 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[4]_genericsmallround.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[4]_genericsmallround.png index 60277652d9..db86db092f 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[4]_genericsmallround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[4]_genericsmallround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b871e3973ecf353e3ae235d41f7c7e5c23a1bf6944e5fb37f954b5bde31c3843 -size 43285 +oid sha256:a7c0c32fec3fba5707e7c9eee2f56128aaefd22068194e3549005047c7eaebe4 +size 38892 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[5]_genericlargeround.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[5]_genericlargeround.png index 4b27b5897c..aa69373285 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[5]_genericlargeround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[5]_genericlargeround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7bbe113efc8961121449edebb74f76813ca55cd462373938939fb353e8d72a94 -size 50333 +oid sha256:0fc63acb2ccd7713e9cb0058f19b27b432978a76fed00e8a1ea648bc681eb59e +size 50653 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[6]_smalldevicebigfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[6]_smalldevicebigfonts.png index 7af6500400..b39546bdfe 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[6]_smalldevicebigfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[6]_smalldevicebigfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c524090ce8d961e32c357bfc91814ccab0879357c486177c7772e499c59b60d -size 36927 +oid sha256:a8931f103a2901d5310b74e17e2ec620ac97bcf1ac7517f063b524b8652059e8 +size 35259 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[7]_largedevicesmallfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[7]_largedevicesmallfonts.png index 746273d063..ec2708cfc5 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[7]_largedevicesmallfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_sideText[7]_largedevicesmallfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:78439471d55da6d783d8aec9d0ea98c546daa06ec04b52508e750fd075a672a1 -size 59155 +oid sha256:47a6bbed83b1e412a904b3b28e1aafcd32eb11c97e178e0906df1100376f3bde +size 50568 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[0]_mobvoiticwatchpro5.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[0]_mobvoiticwatchpro5.png index 32da25f199..0f6b6e4e04 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[0]_mobvoiticwatchpro5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[0]_mobvoiticwatchpro5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a75d8067800d0b7c6bb242d813f2153cf2748a883d68030c18bd07c73912eb3 -size 53485 +oid sha256:3974abed5223e7234f0f232a185a4c973ad26802c522f069eb062a0afea1f941 +size 51407 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[1]_samsunggalaxywatch5.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[1]_samsunggalaxywatch5.png index 578d5b630e..4433987783 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[1]_samsunggalaxywatch5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[1]_samsunggalaxywatch5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61fcaead3942e72e3eb2a274bf17f1c65517cf305e8c8ca2b49b27c570bc8eae -size 44652 +oid sha256:5f67edd2e7cfc126d4456cac83d8fb898d5a8594c50287115fa1a65ab7a45a3d +size 41052 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[2]_samsunggalaxywatch6large.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[2]_samsunggalaxywatch6large.png index 59dfb2004d..5bb5e00ed9 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[2]_samsunggalaxywatch6large.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[2]_samsunggalaxywatch6large.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9cf5d8224629dddd7f06f080607ff2bc493195b0ed3a7ce29b0293d3e6df3a3f -size 52362 +oid sha256:ce40dd97f7ef3c9fc369e7dfb6e7192edaa2080f96cfefa199abb4ad3d63902c +size 53530 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[3]_googlepixelwatch.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[3]_googlepixelwatch.png index 901836040a..b71a28a6e2 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[3]_googlepixelwatch.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[3]_googlepixelwatch.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:49344cb5177b8cc76917b31b3ec9c34d005aacd6c81ec95bb514c78fbce85ee9 -size 43132 +oid sha256:9898e4d9a4874606780a7026917c367d2aed7beee913202eabe1c1fcf215dbed +size 39085 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[4]_genericsmallround.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[4]_genericsmallround.png index 901836040a..b71a28a6e2 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[4]_genericsmallround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[4]_genericsmallround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:49344cb5177b8cc76917b31b3ec9c34d005aacd6c81ec95bb514c78fbce85ee9 -size 43132 +oid sha256:9898e4d9a4874606780a7026917c367d2aed7beee913202eabe1c1fcf215dbed +size 39085 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[5]_genericlargeround.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[5]_genericlargeround.png index f14bc18955..55a9296ca8 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[5]_genericlargeround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[5]_genericlargeround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:193557cfdd97e214ae3a4a2d23d110d63dfc51ecb2a0fecffc33bb00bdb45d5d -size 49481 +oid sha256:3e6c87242e72259d01cc5984e997837f5e491002762a1303497dca0054fff183 +size 50865 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[6]_smalldevicebigfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[6]_smalldevicebigfonts.png index 0d957d4212..18dbaf0f1a 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[6]_smalldevicebigfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[6]_smalldevicebigfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc93dfbde31402be6ec21f14db5030e89d933decc6857ee9fb4e5b2de3d78227 -size 36600 +oid sha256:aa8855356dbe7bafbe51b4dc98f8afa902599d3d5711cbdef1565e2746feb131 +size 35300 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[7]_largedevicesmallfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[7]_largedevicesmallfonts.png index 1dd789cb2b..4b1977d9f6 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[7]_largedevicesmallfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.spec_ScalingLazyColumnExamplesTest_titleOtherText[7]_largedevicesmallfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:057ce7c4c70b675bd219a31be3bc53db4b4f718c126c95ddb2fc2c80c920caff -size 57502 +oid sha256:9b12b289bbad4c493cdf23d0f767491bc8e9dffa8a4bf441724e582d8ae37ad4 +size 50393 From 1335851f85670baed9d5f3b463fb07282ee698e6 Mon Sep 17 00:00:00 2001 From: yschimke Date: Wed, 28 Feb 2024 17:20:42 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A4=96=20reformat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../horologist/compose/layout/ScalingLazyColumnDefaults.kt | 4 ++-- .../java/com/google/android/horologist/spec/UiComponents.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 1b2aa53bf4..f16cf7b7ad 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 @@ -269,14 +269,14 @@ public object ScalingLazyColumnDefaults { enum class ItemType( val topPaddingDp: Float, val bottomPaddingDp: Float, - val paddingCorrection: Dp = 0.dp + val paddingCorrection: Dp = 0.dp, ) { Card(Padding21Pct, Padding31Pct), Chip(Padding21Pct, Padding31Pct), CompactChip( topPaddingDp = Padding12Pct, bottomPaddingDp = Padding20Pct, - paddingCorrection = (-8).dp + paddingCorrection = (-8).dp, ), Icon(Padding12Pct, Padding21Pct), MultiButton(Padding21Pct, Padding20Pct), diff --git a/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt b/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt index 25d6a56f5b..c682480225 100644 --- a/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt +++ b/sample/src/main/java/com/google/android/horologist/spec/UiComponents.kt @@ -58,7 +58,7 @@ val text = "We posted a payment for your credit card ending in 5555. " + fun WarningText() { Text( text, - modifier = Modifier.listTextPadding() + modifier = Modifier.listTextPadding(), ) } From 7c959d06a9416f39638c3f0f6667ec1712547b1f Mon Sep 17 00:00:00 2001 From: yschimke Date: Wed, 28 Feb 2024 17:30:31 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A4=96=20metalava?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose-layout/api/current.api | 1 + 1 file changed, 1 insertion(+) diff --git a/compose-layout/api/current.api b/compose-layout/api/current.api index 5c09a844d9..25bc70a552 100644 --- a/compose-layout/api/current.api +++ b/compose-layout/api/current.api @@ -62,6 +62,7 @@ package com.google.android.horologist.compose.layout { public final class ScalingLazyColumnDefaults { method @com.google.android.horologist.annotations.ExperimentalHorologistApi public com.google.android.horologist.compose.layout.ScalingLazyColumnState.Factory belowTimeText(optional com.google.android.horologist.compose.layout.ScalingLazyColumnState.RotaryMode rotaryMode, optional boolean firstItemIsFullWidth, optional androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement, optional androidx.compose.ui.Alignment.Horizontal horizontalAlignment, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional float topPaddingDp); + method @androidx.compose.runtime.Composable public androidx.compose.ui.Modifier listTextPadding(androidx.compose.ui.Modifier); method @androidx.compose.runtime.Composable public kotlin.jvm.functions.Function0 padding(optional com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType first, optional com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType last, optional float horizontalPercent); method @com.google.android.horologist.annotations.ExperimentalHorologistApi public com.google.android.horologist.compose.layout.ScalingLazyColumnState.Factory responsive(optional boolean firstItemIsFullWidth, optional float additionalPaddingAtBottom, optional androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement, optional float horizontalPaddingPercent, optional com.google.android.horologist.compose.layout.ScalingLazyColumnState.RotaryMode? rotaryMode, optional boolean hapticsEnabled, optional boolean reverseLayout, optional boolean userScrollEnabled); method @com.google.android.horologist.annotations.ExperimentalHorologistApi public com.google.android.horologist.compose.layout.ScalingLazyColumnState.Factory scalingLazyColumnDefaults(optional com.google.android.horologist.compose.layout.ScalingLazyColumnState.RotaryMode rotaryMode, optional int initialCenterIndex, optional int initialCenterOffset, optional androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement, optional androidx.compose.ui.Alignment.Horizontal horizontalAlignment, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.wear.compose.foundation.lazy.AutoCenteringParams? autoCentering, optional int anchorType, optional boolean hapticsEnabled, optional boolean reverseLayout);