Skip to content
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

Report Submitted Screen #60

Merged
merged 4 commits into from
Oct 31, 2024
Merged

Conversation

AndrewCheung360
Copy link
Member

Summary of Changes for Issue #59

  • Created screen to show for report submitted
  • Created modified variant of uplift top bar for back button and centered titles
  • Added check mark circle vector asset

Demo

image

Copy link
Collaborator

@thisjustin123 thisjustin123 left a comment

Choose a reason for hiding this comment

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

Something for you to test! Sorry about the delayed review 😭

Comment on lines +42 to +43
onSubmitAnother: () -> Unit = {},
onReturnHome: () -> Unit = {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a TODO to replace with a viewmodel!

Comment on lines 62 to 86
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(26.dp)
) {
Image(
painter = painterResource(id = R.drawable.ic_check_circle),
contentDescription = "Check Circle",
)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(10.dp)
) {
Text(
text = "Thank you for your input!",
fontFamily = montserratFamily,
fontWeight = FontWeight.Bold,
fontSize = 16.sp,
)
Text(
text = "Your report has been submitted.",
fontFamily = montserratFamily,
fontSize = 14.sp,
)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a tad bit difficult to read the nested composables here; please pull this out into a new private fun composable for readability!

Comment on lines 88 to 107
Column(
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
Surface(
color = GRAY01,
shape = RoundedCornerShape(38.dp),
modifier = Modifier
.width(184.dp)
.height(42.dp),
shadowElevation = 2.dp,
onClick = { onSubmitAnother() }
) {
Text(
text = "SUBMIT ANOTHER",
fontFamily = montserratFamily,
fontSize = 14.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
modifier = Modifier.padding(12.dp)
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing with this column, private fun composable plz!

Comment on lines +142 to +146
@Preview(showBackground = true)
@Composable
private fun ReportSubmittedScreenPreview() {
ReportSubmittedScreen()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do want to make sure that this screen looks correct on several device heights. I actually can't really tell how you're centering the text from the composables above, but...

In general, suppose we centered an object on one device by padding some 300.dp padding on top. If you then have a shorter screen, this might cause the object to render actually lower than the middle.

In general, usages of like Modifier.weight(1f) or verticalArrangement achieve a streamlined effect across screen sizes, but I wasn't quite sure if yours was doing anything like that. If you suspect that your code suffers from that problem above, plz fix!

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi, sorry for the disorganized composables, I extracted them into private composables, but the general idea for centering was I used

verticalArrangement = Arrangement.spacedBy(
                60.dp,
                Alignment.CenterVertically
            ),

from the main outermost column to center the inner most composables vertically and then space them apart by 60.dp

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah okay I see, I actually didn't know you could used spacedBy WITH a center vertically... that's awesome!!

Copy link
Collaborator

@thisjustin123 thisjustin123 left a comment

Choose a reason for hiding this comment

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

Looks awesome, really great job structuring the UI! Super impressive that you considered making it screen size invariant :D

Comment on lines +63 to +64
SubmittedMessageColumn()
ButtonsColumn(onSubmitAnother, onReturnHome)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wonderful stuff!!

@AndrewCheung360 AndrewCheung360 merged commit 3e326e5 into main Oct 31, 2024
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.

2 participants