Skip to content

Commit

Permalink
Added a Contact Us Icon (#277)
Browse files Browse the repository at this point in the history
Co-authored-by: E. Brink <[email protected]>
  • Loading branch information
MuhammadNSC and brinkbrink authored Apr 24, 2024
1 parent 6dc6700 commit d2b2c95
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/src/main/java/com/example/belindas_closet/Routes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
object ContactUs: Routes("Contact_Us")

}
71 changes: 71 additions & 0 deletions app/src/main/java/com/example/belindas_closet/screen/ContactUs.kt
Original file line number Diff line number Diff line change
@@ -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()
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
20 changes: 19 additions & 1 deletion app/src/main/java/com/example/belindas_closet/screen/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
<!-- DonationInfo Screen Strings -->
<string name="donation_info">Donation Info</string>

<!-- ContactUS Screen Strings -->
<string name="contact_us">Contact Us</string>

<!-- Change Password Screen Strings -->
<string name="change_password_title">Change Password</string>
<string name="change_new_password_label">New Password</string>
Expand All @@ -91,4 +94,4 @@

<!-- Edit User Role Strings -->
<string name="edit_user_role_title">User Role Manager</string>
</resources>
</resources>

0 comments on commit d2b2c95

Please sign in to comment.