MaterialScrollBar
MaterialScrollBar copied to clipboard
Support for AppBarLayout / CoordinatorLayout
Hey @krimin-killr21
The AppBarLayout is used to perform scrolling techniques one of which is Showing and Hiding Toolbar on scroll which affects the ScrollBar.
I'll try to provide screenshot of this issue for better understanding. You can look this issue to understand the problem https://github.com/plusCubed/recycler-fast-scroll/issues/4
A solution would be to implement the whole scrollbar logic in a CoordinatorLayout behavior. This would also remove the hierarchy requirements (no more issues with RelativeLayouts and giving ids).
@krimin-killr21 Any workaround for this?
@Rhedox Seems great idea. Can you post code or way to do it?
I think that would require a rewrite of the complete library. If youre interested heres information on how to implement the behavior. https://lab.getbase.com/nested-scrolling-with-coordinatorlayout-on-android/
I'll look into it this weekend. I'm in the process of managing my entrance into university this fall so I've been pressed with time, but I'll do my best :)
@krimin-killr21 Is this fixed?
Sorry, closed the wrong issue
@krimin-killr21 Refer this code for adding AppBarLayout support.
https://github.com/plusCubed/recycler-fast-scroll/blob/master/library/src/main/java/com/pluscubed/recyclerfastscroll/RecyclerFastScroller.java
Any plans on fixing this @turing-tech ? Or any suggestion on how we can get this working?
I tried a few tricks but can't get this working in a satisfactory way
@MFlisar It is important, but unfortunately I have a significant workload as I'm working full-time as developer for a start-up. I will continue to fix critical issue, but anything beyond that I can't really work on right now. Hopefully when my work load goes back down I'll have time to fix all of the bugs. If any of you would like to submit a PR I'd be happy to take a look.
I tried a simple trick by putting the scrollbar outside of the coordinator like following:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/clMain"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rvSidebar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
<com.turingtechnologies.materialscrollbar.TouchScrollBar
android:id="@+id/touchScrollBar"
android:layout_width="16dp"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
app:msb_recyclerView="@id/rvSidebar"
app:msb_lightOnTouch="false" />
</RelativeLayout>
Problem: the problem here is that the scrollbar is consuming all touch events over the complete recycler view. Can I currently limit the scrollbar to only catch touches on the bar? I don't think so as far as I've seen...
Above would be no full solution but a fast work around for now at least