Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Modified Home Screen Team DashBoard #94

Merged
merged 2 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading