mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-11-08 11:13:00 +00:00
De-Duplicated some code
This commit is contained in:
@@ -211,6 +211,10 @@ public class PlayerGestureListener
|
|||||||
+ player.getPlayerType() + "]");
|
+ player.getPlayerType() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player.isControlsVisible() && player.getCurrentState() == STATE_PLAYING) {
|
||||||
|
player.hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
if (playerType == MainPlayer.PlayerType.VIDEO) {
|
if (playerType == MainPlayer.PlayerType.VIDEO) {
|
||||||
if (player.getVolumeRelativeLayout().getVisibility() == View.VISIBLE) {
|
if (player.getVolumeRelativeLayout().getVisibility() == View.VISIBLE) {
|
||||||
animate(player.getVolumeRelativeLayout(), false, 200, SCALE_AND_ALPHA,
|
animate(player.getVolumeRelativeLayout(), false, 200, SCALE_AND_ALPHA,
|
||||||
@@ -220,15 +224,7 @@ public class PlayerGestureListener
|
|||||||
animate(player.getBrightnessRelativeLayout(), false, 200, SCALE_AND_ALPHA,
|
animate(player.getBrightnessRelativeLayout(), false, 200, SCALE_AND_ALPHA,
|
||||||
200);
|
200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isControlsVisible() && player.getCurrentState() == STATE_PLAYING) {
|
|
||||||
player.hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME);
|
|
||||||
}
|
|
||||||
} else /* Popup-Player */ {
|
} else /* Popup-Player */ {
|
||||||
if (player.isControlsVisible() && player.getCurrentState() == STATE_PLAYING) {
|
|
||||||
player.hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isInsideClosingRadius(event)) {
|
if (player.isInsideClosingRadius(event)) {
|
||||||
player.closePopup();
|
player.closePopup();
|
||||||
} else if (!player.isPopupClosing()) {
|
} else if (!player.isPopupClosing()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user