Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("com.google.dagger.hilt.android")
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" // this version matches your Kotlin version
id("org.jetbrains.kotlin.plugin.serialization")

id("com.google.gms.google-services")
}


Expand Down Expand Up @@ -71,6 +71,7 @@ dependencies {
implementation("androidx.navigation:navigation-compose:2.8.2")
implementation(libs.material3)
implementation("com.google.dagger:hilt-android:2.51.1")
implementation(libs.androidx.material3)
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")
Expand All @@ -93,6 +94,8 @@ dependencies {
implementation("io.coil-kt.coil3:coil-compose:3.1.0")
implementation("io.coil-kt.coil3:coil-network-okhttp:3.1.0")
lintChecks(libs.compose.lint.checks)
implementation(platform("com.google.firebase:firebase-bom:34.3.0"))
implementation("com.google.firebase:firebase-analytics")
}

apollo {
Expand Down
29 changes: 29 additions & 0 deletions app/src/google-services.json
Copy link
Collaborator

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-android for a recent example of this.

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
Expand Up @@ -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) {
Expand All @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: imo it makes more sense to both wrap the Text and the Spacer in text.isNotEmpty() rather than just the Spacer

}
Expand Down
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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 enum class with a display string property to store the filters, rather than just strings.


Column {
Row(
modifier = Modifier
.fillMaxWidth()
.clickable { expanded = !expanded },
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(title, fontSize = 18.sp)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The font for this is wrong. You should be using the h2 text style for this according to the Figma. If this isn't in the code base yet, you need to add it.

Image

All this typography should be implemented as specified by the Figma.

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tried having this conditional rendering within the Column, and then given the Column the animateContentSize modifier? I think it would make this look much better!

options.forEach { option ->
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
.clickable { selectedOption = option }
.padding(vertical = 4.dp)
) {
RadioButton(
Copy link
Collaborator

Choose a reason for hiding this comment

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

You are just using the default material RadioButton. As a result the colors are wrong

selected = (selectedOption == option),
onClick = { selectedOption = option }
)
Text(option)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Text is styled incorrectly

}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.cornellappdev.score.screen
import ScoringSummary
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand Down Expand Up @@ -106,6 +107,7 @@ fun GameDetailsContent(
gameCard: DetailsCardData,
navigateToGameScoreSummary: (List<ScoreEvent>) -> Unit
) {
val scrollState = rememberScrollState()
Column(
modifier = Modifier
.background(White)
Expand All @@ -132,7 +134,10 @@ fun GameDetailsContent(
)
Text(
text = gameCard.title,
style = heading1.copy(color = GrayPrimary)
style = heading1.copy(color = GrayPrimary),
maxLines = 1,
modifier = Modifier
.horizontalScroll(scrollState)
)
Spacer(modifier = Modifier.height(13.5.dp))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -43,7 +44,7 @@ fun GameScoreSummaryScreenDetail(scoreEvents: List<ScoreEvent>, onBackArrow: ()
) {
items(scoreEvents.size) { event ->
ScoreEventItemDetailed(event = scoreEvents[event])
Divider(color = Color.LightGray, thickness = 0.5.dp)
HorizontalDivider(thickness = 0.5.dp, color = Color.LightGray)
}
}
}
Expand Down
Loading