From 8f588f6dce66f9860178f320650514da3a6adb4a Mon Sep 17 00:00:00 2001 From: vfsfitvnm Date: Thu, 6 Oct 2022 08:29:16 +0200 Subject: [PATCH] Make ShimmerHost do not fillParentMaxSize if continuing --- .../vfsfitvnm/vimusic/ui/screens/searchresult/ItemsPage.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/searchresult/ItemsPage.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/searchresult/ItemsPage.kt index 953e599..72ff325 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/searchresult/ItemsPage.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/searchresult/ItemsPage.kt @@ -103,11 +103,14 @@ inline fun ItemsPage( if (!(itemsPage != null && itemsPage?.continuation == null)) { item(key = "loading") { + val isFirstLoad = itemsPage?.items.isNullOrEmpty() ShimmerHost( modifier = Modifier - .fillParentMaxSize() + .run { + if (isFirstLoad) fillParentMaxSize() else this + } ) { - repeat(if (itemsPage?.items.isNullOrEmpty()) initialPlaceholderCount else continuationPlaceholderCount) { + repeat(if (isFirstLoad) initialPlaceholderCount else continuationPlaceholderCount) { itemPlaceholderContent() } }