mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Don't move library bubble text in single category mode
This commit is contained in:
parent
8ba6ae64dd
commit
a57695c366
1 changed files with 5 additions and 1 deletions
|
@ -15,7 +15,11 @@ class LibraryFastScroll @JvmOverloads constructor(context: Context, attrs: Attri
|
|||
|
||||
private var currentX = 0f
|
||||
|
||||
private val isSingleCategory: Boolean
|
||||
get() = (recyclerView.adapter as? LibraryCategoryAdapter)?.isSingleCategory ?: true
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
if (isSingleCategory) return super.onTouchEvent(event)
|
||||
val oldFastScroll = categoryFastScroll
|
||||
currentX = event.x
|
||||
if (categoryFastScroll != oldFastScroll && canScroll) {
|
||||
|
@ -49,7 +53,7 @@ class LibraryFastScroll @JvmOverloads constructor(context: Context, attrs: Attri
|
|||
|
||||
override fun setBubbleAndHandlePosition(y: Float) {
|
||||
super.setBubbleAndHandlePosition(y)
|
||||
if (bubbleEnabled) {
|
||||
if (bubbleEnabled && !isSingleCategory) {
|
||||
bubble.translationX =
|
||||
if (categoryFastScroll) {
|
||||
250f * (if (resources.isLTR) -1 else 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue