parent
94158373fa
commit
bfe8bf5b9d
@ -0,0 +1,218 @@
|
||||
package com.example.what_the_fantasy.ui.screens
|
||||
|
||||
import android.widget.ImageButton
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableDoubleStateOf
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.what_the_fantasy.R
|
||||
|
||||
val gradient = Brush.linearGradient(
|
||||
colors = listOf(Color(0xFF7B1FA2), Color(0xFF311B92)),
|
||||
start = Offset(0f, 1000f),
|
||||
end = Offset(1000f, 0f)
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun QuizEndPage(points : Int, idQuiz : Int) {
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(Color(0xFF100C1B))
|
||||
) {
|
||||
// Bandeau ( Bouton Retour / Bouton Profil / Dark-Light Mode )
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.background(Color(0xFF300052))
|
||||
.height(100.dp)
|
||||
.fillMaxWidth()
|
||||
.padding(20.dp)
|
||||
) {
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
) {
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable { },
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Box {
|
||||
IconButton(
|
||||
onClick = { },
|
||||
modifier = Modifier
|
||||
.align(Alignment.TopStart)
|
||||
.fillMaxHeight()
|
||||
) {
|
||||
Icon(
|
||||
Icons.AutoMirrored.Filled.ArrowBack,
|
||||
contentDescription = "Retour",
|
||||
tint = Color.White)
|
||||
}
|
||||
}
|
||||
Box (
|
||||
modifier = Modifier
|
||||
.background(Color.Yellow, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Image (
|
||||
// Image transparente
|
||||
painter = painterResource(id = R.drawable.quiz),
|
||||
contentDescription = "Back Button"
|
||||
)
|
||||
}
|
||||
Box (
|
||||
modifier = Modifier
|
||||
.background(Color.Yellow, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Image (
|
||||
// Image transparente
|
||||
painter = painterResource(id = R.drawable.quiz),
|
||||
contentDescription = "Back Button"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Titre de la page
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(100.dp)
|
||||
.background(Color.Red),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text (
|
||||
text = "▶ Résultats ◀",
|
||||
color = Color.White,
|
||||
style = TextStyle(
|
||||
fontSize = 25.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
textAlign = TextAlign.Center
|
||||
),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
}
|
||||
|
||||
// Résultat du quiz
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.padding(50.dp)
|
||||
) {
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.background(brush = gradient, shape = RoundedCornerShape(20.dp))
|
||||
.fillMaxHeight()
|
||||
.padding(30.dp)
|
||||
) {
|
||||
Box (
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(50.dp),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text (
|
||||
text = "Quiz N°${idQuiz.toString()}",
|
||||
color = Color.White,
|
||||
style = TextStyle(
|
||||
fontSize = 25.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
textAlign = TextAlign.Center
|
||||
),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Bandeau ( Bouton Likes / Bouton Menu / Bouton Quiz )
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.background(Color(0xFF300052))
|
||||
.height(100.dp)
|
||||
.fillMaxWidth()
|
||||
.padding(20.dp)
|
||||
) {
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
) {
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable { },
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Box (
|
||||
modifier = Modifier
|
||||
.background(Color.Yellow, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Image (
|
||||
// Image transparente
|
||||
painter = painterResource(id = R.drawable.quiz),
|
||||
contentDescription = "Back Button"
|
||||
)
|
||||
}
|
||||
Box (
|
||||
modifier = Modifier
|
||||
.background(Color.Yellow, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Image (
|
||||
// Image transparente
|
||||
painter = painterResource(id = R.drawable.quiz),
|
||||
contentDescription = "Back Button"
|
||||
)
|
||||
}
|
||||
Box (
|
||||
modifier = Modifier
|
||||
.background(Color.Yellow, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Image (
|
||||
// Image transparente
|
||||
painter = painterResource(id = R.drawable.quiz),
|
||||
contentDescription = "Back Button"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue