From c35948e2e651940394f1422dce5c67e3ffc300e5 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Mon, 3 Mar 2025 10:46:45 +0100 Subject: [PATCH] =?UTF-8?q?d=C3=A9but=20quote=20little?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- What_The_Fantasy/app/build.gradle.kts | 1 + .../what_the_fantasy/ui/components/NavBar.kt | 3 +- .../ui/components/QuoteLittle.kt | 59 +++++++++++++++++++ What_The_Fantasy/gradle/libs.versions.toml | 2 + 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/QuoteLittle.kt diff --git a/What_The_Fantasy/app/build.gradle.kts b/What_The_Fantasy/app/build.gradle.kts index 4b7e70e..a38d9d3 100644 --- a/What_The_Fantasy/app/build.gradle.kts +++ b/What_The_Fantasy/app/build.gradle.kts @@ -61,6 +61,7 @@ dependencies { implementation(libs.androidx.material3) implementation(libs.androidx.navigation.compose) implementation(libs.androidx.navigation.common.android) + implementation(libs.engage.core) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt index 49cc408..fba4a70 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/NavBar.kt @@ -157,5 +157,4 @@ fun ButtonIconPainterInt(img : Painter, name : String, nav : (Int)->Unit,index: .size(60.dp) ) } -} - +} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/QuoteLittle.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/QuoteLittle.kt new file mode 100644 index 0000000..96aca58 --- /dev/null +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/components/QuoteLittle.kt @@ -0,0 +1,59 @@ +package com.example.what_the_fantasy.ui.components + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.drawBehind +import androidx.compose.ui.geometry.CornerRadius +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import com.example.what_the_fantasy.data.model.Quote + +@Composable +fun QuoteLittle(quote: Quote, modifier: Modifier) { + Column(modifier = modifier.padding(10.dp).drawBehind { + drawRoundRect( + Color(70,190,115), + cornerRadius = CornerRadius(10.dp.toPx()) + ) + }.size(500.dp, 600.dp)) + { + Text( + text = '"'+quote.content+'"' + + ) + InfoQuoteText( + name = "@string/source", + text = quote.source + ) + InfoQuoteText( + name = "@string/charac", + text = quote.character + ) + } +} + +@Composable +fun InfoQuoteText(name : String, text : String){ + Column{ + Text( + text = name + ) + + Text( + text = text, + modifier = Modifier + .drawBehind { + drawRoundRect( + Color(255,255,255), + cornerRadius = CornerRadius(15.dp.toPx()) + ) + } + .padding(5.dp) + ) + } +} + diff --git a/What_The_Fantasy/gradle/libs.versions.toml b/What_The_Fantasy/gradle/libs.versions.toml index 258393f..4227d60 100644 --- a/What_The_Fantasy/gradle/libs.versions.toml +++ b/What_The_Fantasy/gradle/libs.versions.toml @@ -13,6 +13,7 @@ activityCompose = "1.8.0" composeBom = "2024.04.01" navigationCompose = "2.8.6" navigationCommonAndroid = "2.9.0-alpha05" +engageCore = "1.5.6" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -34,6 +35,7 @@ androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit androidx-material3 = { group = "androidx.compose.material3", name = "material3" } androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" } androidx-navigation-common-android = { group = "androidx.navigation", name = "navigation-common-android", version.ref = "navigationCommonAndroid" } +engage-core = { group = "com.google.android.engage", name = "engage-core", version.ref = "engageCore" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" }