turing-tech / MaterialScrollBar

An Android library that brings the Material Design 5.1 sidebar to pre-5.1 devices.
Apache License 2.0
781 stars 126 forks source link

Indicator is hidden behind appbar when at the top #104

Open urob0ros opened 7 years ago

urob0ros commented 7 years ago

How do i force the scrollbar indicator to stay below the appbar? The scrollbar is already at the top but the indicator is being hidden behind the toolbar. See example below:

`<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/searchEditText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="haha"
                android:background="@android:color/transparent"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"/>

        </RelativeLayout>

    </android.support.v7.widget.Toolbar>

</android.support.design.widget.AppBarLayout>

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical"
    android:layout_below="@+id/appbar"/>

<com.turingtechnologies.materialscrollbar.DragScrollBar
    android:id="@+id/dragScrollBar"
    android:layout_width="wrap_content"
    app:msb_recyclerView="@id/recyclerView"
    app:msb_lightOnTouch="false"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

`

kasual1 commented 7 years ago

I'm having the same problem. The indicator is partially hidden behind the toolbar (See image below). In the sample app this problem doesn't occur. device-2017-09-03-111411

turing-tech commented 6 years ago

Is the track thumb (the curvy thing that you use to scroll) ever hidden behind the title bar or just the indicator?