diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a579d79 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: android desktop + +android: + ./gradlew composeApp:assembleDebug + +desktop: + ./gradlew composeApp:run diff --git a/composeApp/src/commonMain/kotlin/ch/parano/myice/ui/screens/EventDetailScreen.kt b/composeApp/src/commonMain/kotlin/ch/parano/myice/ui/screens/EventDetailScreen.kt index 203bc7f..1dddb49 100644 --- a/composeApp/src/commonMain/kotlin/ch/parano/myice/ui/screens/EventDetailScreen.kt +++ b/composeApp/src/commonMain/kotlin/ch/parano/myice/ui/screens/EventDetailScreen.kt @@ -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) + } + } } } }