Fix more fast-scroll issues

Fix two more fast scrolling issues:
- Fixed size of the view would cut off larger fonts
- Thumb would briefly show when the view would initially start

This custom view was a mistake, but anything for less kbs.
This commit is contained in:
OxygenCobalt
2021-03-25 09:24:40 -06:00
parent 6d5ed6dd7b
commit 194bcfcd05
4 changed files with 13 additions and 3 deletions
@@ -9,6 +9,7 @@ import android.view.MotionEvent
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
import androidx.core.view.postDelayed
import androidx.dynamicanimation.animation.DynamicAnimation
import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringForce
@@ -71,6 +72,14 @@ class FastScrollView @JvmOverloads constructor(
it.dampingRatio = SpringForce.DAMPING_RATIO_NO_BOUNCY
}
}
// Prevent the disappear animation from being displayed on startup by making the thumb
// invisible, it will be made visible once the animation ends
binding.scrollThumb.visibility = View.INVISIBLE
postDelayed(200) {
binding.scrollThumb.visibility = View.VISIBLE
}
}
/**