Fix home pull to refresh when empty.
This commit is contained in:
parent
76d3e64f41
commit
d916356653
3 changed files with 6 additions and 5 deletions
|
|
@ -31,7 +31,7 @@ class BooksViewModel @Inject constructor(
|
||||||
val updateError: Flow<BookUpdateErrorUio> get() = _updateError
|
val updateError: Flow<BookUpdateErrorUio> get() = _updateError
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// updateBooks()
|
updateBooks()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateBooks() {
|
fun updateBooks() {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.pixelized.biblib.ui.screen.home.page.books
|
package com.pixelized.biblib.ui.screen.home.page.books
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
@ -42,6 +39,7 @@ private fun BooksPageContent(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
contentPadding = PaddingValues(
|
contentPadding = PaddingValues(
|
||||||
top = MaterialTheme.bibLib.dimen.thumbnail.padding,
|
top = MaterialTheme.bibLib.dimen.thumbnail.padding,
|
||||||
bottom = MaterialTheme.bibLib.dimen.thumbnail.padding + navigationBarsHeight(),
|
bottom = MaterialTheme.bibLib.dimen.thumbnail.padding + navigationBarsHeight(),
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,13 @@ import android.content.res.Configuration.UI_MODE_NIGHT_YES
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
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.GridCells
|
||||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.paging.compose.LazyPagingItems
|
import androidx.paging.compose.LazyPagingItems
|
||||||
|
|
@ -43,6 +45,7 @@ private fun NewsPageContent(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
LazyVerticalGrid(
|
LazyVerticalGrid(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
columns = GridCells.Fixed(2),
|
columns = GridCells.Fixed(2),
|
||||||
contentPadding = PaddingValues(
|
contentPadding = PaddingValues(
|
||||||
start = MaterialTheme.bibLib.dimen.thumbnail.padding,
|
start = MaterialTheme.bibLib.dimen.thumbnail.padding,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue