Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recyclerview single item choice. No multi touch

This is driving me crazy. Something that is implemented by default in ListView is missing from RecyclerView.

I want to have the exact behavior of a listview which is set to single choice mode. I tried the solution from this question but it doesn't fully solve the problem. When I touch the list with 2-3 fingers etc it may only highlight one row indeed, but if I lift my fingers rapidly everything gets triggered even tho only one row is highlighted each time. (I can also hear the sound effect from my phone that gets repeated 3 times very fast)

Basically I want to disable multi touch events from the phone so that the list is forced to select only 1 item each time no matter how many fingers the user uses

like image 764
ThanosFisherman Avatar asked Jul 04 '15 08:07

ThanosFisherman


1 Answers

To disable multi touch in recyclerview, you can use android:splitMotionEvents="false" in your recyclerview tag in layout file. By that attribute, you will not receive multi touch in recyclerview.

like image 108
Sai Soe Harn Avatar answered Sep 30 '22 21:09

Sai Soe Harn