Skip to content

ScrollStateListener not work with fastscroller #68

@ivametal

Description

@ivametal

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;
                }
            }
        };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions