feat(ui): Display players in single card with aligned columns
Replace per-player cards with a single card listing all players. Each player shows on one line: number, name, position, and birth year in muted color. Add Makefile with android and desktop targets.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
.PHONY: android desktop
|
||||
|
||||
android:
|
||||
./gradlew composeApp:assembleDebug
|
||||
|
||||
desktop:
|
||||
./gradlew composeApp:run
|
||||
@@ -19,11 +19,13 @@ package ch.parano.myice.ui.screens
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.Card
|
||||
@@ -150,18 +152,31 @@ fun EventDetailScreen(
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
)
|
||||
}
|
||||
items(detail.convocation.available) { player ->
|
||||
val position = player.position ?: "N/A"
|
||||
val number = player.number ?: "N/A"
|
||||
item {
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
Column(
|
||||
modifier = Modifier.padding(16.dp),
|
||||
) {
|
||||
Text("[$position] #$number - ${player.fname} ${player.lname}")
|
||||
Text(
|
||||
text = "DOB: ${player.dob}",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
detail.convocation.available.forEach { player ->
|
||||
val position = player.position ?: ""
|
||||
val number = player.number ?: ""
|
||||
val muted = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
Text(
|
||||
if (number.isNotEmpty()) "#$number" else "",
|
||||
color = muted,
|
||||
modifier = Modifier.width(40.dp),
|
||||
)
|
||||
Text("${player.fname} ${player.lname}")
|
||||
Spacer(Modifier.weight(1f))
|
||||
if (position.isNotEmpty()) {
|
||||
Text(position, color = muted)
|
||||
}
|
||||
Text("(${player.dob.take(4)})", color = muted)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user