|
|
@ -26,7 +26,9 @@ import androidx.compose.foundation.text.KeyboardActions
|
|
|
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
|
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
|
import androidx.compose.material.icons.filled.Check
|
|
|
|
import androidx.compose.material.icons.filled.Check
|
|
|
|
|
|
|
|
import androidx.compose.material.icons.filled.CheckCircle
|
|
|
|
import androidx.compose.material.icons.filled.Edit
|
|
|
|
import androidx.compose.material.icons.filled.Edit
|
|
|
|
|
|
|
|
import androidx.compose.material.icons.rounded.Face
|
|
|
|
import androidx.compose.material3.Button
|
|
|
|
import androidx.compose.material3.Button
|
|
|
|
import androidx.compose.material3.ButtonDefaults
|
|
|
|
import androidx.compose.material3.ButtonDefaults
|
|
|
|
import androidx.compose.material3.Icon
|
|
|
|
import androidx.compose.material3.Icon
|
|
|
@ -105,13 +107,13 @@ fun ProfilPage(index: Int,
|
|
|
|
horizontalAlignment = Alignment.CenterHorizontally
|
|
|
|
horizontalAlignment = Alignment.CenterHorizontally
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
|
// Titre
|
|
|
|
// Titre
|
|
|
|
TitlePageComponent(R.string.titleProfile, 20, Color.White)
|
|
|
|
TitlePageComponent(R.string.titleProfile, 20, Color.White)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
|
|
|
|
|
|
|
|
// Image de profil
|
|
|
|
// Image de profil
|
|
|
|
ImageProfil(user.imgUrl, 120)
|
|
|
|
ImageProfil(user.imgUrl, 120)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
|
|
|
|
|
|
|
|
EditUsername(user.username, index, services)// Édition du Username
|
|
|
|
EditUsername(user.username, index, services)// Édition du Username
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
@ -122,12 +124,12 @@ fun ProfilPage(index: Int,
|
|
|
|
EditPasswd(index, services)
|
|
|
|
EditPasswd(index, services)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
|
|
|
|
|
|
|
|
// Bouton
|
|
|
|
// Bouton
|
|
|
|
ButtonProfile(R.string.ButtonAddQuoteprofile, 18, Color.Black, Color.White,navUnLog) // Pas encore de navigation definie
|
|
|
|
//ButtonProfile(R.string.ButtonAddQuoteprofile, 18, Color.Black, Color.White,navUnLog) // Pas encore de navigation definie
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
//SpaceHeightComponent(16)
|
|
|
|
ButtonProfile(R.string.ButtonLanguageprofile, 18, Color.Black, Color.White,navUnLog) // Pas encore de navigation definie
|
|
|
|
ButtonProfile(R.string.ButtonLanguageprofile, 18, Color.Black, Color.White,navUnLog) // Pas encore de navigation definie
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
ButtonProfile(R.string.ButtonUnlogprofile, 18, Color.Black, Color.White, navUnLog)
|
|
|
|
ButtonProfile(R.string.ButtonUnlogprofile, 18, Color.Black, Color.White, navUnLog)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -199,7 +201,7 @@ fun EmailEditingField(
|
|
|
|
),
|
|
|
|
),
|
|
|
|
trailingIcon = {
|
|
|
|
trailingIcon = {
|
|
|
|
IconButton(onClick = { if (!emailError) onDone() }) {
|
|
|
|
IconButton(onClick = { if (!emailError) onDone() }) {
|
|
|
|
Icon(imageVector = Icons.Default.Check, contentDescription = "Valider")
|
|
|
|
Icon(imageVector = Icons.Default.CheckCircle, contentDescription = "Valider")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isError = emailError
|
|
|
|
isError = emailError
|
|
|
@ -275,7 +277,7 @@ fun UsernameEditingField(
|
|
|
|
),
|
|
|
|
),
|
|
|
|
trailingIcon = {
|
|
|
|
trailingIcon = {
|
|
|
|
IconButton(onClick = { onDone() }) {
|
|
|
|
IconButton(onClick = { onDone() }) {
|
|
|
|
Icon(imageVector = Icons.Default.Check, contentDescription = "Valider")
|
|
|
|
Icon(imageVector = Icons.Default.CheckCircle, contentDescription = "Valider")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -315,7 +317,7 @@ fun EditPasswd(index: Int, service: IServices) {
|
|
|
|
|
|
|
|
|
|
|
|
// Fonction pour finaliser l'édition du mot de passe et appeler la méthode EditPasswd2
|
|
|
|
// Fonction pour finaliser l'édition du mot de passe et appeler la méthode EditPasswd2
|
|
|
|
fun onDoneEditing() {
|
|
|
|
fun onDoneEditing() {
|
|
|
|
// Appeler EditPasswd2 pour mettre à jour le mot de passe de l'utilisateur
|
|
|
|
// Appeler EditPasswd pour mettre à jour le mot de passe de l'utilisateur
|
|
|
|
service.EditPasswd(newPassword, index)
|
|
|
|
service.EditPasswd(newPassword, index)
|
|
|
|
isEditingPassword = false
|
|
|
|
isEditingPassword = false
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -456,11 +458,6 @@ fun DisplayPassword(onEdit: () -> Unit) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun ButtonProfile(textResId : Int, size :Int, colorTexte : Color, colorButton : Color,navController: () -> Unit){
|
|
|
|
fun ButtonProfile(textResId : Int, size :Int, colorTexte : Color, colorButton : Color,navController: () -> Unit){
|
|
|
|
val text = stringResource(id = textResId)
|
|
|
|
val text = stringResource(id = textResId)
|
|
|
|