Item click is not working, while auto scroll in recyclerview

不羁岁月 提交于 2019-12-24 08:07:00

问题


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.

来源:https://stackoverflow.com/questions/51959211/item-click-is-not-working-while-auto-scroll-in-recyclerview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!