-
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
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -81,6 +81,7 @@ dependencies { | |||||
| implementation(libs.material3) | ||||||
| implementation("com.google.dagger:hilt-android:2.51.1") | ||||||
| implementation(libs.androidx.foundation) | ||||||
| implementation(libs.foundation) | ||||||
| kapt("com.google.dagger:hilt-android-compiler:2.51.1") | ||||||
| implementation("androidx.hilt:hilt-navigation-compose:1.0.0") | ||||||
| implementation("com.google.accompanist:accompanist-pager:0.24.0-alpha") | ||||||
|
|
@@ -103,6 +104,7 @@ dependencies { | |||||
| lintChecks(libs.compose.lint.checks) | ||||||
| implementation(platform("com.google.firebase:firebase-bom:34.3.0")) | ||||||
| implementation("com.google.firebase:firebase-analytics") | ||||||
| implementation("androidx.compose.material:material-icons-extended:1.6.0") | ||||||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Confirm BOM usage + explicit compose versions in this file.
rg -n 'compose-bom|androidx\.compose\..*:[0-9]+\.[0-9]+(\.[0-9]+)?|material-icons-extended' app/build.gradle.ktsRepository: cuappdev/score-android Length of output: 222 🏁 Script executed: # Read the build.gradle.kts file around the relevant lines
sed -n '70,120p' app/build.gradle.kts | cat -nRepository: cuappdev/score-android Length of output: 2477 🌐 Web query:
💡 Result: For
Citations: 🌐 Web query:
💡 Result:
If you want a contemporary stable Navigation Compose version from around that timeframe, Sources Remove explicit version from Line 107 pins version Proposed fix- implementation("androidx.compose.material:material-icons-extended:1.6.0")
+ implementation("androidx.compose.material:material-icons-extended")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| } | ||||||
|
|
||||||
| apollo { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,13 @@ import androidx.navigation.toRoute | |
| import com.cornellappdev.score.model.ScoreEvent | ||
| import com.cornellappdev.score.nav.root.ScoreScreens | ||
| import com.cornellappdev.score.nav.root.ScoreScreens.Home | ||
| import com.cornellappdev.score.screen.EditProfileScreen | ||
| import com.cornellappdev.score.screen.GameDetailsScreen | ||
| import com.cornellappdev.score.screen.HighlightsScreen | ||
| import com.cornellappdev.score.screen.HighlightsSearchScreen | ||
| import com.cornellappdev.score.screen.HomeScreen | ||
| import com.cornellappdev.score.screen.PastGamesScreen | ||
| import com.cornellappdev.score.screen.ProfileScreen | ||
| import com.cornellappdev.score.util.highlightsList | ||
| import com.cornellappdev.score.util.recentSearchList | ||
| import com.cornellappdev.score.util.sportList | ||
|
|
@@ -47,6 +49,20 @@ fun ScoreNavHost(navController: NavHostController) { | |
| }) | ||
| } | ||
| } | ||
| composable<ScoreScreens.Profile> { | ||
| ProfileScreen( | ||
| navigateToEditProfile = { | ||
| navController.navigate(ScoreScreens.EditProfile) | ||
| } | ||
| ) | ||
| } | ||
| composable<ScoreScreens.EditProfile> { | ||
| EditProfileScreen( | ||
| onBackClick = { | ||
| navController.navigateUp() | ||
| } | ||
| ) | ||
| } | ||
|
Comment on lines
+52
to
+65
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. looks good! |
||
| composable<ScoreScreens.GameDetailsPage> { | ||
| GameDetailsScreen( | ||
| onBackArrow = { | ||
|
|
@@ -89,4 +105,3 @@ fun ScoreNavHost(navController: NavHostController) { | |
| // } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import androidx.compose.material3.Text | |
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.navigation.NavBackStackEntry | ||
|
|
@@ -38,11 +39,20 @@ fun ScoreNavigationBar( | |
| selectedIndicatorColor = Color.Transparent | ||
| ), | ||
| icon = { | ||
| Icon( | ||
| painter = painterResource(id = if (isSelected) item.selectedIcon else item.unselectedIcon), | ||
| contentDescription = null, | ||
| tint = Color.Unspecified | ||
| ) | ||
| val icon = if (isSelected) item.selectedIcon else item.unselectedIcon | ||
| if (icon is Int) { | ||
| Icon( | ||
| painter = painterResource(id = icon), | ||
| contentDescription = null, | ||
| tint = Color.Unspecified | ||
| ) | ||
| } else if (icon is ImageVector) { | ||
| Icon( | ||
| imageVector = icon, | ||
| contentDescription = null, | ||
| tint = if (isSelected) CrimsonPrimary else GrayPrimary | ||
| ) | ||
| } | ||
|
Comment on lines
+42
to
+55
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. Is it possible to import the Profile Icon as a Drawable in Resource Manager on the left. This way you do not need this additional if statement. I can show you next time! |
||
| }, | ||
| label = { | ||
| Text( | ||
|
|
||
| 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,17 +136,19 @@ 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( | ||
| val screen: ScoreScreens, | ||
| val label: String, | ||
| val unselectedIcon: Int, | ||
| val selectedIcon: Int | ||
| val unselectedIcon: Any, | ||
| val selectedIcon: Any | ||
|
Comment on lines
+150
to
+151
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. change this back to int |
||
| ) | ||
|
|
||
| val tabs = listOf( | ||
|
|
@@ -157,4 +171,10 @@ val tabs = listOf( | |
| selectedIcon = R.drawable.ic_scores_filled, | ||
| screen = ScoreScreens.ScoresScreen, | ||
| ), | ||
| ) | ||
| NavItem( | ||
| label = "Profile", | ||
| unselectedIcon = Icons.Outlined.Person, | ||
| selectedIcon = Icons.Filled.Person, | ||
| 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.
🧩 Analysis chain
🏁 Script executed:
Repository: cuappdev/score-android
Length of output: 385
Remove duplicate Foundation dependency with conflicting versions
The version catalog aliases resolve
libs.foundationandlibs.androidx-foundationto the same module (androidx.compose.foundation:foundation) but with different versions (1.10.3 vs 1.9.4). Having both dependencies creates a version conflict risk. Keep only one alias, preferably the newer version.🤖 Prompt for AI Agents