diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/navigations/AppNavigator.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/navigations/AppNavigator.kt index 0f18cb6..57b8e47 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/navigations/AppNavigator.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/navigations/AppNavigator.kt @@ -91,6 +91,7 @@ fun AppNavigator() { navAccueil = { navController.navigate(Accueil(favorite.userIndex)) }, navQuiz = { navController.navigate(QuizMenu(favorite.userIndex)) }, navProfil = { navController.navigate(Profil(favorite.userIndex)) }, + navQuote = { quoteId -> navController.navigate(OneQuote(quoteId,favorite.userIndex)) }, services = services ) } @@ -109,8 +110,8 @@ fun AppNavigator() { services = services ) } - composable { - val quote: Quote = it.toRoute() + composable { + val quote: OneQuote = it.toRoute() QuotePage( quoteId = quote.quoteId, index = quote.userIndex, diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/AccueilPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/AccueilPage.kt index 58abed0..4286524 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/AccueilPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/AccueilPage.kt @@ -1,6 +1,7 @@ package com.example.what_the_fantasy.ui.screens import androidx.compose.foundation.background +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items @@ -31,6 +32,7 @@ fun AccueilPage( navProfil: (Int) -> Unit, navQuote: (Int) -> Unit, services: IServices + ) { var itemCount by remember { mutableStateOf(15) } val dailyQuote = DailyQuoteStub.dailyQuote @@ -78,8 +80,13 @@ fun AccueilPage( ) } items(quotes) { quote -> - if(quote.language == user.language){ - QuoteLittle(quote) + + Column(Modifier.clickable {navQuote(quote.id)} + ) { + if(quote.language == user.language){ + QuoteLittle(quote) + Spacer(modifier = Modifier.height(16.dp)) + } } } if (itemCount < QuoteStub.allQuotes.size) { diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/FavoritePage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/FavoritePage.kt index 1a8cc79..467075d 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/FavoritePage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/FavoritePage.kt @@ -1,6 +1,7 @@ package com.example.what_the_fantasy.ui.screens import androidx.compose.foundation.background +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items @@ -18,6 +19,7 @@ import com.example.what_the_fantasy.data.local.FavoriteStub 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.QuoteLittle +import com.example.what_the_fantasy.ui.navigations.OneQuote import com.example.what_the_fantasy.ui.theme.colorBackground @Composable @@ -26,6 +28,7 @@ fun FavoritePage( navAccueil: (Int) -> Unit, navQuiz: (Int) -> Unit, navProfil: (Int) -> Unit, + navQuote: (Int) -> Unit, services: IServices ) { val user = services.getUserById(index) ?: return @@ -57,7 +60,11 @@ fun FavoritePage( ) } items(quotes) { quote -> - QuoteLittle(quote) + Column (Modifier.clickable { navQuote( quote.id )} ){ + QuoteLittle(quote) + + Spacer(modifier = Modifier.height(16.dp)) + } } } } diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizEndPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizEndPage.kt index 6578b17..491db9a 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizEndPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizEndPage.kt @@ -44,8 +44,7 @@ fun QuizEndPage( navProfil:(Int) -> Unit, navQuiz: (Int) -> Unit, ) { - NavBar(onQuiz = true, - index = index, + NavBar(index = index, navControllerFavorite = navFavorite, navControllerAccueil = navAccueil, navControllerProfil = navProfil, diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizPage.kt index e20a5f2..05fdf2f 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ui/screens/QuizPage.kt @@ -61,8 +61,7 @@ fun QuizPage( if (idCurrentQuestion < questions.size - 1) idCurrentQuestion++ else navControllerQuizEnd(idQuiz, pts) // Retour menu } - NavBar(onQuiz = true, - index = index, + NavBar(index = index, navControllerFavorite = navFavorite, navControllerAccueil = navAccueil, navControllerProfil = navProfil,