Show live table action status
This commit is contained in:
@@ -34,6 +34,7 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
@@ -50,6 +51,7 @@ fun TableScreen(vm: PokerViewModel) {
|
||||
// Only show an action bar that belongs to the table currently on screen.
|
||||
val offer = state.liveOffer(rawOffer)
|
||||
val handSummary = state.visibleHandSummary()
|
||||
val status = snap?.let(::tableStatus)
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
@@ -96,7 +98,24 @@ fun TableScreen(vm: PokerViewModel) {
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 18.sp,
|
||||
)
|
||||
Spacer(Modifier.height(8.dp))
|
||||
Text(
|
||||
text = status?.text.orEmpty(),
|
||||
color = when (status?.tone) {
|
||||
TableStatusTone.ACCENT -> Color(0xFFE3C179)
|
||||
TableStatusTone.NORMAL -> Color.White.copy(alpha = 0.78f)
|
||||
TableStatusTone.MUTED, null -> Color.White.copy(alpha = 0.48f)
|
||||
},
|
||||
fontWeight = if (status?.tone == TableStatusTone.ACCENT) {
|
||||
FontWeight.Bold
|
||||
} else {
|
||||
FontWeight.Normal
|
||||
},
|
||||
fontSize = 13.sp,
|
||||
modifier = Modifier.height(24.dp),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
val board = snap?.board.orEmpty()
|
||||
repeat(5) { i ->
|
||||
|
||||
Reference in New Issue
Block a user