Merge QuizUIUX into master

pull/37/head
tomivt 2 months ago
commit 62f6f6d5c3

@ -0,0 +1,126 @@
package com.example.what_the_fantasy.data.local
import com.example.what_the_fantasy.data.model.Quiz
object QuizStub {
val quiz1 = Quiz(
id = 1,
name = "Quiz Seigneur des Anneaux",
questions = listOf(
QuestionStub.question1,
QuestionStub.question4,
QuestionStub.question8,
QuestionStub.question9
),
img = "lotr"
)
val quiz2 = Quiz(
id = 2,
name = "Quiz Harry Potter",
questions = listOf(
QuestionStub.question2,
QuestionStub.question7,
QuestionStub.question10
),
img = "hp"
)
val quiz3 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz4 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz5 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz6 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz7 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz8 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz9 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz10 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val quiz11 = Quiz(
id = 3,
name = "Quiz Divers Fantasy",
questions = listOf(
QuestionStub.question3,
QuestionStub.question5,
QuestionStub.question6
),
img = "quiz"
)
val allQuizzes: List<Quiz> = listOf(quiz1, quiz2, quiz3, quiz4, quiz5, quiz6, quiz7, quiz8, quiz9, quiz10, quiz11)
fun getQuizById(id: Int): Quiz? {
return allQuizzes.find { it.id == id }
}
}

@ -0,0 +1,8 @@
package com.example.what_the_fantasy.data.model
class Quiz (
val id : Int,
val name : String,
val questions : List<Question>,
val img : String
)

@ -18,6 +18,7 @@ import com.example.what_the_fantasy.ui.screens.SignUpPage
import com.example.what_the_fantasy.ui.screens.SubmitQuotePage import com.example.what_the_fantasy.ui.screens.SubmitQuotePage
sealed class Destination(val route: String) { sealed class Destination(val route: String) {
data object Login : Destination("Login") data object Login : Destination("Login")
data object Accueil : Destination("Accueil/{userIndex}") { // Ajout du paramètre userIndex data object Accueil : Destination("Accueil/{userIndex}") { // Ajout du paramètre userIndex
@ -29,20 +30,21 @@ sealed class Destination(val route: String) {
data object Profil : Destination("Profil/{userIndex}") { // Ajout du paramètre userIndex data object Profil : Destination("Profil/{userIndex}") { // Ajout du paramètre userIndex
fun createRoute(userIndex: Int) = "Profil/$userIndex" // Fonction pour créer la route avec l'index fun createRoute(userIndex: Int) = "Profil/$userIndex" // Fonction pour créer la route avec l'index
} }
data object Quote : Destination("Quote")
data object Search : Destination("Search")
data object SignUp : Destination("SignUp")
data object SubmitQuote : Destination("SubmitQuote")
data object QuizMenu : Destination("QuizMenu/{userIndex}") { // Ajout du paramètre userIndex data object QuizMenu : Destination("QuizMenu/{userIndex}") { // Ajout du paramètre userIndex
fun createRoute(userIndex: Int) = "QuizMenu/$userIndex" // Fonction pour créer la route avec l'index fun createRoute(userIndex: Int) = "QuizMenu/$userIndex" // Fonction pour créer la route avec l'index
} }
data object Quiz : Destination("Quiz") data object Quiz : Destination("Quiz/{idQuiz}") {
// Ajout paramètre idQuiz
fun createId(idQuiz : Int) = "Quiz/$idQuiz"
}
data object QuizEnd : Destination("QuizEnd/{idQuiz}/{pts}") { data object QuizEnd : Destination("QuizEnd/{idQuiz}/{pts}") {
// Ajout paramètres idQuiz et pts // Ajout paramètres idQuiz et pts
fun createIdAndPts(idQuiz : Int, pts : Int) = "QuizEnd/$idQuiz/$pts" fun createIdAndPts(idQuiz : Int, pts : Int) = "QuizEnd/$idQuiz/$pts"
} }
data object Quote : Destination("Quote")
data object Search : Destination("Search")
data object SignUp : Destination("SignUp")
data object SubmitQuote : Destination("SubmitQuote")
} }
@Composable @Composable
@ -136,18 +138,23 @@ fun AppNavigator() {
navFavorite = { userIndex -> navFavorite = { userIndex ->
navController.navigate(Destination.Favorite.createRoute(userIndex)) // Passe l'index à Profil navController.navigate(Destination.Favorite.createRoute(userIndex)) // Passe l'index à Profil
}, },
navControllerQuiz = { navController.navigate(Destination.Quiz.route) }, navControllerQuiz = { id ->
navController.navigate(Destination.Quiz.createId(id))
},
navProfil = { userIndex -> navProfil = { userIndex ->
navController.navigate(Destination.Profil.createRoute(userIndex)) // Passe l'index à Profil navController.navigate(Destination.Profil.createRoute(userIndex)) // Passe l'index à Profil
} }
) )
} }
composable(Destination.Quiz.route) { composable(Destination.Quiz.route) { backStackEntry ->
val idQuiz = backStackEntry.arguments?.getString("idQuiz")?.toInt() ?: 0
QuizPage( QuizPage(
navControllerQuizEnd = { idQuiz, pts -> navControllerQuizEnd = { idQuiz, pts ->
navController.navigate(Destination.QuizEnd.createIdAndPts(idQuiz, pts)) navController.navigate(Destination.QuizEnd.createIdAndPts(idQuiz, pts))
}, },
navControllerQuizMenu = { navController.navigate(Destination.QuizMenu.route) } navControllerQuizMenu = { navController.navigate(Destination.QuizMenu.route) },
navControllerMenu = { navController.navigate(Destination.Accueil.route) },
idQuiz
) )
} }
composable(Destination.QuizEnd.route) { backStackEntry -> composable(Destination.QuizEnd.route) { backStackEntry ->
@ -156,7 +163,8 @@ fun AppNavigator() {
QuizEndPage( QuizEndPage(
idQuiz, idQuiz,
pts, pts,
navControllerQuizMenu = { navController.navigate(Destination.QuizMenu.route) } navControllerQuizMenu = { navController.navigate(Destination.QuizMenu.route) },
navControllerMenu = { navController.navigate(Destination.Accueil.route) }
) )
} }
} }

@ -33,29 +33,34 @@ val gradient = Brush.linearGradient(
) )
@Composable @Composable
fun QuizEndPage(idQuiz: Int, points: Int, navControllerQuizMenu: () -> Unit) { fun QuizEndPage(
idQuiz: Int,
points: Int,
navControllerQuizMenu: () -> Unit,
navControllerMenu: () -> Unit
) {
Column( Column(
modifier = Modifier.fillMaxSize().background(Color(0xFF100C1B)) modifier = Modifier.fillMaxSize().background(Color(0xFF100C1B))
) { ) {
// // Bandeau supérieur // Bandeau supérieur
// Row( Row(
// modifier = Modifier modifier = Modifier
// .fillMaxWidth() .fillMaxWidth()
// .weight(0.1f) .weight(0.1f)
// .padding(20.dp), .padding(20.dp),
// horizontalArrangement = Arrangement.SpaceBetween, horizontalArrangement = Arrangement.SpaceBetween,
// verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
// ) { ) {
// Image( Image(
// painter = painterResource(id = R.drawable.profile_icon), painter = painterResource(id = R.drawable.profile_icon),
// contentDescription = "Profil", contentDescription = "Profil",
// modifier = Modifier.size(50.dp) modifier = Modifier.size(50.dp)
// ) )
// Image( Image(
// painter = painterResource(id = R.drawable.toggle), painter = painterResource(id = R.drawable.toggle),
// contentDescription = "Profil" contentDescription = "Profil"
// ) )
// } }
// Contenu principal // Contenu principal
Column( Column(
@ -76,16 +81,16 @@ fun QuizEndPage(idQuiz: Int, points: Int, navControllerQuizMenu: () -> Unit) {
.background(brush = gradient, shape = RoundedCornerShape(20.dp)) .background(brush = gradient, shape = RoundedCornerShape(20.dp))
.padding(30.dp) .padding(30.dp)
.fillMaxSize(), .fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceEvenly
) { ) {
val quiz = QuizStub.getQuizById(idQuiz)
val nbQuestions = quiz?.questions?.size
Text ( Text (
text = "Quiz N°$idQuiz", text = "${quiz?.name}",
color = Color.White, color = Color.White,
style = TextStyle(fontSize = 25.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center) style = TextStyle(fontSize = 25.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center)
) )
val nbQuestions = QuestionStub.allQuestions.size
Text ( Text (
text = "Nombres de Questions : $nbQuestions", text = "Nombres de Questions : $nbQuestions",
color = Color.White, color = Color.White,
@ -96,37 +101,67 @@ fun QuizEndPage(idQuiz: Int, points: Int, navControllerQuizMenu: () -> Unit) {
color = Color.White, color = Color.White,
style = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center) style = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center)
) )
val pourcentage = (points.toDouble() / nbQuestions!!) * 100
val note = when {
pourcentage == 100.0 -> "S"
pourcentage >= 70.0 -> "A"
pourcentage >= 40.0 -> "B"
else -> "C"
}
println("Note obtenue : $note")
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.size(100.dp)
.background(Color.White, shape = RoundedCornerShape(50.dp))
) {
Text(
text = note,
color = Color.Red,
style = TextStyle(
fontSize = 40.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center
)
)
}
} }
} }
// // Bandeau inférieur // Bandeau inférieur
// Row( Row(
// modifier = Modifier modifier = Modifier
// .fillMaxWidth() .fillMaxWidth()
// .weight(0.1f) .weight(0.1f)
// .background(Color(0xFF300052)) .background(Color(0xFF300052))
// .padding(20.dp), .padding(20.dp),
// horizontalArrangement = Arrangement.SpaceAround, horizontalArrangement = Arrangement.SpaceAround,
// verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
// ) { ) {
// // Bouton Likes // Bouton Likes
// Image( Image(
// painter = painterResource(id = R.drawable.like_icon), painter = painterResource(id = R.drawable.like_icon),
// contentDescription = "Bouton", contentDescription = "Bouton",
// modifier = Modifier.size(50.dp) modifier = Modifier.size(50.dp)
// ) )
// // Bouton WhatTheFantasy // Bouton WhatTheFantasy
// Image( Image(
// painter = painterResource(R.drawable.wf_logo), painter = painterResource(R.drawable.wf_logo),
// contentDescription = "Menu Button", contentDescription = "Menu Button",
// Modifier.clickable { navControllerQuizMenu() } Modifier.clickable { navControllerMenu() }
// ) )
// // Bouton Quiz // Bouton Menu Quiz
// Image( Image(
// painter = painterResource(id = R.drawable.quiz_icon), painter = painterResource(id = R.drawable.quiz_icon),
// contentDescription = "Bouton", contentDescription = "Bouton",
// modifier = Modifier.size(50.dp) modifier = Modifier
// ) .size(50.dp)
// } .clickable { navControllerQuizMenu() }
)
}
} }
} }

@ -2,132 +2,162 @@ package com.example.what_the_fantasy.ui.screens
import androidx.compose.foundation.Image import androidx.compose.foundation.Image
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.scrollable
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize 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.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource 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.dp
import androidx.compose.ui.unit.sp
import com.example.what_the_fantasy.R import com.example.what_the_fantasy.R
import com.example.what_the_fantasy.data.local.QuizStub
import com.example.what_the_fantasy.data.services.IServices import com.example.what_the_fantasy.data.services.IServices
import com.example.what_the_fantasy.ui.components.NavBar import com.example.what_the_fantasy.ui.components.NavBar
@Composable @Composable
fun QuizMenu( fun QuizMenu(navControllerQuiz: (Int) -> Unit) {
index: Int,
navFavorite: (Int) -> Unit, Column (
navAccueil: (Int) -> Unit, modifier = Modifier.fillMaxSize().background(Color(0xFF100C1B))
navProfil:(Int) -> Unit,
navControllerQuiz: () -> Unit
) {
NavBar(onQuiz = true,
index = index,
navControllerFavorite = navFavorite,
navControllerAccueil = navAccueil,
navControllerProfil = navProfil,
navControllerQuiz = { }
) { ) {
// Bandeau supérieur
Row( Row(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxWidth()
.background(Color(0xFF100C1B)) .weight(0.1f)
.padding(top = 100.dp) //background(Color(0xFF300052))
.padding(20.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) { ) {
Spacer(modifier = Modifier.weight(0.1f)) Image(
painter = painterResource(id = R.drawable.profile_icon),
contentDescription = "Profil"
)
Image(
painter = painterResource(id = R.drawable.toggle),
contentDescription = "Profil"
)
}
// Contenu princiapl
Column( Column(
modifier = Modifier modifier = Modifier
.weight(0.9f) .weight(0.9f)
.fillMaxHeight(), .fillMaxSize()
.padding(20.dp),
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
Box( Text(
text = "▶ Menu des Quiz ◀",
color = Color.White,
style = TextStyle(fontSize = 25.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center)
)
Spacer(Modifier.height(20.dp))
Column (
modifier = Modifier modifier = Modifier
.size(width = 150.dp, height = 100.dp) .background(brush = gradient, shape = RoundedCornerShape(20.dp))
.padding(8.dp) .fillMaxSize()
.clickable { .padding(vertical = 30.dp)
navControllerQuiz() .verticalScroll(rememberScrollState()),
} horizontalAlignment = Alignment.CenterHorizontally
) { ) {
Image( val quizzes = QuizStub.allQuizzes.chunked(2)
painter = painterResource(id = R.drawable.quiz), val context = LocalContext.current
contentDescription = "Quiz 1", for (rowQuizzes in quizzes) {
modifier = Modifier.fillMaxSize(), Row(
contentScale = ContentScale.Crop modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceEvenly
) {
for (quiz in rowQuizzes) {
val imageResId = context.resources.getIdentifier(
quiz.img,
"drawable",
context.packageName
) )
} Column (
Box(
modifier = Modifier modifier = Modifier
.size(width = 150.dp, height = 100.dp) .size(width = 150.dp, height = 145.dp)
.padding(8.dp) .clickable { navControllerQuiz(quiz.id) },
.clickable {
navControllerQuiz()
}
) { ) {
Image( Image(
painter = painterResource(id = R.drawable.quiz), painter = painterResource(id = imageResId),
contentDescription = "Quiz 2", contentDescription = quiz.name,
modifier = Modifier.fillMaxSize(), modifier = Modifier
.size(width = 150.dp, height = 100.dp)
.clip(shape = RoundedCornerShape(20.dp)),
contentScale = ContentScale.Crop contentScale = ContentScale.Crop
) )
Spacer(Modifier.height(10.dp))
Text(
text = quiz.name,
style = TextStyle(
fontSize = 17.sp,
fontWeight = FontWeight.Medium,
textAlign = TextAlign.Center,
color = Color.White
)
)
} }
} }
Spacer(modifier = Modifier.width(10.dp))
Column(
modifier = Modifier
.weight(0.9f)
.fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Box(
modifier = Modifier
.size(width = 150.dp, height = 100.dp)
.padding(8.dp)
.clickable {
navControllerQuiz()
} }
) { Spacer(Modifier.height(30.dp))
Image( }
painter = painterResource(id = R.drawable.quiz), }
contentDescription = "Quiz 3",
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop
)
} }
Box( // Bandeau inférieur
Row(
modifier = Modifier modifier = Modifier
.size(width = 150.dp, height = 100.dp) .fillMaxWidth()
.padding(8.dp) .weight(0.1f)
.clickable { .background(Color(0xFF300052))
navControllerQuiz() .padding(20.dp),
} horizontalArrangement = Arrangement.SpaceAround,
verticalAlignment = Alignment.CenterVertically
) { ) {
// Bouton Likes
Image( Image(
painter = painterResource(id = R.drawable.quiz), painter = painterResource(id = R.drawable.like_icon),
contentDescription = "Quiz 4", contentDescription = "Bouton"
modifier = Modifier.fillMaxSize(), )
contentScale = ContentScale.Crop // Bouton WhatTheFantasy
Image(
painter = painterResource(R.drawable.wf_logo),
contentDescription = "Menu Button",
Modifier.clickable { }
)
// Bouton Quiz
Image(
painter = painterResource(id = R.drawable.quiz_icon),
contentDescription = "Bouton"
) )
}
}
Spacer(modifier = Modifier.weight(0.1f))
} }
} }
} }

@ -21,13 +21,17 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import com.example.what_the_fantasy.R import com.example.what_the_fantasy.R
import com.example.what_the_fantasy.data.local.QuestionStub import com.example.what_the_fantasy.data.local.QuestionStub
import com.example.what_the_fantasy.data.local.QuizStub
@Composable @Composable
fun QuizPage( fun QuizPage(
navControllerQuizEnd: (Int, Int) -> Unit, navControllerQuizEnd: (Int, Int) -> Unit,
navControllerQuizMenu: () -> Unit navControllerQuizMenu: () -> Unit,
) { navControllerMenu: () -> Unit,
val questions = QuestionStub.allQuestions idQuiz: Int
) {
val quiz = QuizStub.getQuizById(idQuiz)
val questions = quiz?.questions ?: emptyList()
var idCurrentQuestion by remember { mutableIntStateOf(0) } var idCurrentQuestion by remember { mutableIntStateOf(0) }
var pts by remember { mutableIntStateOf(0) } var pts by remember { mutableIntStateOf(0) }
@ -48,31 +52,31 @@ fun QuizPage(
if (answer == correctAnswer) pts++ if (answer == correctAnswer) pts++
if (idCurrentQuestion < questions.size - 1) idCurrentQuestion++ if (idCurrentQuestion < questions.size - 1) idCurrentQuestion++
else navControllerQuizEnd(0, pts) // Retour menu else navControllerQuizEnd(idQuiz, pts) // Retour menu
} }
Column ( Column (
modifier = Modifier.fillMaxSize().background(Color(0xFF100C1B)) modifier = Modifier.fillMaxSize().background(Color(0xFF100C1B))
) { ) {
// // Bandeau supérieur // Bandeau supérieur
// Row( Row(
// modifier = Modifier modifier = Modifier
// .fillMaxWidth() .fillMaxWidth()
// .weight(0.1f) .weight(0.1f)
// //.background(Color(0xFF300052)) //.background(Color(0xFF300052))
// .padding(20.dp), .padding(20.dp),
// horizontalArrangement = Arrangement.SpaceBetween, horizontalArrangement = Arrangement.SpaceBetween,
// verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
// ) { ) {
// Image( Image(
// painter = painterResource(id = R.drawable.profile_icon), painter = painterResource(id = R.drawable.profile_icon),
// contentDescription = "Profil" contentDescription = "Profil"
// ) )
// Image( Image(
// painter = painterResource(id = R.drawable.toggle), painter = painterResource(id = R.drawable.toggle),
// contentDescription = "Profil" contentDescription = "Profil"
// ) )
// } }
// Contenu princiapl // Contenu princiapl
Column( Column(
@ -87,18 +91,21 @@ fun QuizPage(
Column( Column(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {
if (quiz != null) {
Text( Text(
text = "▶ Quiz", text = "${quiz.name}",
color = Color.White, color = Color.White,
style = TextStyle(fontSize = 25.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center) style = TextStyle(fontSize = 20.sp, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center)
) )
}
Spacer(Modifier.height(20.dp))
Column ( Column (
modifier = Modifier modifier = Modifier
.background(brush = gradient, shape = RoundedCornerShape(20.dp)), .background(brush = gradient, shape = RoundedCornerShape(20.dp)),
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
Text( Text(
"Question ${question.id}", "Question ${idCurrentQuestion+1}",
color = Color.White, color = Color.White,
fontSize = 18.sp, fontSize = 18.sp,
modifier = Modifier.padding(top = 20.dp), modifier = Modifier.padding(top = 20.dp),
@ -142,33 +149,33 @@ fun QuizPage(
} }
} }
// // Bandeau inférieur // Bandeau inférieur
// Row( Row(
// modifier = Modifier modifier = Modifier
// .fillMaxWidth() .fillMaxWidth()
// .weight(0.1f) .weight(0.1f)
// .background(Color(0xFF300052)) .background(Color(0xFF300052))
// .padding(20.dp), .padding(20.dp),
// horizontalArrangement = Arrangement.SpaceAround, horizontalArrangement = Arrangement.SpaceAround,
// verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
// ) { ) {
// // Bouton Likes // Bouton Likes
// Image( Image(
// painter = painterResource(id = R.drawable.like_icon), painter = painterResource(id = R.drawable.like_icon),
// contentDescription = "Bouton" contentDescription = "Bouton"
// ) )
// // Bouton WhatTheFantasy // Bouton WhatTheFantasy
// Image( Image(
// painter = painterResource(R.drawable.wf_logo), painter = painterResource(R.drawable.wf_logo),
// contentDescription = "Menu Button", contentDescription = "Menu Button",
// Modifier.clickable { navControllerQuizMenu() } Modifier.clickable { navControllerMenu() }
// ) )
// // Bouton Quiz // Bouton Menu Quiz
// Image( Image(
// painter = painterResource(id = R.drawable.quiz_icon), painter = painterResource(id = R.drawable.quiz_icon),
// contentDescription = "Bouton" contentDescription = "Bouton",
// ) Modifier.clickable { navControllerQuizMenu() }
// } )
}
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Loading…
Cancel
Save