Skip to content

Commit a5255ae

Browse files
committed
Bug fix
1 parent 0774418 commit a5255ae

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

app/src/main/java/com/cornellappdev/score/components/ScoreBox.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ private fun TeamNameColumn(
110110
//set to approximation of minimum width for "Cornell"
111111
modifier.widthIn(max = 70.dp)
112112
} else {
113-
//can take up as much space as is available
114-
modifier.width(IntrinsicSize.Max)
113+
modifier.widthIn(max = 100.dp)
115114
}
116115
) {
117116
Row(
@@ -294,7 +293,7 @@ private fun CompleteTableData(
294293
teamTwoScores = gameData.teamScores.second,
295294
//if maxPeriods > 8, "Totals" header will wrap to two lines. In this case, don't weight so that space is allocated to TotalsColumn first
296295
//otherwise, TotalsColumn will fit without wrapping and can be allocated equal width as the data columns
297-
modifier = if (maxPeriods < 8) {
296+
modifier = if (maxPeriods < 4) {
298297
Modifier.weight(1f, fill = true)
299298
} else {
300299
Modifier
@@ -386,38 +385,39 @@ private fun TotalsColumn(
386385
}
387386

388387

388+
//Padding added to previews to simulate the padding around the ScoreBox when it's displayed on the screen
389389
@Preview
390390
@Composable
391391
private fun PreviewBoxScore() = ScorePreview {
392-
BoxScore(gameData = gameData)
392+
BoxScore(gameData = gameData, Modifier.padding(start = 20.dp, end = 20.dp))
393393
}
394394

395395
@Preview
396396
@Composable
397397
private fun PreviewBoxScoreForLongGame() = ScorePreview {
398-
BoxScore(longGameData)
398+
BoxScore(longGameData, Modifier.padding(start = 20.dp, end = 20.dp))
399399
}
400400

401401
@Preview
402402
@Composable
403403
private fun PreviewBoxScoreForMedGame() = ScorePreview {
404-
BoxScore(mediumGameData)
404+
BoxScore(mediumGameData, Modifier.padding(start = 20.dp, end = 20.dp))
405405
}
406406

407407
@Preview
408408
@Composable
409409
private fun PreviewBoxScoreForShortGame() = ScorePreview {
410-
BoxScore(shortGameData)
410+
BoxScore(shortGameData, Modifier.padding(start = 20.dp, end = 20.dp))
411411
}
412412

413413
@Preview
414414
@Composable
415415
private fun PreviewBoxScoreExtraLongGame() = ScorePreview {
416-
BoxScore(gameData = extraLongGameData)
416+
BoxScore(gameData = extraLongGameData, Modifier.padding(start = 20.dp, end = 20.dp))
417417
}
418418

419419
@Preview
420420
@Composable
421421
private fun PreviewBoxScoreEmpty() = ScorePreview {
422-
BoxScore(gameData = emptyGameData())
422+
BoxScore(gameData = emptyGameData(), Modifier.padding(start = 20.dp, end = 20.dp))
423423
}

app/src/main/java/com/cornellappdev/score/util/TestingConstants.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ val gameList = listOf(
5555
)
5656

5757
val team1 = TeamBoxScore(name = "Cornell")
58-
val team2 = TeamBoxScore(name = "Yale")
58+
val team2 = TeamBoxScore(name = "Yale University")
5959

6060
val teamScore1 = TeamScore(
6161
team = team1,
@@ -129,7 +129,7 @@ val team3 = TeamGameSummary(
129129
"https://cornellbigred.com/images/logos/penn_200x200.png?width=80&height=80&mode=max"
130130
)
131131
val team4 = TeamGameSummary(
132-
name = "Yale",
132+
name = "Yale University",
133133
"https://cornellbigred.com/images/logos/penn_200x200.png?width=80&height=80&mode=max"
134134
)
135135
val scoreEvents1 = listOf(

0 commit comments

Comments
 (0)