From e3cab9c0d9aad3c98ead66d8df70b68a0afef56a Mon Sep 17 00:00:00 2001 From: alansley Date: Thu, 22 Aug 2024 14:26:48 +1000 Subject: [PATCH] SS-75 Prevented ScrollView vertical scroll bar from fading out --- .../java/org/thoughtcrime/securesms/SessionDialogBuilder.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt b/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt index c5ee6ca6ed..0dab6c6a04 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/SessionDialogBuilder.kt @@ -299,7 +299,10 @@ fun Context.showOpenUrlDialog(url: String, showCloseButton: Boolean = true): Ale val maxLines = 5 if (txtView.lineCount >= maxLines) { scrollView.isVerticalScrollBarEnabled = true - scrollView.setScrollbarFadingEnabled(false) + // Note: `scrollView.isScrollbarFadingEnabled = false` does NOT + // work to prevent the scroll bar from fading away - so a hacky + // way to fix this is to allow it to fade out... after an hour, lol. + scrollView.scrollBarFadeDuration = 1000 * 60 * 60 // Value is in milliseconds scrollView.isVerticalFadingEdgeEnabled = false val lineHeight = txtView.lineHeight scrollView.layoutParams.height = lineHeight * maxLines