Changed rewind/fast forward button actions so holding will skip tracks #940
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When in the Now Playing fragment, holding the previous/next button will enable an auto-repeating rewind/fast forward action until the button is released. However, holding the rewind/fast forward buttons will not do anything, it will just do a normal rewind/fast forward action when the press is released.
I have changed the actions so that the rewind/fast forward buttons are better "mirrors" of the previous/next buttons--that is, holding the rewind button will call the previous track action, just as holding the previous button will call the rewind action (and the same for next/FF). I didn't keep the auto-repeating functionality for this, since holding to skip tracks is odd and could be unexpected behavior. Instead, a simple long-press triggers the action, instead of the auto-repeat touch event.
This change also fully separates the rewind/fast forward actions from the next/previous actions. In the current version, the next/previous action would check to see if rewind/fast forward should be called. This can cause unexpected behavior. If I press the "next" button (in multiple contexts, whether in the app itself, on the widget, notification, or Auto controls), I would expect the next song to play, and not the song to simply fast forward. I understand that this check was in there due to rewind/fast forward buttons not showing up in different contexts - I am working on another commit for the home screen widget and for Android Auto. GlennGuy's excellent MediaStyle notifications are already behaving properly with rewind/fast forward button appearances, though that pull request has not been accepted yet. If for some reason it is not accepted, I can work on notifications as well.