From 4498f39b8c4900fccdc359d0c687c26db23526c3 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 7 Oct 2023 03:50:41 +0200 Subject: [PATCH] feat(YouTube): Add `Disable fine scrubbing gesture` patch --- .../DisableFineScrubbingGesturePatch.java | 18 ++++++++++++++++++ .../integrations/settings/SettingsEnum.java | 1 + 2 files changed, 19 insertions(+) create mode 100644 app/src/main/java/app/revanced/integrations/patches/DisableFineScrubbingGesturePatch.java diff --git a/app/src/main/java/app/revanced/integrations/patches/DisableFineScrubbingGesturePatch.java b/app/src/main/java/app/revanced/integrations/patches/DisableFineScrubbingGesturePatch.java new file mode 100644 index 0000000000..72a6859065 --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/DisableFineScrubbingGesturePatch.java @@ -0,0 +1,18 @@ +package app.revanced.integrations.patches; + +import android.view.MotionEvent; +import android.view.VelocityTracker; +import app.revanced.integrations.settings.SettingsEnum; + +public final class DisableFineScrubbingGesturePatch { + /** + * Disables the fine scrubbing gesture. + * @param tracker The velocity tracker that is used to determine the gesture. + * @param event The motion event that is used to determine the gesture. + */ + public static void disableGesture(VelocityTracker tracker, MotionEvent event) { + if (SettingsEnum.DISABLE_FINE_SCRUBBING_GESTURE.getBoolean()) return; + + tracker.addMovement(event); + } +} diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 1c7979d1eb..3affe38447 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -170,6 +170,7 @@ public enum SettingsEnum { EXTERNAL_BROWSER("revanced_external_browser", BOOLEAN, TRUE, true), AUTO_REPEAT("revanced_auto_repeat", BOOLEAN, FALSE), SEEKBAR_TAPPING("revanced_seekbar_tapping", BOOLEAN, TRUE), + DISABLE_FINE_SCRUBBING_GESTURE("revanced_disable_fine_scrubbing_gesture", BOOLEAN, TRUE), SPOOF_SIGNATURE("revanced_spoof_signature_verification_enabled", BOOLEAN, TRUE, true, "revanced_spoof_signature_verification_enabled_user_dialog_message"), SPOOF_SIGNATURE_IN_FEED("revanced_spoof_signature_in_feed_enabled", BOOLEAN, FALSE, false,