turing-tech / MaterialScrollBar

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

Scrollbar doesn't show up #108

Closed ShawnTheBeachy closed 7 years ago

ShawnTheBeachy commented 7 years ago

I'm attempting to use the DragScrollBar inside my FrameLayout in my fragment:


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

    <com.turingtechnologies.materialscrollbar.DragScrollBar
        android:id="@+id/scrollBar"
        android:layout_gravity="fill_vertical|end"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        app:msb_lightOnTouch="false"
        app:msb_recyclerView="@id/recyclerView" />

The problem is that it doesn't show up. It does remove the default scrollbar, but I'm left with no scrollbar at all. I tried setting the color just to make sure it's not transparent or something weird; no dice. Am I missing something here, or is the library broken? I'm running Android 7.0.

Side note: I'm also using an AlphabetIndicator with it. I've confirmed that it does request the indicator from the adapter as I scroll, but it doesn't show the indicator in the UI.

turing-tech commented 7 years ago

The scrollbar must be the child of a relativeLayout with the rv. There should be a programtic check for that somewhere, but perhaps not. Either way, try placing it in a relativeLayout parent.

ShawnTheBeachy commented 7 years ago

I tried placing it in a RelativeLayout, but still couldn't get it to show up. However, I switched to using FastScroll, so this isn't an issue for me anymore. I'll close it.