I have a RecyclerView with a ViewHolder that contains a Button. I want the Button to be a regular single-click Button or a hold & repeat Button depending on a checkbox. Some of the components I have looked at that may be of significance are:
1. Making sure the handler is not added multiple times and is removed before adding the other one when switching between single-click and hold & repeat.
2. Using the Button's Touch event to start/stop repeating when using hold & repeat
3. Whether to use a timer, a while loop containing Task.Delay, or another method when doing hold & repeat
4. Whether to have the hold & repeat manually raise the click event, manually call the click event handler, or just use separate code (the code I need the Button to execute is very short)
Avoiding adding multiple and removing existing event handlers in the Adapter of a RecyclerView is something that I have always found somewhat challenging. Does anyone have any suggestions on how to make a Button that meets my requirements? Thanks.
