-
Notifications
You must be signed in to change notification settings - Fork 0
Advnced Filter UI #85
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
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 |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "project_info": { | ||
| "project_number": "1041954613554", | ||
| "project_id": "score-2bbd4", | ||
| "storage_bucket": "score-2bbd4.firebasestorage.app" | ||
| }, | ||
| "client": [ | ||
| { | ||
| "client_info": { | ||
| "mobilesdk_app_id": "1:1041954613554:android:afdaffd5c956622603cf2b", | ||
| "android_client_info": { | ||
| "package_name": "com.cornellappdev.score" | ||
| } | ||
| }, | ||
| "oauth_client": [], | ||
| "api_key": [ | ||
| { | ||
| "current_key": "AIzaSyCjJpkMnpwSVu270_k6_3UmaHXb_NiCc0I" | ||
| } | ||
| ], | ||
| "services": { | ||
| "appinvite_service": { | ||
| "other_platform_oauth_client": [] | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "configuration_version": "1" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,16 @@ import com.cornellappdev.score.theme.Style.bodyMedium | |
| import com.cornellappdev.score.theme.White | ||
|
|
||
| @Composable | ||
| fun ButtonPrimary(text: String, icon: Painter?, onClick: () -> Unit = {}) { | ||
| Button(onClick = onClick, | ||
| fun ButtonPrimary( | ||
| text: String, | ||
| icon: Painter?, | ||
| modifier: Modifier = Modifier, | ||
| onClick: () -> Unit = {} | ||
| ) { | ||
| Button( | ||
| onClick = onClick, | ||
| colors = ButtonDefaults.buttonColors(containerColor = CrimsonPrimary), | ||
| modifier = modifier, | ||
| contentPadding = PaddingValues(12.dp) | ||
| ) { | ||
| if (icon != null) { | ||
|
|
@@ -32,7 +39,9 @@ fun ButtonPrimary(text: String, icon: Painter?, onClick: () -> Unit = {}) { | |
| .height(24.dp), | ||
| colorFilter = ColorFilter.tint(White) | ||
| ) | ||
| Spacer(modifier = Modifier.width(8.dp)) | ||
| if (text.isNotEmpty()) { | ||
| Spacer(modifier = Modifier.width(8.dp)) | ||
| } | ||
| } | ||
| Text(text = text, style = bodyMedium.copy(color = White)) | ||
|
Comment on lines
+42
to
46
Collaborator
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. nit: imo it makes more sense to both wrap the |
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package com.cornellappdev.score.components | ||
|
|
||
| import androidx.compose.foundation.clickable | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.RadioButton | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.unit.sp | ||
| import com.cornellappdev.score.R | ||
|
|
||
| @Composable | ||
| fun ExpandableSection(title: String, options: List<String>) { | ||
| var expanded by remember { mutableStateOf(false) } | ||
| var selectedOption by remember { mutableStateOf("Under $20") } | ||
|
Comment on lines
+26
to
+27
Collaborator
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. This non-nullable type is asserting a filter is always selected. What about when there are no filters selected? Also, I think we should be using an |
||
|
|
||
| Column { | ||
| Row( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clickable { expanded = !expanded }, | ||
| horizontalArrangement = Arrangement.SpaceBetween, | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| Text(title, fontSize = 18.sp) | ||
|
Collaborator
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. |
||
| Icon( | ||
| painter = painterResource( | ||
| id = if (expanded) R.drawable.ic_round_minus else R.drawable.ic_round_plus | ||
| ), | ||
| contentDescription = if (expanded) "Collapse" else "Expand" | ||
| ) | ||
| } | ||
|
|
||
| if (expanded) { | ||
| Column { | ||
|
Comment on lines
+46
to
+47
Collaborator
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. Have you tried having this conditional rendering within the |
||
| options.forEach { option -> | ||
| Row( | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clickable { selectedOption = option } | ||
| .padding(vertical = 4.dp) | ||
| ) { | ||
| RadioButton( | ||
|
Collaborator
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. You are just using the default material |
||
| selected = (selectedOption == option), | ||
| onClick = { selectedOption = option } | ||
| ) | ||
| Text(option) | ||
|
Collaborator
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. Text is styled incorrectly |
||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||

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.
This file should not be committed. We should get rid of it and do the proper set up using GitHub secrets. See
hustle-androidfor a recent example of this.