Gabriel
03/30/2021, 11:37 AMGabriel
03/30/2021, 11:38 AM@Preview("Player list without buttons", showBackground = true)
@Composable
private fun PlayersSansButton() {
SushiGOScoreTrackerTheme {
PlayerList(
players = listOf(
Player(id = "1", name = "Gabriel", avatar = R.drawable.egg_nigiri),
Player(id = "2", name = "Emma", avatar = R.drawable.salmon_nigiri),
Player(id = "3", name = "SpacedMonkey", avatar = R.drawable.squid_nigiri),
Player(id = "4", name = "Maja", avatar = R.drawable.maki),
Player(id = "5", name = "Aleksandra", avatar = R.drawable.wasabi),
),
addPlayer = { },
canAddPlayers = true
)
}
}
Gabriel
03/30/2021, 11:38 AMandroid.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F07006F.
Gabriel
03/30/2021, 11:39 AM@Immutable
data class Player(
val id: String,
val name: String,
val avatar: Int,
val score: Int = 0,
val wins: Int = 0,
)
Gabriel
03/30/2021, 11:41 AMImage(
painter = painterResource(player.avatar),
contentDescription = "avatar",
modifier = Modifier
.weight(3f)
.padding(5.dp)
)
Gabriel
03/30/2021, 11:42 AM