From 0d5a078336c13772683e2a1a00f6024f9950404d Mon Sep 17 00:00:00 2001 From: antonbutov Date: Thu, 19 Sep 2024 21:30:46 +0300 Subject: [PATCH] changed backGroundColor UInt -> Int in test app --- .../redwood/treehouse/FastGuestProtocolAdapterTest.kt | 4 ++-- .../example/redwood/testapp/presenter/BoxSandbox.kt | 10 +++++----- .../redwood/testapp/presenter/BrokenRowColumn.kt | 2 +- .../redwood/testapp/presenter/BrokenSizeUpdate.kt | 2 +- .../redwood/testapp/presenter/UnscopedModifiers.kt | 5 ++--- .../main/kotlin/com/example/redwood/testapp/schema.kt | 4 ++-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/redwood-treehouse-guest/src/jsTest/kotlin/app/cash/redwood/treehouse/FastGuestProtocolAdapterTest.kt b/redwood-treehouse-guest/src/jsTest/kotlin/app/cash/redwood/treehouse/FastGuestProtocolAdapterTest.kt index 6c7cf955e4..f812dd5910 100644 --- a/redwood-treehouse-guest/src/jsTest/kotlin/app/cash/redwood/treehouse/FastGuestProtocolAdapterTest.kt +++ b/redwood-treehouse-guest/src/jsTest/kotlin/app/cash/redwood/treehouse/FastGuestProtocolAdapterTest.kt @@ -56,7 +56,7 @@ class FastGuestProtocolAdapterTest { val textInput = widgetSystem.TestSchema.TextInput() root.insert(1, textInput) - textInput.modifier = Modifier.backgroundColor(0xff0000u) + textInput.modifier = Modifier.backgroundColor(0xff0000) textInput.text("hello") root.move(0, 1, 1) @@ -69,7 +69,7 @@ class FastGuestProtocolAdapterTest { with(object : TestScope {}) { val button = widgetSystem.TestSchema.Button() button.modifier = Modifier - .backgroundColor(0xff0000u) + .backgroundColor(0xff0000) .customType(5.seconds) .customTypeWithDefault(10.seconds, "sup") .customTypeStateless() diff --git a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BoxSandbox.kt b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BoxSandbox.kt index c12359bb93..45eb090e91 100644 --- a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BoxSandbox.kt +++ b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BoxSandbox.kt @@ -37,11 +37,11 @@ import app.cash.redwood.ui.dp import com.example.redwood.testapp.compose.Text import com.example.redwood.testapp.compose.backgroundColor -private val accentColor = 0xFFDDDDDDu -private val boxColor = 0xFFFFFF66u -private val backColor = 0x88FF0000u -private val middleColor = 0x8800FF00u -private val frontColor = 0x880000FFu +private val accentColor = 0xFFDDDDDD.toInt() +private val boxColor = 0xFFFFFF66.toInt() +private val backColor = 0x88FF0000.toInt() +private val middleColor = 0x8800FF00.toInt() +private val frontColor = 0x880000FF.toInt() @Composable fun BoxSandbox(modifier: Modifier = Modifier) { diff --git a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenRowColumn.kt b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenRowColumn.kt index e3a36a8905..9248f4d873 100644 --- a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenRowColumn.kt +++ b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenRowColumn.kt @@ -49,7 +49,7 @@ fun BrokenRowColumn(modifier: Modifier = Modifier) { .margin(Margin(start = 24.dp, end = 24.dp)) .flex(1.0), ) { - Spacer(48.dp, 48.dp, Modifier.backgroundColor(0xFFFF0000U)) + Spacer(48.dp, 48.dp, Modifier.backgroundColor(0xFFFF0000.toInt())) } } } diff --git a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenSizeUpdate.kt b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenSizeUpdate.kt index debb795560..6c0710ffc8 100644 --- a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenSizeUpdate.kt +++ b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/BrokenSizeUpdate.kt @@ -55,7 +55,7 @@ fun BrokenSizeUpdate(modifier: Modifier = Modifier) { "hello", modifier = Modifier .size(width, height) - .backgroundColor(0xFFFF0000U), + .backgroundColor(0xFFFF0000.toInt()), ) } } diff --git a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/UnscopedModifiers.kt b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/UnscopedModifiers.kt index 04a4befb44..bd22d2971e 100644 --- a/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/UnscopedModifiers.kt +++ b/test-app/presenter/src/commonMain/kotlin/com/example/redwood/testapp/presenter/UnscopedModifiers.kt @@ -27,7 +27,6 @@ import app.cash.redwood.layout.compose.Row import com.example.redwood.testapp.compose.Button import com.example.redwood.testapp.compose.backgroundColor import kotlin.random.Random -import kotlin.random.nextUInt import kotlin.time.Duration.Companion.seconds import kotlinx.coroutines.delay @@ -39,14 +38,14 @@ private const val COLS = 3 fun UnscopedModifiers(modifier: Modifier = Modifier) { val colors = remember { // https://issuetracker.google.com/issues/330350695 - List(ROWS * COLS) { Random.nextUInt() }.toMutableStateList() + List(ROWS * COLS) { Random.nextInt() }.toMutableStateList() } LaunchedEffect(Unit) { while (true) { delay(1.seconds) val randomIndex = Random.nextInt(colors.size) - colors[randomIndex] = Random.nextUInt() + colors[randomIndex] = Random.nextInt() } } diff --git a/test-app/schema/src/main/kotlin/com/example/redwood/testapp/schema.kt b/test-app/schema/src/main/kotlin/com/example/redwood/testapp/schema.kt index 09b873412f..050f38a1c8 100644 --- a/test-app/schema/src/main/kotlin/com/example/redwood/testapp/schema.kt +++ b/test-app/schema/src/main/kotlin/com/example/redwood/testapp/schema.kt @@ -142,8 +142,8 @@ public data object CustomTypeDataObject @Modifier(8) public data class BackgroundColor( - /** Expects argb format: `0xAARRGGBBu`. */ - val color: UInt, + /** Expects argb format: `0xAARRGGBB`. */ + val color: Int, ) @Modifier(-4_543_827) // -4_543_827 is a reserved tag.