Merge pull request 'Ajout IServices avec ServicesStub et ServicesApi' (#19) from service into master

Reviewed-on: #19
pull/21/head
Leni BEAULATON 2 months ago
commit 5d5af2b1d8

@ -0,0 +1,16 @@
package com.example.what_the_fantasy.data.services
interface IServices {
fun EditUsername(username : String)
fun EditEmail(email : String)
fun EditPasswd(passwd : String, passwdValid : String)
fun EditImage(imageURL : String)
fun CreateUser(username : String, email : String, passwd : String, imageURL: String)
fun getFavorite(username: String)
fun SearchQuote(quote : String)
}

@ -0,0 +1,31 @@
package com.example.what_the_fantasy.data.services
class ServicesAPI : IServices {
override fun EditUsername(username: String) {
TODO("Not yet implemented")
}
override fun EditEmail(email: String) {
TODO("Not yet implemented")
}
override fun EditPasswd(passwd: String, passwdValid: String) {
TODO("Not yet implemented")
}
override fun EditImage(imageURL: String) {
TODO("Not yet implemented")
}
override fun CreateUser(username: String, email: String, passwd: String, imageURL: String) {
TODO("Not yet implemented")
}
override fun SearchQuote(quote: String) {
TODO("Not yet implemented")
}
override fun getFavorite(username: String) {
TODO("Not yet implemented")
}
}

@ -0,0 +1,31 @@
package com.example.what_the_fantasy.data.services
class ServicesStub : IServices {
override fun EditUsername(username: String) {
TODO("Not yet implemented")
}
override fun EditEmail(email: String) {
TODO("Not yet implemented")
}
override fun EditPasswd(passwd: String, passwdValid: String) {
TODO("Not yet implemented")
}
override fun EditImage(imageURL: String) {
TODO("Not yet implemented")
}
override fun CreateUser(username: String, email: String, passwd: String, imageURL: String) {
TODO("Not yet implemented")
}
override fun SearchQuote(quote: String) {
TODO("Not yet implemented")
}
override fun getFavorite(username: String) {
TODO("Not yet implemented")
}
}

@ -79,8 +79,6 @@ fun LoginPage(navControllerSignUp: () -> Unit, navControllerProfil: (Int) -> Uni
}
@Composable
fun IdentifiantTextField(textIdentifiantResId : Int) : String{
val textIdentifiant = stringResource(id = textIdentifiantResId)

@ -65,16 +65,13 @@ import com.example.what_the_fantasy.ui.components.ErrorMessageProfileComponent
import com.example.what_the_fantasy.ui.components.SpaceHeightComponent
import com.example.what_the_fantasy.ui.components.TitlePageComponent
import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme
import com.example.what_the_fantasy.ui.theme.gradienBox
@Composable
fun ProfilPage(index: Int, navController: NavController) {
val gradient = Brush.linearGradient(
colors = listOf(Color(0xFF7B1FA2), Color(0xFF311B92)), // Violet clair → Violet foncé
start = Offset(0f, 1000f), // Départ en bas à gauche
end = Offset(1000f, 0f) // Fin en haut à droite
)
val user = UserStub.allUsers
//val index = 2 // Pour changer l'utilisateur pour le moment
val userList = UserStub.allUsers
val user = userList[index]
Box(
modifier = Modifier
@ -87,7 +84,7 @@ fun ProfilPage(index: Int, navController: NavController) {
.fillMaxWidth(0.9f)
.padding(20.dp)
.clip(RoundedCornerShape(16.dp))
.background(gradient)
.background(gradienBox)
.padding(20.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
@ -97,13 +94,13 @@ fun ProfilPage(index: Int, navController: NavController) {
SpaceHeightComponent(16)
// Image de profil
ImageProfil(user[index].imgUrl, 120, 2, Color.White)
ImageProfil(user.imgUrl, 120)
SpaceHeightComponent(16)
EditUsername(user[index].username)// Édition du Username
EditUsername(user.username)// Édition du Username
SpaceHeightComponent(16)
EditEmail(user[index].email)// Édition du Email
EditEmail(user.email)// Édition du Email
Spacer(modifier = Modifier.height(8.dp))
EditPasswd()
@ -122,7 +119,7 @@ fun ProfilPage(index: Int, navController: NavController) {
@Composable
fun ImageProfil(imgProfil : String, size :Int, sizeBorber : Int, colorBorder : Color){
fun ImageProfil(imgProfil : String, size :Int){
AsyncImage(
model = imgProfil,

Loading…
Cancel
Save