Search code examples
androidandroid-recyclerviewandroid-nestedscrollview

Get Scroll in Recyclerview inside Nested Scrollview


I have this code addOnScrollListener of recyclerview which is inside a nestedscroll view

 mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                mScrollState = newState;
                if (newState == RecyclerView.SCROLL_STATE_IDLE && adapter.getItemCount() > 0) {
                    mCalculator.onScrollStateIdle();
                }
            }

            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                mCalculator.onScrolled(mScrollState);
            }
        });

i need to get into those methods in addOnScrollListener when i scroll my view. But unfortunately, while scrolling not entering this methods. can anyone help me how to get scroll of recyclerview inside the nested scrollview


Solution

  • I just handled issue by using gesture motion