Fix home pull to refresh when empty.

This commit is contained in:
Thomas Andres Gomez 2022-10-21 18:08:09 +02:00
parent 76d3e64f41
commit d916356653
3 changed files with 6 additions and 5 deletions

View file

@ -31,7 +31,7 @@ class BooksViewModel @Inject constructor(
val updateError: Flow<BookUpdateErrorUio> get() = _updateError
init {
// updateBooks()
updateBooks()
}
fun updateBooks() {

View file

@ -1,9 +1,6 @@
package com.pixelized.biblib.ui.screen.home.page.books
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
@ -42,6 +39,7 @@ private fun BooksPageContent(
val scope = rememberCoroutineScope()
LazyColumn(
modifier = Modifier.fillMaxSize(),
contentPadding = PaddingValues(
top = MaterialTheme.bibLib.dimen.thumbnail.padding,
bottom = MaterialTheme.bibLib.dimen.thumbnail.padding + navigationBarsHeight(),

View file

@ -5,11 +5,13 @@ import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.paging.compose.LazyPagingItems
@ -43,6 +45,7 @@ private fun NewsPageContent(
val scope = rememberCoroutineScope()
LazyVerticalGrid(
modifier = Modifier.fillMaxSize(),
columns = GridCells.Fixed(2),
contentPadding = PaddingValues(
start = MaterialTheme.bibLib.dimen.thumbnail.padding,