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:24:04 -06:00
parent bb5d163f49
commit 10c45f1492
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 7 additions and 14 deletions

View file

@ -96,7 +96,6 @@ class FastScrollRecyclerView @JvmOverloads constructor(
private var dragStartThumbOffset = 0 private var dragStartThumbOffset = 0
private var dragging = false private var dragging = false
private var didRelayout = true
private var showingScrollbar = false private var showingScrollbar = false
private var showingPopup = false private var showingPopup = false
@ -304,8 +303,8 @@ class FastScrollRecyclerView @JvmOverloads constructor(
updateScrollbarState() updateScrollbarState()
if (didRelayout) { // Measure or layout events result in a fake onScrolled call. Ignore those.
didRelayout = false if (dx == 0 && dy == 0) {
return return
} }
@ -313,12 +312,6 @@ class FastScrollRecyclerView @JvmOverloads constructor(
postAutoHideScrollbar() 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 { override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
val bars = insets.systemBarsCompat val bars = insets.systemBarsCompat

View file

@ -148,10 +148,10 @@
</style> </style>
<style name="Theme.Auxio.Neutral" parent="Theme.Auxio.App"> <style name="Theme.Auxio.Neutral" parent="Theme.Auxio.App">
<item name="colorPrimary">@color/control</item> <item name="colorPrimary">?attr/colorControlNormal</item>
<item name="colorOnPrimary">@color/control</item> <item name="colorOnPrimary">?attr/colorControlNormal</item>
<item name="colorPrimaryInverse">@color/control</item> <item name="colorPrimaryInverse">?attr/colorControlNormal</item>
<item name="colorPrimaryContainer">@color/control</item> <item name="colorPrimaryContainer">?attr/colorControlNormal</item>
<item name="colorOnPrimaryContainer">@color/control</item> <item name="colorOnPrimaryContainer">?attr/colorControlNormal</item>
</style> </style>
</resources> </resources>