parent
cce7424a23
commit
2fae6eb9ad
@ -0,0 +1,67 @@
|
||||
package com.example.what_the_fantasy.ui.components
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import coil.compose.AsyncImage
|
||||
import com.example.what_the_fantasy.R
|
||||
import com.example.what_the_fantasy.ui.theme.gradienBox
|
||||
|
||||
@Composable
|
||||
fun LittleQuoteComponent(imageQuote : String, textQuote : String, dateText : String, TypeText : String, titleText : String, CharacterText : String){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.9f)
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.background(gradienBox)
|
||||
) {
|
||||
val sizeTextInfoQuote = 13
|
||||
val lineHeightText = 12
|
||||
val sizeTextQuote = 16
|
||||
|
||||
AsyncImage(
|
||||
model = imageQuote,
|
||||
contentDescription = "Quote picture",
|
||||
modifier = Modifier
|
||||
.size(130.dp)
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
)
|
||||
Column(modifier = Modifier.padding(10.dp)) {
|
||||
|
||||
TextInfoQuote(
|
||||
textQuote,
|
||||
sizeTextQuote,
|
||||
lineHeightText
|
||||
)
|
||||
|
||||
SpaceHeightComponent(40)
|
||||
|
||||
TextInfoQuote("${stringResource(R.string.dateQuote)} : $dateText", sizeTextInfoQuote, lineHeightText)
|
||||
TextInfoQuote("$TypeText : $titleText", sizeTextInfoQuote, lineHeightText)
|
||||
TextInfoQuote("${stringResource(R.string.CharacterQuote)}: $CharacterText", sizeTextInfoQuote, lineHeightText)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun TextInfoQuote(text : String, fontSizeText : Int, lineHeightText : Int){
|
||||
Text(text,
|
||||
color = Color.White,
|
||||
fontSize = fontSizeText.sp,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
lineHeight = lineHeightText.sp)
|
||||
}
|
Loading…
Reference in new issue