-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation of HomeScreen Design #4
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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.cornellappdev.chimes.ui.components | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.PaddingValues | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.ExperimentalComposeUiApi | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.draw.dropShadow | ||
| import androidx.compose.ui.draw.shadow | ||
| import androidx.compose.ui.geometry.Offset | ||
| import androidx.compose.ui.graphics.Brush | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.shadow.Shadow | ||
| import androidx.compose.ui.unit.DpOffset | ||
| import androidx.compose.ui.unit.dp | ||
|
|
||
| @OptIn(ExperimentalComposeUiApi::class) | ||
| @Composable | ||
| fun ChimeCard (paddingValues: PaddingValues, modifier: Modifier, children: @Composable () -> Unit){ | ||
| Column( | ||
| modifier = modifier | ||
| .shadow( | ||
| elevation = 4.dp, | ||
| shape = RoundedCornerShape(16.dp), | ||
| ambientColor = Color(0x59A86161), | ||
| spotColor = Color(0x59A86161) | ||
| ) | ||
| .clip(RoundedCornerShape(16.dp)) | ||
| .background(brush = | ||
| Brush.linearGradient( | ||
| colors = | ||
| listOf(Color(0xFFFFF5F0), Color(0xFFFFE9E9)),)) | ||
| .padding(paddingValues), | ||
| verticalArrangement = Arrangement.spacedBy(18.dp) | ||
| ){ | ||
| children() | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package com.cornellappdev.chimes.ui.components | ||
|
|
||
| import android.R | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.PaddingValues | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.width | ||
| import androidx.compose.foundation.shape.CircleShape | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.ButtonDefaults | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.draw.shadow | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.unit.sp | ||
|
|
||
| @Composable | ||
| fun ChimeKudos(emoji: String) { | ||
| Button(modifier = Modifier | ||
| .shadow( | ||
| elevation = 4.dp, | ||
| shape = CircleShape, | ||
| ambientColor = Color(0x59A86161), | ||
| spotColor = Color(0x59A86161) | ||
| ) | ||
| .clip(CircleShape) | ||
| .height(64.dp) | ||
| .width(64.dp), | ||
| contentPadding = PaddingValues(0.dp), | ||
| onClick = {}, | ||
| colors = ButtonDefaults.buttonColors( | ||
| Color(0xFFFEEEEE)), | ||
| ){ | ||
| Box( | ||
| modifier = Modifier.fillMaxSize(), | ||
| contentAlignment = Alignment.Center | ||
| ){ | ||
| Text( | ||
| text = emoji, | ||
| fontSize = 32.sp | ||
| ) | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||
| package com.cornellappdev.chimes.ui.components | ||||||||||||||||
|
|
||||||||||||||||
| import androidx.compose.foundation.border | ||||||||||||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||||||||||||
| import androidx.compose.foundation.layout.PaddingValues | ||||||||||||||||
| import androidx.compose.foundation.layout.Row | ||||||||||||||||
| import androidx.compose.foundation.layout.Spacer | ||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxHeight | ||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxSize | ||||||||||||||||
| import androidx.compose.foundation.layout.height | ||||||||||||||||
| import androidx.compose.foundation.layout.width | ||||||||||||||||
| import androidx.compose.material3.Text | ||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||||||
| import androidx.compose.ui.graphics.Color | ||||||||||||||||
| import androidx.compose.ui.text.font.Font | ||||||||||||||||
| import androidx.compose.ui.text.font.FontFamily | ||||||||||||||||
| import androidx.compose.ui.unit.dp | ||||||||||||||||
| import androidx.compose.ui.unit.sp | ||||||||||||||||
| import com.cornellappdev.chimes.R | ||||||||||||||||
| import com.cornellappdev.chimes.ui.theme.Montserrat | ||||||||||||||||
|
|
||||||||||||||||
| @Composable | ||||||||||||||||
| fun ChimePerformanceCard (timePeriod: String, timeRange: String) { | ||||||||||||||||
| ChimeCard( | ||||||||||||||||
| paddingValues = PaddingValues(horizontal = 22.dp, vertical = 11.dp), | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .width(351.dp) | ||||||||||||||||
| .height(51.dp) | ||||||||||||||||
| ){ | ||||||||||||||||
| Row ( | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .fillMaxSize(), | ||||||||||||||||
| horizontalArrangement = Arrangement.spacedBy(16.dp), | ||||||||||||||||
| verticalAlignment = Alignment.CenterVertically | ||||||||||||||||
| ) { | ||||||||||||||||
| Text( | ||||||||||||||||
| text = timePeriod, | ||||||||||||||||
| fontSize = 18.sp, | ||||||||||||||||
| fontFamily = Montserrat, | ||||||||||||||||
| modifier = Modifier.width(75.dp) | ||||||||||||||||
| ) | ||||||||||||||||
| Spacer(modifier = Modifier.fillMaxHeight().width((1f).dp).border((0.5f).dp, Color(0x4D635858))) | ||||||||||||||||
|
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. Spacer with border won't render a visible divider.
🐛 Proposed fix using Box- Spacer(modifier = Modifier.fillMaxHeight().width((1f).dp).border((0.5f).dp, Color(0x4D635858)))
+ Box(
+ modifier = Modifier
+ .fillMaxHeight()
+ .width(1.dp)
+ .background(Color(0x4D635858))
+ )📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| Text( | ||||||||||||||||
| text = timeRange, | ||||||||||||||||
| fontFamily = Montserrat, | ||||||||||||||||
| fontSize = 18.sp | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package com.cornellappdev.chimes.ui.components | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.fillMaxHeight | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.offset | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.width | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.drawWithCache | ||
| import androidx.compose.ui.geometry.Offset | ||
| import androidx.compose.ui.graphics.BlendMode | ||
| import androidx.compose.ui.graphics.Brush | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.ColorFilter | ||
| import androidx.compose.ui.graphics.graphicsLayer | ||
| import androidx.compose.ui.layout.ContentScale | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.unit.dp | ||
| import com.cornellappdev.chimes.R | ||
|
|
||
| @Composable | ||
| fun Slope() { | ||
| Box( | ||
| modifier = Modifier.fillMaxSize() | ||
| ){ | ||
| Box( | ||
| modifier = Modifier | ||
| .height(411.dp) | ||
| .fillMaxWidth() | ||
| .background(brush = | ||
| Brush.linearGradient(colors = | ||
| listOf(Color(0xFFD3EEFF), Color(0xFFF6FAFF)))) | ||
| ) | ||
| Image( | ||
| painter = painterResource(R.drawable.ic_music_notes), | ||
| contentDescription = "", | ||
|
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. Mark decorative images as non-accessibility elements. At Lines 42/47/53/75/81, use Suggested patch- contentDescription = "",
+ contentDescription = null,Also applies to: 47-47, 53-53, 75-75, 81-81 🤖 Prompt for AI Agents |
||
| modifier = Modifier.offset(x = 32.dp, y = 181.dp) | ||
| ) | ||
| Image( | ||
| painter = painterResource(R.drawable.ic_trees_back), | ||
| contentDescription = "", | ||
| modifier = Modifier. | ||
| offset(y = 346.dp) | ||
| ) | ||
| Image( | ||
| painter = painterResource(R.drawable.ic_slope), | ||
| contentDescription = "", | ||
| contentScale = ContentScale.FillBounds, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(0.dp) | ||
| .offset(y = 289.dp) | ||
| .graphicsLayer(alpha = 0.99f) | ||
| .drawWithCache { | ||
| onDrawWithContent { | ||
| drawContent() | ||
| drawRect( | ||
| brush = Brush.linearGradient( | ||
| colors = listOf(Color(0xFFF2B5B5), Color(0xFFFBD3D3)), | ||
| start = Offset(0f, 0f), | ||
| end = Offset(0f, size.height)), | ||
| blendMode = BlendMode.SrcAtop | ||
| ) | ||
| } | ||
| }, | ||
| ) | ||
| Image( | ||
| painter = painterResource(R.drawable.ic_trees_front), | ||
| contentDescription = "", | ||
| modifier = Modifier. | ||
| offset(y = 324.dp) | ||
| ) | ||
| Image( | ||
| painter = painterResource(R.drawable.ic_clocktower_day), | ||
| contentDescription = "", | ||
| modifier = Modifier.offset(x = 200.dp, y = 165.dp).height(224.dp).width(164.dp), | ||
| ) | ||
| } | ||
| } | ||
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/chimes-android
Length of output: 762
Remove duplicate graphics dependency and verify nonstandard room group.
Line 50 (
libs.androidx.ui.graphics) duplicates an existing graphics dependency—bothandroidx-compose-ui-graphicsandandroidx-ui-graphicsresolve to the same moduleandroidx.compose.ui:ui-graphics. Remove one or consolidate the imports.Line 51 uses a nonstandard library group:
androidx-room3-runtimemaps toandroidx.room3:room3-runtime, but the correct androidx.room group isandroidx.room, notandroidx.room3. Verify this is intentional or correct the version catalog entry.🤖 Prompt for AI Agents