From 65bb1dcdbfb2820be2ff99f88a3949397a70f047 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Tue, 14 Dec 2021 20:44:01 +0100 Subject: [PATCH] Refactored code --- app/src/main/java/org/schabi/newpipe/player/Player.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index fbfaf7b95..653b226df 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -529,6 +529,10 @@ public final class Player implements binding.resizeTextView.setOnClickListener(this); binding.playbackLiveSync.setOnClickListener(this); + playerGestureListener = new PlayerGestureListener(this, service); + gestureDetector = new GestureDetectorCompat(context, playerGestureListener); + binding.getRoot().setOnTouchListener(playerGestureListener); + binding.queueButton.setOnClickListener(this); binding.segmentsButton.setOnClickListener(this); binding.repeatButton.setOnClickListener(this); @@ -583,10 +587,6 @@ public final class Player implements * Initializes the Fast-For/Backward overlay. */ private void setupPlayerSeekOverlay() { - playerGestureListener = new PlayerGestureListener(this, service); - gestureDetector = new GestureDetectorCompat(context, playerGestureListener); - binding.getRoot().setOnTouchListener(playerGestureListener); - binding.fastSeekOverlay .seekSeconds((int) (retrieveSeekDurationFromPreferences(this) / 1000.0f)) .performListener(new PlayerFastSeekOverlay.PerformListener() {