|
|
|
@ -29,6 +29,7 @@ import com.example.what_the_fantasy.ui.components.QuoteLittle
|
|
|
|
|
import com.example.what_the_fantasy.ui.states.CurrentUserState
|
|
|
|
|
import com.example.what_the_fantasy.ui.viewModels.CurrentUserViewModel
|
|
|
|
|
import com.example.what_the_fantasy.ui.theme.colorBackground
|
|
|
|
|
import kotlinx.coroutines.awaitAll
|
|
|
|
|
import kotlinx.coroutines.delay
|
|
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
|
|
|
|
|
@ -46,11 +47,6 @@ fun AccueilPage(
|
|
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
val coroutineScope = rememberCoroutineScope()
|
|
|
|
|
val dailyQuote = Quote(-1,"",0,SrcLanguage.vo,"","","",SrcType.Movie,0)
|
|
|
|
|
coroutineScope.launch {
|
|
|
|
|
val dailyQuote = services.getDalyQuote(currentUserState.langage)
|
|
|
|
|
}
|
|
|
|
|
//val dailyQuote = DailyQuoteStub.dailyQuote
|
|
|
|
|
|
|
|
|
|
val titleDalyQuote = stringResource(R.string.TitleHomeDailyQuote)
|
|
|
|
@ -65,6 +61,11 @@ fun AccueilPage(
|
|
|
|
|
val fullyVisibleItemsInfo = visibleItemsInfo.toMutableList()
|
|
|
|
|
val lastItem = if (fullyVisibleItemsInfo.isNotEmpty()) fullyVisibleItemsInfo.last() else null
|
|
|
|
|
|
|
|
|
|
val dailyQuote = DailyQuoteStub.dailyQuote
|
|
|
|
|
//var dailyQuote = remember{ Quote(-1,"",0,SrcLanguage.vo,"","","",SrcType.Movie,0) }
|
|
|
|
|
//LaunchedEffect(true){
|
|
|
|
|
// dailyQuote = services.getDalyQuote(currentUserState.langage)
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
LaunchedEffect(page.intValue) {
|
|
|
|
|
if (!isLoading.value) {
|
|
|
|
@ -114,8 +115,21 @@ fun AccueilPage(
|
|
|
|
|
)
|
|
|
|
|
QuoteLittle(dailyQuote)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
item {
|
|
|
|
|
Box(
|
|
|
|
|
modifier = Modifier
|
|
|
|
|
.fillMaxWidth()
|
|
|
|
|
.padding(16.dp),
|
|
|
|
|
contentAlignment = Alignment.Center
|
|
|
|
|
) {
|
|
|
|
|
CircularProgressIndicator()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
item {
|
|
|
|
|
Text(
|
|
|
|
|
text = titleSuggestion,
|
|
|
|
|
color = MaterialTheme.colorScheme.onBackground,
|
|
|
|
@ -126,7 +140,7 @@ fun AccueilPage(
|
|
|
|
|
textAlign = TextAlign.Center
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
items(quotes) { quote ->
|
|
|
|
|
if (quote.language == currentUserState.langage) {
|
|
|
|
|
Column(Modifier.clickable { navQuote(quote.id ) }) {
|
|
|
|
|