-
Notifications
You must be signed in to change notification settings - Fork 0
Profile and edit profile screen UI #106
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
base: main
Are you sure you want to change the base?
Changes from all commits
c1b0570
b9064ef
d6a14ec
152765a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| package com.cornellappdev.score.components | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.PaddingValues | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.width | ||
| import androidx.compose.foundation.lazy.LazyRow | ||
| import androidx.compose.foundation.lazy.items | ||
| import androidx.compose.material.icons.Icons | ||
| import androidx.compose.material.icons.outlined.ChevronRight | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.unit.dp | ||
| import com.cornellappdev.score.R | ||
| import com.cornellappdev.score.model.GameCardData | ||
| import com.cornellappdev.score.theme.CornellRed | ||
| import com.cornellappdev.score.theme.GrayMedium | ||
| import com.cornellappdev.score.theme.Style | ||
|
|
||
| @Composable | ||
| fun ProfileGameCarousel( | ||
| title: String, | ||
| games: List<GameCardData>, | ||
| onClick: (String) -> Unit, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| Column( | ||
| modifier = modifier.fillMaxWidth() | ||
| ) { | ||
| Row( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(horizontal = 20.dp), | ||
| horizontalArrangement = Arrangement.SpaceBetween, | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| style = Style.heading6 | ||
| ) | ||
|
|
||
| Row(verticalAlignment = Alignment.CenterVertically) { | ||
| Text( | ||
| text = "${games.size} Results", | ||
| style = Style.bodyNormalGray | ||
| ) | ||
| Icon( | ||
| imageVector = Icons.Outlined.ChevronRight, | ||
| contentDescription = null, | ||
| tint = GrayMedium, | ||
| modifier = Modifier.size(18.dp) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.height(12.dp)) | ||
|
|
||
| LazyRow( | ||
| contentPadding = PaddingValues(horizontal = 20.dp), | ||
| horizontalArrangement = Arrangement.spacedBy(12.dp) | ||
| ) { | ||
| items(games) { game -> | ||
| FeaturedGameCard( | ||
| leftTeamLogo = painterResource(R.drawable.cornell_logo), | ||
| rightTeamLogo = game.teamLogo, | ||
| team = game.team, | ||
| date = game.dateString, | ||
| isLive = game.isLive, | ||
| isPast = game.isPast, | ||
| genderIcon = painterResource(game.genderIcon), | ||
| sportIcon = painterResource(game.sportIcon), | ||
| location = game.location, | ||
| gradientColor1 = CornellRed, | ||
| gradientColor2 = game.teamColor, | ||
| leftScore = game.cornellScore?.toInt(), | ||
| rightScore = game.otherScore?.toInt(), | ||
| onClick = { onClick(game.id) }, | ||
| modifier = Modifier.width(241.dp), | ||
| headerModifier = Modifier | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.height(24.dp)) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,10 @@ import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material.icons.Icons | ||
| import androidx.compose.material.icons.filled.Person | ||
| import androidx.compose.material.icons.outlined.Person | ||
| import androidx.compose.material.icons.outlined.Schedule | ||
| import androidx.compose.material3.Scaffold | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.runtime.Composable | ||
|
|
@@ -18,6 +22,7 @@ import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.draw.dropShadow | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.shadow.Shadow | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.unit.DpOffset | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.hilt.navigation.compose.hiltViewModel | ||
|
|
@@ -65,7 +70,8 @@ fun RootNavigation( | |
|
|
||
| Scaffold( | ||
| modifier = modifier.fillMaxSize(), bottomBar = { | ||
| if (navBackStackEntry?.toScreen() is ScoreScreens.GameDetailsPage) { | ||
| val currentScreen = navBackStackEntry?.toScreen() | ||
| if (currentScreen is ScoreScreens.GameDetailsPage || currentScreen is ScoreScreens.EditProfile) { | ||
| return@Scaffold | ||
| } | ||
| Surface( | ||
|
|
@@ -110,6 +116,12 @@ sealed class ScoreScreens { | |
| @Serializable | ||
| data class GameScoreSummaryPage(val scoreEvents: String) : ScoreScreens() | ||
|
|
||
| @Serializable | ||
| data object Profile : ScoreScreens() | ||
|
|
||
| @Serializable | ||
| data object EditProfile : ScoreScreens() | ||
|
|
||
| ////removed for 2/2026 release | ||
| // @Serializable | ||
| // data object HighlightsScreen : ScoreScreens() | ||
|
|
@@ -124,10 +136,12 @@ fun NavBackStackEntry.toScreen(): ScoreScreens? = | |
| "GameDetailsPage" -> toRoute<ScoreScreens.GameDetailsPage>() | ||
| "ScoresScreen" -> toRoute<ScoreScreens.ScoresScreen>() | ||
| "GameScoreSummaryPage" -> toRoute<ScoreScreens.GameScoreSummaryPage>() | ||
| "Profile" -> toRoute<ScoreScreens.Profile>() | ||
| "EditProfile" -> toRoute<ScoreScreens.EditProfile>() | ||
| //removed for 2/2026 release | ||
| // "HighlightsScreen" -> toRoute<ScoreScreens.HighlightsScreen>() | ||
| // "HighlightsSearchScreen" -> toRoute<ScoreScreens.HighlightsScreen>() | ||
| else -> throw IllegalArgumentException("Invalid screen") | ||
| else -> null | ||
| } | ||
|
|
||
| data class NavItem( | ||
|
|
@@ -157,4 +171,10 @@ val tabs = listOf( | |
| selectedIcon = R.drawable.ic_scores_filled, | ||
| screen = ScoreScreens.ScoresScreen, | ||
| ), | ||
| ) | ||
| NavItem( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we might've talked ab this after you opened this PR so no worries, but just a note that this icon will be in the top right corner of the home page! |
||
| label = "Profile", | ||
| unselectedIcon = R.drawable.ic_profile, | ||
| selectedIcon = R.drawable.ic_profile_filled, | ||
| screen = ScoreScreens.Profile, | ||
| ), | ||
| ) | ||
|
Comment on lines
+174
to
+180
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all the other Icons are Drawable so here u would make the change! |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!