Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ fun NavigationController(

composable("settings") {
SettingsScreen (
onAboutClick = {navController.navigateSingleTop("about")},
onSupportClick = {navController.navigateSingleTop("support")},
onNotificationsAndPrivacyClick = {navController.navigateSingleTop("notifs_privacy")})
onAboutClick = { navController.navigateSingleTop("about") },
onSupportClick = { navController.navigateSingleTop("support") },
onNotificationsAndPrivacyClick = { navController.navigateSingleTop("notifs_privacy") },
onBackClick = { navController.popBackStack() }
)
}

composable("about") {
AboutScreen()
AboutScreen(onBackClick = { navController.popBackStack() })
}

composable("notifs_privacy") {
Expand All @@ -69,7 +71,7 @@ fun NavigationController(
}

composable("support") {
SupportScreen()
SupportScreen(onBackClick = { navController.popBackStack() })
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ fun HomeScreen(
properties = MapProperties(
isMyLocationEnabled = permissionState.status.isGranted
),
uiSettings = MapUiSettings(zoomControlsEnabled = false, mapToolbarEnabled = false),
uiSettings = MapUiSettings(
zoomControlsEnabled = false,
mapToolbarEnabled = false,
myLocationButtonEnabled = false
),
contentPadding = PaddingValues(
bottom = filterSheetState.sheetVisibleHeightDp.orZeroIfUnspecified()
)
Expand Down Expand Up @@ -615,4 +619,3 @@ private fun HomeScreenSearchBar(

}
}

Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fun RouteScreen(

val keyboardController = LocalSoftwareKeyboardController.current

val lastRoute = routeViewModel.lastRouteFlow.collectAsState().value
val lastRoute = routeViewModel.displayedRouteFlow.collectAsState().value

val startSheetState =
rememberModalBottomSheetState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,27 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.KeyboardArrowLeft
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
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.TransformOrigin
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.cornellappdev.transit.R
import com.cornellappdev.transit.ui.components.SettingsPageItem
import com.cornellappdev.transit.ui.theme.IconGray
import com.cornellappdev.transit.ui.theme.TransitBlue
import com.cornellappdev.transit.ui.theme.robotoFamily
import com.cornellappdev.transit.util.NOTIFICATIONS_ENABLED
Expand All @@ -31,52 +35,65 @@ import com.cornellappdev.transit.util.NOTIFICATIONS_ENABLED
* Composable for Settings Screen, which displays a list of settings options and app information.
* **/
@Composable
fun SettingsScreen(onSupportClick: () -> Unit,
onAboutClick: () -> Unit,
onNotificationsAndPrivacyClick: () -> Unit ){
Column(
modifier = Modifier
.fillMaxSize()
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(10.dp)
)
{
Text(
text = "Settings",
fontSize = 32.sp,
modifier = Modifier.padding(top = 16.dp, start = 16.dp),
fontWeight = FontWeight.Bold,
fontFamily = robotoFamily,
color = TransitBlue,
)

SettingsPageItem(
name = stringResource(R.string.about_text),
description = "Learn more about the team behind the app",
icon = R.drawable.appdev_gray,
onClick = onAboutClick)
HorizontalDivider(thickness = 0.5.dp)
fun SettingsScreen(
onSupportClick: () -> Unit,
onAboutClick: () -> Unit,
onNotificationsAndPrivacyClick: () -> Unit,
onBackClick: () -> Unit
) {
Box(modifier = Modifier.fillMaxSize()) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 8.dp)
.padding(top = 12.dp),
verticalArrangement = Arrangement.spacedBy(10.dp)
) {
IconButton(onClick = onBackClick) {
Icon(
imageVector = Icons.AutoMirrored.Outlined.KeyboardArrowLeft,
contentDescription = "Go back",
tint = IconGray,
modifier = Modifier.size(24.dp)
)
}

// Disable Notifications until implemented
Text(
text = "Settings",
fontSize = 32.sp,
modifier = Modifier.padding(start = 16.dp),
fontWeight = FontWeight.Bold,
fontFamily = robotoFamily,
color = TransitBlue,
)

if (NOTIFICATIONS_ENABLED) {
SettingsPageItem(
name = "Notifications and Privacy",
description = "Manage permissions and analytics",
icon = R.drawable.lock,
onClick = onNotificationsAndPrivacyClick
name = stringResource(R.string.about_text),
description = "Learn more about the team behind the app",
icon = R.drawable.appdev_gray,
onClick = onAboutClick
)
HorizontalDivider(thickness = 0.5.dp)

// Disable Notifications until implemented
if (NOTIFICATIONS_ENABLED) {
SettingsPageItem(
name = "Notifications and Privacy",
description = "Manage permissions and analytics",
icon = R.drawable.lock,
onClick = onNotificationsAndPrivacyClick
)
HorizontalDivider(thickness = 0.5.dp)
}

SettingsPageItem(
name = "Support",
description = "Report issues and contact us",
icon = R.drawable.help_outline,
onClick = onSupportClick
)
}

SettingsPageItem(
name = "Support",
description = "Report issues and contact us",
icon = R.drawable.help_outline,
onClick = onSupportClick
)
}
Box(modifier = Modifier.fillMaxSize()) {
Image(
painter = painterResource(R.drawable.clock_tower),
contentDescription = "Clock Tower",
Expand All @@ -94,5 +111,5 @@ fun SettingsScreen(onSupportClick: () -> Unit,
@Preview(showBackground = true)
@Composable
private fun SettingsScreenPreview() {
SettingsScreen({}, {}, {})
SettingsScreen({}, {}, {}, {})
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.cornellappdev.transit.ui.screens.settings

import android.content.Intent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
Expand All @@ -10,9 +11,12 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.KeyboardArrowLeft
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand All @@ -31,11 +35,14 @@ import androidx.compose.ui.unit.sp
import androidx.core.net.toUri
import com.cornellappdev.transit.R
import com.cornellappdev.transit.ui.components.MemberList
import com.cornellappdev.transit.ui.theme.IconGray
import com.cornellappdev.transit.ui.theme.TransitBlue
import com.cornellappdev.transit.ui.theme.robotoFamily

private val names = mapOf(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: can probably be made into another issue but hardcoded strings like these should ideally be extracted into some sort of strings.xml or constants file instead of living in the screen

"iOS" to listOf(
"Gabriel Castillo",
"Isha Nagireddy",
"Angelina Chen",
"Asen Ou",
"Jayson Hahn",
Expand All @@ -53,6 +60,8 @@ private val names = mapOf(
"Monica Ong"
),
"Android" to listOf(
"Ryan Cheung",
"Abigail Labanok",
"Mihili Herath",
"Jonathan Chen",
"Veronica Starchenko",
Expand All @@ -70,6 +79,7 @@ private val names = mapOf(
"Abdullah Islam"
),
"Design" to listOf(
"Seojin Park",
"Gillian Fang",
"Leah Kim",
"Amy Ge",
Expand All @@ -81,6 +91,8 @@ private val names = mapOf(
"Mind Apivessa"
),
"Marketing" to listOf(
"Maya Levine",
"Nina Zambrano",
"Anvi Savant",
"Christine Tao",
"Luke Stewart",
Expand All @@ -92,6 +104,7 @@ private val names = mapOf(
"Catherine Wei"
),
"Backend" to listOf(
"Wyatt Cox",
"Nicole Qiu",
"Daisy Chang",
"Lauren Ah-Hot",
Expand All @@ -110,16 +123,25 @@ private val names = mapOf(
* Composable for the About Screen of the app, which displays information about team behind it.
*/
@Composable
fun AboutScreen() {
fun AboutScreen(onBackClick: () -> Unit) {
val context = LocalContext.current

Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
)

{
IconButton(onClick = onBackClick) {
Icon(
imageVector = Icons.AutoMirrored.Outlined.KeyboardArrowLeft,
contentDescription = "Go back",
tint = IconGray,
modifier = Modifier.size(24.dp)
)
}

Text(
text = stringResource(R.string.about_text),
fontSize = 32.sp,
Expand Down Expand Up @@ -180,6 +202,7 @@ fun AboutScreen() {
)
MemberList(
listOf(
"Nina Zambrano",
"Anvi Savant",
"Cindy Liang",
"Maxwell Pang",
Expand Down Expand Up @@ -233,5 +256,5 @@ fun AboutScreen() {
@Preview(showBackground = true)
@Composable
private fun PreviewAboutScreen() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: for consistency, should stick with Preview after AboutScreen

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, there's a preview rendering issue here as well.

AboutScreen()
AboutScreen {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.KeyboardArrowLeft
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand All @@ -25,6 +28,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.net.toUri
import com.cornellappdev.transit.R
import com.cornellappdev.transit.ui.theme.IconGray
import com.cornellappdev.transit.ui.theme.TransitBlue
import com.cornellappdev.transit.ui.theme.robotoFamily

Expand All @@ -33,7 +37,7 @@ import com.cornellappdev.transit.ui.theme.robotoFamily
* report issues.
*/
@Composable
fun SupportScreen() {
fun SupportScreen(onBackClick: () -> Unit) {
val context = LocalContext.current
Column(
modifier = Modifier
Expand All @@ -42,6 +46,15 @@ fun SupportScreen() {
verticalArrangement = Arrangement.spacedBy(8.dp)
)
{
IconButton(onClick = onBackClick) {
Icon(
imageVector = Icons.AutoMirrored.Outlined.KeyboardArrowLeft,
contentDescription = "Go back",
tint = IconGray,
modifier = Modifier.size(24.dp)
)
}

Text(
text = "Support",
fontSize = 32.sp,
Expand Down Expand Up @@ -112,5 +125,5 @@ fun SupportScreen() {
@Preview(showBackground = true)
@Composable
fun SupportScreenPreview() {
SupportScreen()
SupportScreen {}
}
Loading