diff --git a/What_The_Fantasy/app/build.gradle.kts b/What_The_Fantasy/app/build.gradle.kts index 994366b..e884189 100644 --- a/What_The_Fantasy/app/build.gradle.kts +++ b/What_The_Fantasy/app/build.gradle.kts @@ -68,4 +68,6 @@ dependencies { androidTestImplementation(libs.androidx.ui.test.junit4) debugImplementation(libs.androidx.ui.tooling) debugImplementation(libs.androidx.ui.test.manifest) + implementation(libs.coil.compose) + } \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt index de8c577..7d287df 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/ProfilPage.kt @@ -56,6 +56,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.NavController +import coil.compose.AsyncImage 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 @@ -69,7 +70,7 @@ fun ProfilPage() { end = Offset(1000f, 0f) // Fin en haut à droite ) val user = UserStub.allUsers - val index = 5 // Pour changer l'utilisateur pour le moment + val index = 2 // Pour changer l'utilisateur pour le moment Box( modifier = Modifier @@ -139,15 +140,14 @@ fun TitleProfil(titleResId : Int, size : Int, color : Color){ @Composable fun ImageProfil(imgProfil : String, size :Int, sizeBorber : Int, colorBorder : Color){ - - Image( - painter = painterResource(imgProfil), + AsyncImage( + model = imgProfil, contentDescription = "Photo de profil", modifier = Modifier .size(size.dp) .clip(CircleShape) - .border(sizeBorber.dp, colorBorder, CircleShape) ) + } diff --git a/What_The_Fantasy/gradle/libs.versions.toml b/What_The_Fantasy/gradle/libs.versions.toml index 302bb60..251a75f 100644 --- a/What_The_Fantasy/gradle/libs.versions.toml +++ b/What_The_Fantasy/gradle/libs.versions.toml @@ -1,5 +1,6 @@ [versions] agp = "8.6.0" +coilCompose = "2.2.1" kotlin = "1.9.0" coreKtx = "1.10.1" junit = "4.13.2" @@ -13,6 +14,7 @@ navigationCommonAndroid = "2.9.0-alpha05" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coilCompose" } junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }