@@ -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
391391private 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
397397private fun PreviewBoxScoreForLongGame () = ScorePreview {
398- BoxScore (longGameData)
398+ BoxScore (longGameData, Modifier .padding(start = 20 .dp, end = 20 .dp) )
399399}
400400
401401@Preview
402402@Composable
403403private fun PreviewBoxScoreForMedGame () = ScorePreview {
404- BoxScore (mediumGameData)
404+ BoxScore (mediumGameData, Modifier .padding(start = 20 .dp, end = 20 .dp) )
405405}
406406
407407@Preview
408408@Composable
409409private fun PreviewBoxScoreForShortGame () = ScorePreview {
410- BoxScore (shortGameData)
410+ BoxScore (shortGameData, Modifier .padding(start = 20 .dp, end = 20 .dp) )
411411}
412412
413413@Preview
414414@Composable
415415private 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
421421private fun PreviewBoxScoreEmpty () = ScorePreview {
422- BoxScore (gameData = emptyGameData())
422+ BoxScore (gameData = emptyGameData(), Modifier .padding(start = 20 .dp, end = 20 .dp) )
423423}
0 commit comments