Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test app #2310

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun BrokenSizeUpdate(modifier: Modifier = Modifier) {
"hello",
modifier = Modifier
.size(width, height)
.backgroundColor(0xFFFF0000U),
.backgroundColor(0xFFFF0000.toInt()),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down