parent
3d130b2504
commit
fdc03b62cf
@ -0,0 +1,168 @@
|
||||
package com.example.what_the_fantasy.ui.screens
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Favorite
|
||||
import androidx.compose.material.icons.filled.FavoriteBorder
|
||||
import androidx.compose.material.icons.filled.MailOutline
|
||||
import androidx.compose.material.icons.filled.Share
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.drawBehind
|
||||
import androidx.compose.ui.geometry.CornerRadius
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.what_the_fantasy.R
|
||||
import coil.compose.AsyncImage
|
||||
import com.example.what_the_fantasy.ui.components.NavBar
|
||||
import com.example.what_the_fantasy.ui.theme.gradienBox
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import com.example.what_the_fantasy.data.model.Character
|
||||
|
||||
|
||||
@Composable
|
||||
fun RecapSubmitPage(
|
||||
index: Int,
|
||||
navFavorite: (Int) -> Unit,
|
||||
navAccueil: (Int) -> Unit,
|
||||
navProfil:(Int) -> Unit,
|
||||
quoteContent : String,
|
||||
character: String,
|
||||
source: String
|
||||
) {
|
||||
NavBar(onQuiz = true,
|
||||
index = index,
|
||||
navControllerFavorite = navFavorite,
|
||||
navControllerAccueil = navAccueil,
|
||||
navControllerProfil = navProfil,
|
||||
navControllerQuiz = { }
|
||||
) {
|
||||
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize().background(Color(0xFF100C1B))
|
||||
) {
|
||||
// Contenu princiapl
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.weight(0.9f)
|
||||
.fillMaxSize()
|
||||
.padding(20.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = "▶ Recap de la citation ◀",
|
||||
color = Color.White,
|
||||
style = TextStyle(
|
||||
fontSize = 25.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
)
|
||||
Spacer(Modifier.height(20.dp))
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.background(brush = gradient, shape = RoundedCornerShape(20.dp))
|
||||
.fillMaxSize()
|
||||
.padding(vertical = 30.dp)
|
||||
.verticalScroll(rememberScrollState()),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Column(modifier = Modifier
|
||||
.padding(15.dp)
|
||||
.drawBehind {
|
||||
drawRoundRect(
|
||||
gradienBox,
|
||||
cornerRadius = CornerRadius(15.dp.toPx()),
|
||||
)
|
||||
}
|
||||
) {
|
||||
Row(modifier = Modifier.padding(15.dp)) {
|
||||
ImageQuote(
|
||||
imageUrl = "https://img.freepik.com/vecteurs-libre/personnage-guerrier-fantaisie_1045-185.jpg?size=338&ext=jpg"
|
||||
)
|
||||
Column {
|
||||
QuoteText(
|
||||
text = '"' + quoteContent + '"'
|
||||
)
|
||||
}
|
||||
}
|
||||
Column(modifier = Modifier
|
||||
.padding(15.dp)
|
||||
.fillMaxWidth()
|
||||
) {
|
||||
InfoQuoteText(
|
||||
nameId = R.string.source,
|
||||
text = source
|
||||
)
|
||||
Text(
|
||||
text = character
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun QuoteText(text: String ){
|
||||
Text(
|
||||
text = text,
|
||||
modifier = Modifier.padding(start = 10.dp, top = 15.dp),
|
||||
fontWeight = FontWeight(1000),
|
||||
fontSize = 20.sp
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ImageQuote(imageUrl : String){
|
||||
AsyncImage(
|
||||
model = imageUrl,
|
||||
contentDescription = "exemple",
|
||||
modifier = Modifier
|
||||
.size(150.dp)
|
||||
.clip(RoundedCornerShape(15.dp))
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun InfoQuoteText(nameId : Int, text : String){
|
||||
Column(modifier = Modifier.padding(bottom = 20.dp)){
|
||||
|
||||
Text(
|
||||
text = text,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight(400),
|
||||
modifier = Modifier
|
||||
.drawBehind {
|
||||
drawRoundRect(
|
||||
Color(255,255,255),
|
||||
cornerRadius = CornerRadius(15.dp.toPx())
|
||||
)
|
||||
}
|
||||
.padding(5.dp),
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Reference in new issue