home: prevent scrollbar from showing on measure

Prevent FastScrollRecyclerView from showing the scrollbar whenever it
would measure itself, which again results in a scroll event for some
reason.
This commit is contained in:
OxygenCobalt
2021-11-03 06:28:00 -06:00
parent bb5d163f49
commit 10c45f1492
2 changed files with 7 additions and 14 deletions
@@ -96,7 +96,6 @@ class FastScrollRecyclerView @JvmOverloads constructor(
private var dragStartThumbOffset = 0
private var dragging = false
private var didRelayout = true
private var showingScrollbar = false
private var showingPopup = false
@@ -304,8 +303,8 @@ class FastScrollRecyclerView @JvmOverloads constructor(
updateScrollbarState()
if (didRelayout) {
didRelayout = false
// Measure or layout events result in a fake onScrolled call. Ignore those.
if (dx == 0 && dy == 0) {
return
}
@@ -313,12 +312,6 @@ class FastScrollRecyclerView @JvmOverloads constructor(
postAutoHideScrollbar()
}
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
super.onLayout(changed, l, t, r, b)
didRelayout = changed
}
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
val bars = insets.systemBarsCompat