Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…oset-android into enhancement-167-edit-user-role-01
  • Loading branch information
Annelisebx committed Nov 25, 2023
2 parents af6453c + 856c1f2 commit 43bf626
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 169 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/belindas_closet/Routes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sealed class Routes (val route: String) {
object AddProduct: Routes("Add Product")
object ForgotPassword: Routes("Forgot Password")
object IndividualProduct: Routes("Individual_Product")
object IndividualProductUpdate: Routes("Individual_Product_Update")
object IndividualProductUpdatePage: Routes("Individual_Product_Update")
object AdminView: Routes("Admin_View")
object EditUserRole: Routes("Edit_User_Role")

Expand Down
235 changes: 79 additions & 156 deletions app/src/main/java/com/example/belindas_closet/data/Datasource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,6 @@ class Datasource {
private val productList = mutableListOf<Product>()

init {
productList.add(
Product(
ProductType.DRESS,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a beautiful dress",
R.drawable.product1.toString(),
"1"
)
)
productList.add(
Product(
ProductType.DRESS,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is ALSO a beautiful dress and everything past this is just content used to test the app!",
R.drawable.product1.toString(),
"2"
)
)
productList.add(
Product(
ProductType.SHOES,
Expand All @@ -54,41 +28,28 @@ class Datasource {
)
productList.add(
Product(
ProductType.PANT,
ProductGender.MALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a pair of pants",
R.drawable.product3.toString(),
"4"
)
)
productList.add(
Product(
ProductType.SHORT_SLEEVE_SHIRT,
ProductType.SHIRTS,
ProductGender.MALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a short sleeve shirt",
R.drawable.product2.toString(),
"5"
"This is a long sleeve shirt",
R.drawable.product5.toString(),
"6"
)
)
productList.add(
Product(
ProductType.LONG_SLEEVE_SHIRT,
ProductType.PANTS,
ProductGender.MALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a long sleeve shirt",
R.drawable.product5.toString(),
"6"
"This is a pair of pants",
R.drawable.product3.toString(),
"4"
)
)
productList.add(
Expand All @@ -106,33 +67,7 @@ class Datasource {
)
productList.add(
Product(
ProductType.TIE,
ProductGender.NON_BINARY,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a tie",
R.drawable.product7.toString(),
"8"
)
)
productList.add(
Product(
ProductType.BELT,
ProductGender.NON_BINARY,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a belt",
R.drawable.product8.toString(),
"9"
)
)
productList.add(
Product(
ProductType.JACKETS,
ProductType.JACKET_BLAZER,
ProductGender.MALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
Expand All @@ -145,131 +80,119 @@ class Datasource {
)
productList.add(
Product(
ProductType.HAT,
ProductGender.NON_BINARY,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a hat",
R.drawable.product10.toString(),
"11"
)
)
productList.add(
Product(
ProductType.SOCKS,
ProductGender.NON_BINARY,
ProductType.DRESS,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a pair of socks",
R.drawable.product11.toString(),
"12"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a beautiful dress",
R.drawable.product1.toString(),
"1"
)
)
productList.add(
Product(
ProductType.HANDBAG,
ProductType.CASUAL_WEAR,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a handbag",
R.drawable.product12.toString(),
"13"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a beautiful sweater",
R.drawable.product16.toString(),
"17"
)
)
productList.add(
Product(
ProductType.SCARF,
ProductGender.NON_BINARY,
ProductType.CASUAL_WEAR,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a scarf",
R.drawable.product13.toString(),
"14"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a beautiful sweater vest",
R.drawable.product17.toString(),
"18"
)
)
productList.add(
Product(
ProductType.GOWN,
ProductGender.NON_BINARY,
ProductType.SUITS,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a gown",
R.drawable.product14.toString(),
"15"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a nice suit",
R.drawable.product9.toString(),
"10"
)
)
productList.add(
Product(
ProductType.HOODIE,
ProductGender.MALE,
ProductType.ACCESSORIES,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a hoodie",
R.drawable.product15.toString(),
"16"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a handbag",
R.drawable.product12.toString(),
"13"
)
)
productList.add(
Product(
ProductType.SWEATER,
ProductType.ACCESSORIES,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a sweater",
R.drawable.product16.toString(),
"17"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a pair of gloves",
R.drawable.product18.toString(),
"19"
)
)
productList.add(
Product(
ProductType.VEST,
ProductGender.MALE,
ProductType.ACCESSORIES,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a vest",
R.drawable.product17.toString(),
"18"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a scarf",
R.drawable.product13.toString(),
"14"
)
)
productList.add(
Product(
ProductType.OTHER,
ProductGender.NON_BINARY,
ProductType.ACCESSORIES,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a pair of gloves",
R.drawable.product18.toString(),
"19"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a tie",
R.drawable.product7.toString(),
"8"
)
)
productList.add(
Product(
ProductType.BELT,
ProductGender.NON_BINARY,
ProductType.ACCESSORIES,
ProductGender.FEMALE,
ProductSizeShoes.SELECT_SIZE,
ProductSizes.M,
ProductSizePantsWaist.M,
ProductSizePantsInseam.M,
"This is a belt with no image yet",
id = "20"
ProductSizes.XS,
ProductSizePantsWaist.XS,
ProductSizePantsInseam.XS,
"This is a belt",
R.drawable.product8.toString(),
"9"
)
)
}
Expand Down
12 changes: 3 additions & 9 deletions app/src/main/java/com/example/belindas_closet/model/Product.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ package com.example.belindas_closet.model
import com.example.belindas_closet.R

enum class ProductType(val type: String, val image: Int = R.drawable.placeholder) {
SHOES("Shoes"), LONG_SLEEVE_SHIRT("Long Sleeve Shirt"), SHORT_SLEEVE_SHIRT("Short Sleeve Shirt"), PANT(
"Pant"
),
SKIRT("Skirt"), TIE("Tie"), BELT("Belt"), JACKETS("Jackets"), DRESS("Dress"), HAT("Hat"), SOCKS(
"Socks"
),
HANDBAG("Handbag"), SCARF("Scarf"), GOWN("Gown"), HOODIE("Hoodie"), SWEATER("Sweater"), VEST("Vest"), OTHER(
"Other"
)
SHOES("Shoes"), SHIRTS("Shirts"), PANTS("Pants"),
SKIRT("Skirt"), JACKET_BLAZER("Jacket/Blazer"), DRESS("Dress"),
CASUAL_WEAR("Casual Wear"), SUITS("Suits"), ACCESSORIES("Accessories")
}

enum class ProductGender {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ fun DisplayNewProduct(newProduct: Product) {
// else show product size
if (newProduct.productType == ProductType.SHOES) {
Text(text = "Product Shoe Size: ${newProduct.productSizeShoe}")
} else if (newProduct.productType == ProductType.PANT) {
} else if (newProduct.productType == ProductType.PANTS) {
Text(text = "Product Pants Waist Size: ${newProduct.productSizePantsWaist}")
Text(text = "Product Pants Inseam Size: ${newProduct.productSizePantsInseam}")
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
Expand Down Expand Up @@ -73,6 +74,15 @@ fun ForgotPasswordPage(navController: NavHostController) {
) {
Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "Back")
}
},
actions = {
IconButton(
onClick = {
// Handle menu icon click
}
) {
Icon(imageVector = Icons.Default.Menu, contentDescription = "Menu")
}
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fun IndividualProductPage(navController: NavController, productId: String) {
actions = {
IconButton(
onClick = {
navController.navigate(Routes.IndividualProductUpdate.route + "/${productId}")
navController.navigate(Routes.IndividualProductUpdatePage.route + "/$productId")
}
) {
Icon(imageVector = Icons.Default.Edit, contentDescription = "Edit")
Expand Down
Loading

0 comments on commit 43bf626

Please sign in to comment.