|
|
@ -52,7 +52,7 @@ fun AccueilPage(
|
|
|
|
val titleDalyQuote = stringResource(R.string.TitleHomeDailyQuote)
|
|
|
|
val titleDalyQuote = stringResource(R.string.TitleHomeDailyQuote)
|
|
|
|
val titleSuggestion = stringResource(R.string.TitleHomeSuggestion)
|
|
|
|
val titleSuggestion = stringResource(R.string.TitleHomeSuggestion)
|
|
|
|
|
|
|
|
|
|
|
|
val page = remember { mutableIntStateOf(1) }
|
|
|
|
val page = remember { mutableIntStateOf(0) }
|
|
|
|
val quotes = remember { mutableStateListOf<Quote>() }
|
|
|
|
val quotes = remember { mutableStateListOf<Quote>() }
|
|
|
|
val state = rememberLazyListState()
|
|
|
|
val state = rememberLazyListState()
|
|
|
|
val layoutInfo = remember { derivedStateOf { state.layoutInfo } }
|
|
|
|
val layoutInfo = remember { derivedStateOf { state.layoutInfo } }
|
|
|
@ -61,11 +61,10 @@ fun AccueilPage(
|
|
|
|
val fullyVisibleItemsInfo = visibleItemsInfo.toMutableList()
|
|
|
|
val fullyVisibleItemsInfo = visibleItemsInfo.toMutableList()
|
|
|
|
val lastItem = if (fullyVisibleItemsInfo.isNotEmpty()) fullyVisibleItemsInfo.last() else null
|
|
|
|
val lastItem = if (fullyVisibleItemsInfo.isNotEmpty()) fullyVisibleItemsInfo.last() else null
|
|
|
|
|
|
|
|
|
|
|
|
val dailyQuote = DailyQuoteStub.dailyQuote
|
|
|
|
val dailyQuote = remember { mutableStateOf(Quote(-1,"",0,SrcLanguage.vo,"","","",SrcType.Movie,0)) }
|
|
|
|
//var dailyQuote = remember{ Quote(-1,"",0,SrcLanguage.vo,"","","",SrcType.Movie,0) }
|
|
|
|
LaunchedEffect(true){
|
|
|
|
//LaunchedEffect(true){
|
|
|
|
dailyQuote.value=services.getDalyQuote(currentUserState.langage)
|
|
|
|
// dailyQuote = services.getDalyQuote(currentUserState.langage)
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LaunchedEffect(page.intValue) {
|
|
|
|
LaunchedEffect(page.intValue) {
|
|
|
|
if (!isLoading.value) {
|
|
|
|
if (!isLoading.value) {
|
|
|
@ -101,9 +100,9 @@ fun AccueilPage(
|
|
|
|
.background(MaterialTheme.colorScheme.background)
|
|
|
|
.background(MaterialTheme.colorScheme.background)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
LazyColumn(modifier = Modifier.weight(1f), state = state) {
|
|
|
|
LazyColumn(modifier = Modifier.weight(1f), state = state) {
|
|
|
|
if(dailyQuote.id!=-1) {
|
|
|
|
if(dailyQuote.value.id!=-1) {
|
|
|
|
item {
|
|
|
|
item {
|
|
|
|
Column(Modifier.clickable { navQuote(dailyQuote.id) }) {
|
|
|
|
Column(Modifier.clickable { navQuote(dailyQuote.value.id) }) {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = titleDalyQuote,
|
|
|
|
text = titleDalyQuote,
|
|
|
|
color = MaterialTheme.colorScheme.onBackground,
|
|
|
|
color = MaterialTheme.colorScheme.onBackground,
|
|
|
@ -113,7 +112,7 @@ fun AccueilPage(
|
|
|
|
.padding(16.dp),
|
|
|
|
.padding(16.dp),
|
|
|
|
textAlign = TextAlign.Center
|
|
|
|
textAlign = TextAlign.Center
|
|
|
|
)
|
|
|
|
)
|
|
|
|
QuoteLittle(dailyQuote)
|
|
|
|
QuoteLittle(dailyQuote.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|