[Catalog] Fix CardSelectionModeActivity sample
Resolves https://github.com/material-components/material-components-android/issues/2716
The original commit that added this solution/workaround: https://github.com/material-components/material-components-android/commit/a49fa6ab36276a762d46d9f716b4ef8ff5947907
If I understand correctly, SelectionTracker is using RecyclerView.OnItemTouchListener to grab click/long click events. Therefore if the accessibility framework directly send click/long click events, SelectionTracker won't be able to catch them, and that's why we need the workaround at the beginning and we need to keep the behavior.
Unfortunately, this workaround doesn't fulfill its task and makes the situation even worse:
- Сard selection stopped working in normal use (see #2716).
- Card selection still doesn't work in TalkBack mode for the same reason.
- Even if this workaround worked, it would still not match the behavior expected from
SelectionTracker. A long click is only needed to enter the selection mode and activate the first item, to activate/deactivate the other elements, a single click should work.
Paul, can you take a look?
This just reverts the original change that was made to make (attempt...) the card selection accessible, would be great to find a proper fix instead of just removing it.
A proper fix can only be provided by androidx.recyclerview:recyclerview-selection developers.
The original solution is correct from a logical point of view, but doesn't work only with Talkback due to some problem with recyclerview-selection. The current solution is a hack and doesn't work correctly at all (neither in normal mode nor in Talkback). That's why I think the current change needs to be reverted.