Giter Site home page Giter Site logo

futuremind / recycler-fast-scroll Goto Github PK

View Code? Open in Web Editor NEW
488.0 27.0 106.0 247 KB

Provides fast scroll and section idexer for recycler view

License: Apache License 2.0

Java 100.00%
recyclerview android fastscroll scrolling bubble recyclerview-adapter alphabetindexer-

recycler-fast-scroll's Introduction

Deprecation notice

With significant changes to recyclerview and stable jetpack compose being released, this project will no longer be maintained.

Recycler Bubble

Provides fast scroll and section indexer for recycler view. Uses a different mechanism than similar libraries to provide smooth movement of scroller handle when scrolling the list. Can be used with vertical and horizontal RecyclerViews. You can style it or even use a custom layout and animations for your fast scroll handle and bubble.

alt tag

Usage

Minimal working example

In your layout file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

    <com.futuremind.recyclerviewfastscroll.FastScroller
        android:id="@+id/fastscroll"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentRight="true"/>

</RelativeLayout>

In Activity/Fragment:

        recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        fastScroller = (FastScroller) findViewById(R.id.fastscroll);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);

        //has to be called AFTER RecyclerView.setAdapter()
        fastScroller.setRecyclerView(recyclerView);

In your RecyclerView.Adapter

        public class MyAdapter ... implements SectionTitleProvider{
            
            ...
            
            @Override
            public String getSectionTitle(int position) {
                //this String will be shown in a bubble for specified position
                return getItem(position).substring(0, 1);
            }
            
        }

Note: You have to populate your adapter with enough items for the FastScroll to show. I has an auto-hide mechanism in case there is nothing to scroll.

Horizontal orientation

You can use this library with horizontal LayoutManager. To do it use android:orientation="horizontal" attribute:

    <com.futuremind.recyclerviewfastscroll.FastScroller
        android:id="@+id/fastscroll"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

Styling

Styling was introduced in version 0.1.5 with a limited set of styleable attributes. More are on their way.

You can style the attributes in the xml layout:

    <com.futuremind.recyclerviewfastscroll.FastScroller
           ...
           app:fastscroll__handleColor="#8f93d1"
           app:fastscroll__bubbleColor="#5e64ce"
           app:fastscroll__bubbleTextAppearance="@style/StyledScrollerTextAppearance"
           />

Or directly in the code:

         fastScroller.setBubbleColor(0xffff0000);
         fastScroller.setHandleColor(0xffff0000);
         fastScroller.setBubbleTextAppearance(R.style.StyledScrollerTextAppearance);

See the example code for more info.

Custom views

You can set custom layouts and animations for your handle and bubble, using:

        myViewProvider = new MyScrollerViewProvider();
        fastScroller.setViewProvider(myViewProvider);

For more information, consult CustomScrollerViewProvider in the example code.

Download

Download via Gradle:

compile 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'

License

Copyright 2015 Future Mind

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

recycler-fast-scroll's People

Contributors

chendrak avatar mcpo avatar michar avatar nbadal avatar niknetniko avatar qhutch avatar talklittle avatar tostf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

recycler-fast-scroll's Issues

Fastscroll position in screen

Fastscroll isn't in the correct position in screen

Fast scroll

My xml :

`

<com.cjj.MaterialRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />
	
<com.futuremind.recyclerviewfastscroll.FastScroller
    android:id="@+id/fastscroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentRight="true"/>
	
<com.recyclerview.header.RecyclerViewHeader
	android:id="@+id/recyclerHeader"
    android:layout_width="match_parent"
	android:layout_height="wrap_content"/>
	
</com.cjj.MaterialRefreshLayout>
`

View half-hidden state sometimes happen in VisibilityAnimationManager

There is a little bug in VisibilityAnimationManager:

  • grab the handle => the bubble shows up
  • release the handle
  • grab the handle again at the moment the bubble hide animation starts

Bug => the bubble is in a half-hidden state

To fix this, you have to start the show animation if the hide animation is still running:

    @Override
    public void show() {
        boolean hideIsRunning = hideAnimator.isRunning();
        hideAnimator.cancel();
        if (view.getVisibility() == View.INVISIBLE || hideIsRunning) {
            view.setVisibility(View.VISIBLE);
            updatePivot();
            showAnimator.start();
        }
    }

Calling SectionTitleProvider.getSectionTitle with negative (-1) index

FastScroller is trying to get section title for item with negative index when RecyclerViews items are cleared while in active scroll with section bubble visible. That can lead to ArrayIndexOutOfBoundsException in application code.

java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
    at java.util.ArrayList.get(ArrayList.java:310)
    at my.Adapter.getSectionTitle(MyAdapter.java:123)
    at com.futuremind.recyclerviewfastscroll.FastScroller.setRecyclerViewPosition(FastScroller.java:250)
    at com.futuremind.recyclerviewfastscroll.FastScroller.access$500(FastScroller.java:21)
    at com.futuremind.recyclerviewfastscroll.FastScroller$2.onTouch(FastScroller.java:195)
    at android.view.View.dispatchTouchEvent(View.java:9371)

Develop README

Should have a short usage example and a screenshot / gif. We can probably also put the example app on Google Play.

How to Set fastscroll on viewpager

This method works
fastScrollerHorizontal.setRecyclerView(recyclerViewHorizontal);

but there is no method like this
fastScrollerHorizontal.setViewPager(viewPager);

is there any way to use FAST SCROLLER on viewpager?

Custom bubble and handle catch the touches/clicks/scrolling gestures after they are hidden

I have a recycler view with custom cards and the fast scroller in a relative layout.
I used a custom view provider which is mostly based on the default view provider except for a few changes to the bubble's layout. Things work smoothly w.r.t to scrolling and indexing.
However, when the bubble hides after being released, all the touches, clicks, scrolls made on the "bubble area" are being blocked by the invisible bubble and thereby prevents the recycler view from collecting them. So, the recycler view basically does nothing when tapped or scrolled on the region where the bubble is present. In the sample project , this does not happen though.
Any ideas on what might be causing this?

Scrollbar not visible when used inside Nested Scroll View

In my Project, I am using CoordinatorLayout + AppbarLayout + CollapsingToolbarLayout... here is the XML for MainActivity:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/main_appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/main_collapsing"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:collapsedTitleGravity="left|center_vertical">

        <FrameLayout
                android:id="@+id/header_fragment_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.7"
                android:paddingTop="50dp">

            </FrameLayout>

            <android.support.v7.widget.Toolbar
                android:id="@+id/drawer_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:theme="@style/ToolbarColoredBackArrow"
                app:popupTheme="@style/AppTheme.PopupOverlay" >
                </android.support.v7.widget.Toolbar>


        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/app_bar_main"
    android:scrollbars="vertical"
    android:fillViewport="true"
    android:id="@+id/content_main_scroll_view"
    >

    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:fitsSystemWindows="true"
        />
</android.support.v4.widget.NestedScrollView>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/main_fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_directions"
        app:layout_anchor="@id/main_appbar"
        app:layout_anchorGravity="bottom|end" />

</android.support.design.widget.CoordinatorLayout 

Now I use your scrollbar in one of the fragments with a recyclerView .. fragment XML is


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">


        <controls.CustomFontTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="20dp"
            android:text="Title: "
            android:textColor="@android:color/black"
            android:textSize="16sp" />

        <Spinner
            android:id="@+id/title_spinner"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_margin="20dp"
            android:background="@drawable/spinner" />
    </LinearLayout>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/staff_directory_recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fastScrollEnabled="true"
            />

        <com.futuremind.recyclerviewfastscroll.FastScroller
            android:id="@+id/fastscroll"
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"/>

    </RelativeLayout>


</LinearLayout>

Currently, I do exactly as you mentioned in the Wiki to initialize YOUR scrollView. However, it doesn't appear at all.

I would appreciate if you pointed me to the fix.

Null pointer exception in design view

java.lang.NullPointerException   at com.futuremind.recyclerviewfastscroll.RecyclerViewScrollListener.updateHandlePosition(RecyclerViewScrollListener.java:47)   at com.futuremind.recyclerviewfastscroll.FastScroller.onLayout_Original(FastScroller.java:168)   at com.futuremind.recyclerviewfastscroll.FastScroller.onLayout(FastScroller.java:-1)   at android.view.View.layout(View.java:17520)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)   at android.view.View.layout(View.java:17520)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.support.constraint.ConstraintLayout.onLayout_Original(ConstraintLayout.java:1127)   at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:-1)   at android.view.View.layout(View.java:17520)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)   at android.view.View.layout(View.java:17520)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)   at android.view.View.layout(View.java:17520)   at android.view.ViewGroup.layout(ViewGroup.java:5612)

I get the above null pointer exception in my design view.

Below is my xml:

`

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

    <com.futuremind.recyclerviewfastscroll.FastScroller
        android:id="@+id/fastScroller"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentEnd="true"
        android:orientation="vertical"
        app:fastscroll__bubbleColor="@color/colorGold"
        app:fastscroll__bubbleTextAppearance="@style/StyledScrollerTextAppearance"/>

</RelativeLayout>`

Can you please help me and let me know what am I missing here?

Attribute Issue and Bubble offset

When trying to set the bubble color and handle color I received errors saying that those attributes are not in my package. Any idea why this is happening? I added the library through gradle so it should be there.

Also, is there a way to set the offset of the bubble from the handle? It is currently quite close to the handle and your finger covers the bubble.

Viewprovider Error

in the FastScoller class i keep getting this error

viewProvider.setFastScroller(this);

it says "Setfastscroller in ScrollerviewProvider can not be applied to Fastscroller"

Scrollbar Visibility

How to make scrollbar all time visible
Now the visibility appears after scrolling

android.view.InflateException: Binary XML file line #88: RecyclerView has no LayoutManager

Before inflating this library everything was working fine but when I have included this one I got this error.
Here is my code... I am updating data list later on...
phoneContactListAdapter = new PhoneContactListAdapter(coordinatorLayout, getActivity(), new ArrayList<Contact>()); contactListView.setItemViewCacheSize(1000); contactListView.setLayoutManager(new LinearLayoutManager(getActivity())); contactListView.setItemAnimator(new DefaultItemAnimator()); contactListView.setAdapter(phoneContactListAdapter); fastScroller.setRecyclerView(contactListView);

Bug when list have no items

I found a bug when recycler view list adapter is empty.

For solve it, at ScrollListener implementation of FastScroller class, after retrieve first recycler view child:

View firstVisibleView = recyclerView.getChildAt(0);

.. Verify if firstVisibleView is null and return without execute rest of method.

View firstVisibleView = recyclerView.getChildAt(0);
if(firstVisibleView == null)
    return;

This check avoid app's crash!

I hope I helped!

How does vertical fade out work?

I've been trying to enable the scroll bar fade out with setScrollbarFadingEnabled(true) and also tried setScrollBarFadeDuration and setScrollBarDefaultDelayBeforeFade but the scrollbar is never faded out..

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference

I am facing this issue, Please assist me...

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnTouchListener(android.view.View$OnTouchListener)' on a null object reference
at com.futuremind.recyclerviewfastscroll.FastScroller.initHandleMovement(FastScroller.java:186)
at com.futuremind.recyclerviewfastscroll.FastScroller.onLayout(FastScroller.java:162)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1767)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1364)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:846)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:724)
at android.view.View.layout(View.java:17522)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2342)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2069)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)

Example does not display bubble

I have run the example on 3 devices, with Android 7, 5.0.2, and 4.4.4 and the bubble does not display (though the handle does). In Android Studio, I set a break point at CountriesAdapter.getSectionTitle() and it never gets there.

How to auto hide the scrollbar?

I successfully use this library, and fast scroll bars appear so perfectly and easily applied. but I want some animation to fastscroll can disappear automatically, this might be a basic question, but I would be very happy if I get a code that is easier to use. This is my code :

View rootView = inflater.inflate(R.layout.fragment, container, false);

RecyclerView rv = (RecyclerView) rootView.findViewById(R.id.recycler_view);
        FastScroller fastScroller = (FastScroller) rootView.findViewById(R.id.FutureMind_fastscroll);
        rv.setHasFixedSize(true);
        Adapter adapter = new Adapter(
                result
        );
        rv.setAdapter(adapter);

        LinearLayoutManager llm = new LinearLayoutManager(getActivity());
        rv.setLayoutManager(llm);
        fastScroller.setRecyclerView(rv);

return rootView;

is there a quick way to display the scroll bar at the time of the action by the user and hide automatically when a few seconds if user does not scroll.

Is there a way to modify my code above and resolve the issue?
Thank you for the help.

Designer NPE

Following the basic example I end up with this error in the designer:

java.lang.NullPointerException
    at com.futuremind.recyclerviewfastscroll.FastScroller.initHandleMovement(FastScroller.java:186)
    at com.futuremind.recyclerviewfastscroll.FastScroller.onLayout_Original(FastScroller.java:162)
    at com.futuremind.recyclerviewfastscroll.FastScroller.onLayout(FastScroller.java)
    at android.view.View.layout(View.java:17520)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
    at android.view.View.layout(View.java:17520)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.support.v4.widget.DrawerLayout.onLayout_Original(DrawerLayout.java:1197)
    at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java)
    at android.view.View.layout(View.java:17520)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
    at android.view.View.layout(View.java:17520)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
    at android.view.View.layout(View.java:17520)
    at android.view.ViewGroup.layout(ViewGroup.java:5612)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:345)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
    at com.android.tools.idea.rendering.RenderTask.lambda$inflate$53(RenderTask.java:659)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Dependency issue

Hi!
When I'm adding your library dependency to my gradle file, my app begins to crash on launch with following exception. As I understand that is some conflict between support libraries I use and your library:

06-10 14:34:47.163 32314-32314/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: info.oleksandr.utilitymeter, PID: 32314
                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{info.oleksandr.utilitymeter/info.oleksandr.utilitymeter.MainActivity}: android.view.InflateException: Binary XML file line #42: Error inflating class android.support.design.widget.FloatingActionButton
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:135)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:372)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                    Caused by: android.view.InflateException: Binary XML file line #42: Error inflating class android.support.design.widget.FloatingActionButton
                                                       at android.view.LayoutInflater.createView(LayoutInflater.java:633)
                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
                                                       at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288)
                                                       at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)
                                                       at info.oleksandr.utilitymeter.MainActivity.onCreate(MainActivity.java:73)
                                                       at android.app.Activity.performCreate(Activity.java:5990)
                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:135) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:372) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
                                                    Caused by: java.lang.reflect.InvocationTargetException
                                                       at java.lang.reflect.Constructor.newInstance(Native Method)
                                                       at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
                                                       at android.view.LayoutInflater.createView(LayoutInflater.java:607)
                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                                                       at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288) 
                                                       at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143) 
                                                       at **info.oleksandr.utilitymeter.MainActivity**.onCreate(MainActivity.java:73) 
                                                       at android.app.Activity.performCreate(Activity.java:5990) 
                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:135) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:372) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

my gradle dependencies are the following:

compile 'net.danlew:android.joda:2.9.2'
  compile 'com.android.support:appcompat-v7:23.4.0'
  compile 'com.android.support:design:23.4.0'
  compile 'com.android.support:recyclerview-v7:23.4.0'
  compile 'com.android.support:cardview-v7:23.4.0'
  compile 'com.larswerkman:lobsterpicker:1.0.1'
  compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
  compile 'com.google.android.gms:play-services-ads:10.2.1'
  compile 'com.google.android.gms:play-services-drive:10.2.1'
  compile 'org.jetbrains:annotations-java5:15.0'
  compile 'com.google.android.gms:play-services-auth:10.2.1'
  compile 'com.facebook.stetho:stetho:1.3.1'
  compile 'com.jakewharton:butterknife:8.4.0'
  compile 'com.squareup:otto:1.3.8'
  compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
  compile 'io.reactivex.rxjava2:rxjava:2.0.9'
  compile 'com.android.support:support-v13:23.4.0'
  compile 'com.android.support:support-annotations:23.4.0'
  compile 'com.google.firebase:firebase-core:10.2.1'
  compile 'com.android.support.constraint:constraint-layout:1.0.2'
  testCompile 'junit:junit:4.12'
  androidTestCompile 'org.testng:testng:6.9.6'
  apt 'com.jakewharton:butterknife-compiler:8.4.0'
  compile 'lib.kashif:folderpicker:2.2'

  compile 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'

NPE when inflate fragment layout

There is an npe when android inflate layout then call method setVisible but recyclerView is null

public void setVisibility(int visibility) {  //android call this method when inflate layout
        maxVisibility = visibility;
        invalidateVisibility();
    }

    private void invalidateVisibility() {
        if(                              //just add if recyclerView != null ????
                recyclerView.getAdapter()==null ||
                recyclerView.getAdapter().getItemCount()==0 ||
                recyclerView.getChildAt(0)==null ||
                isRecyclerViewNotScrollable() ||
                maxVisibility != View.VISIBLE
                ){
            super.setVisibility(INVISIBLE);
        } else {
            super.setVisibility(VISIBLE);
        }
    }

this is my stacktrace :

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: it.seiton.healtcare.internal.debug, PID: 16401
                  java.lang.RuntimeException: Unable to start activity ComponentInfo{it.seiton.healtcare.internal.debug/it.seiton.healtcare.ui.main.MainActivity}: android.view.InflateException: Binary XML file line #138: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$Adapter android.support.v7.widget.RecyclerView.getAdapter()' on a null object reference
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                      at android.app.ActivityThread.-wrap11(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                   Caused by: android.view.InflateException: Binary XML file line #138: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$Adapter android.support.v7.widget.RecyclerView.getAdapter()' on a null object reference
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                      at it.seiton.common.ui.BaseFragment.onCreateView(BaseFragment.kt:22)
                      at android.support.v4.app.Fragment.performCreateView(Fragment.java:2080)
                      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108)
                      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290)
                      at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
                      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1677)
                      at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
                      at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:604)
                      at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
                      at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
                      at android.app.Activity.performStart(Activity.java:6253)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                      at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:148) 
                      at android.app.ActivityThread.main(ActivityThread.java:5417) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$Adapter android.support.v7.widget.RecyclerView.getAdapter()' on a null object reference
                      at com.futuremind.recyclerviewfastscroll.FastScroller.invalidateVisibility(FastScroller.java:224)
                      at com.futuremind.recyclerviewfastscroll.FastScroller.setVisibility(FastScroller.java:220)
                      at android.widget.ViewAnimator.addView(ViewAnimator.java:187)
                      at android.view.ViewGroup.addView(ViewGroup.java:4117)
                      at android.view.LayoutInflater.rInflate(LayoutInflater.java:839)
                      at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                      at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
                      at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                      at it.seiton.common.ui.BaseFragment.onCreateView(BaseFragment.kt:22) 
                      at android.support.v4.app.Fragment.performCreateView(Fragment.java:2080) 
                      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108) 
                      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290) 
                      at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801) 
                      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1677) 
                      at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) 
                      at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:604) 
                      at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178) 
                      at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237) 
                      at android.app.Activity.performStart(Activity.java:6253) 
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379) 
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                      at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:148) 
                      at android.app.ActivityThread.main(ActivityThread.java:5417) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

Make the appearance of the widget styleable

Stylable attributes:

  • bg color of the bubble,
  • width/height of the bubble,
  • text style of the bubble,
  • bubble corner round size,
  • animation for bubble showing/hiding (via ScrollerViewProvider),
  • bubble hide time offset,
  • handle color,
  • custom layout for bubble,
  • custom layout for handle,
  • handle margin,
  • bubble margin.

Scroll bar not visible

Am using this with gradle in my project. i have attached the fastscroller as mentioned in example but am not seeing the scroll bar in output.

Nested Scrolling support

I tried to use this library with a RecyclerView inside of a CoordinatorLayout that also contains a AppBarLayout with a Toolbar that uses app:layout_scrollFlags="scroll|enterAlways|snap":

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    android:id="@+id/coordinator_layout"
    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.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_scrollFlags="scroll|enterAlways|snap"/>

    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/store_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

    <com.futuremind.recyclerviewfastscroll.FastScroller
        android:id="@+id/fastscroll"
        android:orientation="vertical"
        android:layout_gravity="right"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        android:layout_marginBottom="?attr/actionBarSize"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</android.support.design.widget.CoordinatorLayout>

This has the following problems:

  • the FastScroller isn't collapsing/expanding the AppBarLayout
  • this prevents the FastScroller to scroll to the last entry in the list if the AppBarLayout is expanded
  • parts of the FastScroller are not visible (I quick fixed this problem with using marginTop/marginBottom for the FastScroller)

It seems that RecyclerView doesn't handle Nested Scrolling if you scroll with scrollToPosition. Sadly I couldn't find any proper documentation how Nested Scrolling is supposed to work. So I can't say if this is a bug in RecyclerView or this is supposed to be handled by the scroll initiator. But I think it is possible to handle it with:

  • ViewCompat.startNestedScroll
  • ViewCompat.dispatchNestedPreScroll
  • RecyclerView.scrollBy
  • ViewCompat.dispatchNestedScroll
  • ViewCompat.stopNestedScroll

This snippet demonstrates a way that let's the RecyclerView scroll by 300px while also collapsing the AppBarLayout. However I don't know this is the proper way to do it:

if (ViewCompat.isNestedScrollingEnabled(recyclerView) && ViewCompat.startNestedScroll(recyclerView, ViewCompat.SCROLL_AXIS_VERTICAL)) {
    int[] consumed = new int[2];
    ViewCompat.dispatchNestedPreScroll(recyclerView, 0, 300, consumed, null);
    int unsconumed = 300 - consumed[1];
    recyclerView.scrollBy(0, unsconumed);
    ViewCompat.dispatchNestedScroll(recyclerView, consumed[0], consumed[1], 0, unsconumed, null);
    ViewCompat.stopNestedScroll(recyclerView);
}

I'm not sure if it is possible to fix this problem with the current approach in this lib to scroll with scrollToPosition.

Don't make classes methods private or package-private

Hi,

As FastScroller.setRecyclerViewPosition() behavior does not fit my needs (use LinearLayoutManager.scrollToPositionWithOffset(targetPos, 0) instead of recyclerView.scrollToPosition(targetPos)), I have to copy/paste FastScroller.java, RecyclerViewScrollListener.java and ScrollerViewProvider.java to be able to modify FastScroller.setRecyclerViewPosition() :/
So can you avoid making your methods private or package-private?

Really good work though!

Best regards.

RecyclerView Not Wrapping content for horizontal scroll

I am using trying use a horizontal list of image views. The list displays fine but the fastscroll and recyclerView has some offset in between that I don't understand why.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_below="@+id/upper_widget_bar"
    android:background="@color/colorPrimaryDark">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"/>

    <com.futuremind.recyclerviewfastscroll.FastScroller
        android:id="@+id/fastscroll"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

</LinearLayout>

ScrollStateListener not work with fastscroller

I implement onScrollStateChanged method in RecyclerView and it works great, i want to show scroller when recycler dragged and i succesfully do it. But when i try to scroll by fastscroller recycler wont notify onScrollStateListener and nothing happened.

It works only when i drag recycler without scroller, how can i make it work with fastscroller too?

RecyclerViewScrollListener onScrollListener = new RecyclerViewScrollListener(mFastScroller) {
            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                switch (newState) {
                    case RecyclerView.SCROLL_STATE_DRAGGING :
                        Animation fadeInAnimation = AnimationUtils
                                .loadAnimation(IMContactsListFragment.this.getContext(), R.anim.fade_in);
                        mFastScroller.startAnimation(fadeInAnimation);
                        mFastScroller.setVisibility(View.VISIBLE);
                        break;
                    case RecyclerView.SCROLL_STATE_IDLE :
                        Animation fadeOutAnimation = AnimationUtils
                                .loadAnimation(IMContactsListFragment.this.getContext(), R.anim.fade_out);
                        mFastScroller.startAnimation(fadeOutAnimation);
                        mFastScroller.setVisibility(View.GONE);
                        break;
                }
            }
        };

Scrollbar jumping up and down with varying heights rows

Thought it was good to open a separate issue for this:

I have a RecyclerView that consists of varying heights TextViews (and some of the TextViews are larger than the full screen height).

When scrolling down using swiping (NOT using the fast scroll), I see the scrollbar jumping up and down as I scroll down.

Feels like the component needs a android:smoothScrollbar="false" like the ListView, but not entirely sure why it's happening... Any ideas?

Date instead of the first Letter

I want to have my items sorted by their date field and the fast scroll show the date instead of alphabetical, is that possible?

Feature Request: Animator to show/hide handle by translating x

Problem: I want to style my handle using translateX, so it will get in from the right of the screen, and get out to the right of the screen.
I find it impossible to do with just @AnimatorRes int but it can be done easily by java, because i can't get the screen width. Maybe VisibilityAnimationManager.AbsBuilder.withShowAnimator and VisibilityAnimationManager.AbsBuilder.withHideAnimator can accept AnimatorSet object directly?

null pointer

i dont set recycler view in the oncreateview
in on create view i fetch data via async task and then set recycler view
in this scenarios it says
nullpointer .. in onLayout when goes it set onTouch listener on handle .hhandle is null ,,??
what is this scene what do i do ??

Not working out of the box

I am creating a list of countries and I followed exactly what is written on the github page. The bubble text is not appearing. I tried this on Android 4.0+. The included example project is also not working. No text bubble/indicators.

It also seem getSectionTitle not being called. Any ideas?

AppCompactDependancy Issue

I think you used compile 'com.android.support:appcompat-v7:25.1.0'

please come back to compile 'com.android.support:appcompat-v7:25.0.1'

becz, in appcompat : 25.1.0 fragment getSupportFragmentManager().popBackStack(); have a bug and it's not working perfectly...

Scrollbar not visible at first

Not sure if this is a bug of if I'm missing something so thought I'd ask.

I have a RecyclerView that consists of varying heights TextViews (and some of the TextViews are larger than the full screen height).

When my view is first loaded, I do not see the scrollbar at all. In this case the first TextView is larger than the full screen height. As soon as I scroll down to the first line in the second TextView, the scrollbar shows up.

After that the scrollbar sticks and works fine even when scrolling back up to the top.

Any idea what might be happening here?

Force closed if my custom ViewGroup called onLayout directly

I have a custom ViewGroup that called onLayout directly, but this line scrollListener.updateHandlePosition(recyclerView); will make application force closed with error java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView.computeVerticalScrollOffset()' on a null object reference

Actually i could avoid the force closed easily by setting mFastScroller.setRecyclerView(mRecyclerView); twice: after findViewById and after mRecyclerView.setAdapter(mAdapter);

But i think it will be more useful if the library itself check for null object directly before set any value to it.

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.