From 45be957df5f7b71430c31b58f87bfee998d295dd Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sat, 6 Apr 2024 13:31:36 +0800 Subject: [PATCH] Workaround for comment list lagging at the bottom --- .../ehviewer/ui/screen/GalleryCommentsScreen.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryCommentsScreen.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryCommentsScreen.kt index b69719caf..cb5057d00 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryCommentsScreen.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryCommentsScreen.kt @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -286,11 +287,7 @@ fun GalleryCommentsScreen(gid: Long, navigator: DestinationsNavigator) = composi val additionalPadding = if (commenting) { editTextMeasured } else { - if (!comments.hasMore) { - MinimumContentPaddingEditText - } else { - 0.dp - } + 0.dp } val voteUpSucceed = stringResource(R.string.vote_up_successfully) val cancelVoteUpSucceed = stringResource(R.string.cancel_vote_up_successfully) @@ -401,6 +398,12 @@ fun GalleryCommentsScreen(gid: Long, navigator: DestinationsNavigator) = composi } } } + } else { + // Workaround for comment list lagging when reaching the bottom + // https://github.com/FooIbar/EhViewer/issues/994 + item { + Spacer(modifier = Modifier.height(MinimumContentPaddingEditText)) + } } } PullToRefreshContainer(