Skip to content

Conversation

@vkay94
Copy link
Contributor

@vkay94 vkay94 commented Oct 21, 2020

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

This PR separates the logic behind the player gestures (for example popup position observation) and the UI (for example show/hide controls and adjusting the brightness during scrolling) This way it is more readable.

  • Created BasePlayerGestureListener which handles the logic and provides abstract methods for listening
  • Now PlayerGestureListener contains only visual code
  • Added DisplayPortion enum class (LEFT,MIDDLE,RIGHT for double tap, LEFT_HALF, RIGHT_HALF for scrolling)
  • Added multi-double-tap-logic (will be used by [Feature Request] YouTube's fast forward/rewind behavior #4264 soon)

APK testing

app-debug-0.20.2-fix.zip

Due diligence

@TobiGr TobiGr added the player Issues related to any player (main, popup and background) label Oct 21, 2020
@vkay94 vkay94 force-pushed the separate-player-gesture-logic-ui branch from 7a5de5d to e97f71c Compare October 29, 2020 12:12
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, I also did some testing and everything worked as expected. Thank you!

return true;
if (portion == DisplayPortion.LEFT) {
playerImpl.onFastRewind();
} else if (portion == DisplayPortion.RIGHT) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add here else if (portion == DisplayPortion.MIDDLE) { playerImpl.onPlayPause(); }, so that a double tap in the middle changes the playing state, as it did before #2907? Or will you do this in a future PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed this middle gesture somehow., my bad. I'll add it again (or if you'd like to you can do it since you're authorized) :')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'm gonna do it and then merge

@Stypox Stypox force-pushed the separate-player-gesture-logic-ui branch from e97f71c to 347566c Compare November 2, 2020 14:55
@Stypox Stypox merged commit f1583b6 into TeamNewPipe:dev Nov 2, 2020
This was referenced Nov 10, 2020
@vkay94 vkay94 deleted the separate-player-gesture-logic-ui branch December 2, 2020 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

player Issues related to any player (main, popup and background)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants