Closed iRYO400 closed 7 years ago
Your parent ViewGroup is a ScrollView which is unnecessary since RecyclerView provides scrolling. Try replacing it with a FrameLayout.
Currently the parent ViewGroup must be a FrameLayout or RelativeLayout in order for the FastScroller to be properly displayed on top of the RecyclerView. We plan to add support for CoordinatorLayout and ConstraintLayout in the future.
ok. but I got the same if I do next
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.l4digital.fastscroll.FastScrollRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bubbleColor="@color/blue_main"
app:bubbleTextColor="#ffffff"
app:handleColor="#999999"
app:hideScrollbar="false"
app:showTrack="true"
app:trackColor="@color/blue_light" />
</FrameLayout>
</ScrollView>
What is the error you are seeing? You might need to use NestedScrollView instead of ScrollView.
It's not an error. I just cant scroll it. The same if I use NestedScrollView Please look at gif
And I also tried with RecyclerView.setNestedScroll(false)
@iRYO400 - The layout shown in your GIF should not need a ScrollView at all. Have you tried removing any parent scrollview so your XML looks like:
<FrameLayout
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">
<com.l4digital.fastscroll.FastScrollRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bubbleColor="@color/blue_main"
app:bubbleTextColor="#ffffff"
app:handleColor="#999999"
app:hideScrollbar="false"
app:showTrack="true"
app:trackColor="@color/blue_light" />
</FrameLayout>
@zacharyyy hi! The gif shows a sample layout. I didn't show that I have another RecyclerView(for friend invites) above FastScrollRecyclerView(list of current friends). Today I've done with the final layout:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_stavki"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="56dp">
<android.support.v7.widget.SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginBottom="16dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="16dp"
android:background="@drawable/searchview_round_bg"
android:gravity="center"
android:queryHint="Search" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview_fragment2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.l4digital.fastscroll.FastScrollRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bubbleColor="@color/blue_main"
app:bubbleTextColor="#ffffff"
app:handleColor="#999999"
app:hideScrollbar="false"
app:showTrack="true"
app:trackColor="@color/blue_light" />
</FrameLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Code:
adapter = new FriendsAdapter(friendsChildModelList);
binding.recyclerView.setAdapter(adapter);
binding.recyclerView.setNestedScrollingEnabled(true);
binding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
adapter2 = new FriendsInvitesAdapter(invitesChildModelList);
binding.recyclerviewFragment2.setAdapter(adapter2);
binding.recyclerviewFragment2.setNestedScrollingEnabled(true);
binding.recyclerviewFragment2.setLayoutManager(new inearLayoutManager(getActivity()));
Can you please give any idea how to handle that?
There are a couple things that stand out as possible issues.
binding.recyclerviewFragment2.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL/HORIZONTAL, false));
If both of your recyclerviews use VERTICAL orientation then your layout will likely have issues of the views squashing each other. You should only need one vertically scrolling recyclerview with heterogenous layouts.
Hi! Library is cool and smooth to use. Like it. I'm interesting. Is this possible to make it working inside ScrollView/NestedSV? I tried. but it doesn't work. The XML
In code
Thanks!