Skip to content

Conversation

@EmilJiang
Copy link
Contributor

So, for gamedetails there are still a lot of things to work on. I will attach a picture of what it looks like now, and a list of things to work on. I just wanted to create this PR for comments because there is a lot of changes, and I am not totally done with everything. I tried to follow the code structure of Amy's as much as possible :).

What I did

The networking should be all done, but sometimes it does not load which I think is a backend issue. In the slack, Skye said he will look into it. The Screen with all the components is mostly done.

Specific things that still needs work

hopfully quick ones

  • Timer for games that have not started yet
  • Add to calendar
  • No scoring summary state
Screenshot 2025-03-23 at 9 54 26 PM
  • Scoring Summary navigation (not sure if helen already added this)

longer ones

  • Score for the Header (right now i have 0's as placeholders). I do not know how IOS is getting there scores from. A potential idea is summing up the periods from the scoreBreakdown, BUT sometimes that is null, so maybe continuously checking if result is not null signaling the end of match
  • scoreBreakdown for each sport. There is a pdf for how the breakdown works, and I am thinking just to do a huge when statement of if statement. Right now it is a basic score of last one in the list being final score and the rest being the periods
  • change scoreSummary to be what IOS has instead of figma. Left is Figma, right is IOS.
Screenshot 2025-03-23 at 9 50 53 PM Screenshot 2025-03-23 at 9 51 58 PM

Current result
Screenshot 2025-03-23 at 9 53 34 PM

@EmilJiang EmilJiang requested a review from zachseidner1 March 24, 2025 01:54
Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass CI before requesting review please. Thank you!

Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emil, this is a really strong first draft, especially as a new member. Really great work. There are still some fixes to be made, but you did a nice job. Also please provide a way for me to test the game details screen! Right now the function is just unused.

Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

I found some more UI issues: you should update this screen so that the padding matches the Figma page. Please use dev mode to see the padding easier, and add the missing score header.

We can fix the score box card in a separate PR since that's not something you worked on.

@EmilJiang
Copy link
Contributor Author

UI fixes still need to be done, but I think all the logic should be done.

@EmilJiang
Copy link
Contributor Author

I have added all the functionality, and done the UI changes for most. I am still confused on the navigation header padding for the top. In the image below, it cant be 56 because that includes the top of the phone too I think.
Screenshot 2025-04-09 at 1 03 03 AM
Testing is the same as before with a button on the top which sometimes does not work if scraping is done. Some things that still need to be done are navigation and scoring summary UI fix to match with IOS. I will ask for the design tomorrow
Screenshot 2025-04-09 at 1 05 51 AM

@EmilJiang EmilJiang requested a review from zachseidner1 April 9, 2025 05:13
Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on this Emil! So happy to see this page coming together. I left a few comments for you to address 🫡

putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endMillis)
}

if (intent.resolveActivity(context.packageManager) != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the deal with this if statement?

import com.cornellappdev.score.model.DetailsCardData
import java.time.ZoneId

fun addToCalendar(context: Context, details: DetailsCardData) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a function spec, and have you tested this?

Also, this function shouldn't be specific to DetailsGameCard. Maybe instead it could take in some kind of CalendarEvent data class that takes in the minimum data needed to add an event to a calendar?

modifier = Modifier
.background(Color.White)
) {
Button(onClick = { navigateToGameDetails(true) }) { }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be of type () -> Unit not (Boolean) -> Unit

@EmilJiang EmilJiang requested a review from zachseidner1 April 14, 2025 04:41
Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey sorry for responding to this a bit late, but thank you for pushing those fixes! for the boolean, navigateToGameDetails should not take in a boolean as an argument. It should take in a string instead. Then we should pass in the string to the navController here instead of the empty string.

HomeScreen(navigateToGameDetails = {
navController.navigate(ScoreRootScreens.GameDetailsPage(""))
})

Also, do you think you’re able to resolve merge conflicts on your own, or do you want me to help out with that? it seems like there are a lot so lmk what you think.

@EmilJiang
Copy link
Contributor Author

I added navigation to the components to gameDetails. One thing I noticed though was the padding is kind of off. There seems to be hardcoded values, but figma does not show. The "add to calendar" is off the page.
Screenshot 2025-04-14 at 5 42 09 PM
There no numbers attached to spacing between days left and add to calendar. Also, I do not see an example with the bottom navigation. So, I do not know what the padding should be with the bottom navigation or if it should be scrollable
Screenshot 2025-04-14 at 5 43 46 PM

@EmilJiang EmilJiang requested a review from zachseidner1 April 14, 2025 21:45
Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For situations like these, we can use Spacers with weight modifier. This way it will take up as much space as it can, but it will never cut off the button. We can kinda eye-ball the Figma as a general guideline for weight ratios.

@EmilJiang EmilJiang requested a review from zachseidner1 April 14, 2025 22:04
…s_ui

# Conflicts:
#	app/src/main/java/com/cornellappdev/score/components/GamesCarousel.kt
#	app/src/main/java/com/cornellappdev/score/screen/HomeScreen.kt
#	app/src/main/java/com/cornellappdev/score/screen/PastGamesScreen.kt
Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for responding to my comments! I have a few more 😭 but these are mostly minor. I want to say you did a really great job with this! I really appreciate you being receptive and being able to address most things I say quite quickly.

Make sure to pull before beginning work again since I made a couple small fixes to this branch.

Also, the scoring summary shouldn't be a LazyColumn, it should just only show the first 3 items. You can use Kotlin's Iterable<T>.take extension function for this.


@Composable
fun FeaturedGameCard(
id: String,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never require an id to show a Composable, the only parameters Composables should take are things related to its view state, or click methods. So really, this composable should have an onClick: () -> Unit method. Then we would write:

onClick = { 
                    onClick(game.id)
                }

And pass it through like that. Lmk if that makes sense.

painterResource(R.drawable.ic_calendar),
onClick = {
gameCard.toCalendarEvent()?.let { event ->
addToCalendar(context = context, event)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nit: I don't think you need to pass in context as a named parameter, feels a bit redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addTocalendar still does not work, so I think I will be working on that as the first issue.

@EmilJiang
Copy link
Contributor Author

I think in this case, GameCardData needs to have an id because the uistate uses GameCardData. If there is a better way, please let me know!

@EmilJiang EmilJiang requested a review from zachseidner1 April 15, 2025 02:03
@zachseidner1
Copy link
Collaborator

zachseidner1 commented Apr 15, 2025

The addTocalendar still does not work, so I think I will be working on that as the first issue.

Are you sure add to calendar doesn't work? I tried it and it opened google calendar, but not much else happened. Does the same issue happen on your end?

Copy link
Collaborator

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally ready to merge this in! Thank you so much again for responding to all of my comments. I think we've had good discussion and I hope you've learned a lot!

Yes that was my bad about the GameCardData, it's fine for it to have an ID. But it definitely shouldn't be a parameter to the Composable and I'm glad you were able to remove that.

@EmilJiang EmilJiang merged commit 63ae483 into main Apr 15, 2025
1 check passed
@EmilJiang EmilJiang deleted the emil_jiang_gamedetails_ui branch April 15, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants