From 1dd62af188b49586413ad41857be456c856c17dd Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 29 Mar 2023 22:53:58 -0400 Subject: [PATCH] Ensure EmptyScreen is scrollable Also fix padding for loading/empty states in BrowseSourceScreen --- .../eu/kanade/presentation/browse/BrowseSourceScreen.kt | 5 ++++- .../tachiyomi/presentation/core/screens/EmptyScreen.kt | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt index cd645874fc..453f4735af 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt @@ -78,6 +78,7 @@ fun BrowseSourceContent( if (mangaList.itemCount <= 0 && errorState != null && errorState is LoadState.Error) { EmptyScreen( + modifier = Modifier.padding(contentPadding), message = getErrorMessage(errorState), actions = if (source is LocalSource) { listOf( @@ -112,7 +113,9 @@ fun BrowseSourceContent( } if (mangaList.itemCount == 0 && mangaList.loadState.refresh is LoadState.Loading) { - LoadingScreen() + LoadingScreen( + modifier = Modifier.padding(contentPadding), + ) return } diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/screens/EmptyScreen.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/screens/EmptyScreen.kt index 80265cd815..c7ca184ec4 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/screens/EmptyScreen.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/screens/EmptyScreen.kt @@ -9,6 +9,8 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.paddingFromBaseline +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -54,6 +56,7 @@ fun EmptyScreen( Column( modifier = modifier .fillMaxSize() + .verticalScroll(rememberScrollState()) .padding(horizontal = 24.dp), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, @@ -66,7 +69,9 @@ fun EmptyScreen( Text( text = message, - modifier = Modifier.paddingFromBaseline(top = 24.dp).secondaryItemAlpha(), + modifier = Modifier + .paddingFromBaseline(top = 24.dp) + .secondaryItemAlpha(), style = MaterialTheme.typography.bodyMedium, textAlign = TextAlign.Center, )