Skip to content

Commit

Permalink
Merge pull request #94 from eshc123/feature/mod-home-screen
Browse files Browse the repository at this point in the history
[FEATURE] Modified Home Screen Team DashBoard
  • Loading branch information
eshc123 authored Jun 9, 2024
2 parents c84ffa3 + 957c25f commit f80da90
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ fun RemoteRank.toModel() = Rank(
goalDifference = goalDifference,
teamId = teamId,
teamName = teamName,
teamImgUrl = teamImgUrl,
shortCode = shortCode
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data class Rank(
val goalDifference: Int,
val teamId: Int,
val teamName: String,
val teamImgUrl: String,
val shortCode: String
) {
fun getTotalGames(): Int = wins + draw + loss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ data class RemoteRank(
@SerialName("goal_difference") val goalDifference : Int,
@SerialName("team_id") val teamId : Int,
@SerialName("team_name") val teamName : String,
@SerialName("team_image_url") val teamImgUrl: String,
@SerialName("short_code") val shortCode : String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun DashboardCard(
LeagueDashboardItem(
rank = rank.position,
teamId = rank.teamId,
teamImgUrl = "",
teamImgUrl = rank.teamImgUrl,
teamShortName = rank.shortCode,
totalGames = rank.getTotalGames(),
wins = rank.wins,
Expand Down Expand Up @@ -127,7 +127,7 @@ fun LeagueDashboardRow(modifier: Modifier = Modifier) {
Row(
modifier = modifier
.fillMaxWidth()
.padding(start = 10.dp, end = 17.dp),
.padding(start = 17.dp, end = 17.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
Expand All @@ -145,36 +145,42 @@ fun LeagueDashboardRow(modifier: Modifier = Modifier) {
)
Text(
text = "PL",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = ColorFF9E9E9E,
style = GnrTypography.descriptionMedium
)
Text(
text = "W",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = ColorFF9E9E9E,
style = GnrTypography.descriptionMedium
)
Text(
text = "D",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = ColorFF9E9E9E,
style = GnrTypography.descriptionMedium
)
Text(
text = "L",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = ColorFF9E9E9E,
style = GnrTypography.descriptionMedium
)
Text(
text = "GD",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = ColorFF9E9E9E,
style = GnrTypography.descriptionMedium
)
Text(
text = "Pts",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = ColorFF9E9E9E,
style = GnrTypography.descriptionMedium
Expand Down Expand Up @@ -207,7 +213,7 @@ fun LeagueDashboardItem(
Row(
modifier = modifier
.fillMaxWidth()
.padding(top = 2.dp, bottom = 2.dp, end = 17.dp, start = 10.dp),
.padding(top = 2.dp, bottom = 2.dp, end = 17.dp, start = 17.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
Expand All @@ -225,37 +231,43 @@ fun LeagueDashboardItem(
)
Text(
text = "$totalGames",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = cardItemTextColor,
style = GnrTypography.body2Regular
)
Text(
text = "$wins",
modifier = modifier.weight(1f),
text = "$wins",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = cardItemTextColor,
style = GnrTypography.body2Regular
)
Text(
text = "$draws",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = cardItemTextColor,
style = GnrTypography.body2Regular
)
Text(
text = "$losses",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = cardItemTextColor,
style = GnrTypography.body2Regular
)

Text(
text = "${if(goalDiff > 0)"+" else ""}${goalDiff}",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = cardItemTextColor,
style = GnrTypography.body2Regular
)
Text(
text = "$points",
textAlign = TextAlign.Center,
modifier = modifier.weight(1f),
color = cardItemTextColor,
style = GnrTypography.body2SemiBold
Expand Down

0 comments on commit f80da90

Please sign in to comment.