Sam Michael
08/06/2021, 5:16 AMColton Idle
08/06/2021, 5:34 AMSam Michael
08/06/2021, 5:44 AM@Composable
private fun tileButton(
isVisible: MutableState<Boolean> = mutableStateOf(false),
turn: MutableState<Int> = mutableStateOf(0)
) = Button(
onClick = {
isVisible.value = true
turn.value += 1
},
border = BorderStroke(0.dp, accentAmber),
shape = RectangleShape,
colors = ButtonDefaults.buttonColors(accentAmber),
modifier = Modifier.size(60.dp).padding(0.dp),
) {
Box(Modifier.drawWithContent {
drawLine(
color = Color.Black,
start = Offset(center.x, -200F),
end = Offset(center.x, 200F),
strokeWidth = 2f,
cap = StrokeCap.Round
)
drawLine(
color = Color.Black,
start = Offset(-200F, center.y),
end = Offset(200F, center.y),
strokeWidth = 2f,
cap = StrokeCap.Round
)
if (isVisible.value) drawCircle(if (turn.value % 2 == 0) Color.Black else Color.White, radius = 55f)
})
}
Sam Michael
08/06/2021, 5:45 AMColton Idle
08/06/2021, 5:58 AMSam Michael
08/06/2021, 6:06 AMColton Idle
08/06/2021, 6:11 AM