Skip to content

Commit 316585c

Browse files
committed
Add team and score underlining in EventTeamMatchesView
1 parent 356fd00 commit 316585c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

app/src/main/java/com/sunkensplashstudios/VRCRoboScout/EventTeamMatchesView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fun EventTeamMatchesView(event: Event, team: Team, eventTeamMatchesViewModel: Ev
105105
NoDataView()
106106
}
107107
else {
108-
MatchesView(eventTeamMatchesViewModel.matches)
108+
MatchesView(eventTeamMatchesViewModel.matches, eventTeamMatchesViewModel.team)
109109
}
110110
}
111111
}

app/src/main/java/com/sunkensplashstudios/VRCRoboScout/helperviews/MatchesView.kt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ import androidx.compose.ui.Modifier
1919
import androidx.compose.ui.graphics.Color
2020
import androidx.compose.ui.text.font.FontWeight
2121
import androidx.compose.ui.text.style.TextAlign
22+
import androidx.compose.ui.text.style.TextDecoration
2223
import androidx.compose.ui.text.style.TextOverflow
2324
import androidx.compose.ui.unit.dp
2425
import androidx.compose.ui.unit.sp
2526
import com.sunkensplashstudios.VRCRoboScout.Match
27+
import com.sunkensplashstudios.VRCRoboScout.Team
2628
import com.sunkensplashstudios.VRCRoboScout.ui.theme.allianceBlue
2729
import com.sunkensplashstudios.VRCRoboScout.ui.theme.allianceRed
2830

2931
@Composable
30-
fun MatchesView(matchList: List<Match>) {
32+
fun MatchesView(matchList: List<Match>, team: Team? = null) {
3133
val timeFormat = java.text.SimpleDateFormat("h:mm a", java.util.Locale.getDefault())
3234
Column(
3335
modifier = Modifier.verticalScroll(rememberScrollState())
@@ -79,7 +81,8 @@ fun MatchesView(matchList: List<Match>) {
7981
Text(
8082
text = member.team.name,
8183
fontSize = 15.sp,
82-
color = allianceRed
84+
color = allianceRed,
85+
textDecoration = if (team != null && member.team.id == team.id) TextDecoration.Underline else TextDecoration.None
8386
)
8487
}
8588
}
@@ -91,7 +94,8 @@ fun MatchesView(matchList: List<Match>) {
9194
fontWeight = FontWeight.Bold,
9295
color = allianceRed,
9396
textAlign = TextAlign.Start,
94-
modifier = Modifier.width(50.dp)
97+
modifier = Modifier.width(50.dp),
98+
textDecoration = if (team != null && match.redAlliance.members.find { member -> member.team.id == team.id } != null ) TextDecoration.Underline else TextDecoration.None
9599
)
96100
Spacer(modifier = Modifier.weight(1f))
97101
Text(
@@ -100,7 +104,8 @@ fun MatchesView(matchList: List<Match>) {
100104
fontWeight = FontWeight.Bold,
101105
color = allianceBlue,
102106
textAlign = TextAlign.End,
103-
modifier = Modifier.width(50.dp)
107+
modifier = Modifier.width(50.dp),
108+
textDecoration = if (team != null && match.blueAlliance.members.find { member -> member.team.id == team.id } != null ) TextDecoration.Underline else TextDecoration.None
104109
)
105110
}
106111
else {
@@ -126,7 +131,8 @@ fun MatchesView(matchList: List<Match>) {
126131
Text(
127132
text = member.team.name,
128133
fontSize = 15.sp,
129-
color = allianceBlue
134+
color = allianceBlue,
135+
textDecoration = if (team != null && member.team.id == team.id) TextDecoration.Underline else TextDecoration.None
130136
)
131137
}
132138
}

0 commit comments

Comments
 (0)