Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a62439a8 authored by tibbi's avatar tibbi
Browse files

add the fastscroller bubble to horizontal scrolling too

parent 75dcf638
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.1.7'
        propVersionName = '3.1.9'
        kotlin_version = '1.2.0'
        support_libs = '27.0.2'
    }
+4 −0
Original line number Diff line number Diff line
@@ -202,6 +202,10 @@ class FastScroller : FrameLayout {
            val position = pos / currWidth
            val handleWidth = handle!!.width
            handle!!.x = getValueInRange(0f, (currWidth - handleWidth).toFloat(), (currWidth - handleWidth) * position)

            val bubbleWidth = bubble?.width ?: 0
            val newX = getValueInRange(0f, (currWidth - bubbleWidth).toFloat(), (currWidth - bubbleWidth) * position)
            bubble?.x = Math.max(0f, newX)
        } else {
            val position = pos / currHeight
            val handleHeight = handle!!.height
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <ImageView
        android:id="@+id/fastscroller_handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:alpha="0"
        android:background="@drawable/fastscroller_handle_horizontal"/>

    <TextView
        android:id="@+id/fastscroller_bubble"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/fastscroll_height"
        android:alpha="0"
        android:background="@drawable/fastscroller_bubble"
        android:ellipsize="end"
        android:lines="1"
        android:padding="@dimen/medium_margin"
        android:singleLine="true"
        android:textSize="@dimen/normal_text_size"
        tools:text="bubble"/>

</merge>