Modif Quote page

pull/38/head
kevin.modejar 2 months ago
parent a42951727e
commit 9d214cbe9d

@ -1,7 +1,8 @@
package com.example.what_the_fantasy.ui.screens package com.example.what_the_fantasy.ui.screens
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column 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.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -13,16 +14,24 @@ import com.example.what_the_fantasy.data.model.Quote
@Composable @Composable
fun QuotePage(quote : Quote, modifier: Modifier) { fun QuotePage(quote : Quote, modifier: Modifier) {
Column(modifier = modifier.background(Color.Black)) { Column(modifier = modifier.padding(10.dp).drawBehind {
drawRoundRect(
Color(70,190,115),
cornerRadius = CornerRadius(10.dp.toPx())
)
}.size(500.dp, 600.dp))
{
Text( Text(
text = '"'+quote.content+'"' text = '"'+quote.content+'"'
) )
InfoQuoteText( InfoQuoteText(
text = quote.character name = "@string/source",
text = quote.source
) )
Text( InfoQuoteText(
text = "-" + quote.source name = "@string/charac",
text = quote.character
) )
Text( Text(
text = "like : " + quote.likes.toString() text = "like : " + quote.likes.toString()
@ -32,15 +41,22 @@ fun QuotePage(quote : Quote, modifier: Modifier) {
} }
@Composable @Composable
fun InfoQuoteText(text : String){ fun InfoQuoteText(name : String, text : String){
Text( Column{
text = text, Text(
modifier = Modifier text = name
.drawBehind { )
drawRoundRect(
Color(255,255,255), Text(
cornerRadius = CornerRadius(10.dp.toPx()) text = text,
) modifier = Modifier
} .drawBehind {
) drawRoundRect(
Color(255,255,255),
cornerRadius = CornerRadius(15.dp.toPx())
)
}
.padding(5.dp)
)
}
} }

@ -4,4 +4,6 @@
<string name="movie">Film</string> <string name="movie">Film</string>
<string name="videoGame">Jeu Vidéo</string> <string name="videoGame">Jeu Vidéo</string>
<string name="series">Série</string> <string name="series">Série</string>
<string name="charac">Personnage</string>
<string name="source">Source</string>
</resources> </resources>

@ -3,4 +3,6 @@
<string name="movie">Movie</string> <string name="movie">Movie</string>
<string name="videoGame">Video Game</string> <string name="videoGame">Video Game</string>
<string name="series">Series</string> <string name="series">Series</string>
<string name="charac">Character</string>
<string name="source">Source</string>
</resources> </resources>
Loading…
Cancel
Save