Make ShimmerHost do not fillParentMaxSize if continuing

This commit is contained in:
vfsfitvnm 2022-10-06 08:29:16 +02:00
parent b02192d828
commit 8f588f6dce

View file

@ -103,11 +103,14 @@ inline fun <T : Innertube.Item> ItemsPage(
if (!(itemsPage != null && itemsPage?.continuation == null)) { if (!(itemsPage != null && itemsPage?.continuation == null)) {
item(key = "loading") { item(key = "loading") {
val isFirstLoad = itemsPage?.items.isNullOrEmpty()
ShimmerHost( ShimmerHost(
modifier = Modifier modifier = Modifier
.fillParentMaxSize() .run {
if (isFirstLoad) fillParentMaxSize() else this
}
) { ) {
repeat(if (itemsPage?.items.isNullOrEmpty()) initialPlaceholderCount else continuationPlaceholderCount) { repeat(if (isFirstLoad) initialPlaceholderCount else continuationPlaceholderCount) {
itemPlaceholderContent() itemPlaceholderContent()
} }
} }