|
|
@ -61,6 +61,7 @@ fun ProfilPage(index: Int,
|
|
|
|
navAccueil: (Int) -> Unit,
|
|
|
|
navAccueil: (Int) -> Unit,
|
|
|
|
navQuiz: (Int) -> Unit,
|
|
|
|
navQuiz: (Int) -> Unit,
|
|
|
|
navUnLog: () -> Unit,
|
|
|
|
navUnLog: () -> Unit,
|
|
|
|
|
|
|
|
navSubmitQuote: () -> Unit,
|
|
|
|
services: IServices
|
|
|
|
services: IServices
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
val user = services.getUserById(index) ?: return
|
|
|
|
val user = services.getUserById(index) ?: return
|
|
|
@ -84,13 +85,13 @@ fun ProfilPage(index: Int,
|
|
|
|
.fillMaxWidth(0.9f)
|
|
|
|
.fillMaxWidth(0.9f)
|
|
|
|
.padding(20.dp)
|
|
|
|
.padding(20.dp)
|
|
|
|
.clip(RoundedCornerShape(16.dp))
|
|
|
|
.clip(RoundedCornerShape(16.dp))
|
|
|
|
.background(MaterialTheme.colorScheme.primary)
|
|
|
|
.background(MaterialTheme.colorScheme.onPrimary)
|
|
|
|
.padding(20.dp),
|
|
|
|
.padding(20.dp),
|
|
|
|
horizontalAlignment = Alignment.CenterHorizontally
|
|
|
|
horizontalAlignment = Alignment.CenterHorizontally
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
|
// Titre
|
|
|
|
// Titre
|
|
|
|
TitlePageComponent(R.string.titleProfile, MaterialTheme.colorScheme.onPrimary)
|
|
|
|
TitlePageComponent(R.string.titleProfile, Color.White)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
|
|
|
|
|
|
|
|
// Image de profil
|
|
|
|
// Image de profil
|
|
|
@ -207,12 +208,12 @@ fun DisplayEmail(email: String, onEdit: () -> Unit) {
|
|
|
|
text = email,
|
|
|
|
text = email,
|
|
|
|
fontSize = 18.sp,
|
|
|
|
fontSize = 18.sp,
|
|
|
|
fontWeight = FontWeight.Bold,
|
|
|
|
fontWeight = FontWeight.Bold,
|
|
|
|
color = MaterialTheme.colorScheme.onPrimary
|
|
|
|
color = MaterialTheme.colorScheme.primary
|
|
|
|
)
|
|
|
|
)
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
imageVector = Icons.Default.Edit,
|
|
|
|
imageVector = Icons.Default.Edit,
|
|
|
|
contentDescription = "Modifier",
|
|
|
|
contentDescription = "Modifier",
|
|
|
|
tint = MaterialTheme.colorScheme.onPrimary,
|
|
|
|
tint = MaterialTheme.colorScheme.primary,
|
|
|
|
modifier = Modifier.size(16.dp).padding(start = 8.dp)
|
|
|
|
modifier = Modifier.size(16.dp).padding(start = 8.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -250,7 +251,7 @@ fun UsernameEditingField(
|
|
|
|
value = username,
|
|
|
|
value = username,
|
|
|
|
onValueChange = onUsernameChange,
|
|
|
|
onValueChange = onUsernameChange,
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
textStyle = TextStyle(color = MaterialTheme.colorScheme.onPrimary, fontSize = 18.sp),
|
|
|
|
textStyle = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 18.sp),
|
|
|
|
singleLine = true,
|
|
|
|
singleLine = true,
|
|
|
|
keyboardOptions = KeyboardOptions.Default.copy(
|
|
|
|
keyboardOptions = KeyboardOptions.Default.copy(
|
|
|
|
imeAction = ImeAction.Done
|
|
|
|
imeAction = ImeAction.Done
|
|
|
@ -276,12 +277,12 @@ fun DisplayUsername(username: String, onEdit: () -> Unit) {
|
|
|
|
text = username,
|
|
|
|
text = username,
|
|
|
|
fontSize = 18.sp,
|
|
|
|
fontSize = 18.sp,
|
|
|
|
fontWeight = FontWeight.Bold,
|
|
|
|
fontWeight = FontWeight.Bold,
|
|
|
|
color = MaterialTheme.colorScheme.onPrimary
|
|
|
|
color = MaterialTheme.colorScheme.primary
|
|
|
|
)
|
|
|
|
)
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
imageVector = Icons.Default.Edit,
|
|
|
|
imageVector = Icons.Default.Edit,
|
|
|
|
contentDescription = "Modifier",
|
|
|
|
contentDescription = "Modifier",
|
|
|
|
tint = MaterialTheme.colorScheme.onPrimary,
|
|
|
|
tint = MaterialTheme.colorScheme.primary,
|
|
|
|
modifier = Modifier.size(16.dp).padding(start = 8.dp)
|
|
|
|
modifier = Modifier.size(16.dp).padding(start = 8.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -387,7 +388,7 @@ fun PasswordTextField(
|
|
|
|
onValueChange = onValueChange,
|
|
|
|
onValueChange = onValueChange,
|
|
|
|
label = { Text(label) },
|
|
|
|
label = { Text(label) },
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
textStyle = TextStyle(color = MaterialTheme.colorScheme.onPrimary, fontSize = 18.sp),
|
|
|
|
textStyle = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 18.sp),
|
|
|
|
singleLine = true,
|
|
|
|
singleLine = true,
|
|
|
|
keyboardOptions = KeyboardOptions.Default.copy(
|
|
|
|
keyboardOptions = KeyboardOptions.Default.copy(
|
|
|
|
keyboardType = KeyboardType.Password,
|
|
|
|
keyboardType = KeyboardType.Password,
|
|
|
@ -472,4 +473,19 @@ fun ButtonLanguage(textResId : Int, size :Int, colorTexte : Color, colorButton :
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Text("${text} (${currentLangage.value})", fontSize = size.sp, color = MaterialTheme.colorScheme.primary)
|
|
|
|
Text("${text} (${currentLangage.value})", fontSize = size.sp, color = MaterialTheme.colorScheme.primary)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
|
|
|
|
fun ButtonProfil(textResId : Int, size :Int, colorTexte : Color, colorButton : Color,navController: () -> Unit){
|
|
|
|
|
|
|
|
val text = stringResource(id = textResId)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Button(
|
|
|
|
|
|
|
|
onClick = {
|
|
|
|
|
|
|
|
navController()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
colors = ButtonDefaults.buttonColors(containerColor = colorButton),
|
|
|
|
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
Text(text, fontSize = size.sp, color = colorTexte)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|