Fix long press behavior in audio player
Description
This MR resolves an issue introduced in !964 (merged) which was causing the previous and next buttons to skip two tracks at a time. The issue was determined to be two listeners each invoking the onPreviousClick()/onNextClick() functions because the button press events were not consumed by either listener. The button press is now cleared programmatically by the long press listener, which resets the background color.
Motivation and Context
The change restores the existing functionality which allows for a long press of the previous button to seek back to the start of a track, and long press of the next button to advance to the end of the track.
I prefer the new behavior to the pre-redesign implementation, as long pressing on the next button does not drop you multiple seconds into the subsequent track. It goes to the end of the current track, which then advances to the start of the next track in the playlist.
How Has This Been Tested?
Tested on a Google Pixel 3 running Android 11.
Types of changes
-
Bug fix (non-breaking change which fixes an issue)
Checklist
-
I have read the CONTRIBUTING section of the README document.