SS-75 Prevented ScrollView vertical scroll bar from fading out

This commit is contained in:
alansley 2024-08-22 14:26:48 +10:00
parent b0b835092d
commit e3cab9c0d9

View File

@ -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