问题
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