|
|
@ -1,59 +1,87 @@
|
|
|
|
package com.example.what_the_fantasy.ui.components
|
|
|
|
package com.example.what_the_fantasy.ui.components
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.compose.foundation.Image
|
|
|
|
|
|
|
|
import androidx.compose.foundation.background
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Spacer
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
|
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.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.draw.drawBehind
|
|
|
|
import androidx.compose.ui.draw.clip
|
|
|
|
import androidx.compose.ui.geometry.CornerRadius
|
|
|
|
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
|
|
|
|
|
import androidx.compose.ui.layout.ContentScale
|
|
|
|
|
|
|
|
import androidx.compose.ui.text.style.TextOverflow
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
|
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
|
|
|
|
|
import coil.compose.rememberAsyncImagePainter
|
|
|
|
|
|
|
|
import coil.compose.rememberImagePainter
|
|
|
|
import com.example.what_the_fantasy.data.model.Quote
|
|
|
|
import com.example.what_the_fantasy.data.model.Quote
|
|
|
|
|
|
|
|
import com.example.what_the_fantasy.ui.theme.colorBackground
|
|
|
|
|
|
|
|
import com.example.what_the_fantasy.ui.theme.gradienBox
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun QuoteLittle(quote: Quote, modifier: Modifier) {
|
|
|
|
fun QuoteLittle(quote: Quote, modifier: Modifier = Modifier) {
|
|
|
|
Column(modifier = modifier.padding(10.dp).drawBehind {
|
|
|
|
Row(
|
|
|
|
drawRoundRect(
|
|
|
|
modifier = modifier
|
|
|
|
Color(70,190,115),
|
|
|
|
.fillMaxWidth()
|
|
|
|
cornerRadius = CornerRadius(10.dp.toPx())
|
|
|
|
.padding(8.dp)
|
|
|
|
)
|
|
|
|
.clip(RoundedCornerShape(16.dp))
|
|
|
|
}.size(500.dp, 600.dp))
|
|
|
|
.background(colorBackground)
|
|
|
|
{
|
|
|
|
) {
|
|
|
|
Text(
|
|
|
|
Image(
|
|
|
|
text = '"'+quote.content+'"'
|
|
|
|
painter = rememberAsyncImagePainter(quote.imgUrl),
|
|
|
|
|
|
|
|
contentDescription = "Character Image",
|
|
|
|
|
|
|
|
contentScale = ContentScale.Crop,
|
|
|
|
|
|
|
|
modifier = Modifier
|
|
|
|
|
|
|
|
.size(width = 135.dp, height = 135.dp)
|
|
|
|
|
|
|
|
.clip(
|
|
|
|
|
|
|
|
RoundedCornerShape(
|
|
|
|
|
|
|
|
topStart = 12.dp,
|
|
|
|
|
|
|
|
bottomStart = 12.dp,
|
|
|
|
|
|
|
|
topEnd = 0.dp,
|
|
|
|
|
|
|
|
bottomEnd = 0.dp
|
|
|
|
)
|
|
|
|
)
|
|
|
|
InfoQuoteText(
|
|
|
|
|
|
|
|
name = "@string/source",
|
|
|
|
|
|
|
|
text = quote.source
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
InfoQuoteText(
|
|
|
|
|
|
|
|
name = "@string/charac",
|
|
|
|
|
|
|
|
text = quote.character
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
Column(
|
|
|
|
fun InfoQuoteText(name : String, text : String){
|
|
|
|
modifier = Modifier
|
|
|
|
Column{
|
|
|
|
.weight(1f)
|
|
|
|
|
|
|
|
.height(135.dp)
|
|
|
|
|
|
|
|
.clip(
|
|
|
|
|
|
|
|
RoundedCornerShape(
|
|
|
|
|
|
|
|
topEnd = 12.dp,
|
|
|
|
|
|
|
|
bottomEnd = 12.dp
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.background(gradienBox)
|
|
|
|
|
|
|
|
.padding(12.dp)
|
|
|
|
|
|
|
|
) {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = name
|
|
|
|
text = quote.content,
|
|
|
|
|
|
|
|
color = Color.White,
|
|
|
|
|
|
|
|
fontSize = 16.sp,
|
|
|
|
|
|
|
|
maxLines = 2,
|
|
|
|
|
|
|
|
overflow = TextOverflow.Ellipsis
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(8.dp))
|
|
|
|
|
|
|
|
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = text,
|
|
|
|
text = "Film : ${quote.source}",
|
|
|
|
modifier = Modifier
|
|
|
|
color = Color.White,
|
|
|
|
.drawBehind {
|
|
|
|
fontSize = 12.sp
|
|
|
|
drawRoundRect(
|
|
|
|
|
|
|
|
Color(255,255,255),
|
|
|
|
|
|
|
|
cornerRadius = CornerRadius(15.dp.toPx())
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
Text(
|
|
|
|
.padding(5.dp)
|
|
|
|
text = "Personnage : ${quote.character}",
|
|
|
|
|
|
|
|
color = Color.White,
|
|
|
|
|
|
|
|
fontSize = 12.sp
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|