MaterialScrollBar icon indicating copy to clipboard operation
MaterialScrollBar copied to clipboard

Support for AppBarLayout / CoordinatorLayout

Open AkshayChordiya opened this issue 9 years ago • 11 comments

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

AkshayChordiya avatar Jan 12 '16 05:01 AkshayChordiya

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).

K0bin avatar Mar 10 '16 19:03 K0bin

@krimin-killr21 Any workaround for this?

AkshayChordiya avatar Mar 19 '16 09:03 AkshayChordiya

@Rhedox Seems great idea. Can you post code or way to do it?

AkshayChordiya avatar Mar 21 '16 01:03 AkshayChordiya

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/

K0bin avatar Mar 22 '16 21:03 K0bin

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 :)

turing-tech avatar Mar 23 '16 01:03 turing-tech

@krimin-killr21 Is this fixed?

AkshayChordiya avatar Mar 28 '16 05:03 AkshayChordiya

Sorry, closed the wrong issue

turing-tech avatar Mar 28 '16 05:03 turing-tech

@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

AkshayChordiya avatar Apr 17 '16 03:04 AkshayChordiya

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 avatar Jul 15 '17 18:07 MFlisar

@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.

turing-tech avatar Jul 15 '17 18:07 turing-tech

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

MFlisar avatar Jul 15 '17 18:07 MFlisar