From d2b2c9581ba346e2e016f33f4e0ce7b48e9bf6ca Mon Sep 17 00:00:00 2001 From: MuhammadouDrammeh <117953848+MuhammadNSC@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:46:14 -0700 Subject: [PATCH] Added a Contact Us Icon (#277) Co-authored-by: E. Brink <80282265+brinkbrink@users.noreply.github.com> --- .../com/example/belindas_closet/Routes.kt | 4 +- .../belindas_closet/screen/ContactUs.kt | 71 +++++++++++++++++++ .../belindas_closet/screen/DonationInfo.kt | 2 +- .../example/belindas_closet/screen/Home.kt | 20 +++++- .../belindas_closet/screen/ScreenMain.kt | 4 ++ app/src/main/res/values/strings.xml | 5 +- 6 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/example/belindas_closet/screen/ContactUs.kt diff --git a/app/src/main/java/com/example/belindas_closet/Routes.kt b/app/src/main/java/com/example/belindas_closet/Routes.kt index 42eb58af..49112929 100644 --- a/app/src/main/java/com/example/belindas_closet/Routes.kt +++ b/app/src/main/java/com/example/belindas_closet/Routes.kt @@ -15,4 +15,6 @@ sealed class Routes (val route: String) { object CreatorView: Routes("Creator_View") object EditUserRole: Routes("Edit User Role") object DonationInfo: Routes("Donation_Info") -} \ No newline at end of file + object ContactUs: Routes("Contact_Us") + +} diff --git a/app/src/main/java/com/example/belindas_closet/screen/ContactUs.kt b/app/src/main/java/com/example/belindas_closet/screen/ContactUs.kt new file mode 100644 index 00000000..80065a33 --- /dev/null +++ b/app/src/main/java/com/example/belindas_closet/screen/ContactUs.kt @@ -0,0 +1,71 @@ +package com.example.belindas_closet.screen + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.* +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +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.res.stringResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.navigation.NavController +import com.example.belindas_closet.R +import com.example.belindas_closet.Routes + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun ContactUsPage(navController: NavController) { + /* Top app bar with navigation back to Home page */ + TopAppBar( + title = { Text("Home") }, + navigationIcon = { + IconButton( + onClick = { + navController.navigate(Routes.Home.route) + } + ) { + Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "Back") + } + }, + actions = { + IconButton( + onClick = { + } + ) { + Icon(imageVector = Icons.Default.Menu, contentDescription = "Menu") + } + } + ) + + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.Top, + ) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier.fillMaxWidth() + ) { + Spacer(modifier = Modifier.height(75.dp)) + Text( + text = stringResource(id = R.string.contact_us), + style = TextStyle( + fontSize = 30.sp, + fontWeight = FontWeight.Light, + color = if (isSystemInDarkTheme()) Color.White else Color.Black + ), + modifier = Modifier.wrapContentSize() + ) + } + } +} diff --git a/app/src/main/java/com/example/belindas_closet/screen/DonationInfo.kt b/app/src/main/java/com/example/belindas_closet/screen/DonationInfo.kt index a9de3f20..274e4cb6 100644 --- a/app/src/main/java/com/example/belindas_closet/screen/DonationInfo.kt +++ b/app/src/main/java/com/example/belindas_closet/screen/DonationInfo.kt @@ -33,7 +33,7 @@ import com.example.belindas_closet.Routes @Composable fun DonationInfoPage(navController: NavController) { - /* Back arrow that navigates back to Home page */ + /* Back arrow that navigataes back to Home page */ TopAppBar( title = { Text("Home") }, navigationIcon = { diff --git a/app/src/main/java/com/example/belindas_closet/screen/Home.kt b/app/src/main/java/com/example/belindas_closet/screen/Home.kt index a0c6961c..14c403e0 100644 --- a/app/src/main/java/com/example/belindas_closet/screen/Home.kt +++ b/app/src/main/java/com/example/belindas_closet/screen/Home.kt @@ -13,7 +13,10 @@ import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Call import androidx.compose.material.icons.filled.Menu +import androidx.compose.material.icons.filled.Person +import androidx.compose.material.icons.filled.Phone import androidx.compose.material3.Button import androidx.compose.material3.Card import androidx.compose.material3.ExperimentalMaterial3Api @@ -62,21 +65,36 @@ fun HomePage(navController: NavController) { onClick = { navController.navigate(Routes.DonationInfo.route) } - ) { + ) + { Icon( painter = painterResource(R.drawable.info_icon), contentDescription = "Donation Info page", modifier = Modifier.padding(10.dp) ) } + IconButton( + onClick = { + navController.navigate(Routes.ContactUs.route) + } + ) + { + Icon( + imageVector = Icons.Filled.Call, // Use the ContactSupport icon + contentDescription = "Contact Us page", + modifier = Modifier.padding(10.dp) + ) + } IconButton( onClick = { } ) { Icon(imageVector = Icons.Default.Menu, contentDescription = "Menu") } + }, ) + Row( modifier = Modifier .size(75.dp) diff --git a/app/src/main/java/com/example/belindas_closet/screen/ScreenMain.kt b/app/src/main/java/com/example/belindas_closet/screen/ScreenMain.kt index 986ce79c..256c1b41 100644 --- a/app/src/main/java/com/example/belindas_closet/screen/ScreenMain.kt +++ b/app/src/main/java/com/example/belindas_closet/screen/ScreenMain.kt @@ -48,6 +48,10 @@ fun ScreenMain() { composable(Routes.DonationInfo.route) { DonationInfoPage(navController = navController) } + composable(Routes.ContactUs.route) { + ContactUsPage(navController = navController) + } + composable(Routes.CreatorView.route) { CreatorView(navController = navController) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e049dada..0b31ff84 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -79,6 +79,9 @@ Donation Info + + Contact Us + Change Password New Password @@ -91,4 +94,4 @@ User Role Manager - \ No newline at end of file +