Item click is not working, while auto scroll in recyclerview
Asked Answered
W

0

1

I have used the following code to autoscroll the Horizontal recyclerview.

private final Runnable SCROLLING_RUNNABLE = new Runnable() {

        @Override
        public void run() {
            recyclerViewDate.smoothScrollBy(pixelsToMove, 0);
            setDateValue();
            mHandler.postDelayed(this, duration);
        }
    };


@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_center_item_finder);
        txtSelected=(TextView)findViewById(R.id.txtSelected);
        getRecyclerviewData();
        mHandler.postDelayed(SCROLLING_RUNNABLE, 100);
    }

But I'm not able to perform click on recycler items, while scrolling. Found this solution, created a custom recyclerview. Android - the item inside RecyclerView can't be clicked after scroll Still click not working.

Windproof answered 22/8, 2018 at 2:44 Comment(1)
I amde a custom class extend Recylerview and put this answer into this and it worked good for me. https://mcmap.net/q/500346/-recyclerview-items-clicking-while-scrollingCrudden

© 2022 - 2024 — McMap. All rights reserved.