Code Monkey home page Code Monkey logo

Comments (8)

randr0id avatar randr0id commented on June 16, 2024

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.

from fastscroll.

iRYO400 avatar iRYO400 commented on June 16, 2024

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>

from fastscroll.

randr0id avatar randr0id commented on June 16, 2024

What is the error you are seeing? You might need to use NestedScrollView instead of ScrollView.

from fastscroll.

iRYO400 avatar iRYO400 commented on June 16, 2024

It's not an error. I just cant scroll it. The same if I use NestedScrollView
Please look at gif
ezgif-4081226412

from fastscroll.

iRYO400 avatar iRYO400 commented on June 16, 2024

And I also tried with RecyclerView.setNestedScroll(false)

from fastscroll.

zdunaisky-chwy avatar zdunaisky-chwy commented on June 16, 2024

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

from fastscroll.

iRYO400 avatar iRYO400 commented on June 16, 2024

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

from fastscroll.

zdunaisky-chwy avatar zdunaisky-chwy commented on June 16, 2024

There are a couple things that stand out as possible issues.

  1. You have two RecyclerViews in the same layout with layout_height=match_parent. Are they both vertically scrolling?
  2. Your layout manager don't specify VERTICAL or HORIZONTAL.
    Should look something like:
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.

from fastscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.