|
|
@ -1,52 +1,88 @@
|
|
|
|
package com.example.what_the_fantasy.ui.screens
|
|
|
|
package com.example.what_the_fantasy.ui.screens
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
|
|
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
|
|
|
|
import androidx.compose.ui.draw.clip
|
|
|
|
import androidx.compose.ui.draw.drawBehind
|
|
|
|
import androidx.compose.ui.draw.drawBehind
|
|
|
|
import androidx.compose.ui.geometry.CornerRadius
|
|
|
|
import androidx.compose.ui.geometry.CornerRadius
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
|
|
|
|
import androidx.compose.ui.text.font.FontWeight
|
|
|
|
|
|
|
|
import androidx.compose.ui.unit.TextUnit
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import com.example.what_the_fantasy.R
|
|
|
|
import com.example.what_the_fantasy.R
|
|
|
|
import com.example.what_the_fantasy.data.model.Quote
|
|
|
|
import com.example.what_the_fantasy.data.model.Quote
|
|
|
|
|
|
|
|
import coil.compose.AsyncImage
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun QuotePage(quote : Quote) {
|
|
|
|
fun QuotePage(quote : Quote) {
|
|
|
|
Column(modifier = Modifier.padding(10.dp).drawBehind {
|
|
|
|
// Column (modifier = Modifier.padding(15.dp).drawBehind {
|
|
|
|
drawRoundRect(
|
|
|
|
// drawRoundRect(
|
|
|
|
Color(70,190,115),
|
|
|
|
// Color(70,190,115),
|
|
|
|
cornerRadius = CornerRadius(10.dp.toPx())
|
|
|
|
// cornerRadius = CornerRadius(15.dp.toPx()),
|
|
|
|
)
|
|
|
|
// )
|
|
|
|
}.size(500.dp, 600.dp))
|
|
|
|
// }.size(500.dp, 600.dp))
|
|
|
|
|
|
|
|
Box
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Text(
|
|
|
|
Row(modifier = Modifier.padding(15.dp)){
|
|
|
|
text = '"'+quote.content+'"'
|
|
|
|
ImageQuote(
|
|
|
|
|
|
|
|
imageUrl = quote.imgUrl
|
|
|
|
)
|
|
|
|
)
|
|
|
|
InfoQuoteText(
|
|
|
|
QuoteText(
|
|
|
|
nameId = R.string.source,
|
|
|
|
text = '"'+quote.content+'"'
|
|
|
|
text = quote.source
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
InfoQuoteText(
|
|
|
|
|
|
|
|
nameId = R.string.charac,
|
|
|
|
|
|
|
|
text = quote.character
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
text = "like : " + quote.likes.toString()
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Column (modifier = Modifier.padding(15.dp)) {
|
|
|
|
|
|
|
|
InfoQuoteText(
|
|
|
|
|
|
|
|
nameId = R.string.source,
|
|
|
|
|
|
|
|
text = quote.source
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
InfoQuoteText(
|
|
|
|
|
|
|
|
nameId = R.string.charac,
|
|
|
|
|
|
|
|
text = quote.character
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
text = "like : " + quote.likes.toString()
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
|
|
|
|
fun QuoteText(text: String ){
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
text = text,
|
|
|
|
|
|
|
|
modifier = Modifier.padding(start = 10.dp, top = 15.dp),
|
|
|
|
|
|
|
|
fontWeight = FontWeight(1000)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
|
|
|
|
fun ImageQuote(imageUrl : String){
|
|
|
|
|
|
|
|
AsyncImage(
|
|
|
|
|
|
|
|
model = imageUrl,
|
|
|
|
|
|
|
|
contentDescription = "Photo de profil",
|
|
|
|
|
|
|
|
modifier = Modifier
|
|
|
|
|
|
|
|
.size(150.dp)
|
|
|
|
|
|
|
|
.clip(RoundedCornerShape(15.dp))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun InfoQuoteText(nameId : Int, text : String){
|
|
|
|
fun InfoQuoteText(nameId : Int, text : String){
|
|
|
|
Column{
|
|
|
|
Column(modifier = Modifier.padding(bottom = 40.dp)){
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = stringResource(id = nameId)
|
|
|
|
text = stringResource(id = nameId),
|
|
|
|
|
|
|
|
fontWeight = FontWeight(500)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
@ -58,7 +94,7 @@ fun InfoQuoteText(nameId : Int, text : String){
|
|
|
|
cornerRadius = CornerRadius(15.dp.toPx())
|
|
|
|
cornerRadius = CornerRadius(15.dp.toPx())
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.padding(5.dp)
|
|
|
|
.padding(5.dp),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|