This repository was archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into enhancement-108-creator-view-page-1
- Loading branch information
Showing
12 changed files
with
579 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,13 @@ import com.example.belindas_closet.model.ProductSizePantsWaist | |
import com.example.belindas_closet.model.ProductSizeShoes | ||
import com.example.belindas_closet.model.ProductSizes | ||
import com.example.belindas_closet.model.ProductType | ||
import com.example.belindas_closet.model.User | ||
import com.example.belindas_closet.model.UserRole | ||
|
||
class Datasource { | ||
private val productList = mutableListOf<Product>() | ||
private val userList = mutableListOf<User>() | ||
|
||
|
||
init { | ||
productList.add( | ||
|
@@ -195,9 +199,72 @@ class Datasource { | |
"9" | ||
) | ||
) | ||
|
||
} | ||
init { | ||
|
||
// Adding Users to UserList | ||
userList.add( | ||
User( | ||
userFirstName = "John", | ||
userLastName = "Smith", | ||
userEmail = "[email protected]", | ||
UserRole.ADMIN, | ||
userId = "1" | ||
) | ||
) | ||
userList.add( | ||
User( | ||
userFirstName = "Alex", | ||
userLastName = "Brown", | ||
userEmail = "[email protected]", | ||
UserRole.STANDARD, | ||
userId = "2" | ||
) | ||
) | ||
userList.add( | ||
User( | ||
userFirstName = "Jason", | ||
userLastName = "Ni", | ||
userEmail = "[email protected]", | ||
UserRole.ADMIN, | ||
userId = "3" | ||
) | ||
) | ||
userList.add( | ||
User( | ||
userFirstName = "Kim", | ||
userLastName = "Johnson", | ||
userEmail = "[email protected]", | ||
UserRole.ADMIN, | ||
userId = "4" | ||
) | ||
) | ||
userList.add( | ||
User( | ||
userFirstName = "Ellen", | ||
userLastName = "Jones", | ||
userEmail = "[email protected]", | ||
UserRole.STANDARD, | ||
userId = "5" | ||
) | ||
) | ||
userList.add( | ||
User( | ||
userFirstName = "Taylor", | ||
userLastName = "Wright", | ||
userEmail = "[email protected]", | ||
UserRole.STANDARD, | ||
userId = "6" | ||
) | ||
) | ||
} | ||
|
||
fun loadProducts(): List<Product> { | ||
return productList | ||
} | ||
|
||
fun loadUsers(): List<User> { | ||
return userList | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
app/src/main/java/com/example/belindas_closet/model/User.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.example.belindas_closet.model | ||
|
||
import android.view.View | ||
import com.example.belindas_closet.R | ||
|
||
// saving template of product variables in case of editing user variables similarly | ||
enum class UserRole(val userType: String) { | ||
ADMIN("Admin"), STANDARD("Standard") | ||
} | ||
// | ||
//// Shoes sizes | ||
//enum class UserLastName(val size: Int?) { | ||
// SELECT_SIZE(null), XS(5), S(6), M(7), L(8), XL(9), XXL(10), XXXL(11), XXXXL(12) | ||
//} | ||
// | ||
//// General product sizes | ||
//enum class UserEmail { | ||
// SELECT_SIZE, XXS, XS, S, M, L, XL, XXL, XXXL, XXXXL | ||
//} | ||
// | ||
//// productSizePantsWaist is nullable because not all products have a waist size | ||
//enum class UserRole(val size: Int?) { | ||
// SELECT_SIZE(null), XS(28), S(30), M(32), L(34), XL(36), XXL(38), XXXL(40), XXXXL(42) | ||
//} | ||
|
||
|
||
data class User( | ||
val userFirstName: String, | ||
val userLastName: String, | ||
val userEmail: String, | ||
val userRole: UserRole, | ||
val userId: String = "0" | ||
) { | ||
companion object { | ||
const val userFirstName: String = "User First Name" | ||
const val userLastName: String = "User Last Name" | ||
const val userEmail: String = "[email protected]" | ||
val userRole: UserRole = UserRole.STANDARD | ||
val userId: String ="00" | ||
} | ||
} | ||
|
Oops, something went wrong.