parent
c8f704627b
commit
c35948e2e6
@ -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)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue