From 9ff6ae81bdcb7ce8d1a180f86fad8870324bcf1e Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sun, 26 Jun 2022 23:58:31 +0700 Subject: [PATCH] VerticalFastScroller: Fix incorrect touch target (#7384) --- .../components/VerticalFastScroller.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/components/VerticalFastScroller.kt b/app/src/main/java/eu/kanade/presentation/components/VerticalFastScroller.kt index 15c8d9990d..b46d85c652 100644 --- a/app/src/main/java/eu/kanade/presentation/components/VerticalFastScroller.kt +++ b/app/src/main/java/eu/kanade/presentation/components/VerticalFastScroller.kt @@ -114,18 +114,6 @@ fun VerticalFastScroller( Box( modifier = Modifier .offset { IntOffset(0, thumbOffsetY.roundToInt()) } - .height(ThumbLength) - .then( - // Exclude thumb from gesture area only when needed - if (isThumbVisible && !isThumbDragged && !listState.isScrollInProgress) { - Modifier.systemGestureExclusion() - } else Modifier, - ) - .padding(horizontal = 8.dp) - .padding(end = endContentPadding) - .width(ThumbThickness) - .alpha(alpha.value) - .background(color = thumbColor, shape = ThumbShape) .then( // Recompose opts if (!listState.isScrollInProgress) { @@ -139,7 +127,19 @@ fun VerticalFastScroller( }, ) } else Modifier, - ), + ) + .then( + // Exclude thumb from gesture area only when needed + if (isThumbVisible && !isThumbDragged && !listState.isScrollInProgress) { + Modifier.systemGestureExclusion() + } else Modifier, + ) + .height(ThumbLength) + .padding(horizontal = 8.dp) + .padding(end = endContentPadding) + .width(ThumbThickness) + .alpha(alpha.value) + .background(color = thumbColor, shape = ThumbShape), ) }.map { it.measure(scrollerConstraints) } val scrollerWidth = scrollerPlaceable.fastMaxBy { it.width }?.width ?: 0