Stub en cours pour la page profil, pb pour l'image url

pull/12/head
Leni BEAULATON 2 months ago
parent 773c40bfa6
commit d102a7f3d8

@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"

@ -32,8 +32,8 @@ class MainActivity : ComponentActivity() {
}
}
//AppNavigator() // Accès à la page login et SingUp (pour le moment)
//ProfilPage() //Accès à la page profil
QuizPage()
ProfilPage() //Accès à la page profil
//QuizPage()
}
}
}

@ -1,6 +1,8 @@
package com.example.what_the_fantasy.ui.screens
import android.content.Context
import android.os.Bundle
import android.widget.ImageView
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
@ -55,6 +57,8 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.example.what_the_fantasy.R
import com.example.what_the_fantasy.data.local.QuestionStub
import com.example.what_the_fantasy.data.local.UserStub
import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme
@Composable
@ -64,6 +68,8 @@ fun ProfilPage() {
start = Offset(0f, 1000f), // Départ en bas à gauche
end = Offset(1000f, 0f) // Fin en haut à droite
)
val user = UserStub.allUsers
val index = 5 // Pour changer l'utilisateur pour le moment
Box(
modifier = Modifier
@ -86,16 +92,14 @@ fun ProfilPage() {
SpaceProfil(16)
// Image de profil
val id = R.drawable.ic_launcher_foreground
ImageProfil(id, 120, 2, Color.White)
//val id = R.drawable.ic_launcher_foreground
ImageProfil(user[index].imgUrl, 120, 2, Color.White)
SpaceProfil(16)
EditUsername()// Édition du Username
EditUsername(user[index].username)// Édition du Username
SpaceProfil(16)
EditEmail()// Édition du Email
EditEmail(user[index].email)// Édition du Email
Spacer(modifier = Modifier.height(8.dp))
EditPasswd()
@ -133,7 +137,9 @@ fun TitleProfil(titleResId : Int, size : Int, color : Color){
}
@Composable
fun ImageProfil(imgProfil : Int, size :Int, sizeBorber : Int, colorBorder : Color){
fun ImageProfil(imgProfil : String, size :Int, sizeBorber : Int, colorBorder : Color){
Image(
painter = painterResource(imgProfil),
contentDescription = "Photo de profil",
@ -145,9 +151,11 @@ fun ImageProfil(imgProfil : Int, size :Int, sizeBorber : Int, colorBorder : Colo
}
@Composable
fun EditEmail(){
var email by remember { mutableStateOf("user@example.com") }
fun EditEmail(userEmail : String){
var email by remember { mutableStateOf(userEmail) }
var isEditingEmail by remember { mutableStateOf(false) } // État d'édition
var emailError by remember { mutableStateOf(false) }
@ -207,8 +215,8 @@ fun EditEmail(){
@Composable
fun EditUsername(){
var username by remember { mutableStateOf("Username") }
fun EditUsername(userName : String){
var username by remember { mutableStateOf(userName) }
var isEditingUsername by remember { mutableStateOf(false) } // État d'édition
if (isEditingUsername) {

Loading…
Cancel
Save