-
Notifications
You must be signed in to change notification settings - Fork 0
Highlights Search Screen UI #90
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?
Conversation
(needed for Modifier.dropShadow)
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/HighlightsSearchBar.kt
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/HighlightsSearchBar.kt
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/HighlightsSearchBar.kt
Outdated
Show resolved
Hide resolved
|
|
||
| @Composable | ||
| fun HighlightsSubScreen( | ||
| sportList: List<Sport>, |
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.
Same comment as before for highlights screen about extracting parameters to vm. For testing purposes, you can maybe just define test variables within the composable
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.
Awesome work as always! The UI is looking great and matches the figma pretty well! I just have some questions and potential considerations about the approach for handling the search logic along with some nits. I think one thing though, is that the use of focusrequester in the previews seems to be causing a lint check error, so we might want to get that fixed. Other than that, I'll leave it to Zach for anything I may have missed.
zachseidner1
left a comment
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.
I think Andrew got pretty much everything but have a few comments of my own. We need to resolve the lint before this gets merged!
...c/main/java/com/cornellappdev/score/components/highlights/HighlightsScreenSearchFilterBar.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/HighlightsSearchBar.kt
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/screen/HighlightsSearchScreen.kt
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Show resolved
Hide resolved
app/src/main/java/com/cornellappdev/score/components/highlights/RecentSearches.kt
Show resolved
Hide resolved
| interactionSource = interactionSource, | ||
| indication = null | ||
| ) { onSearchClick() } | ||
| .clickable { onSearchClick() } |
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.
Is this onSearchClick necessary for focusing or can we allow the basic text field focus to take care of that for us?
| }, | ||
| modifier = Modifier | ||
| .weight(1f) | ||
| .onFocusChanged { state -> |
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.
Not sure if this is necessary if we have the logic in the text field?
| modifier = Modifier | ||
| .padding(horizontal = 24.dp) | ||
| .clip(shape = RoundedCornerShape(100.dp)) | ||
| .onFocusChanged { focusState -> |
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.
Not sure if this ideal to have here or if we can just pass in some sort of onFocus function/logic to the search bar component
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| HighlightsSearchBar( | ||
| onSearchClick = { |
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.
Not sure if this is needed here if we have the focus change detection in the search bar itself? Maybe you can pass in an onFocus function?
| "Cancel", | ||
| style = bodyMedium, | ||
| modifier = Modifier.clickable { | ||
| isFocused = true; |
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.
Should this be false?
| } | ||
| } | ||
|
|
||
| @Preview |
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.
Nit: might be good to have a preview or preview parameter where we can see the highlights list as well instead of just recent searches
| Column( | ||
| modifier = Modifier.padding(horizontal = 24.dp) | ||
| ) { | ||
| if (recentSearchList.isNotEmpty() && query.isEmpty()) { //start state: no search attempted yet |
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.
Nit: It could be potentially worth considering using something like animatedcontent here to have more control over the transition between recent searches content and the search results
|
|
||
| /* Used to display number of results in on HighlightsSearchScreen*/ | ||
| @Composable | ||
| fun HighlightsCardLazyColumnNumResultsHeader( |
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.
Nit: probably don't need to abbreviate num or can potentially just remove num
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.
I'm going to preemptively approve, but left some comments about the focus logic and some nits. Great work!
Overview
HighlightsSearchScreen + HighlightsSubScreen
related components
Changes Made
All components for search screens complete
Updated nav bar so HighlightsScreen is accessible when app is run
Other search screens can be viewed via previews
Test Coverage
Visually matches figma
Next Steps
Code structure/logical flow def isn't perfect rn, will clean that up when I network
Screenshots
search bar functionality
score_pr90.webm