Given: RecyclerView with plain TextView as markup for list item. API version 17 and higher.
Required: select an element, including the click animation at the beginning (standard Material animation), but after a long press, leave the element pressed.
Solution options: the only thing I came up with was to install OnLongClickListener and manually check the press. After a long press, simply change the background to the clicked.
Also, as an option, I wanted to set the background selector, which prescribes the color at the stages of pressing, but then there were two problems: I get the animation by setting android:background="?android:attr/selectableItemBackground , so it will disappear, and, if manually to expose the color, after a certain number of elements, is found the same, highlighted (until I understood why).
Question: How is it right to select elements in RecyclerView , with Material animation (if the Android version is higher than 5th) and without the appearance of bugs with the following elements?