This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
310 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 2 additions & 12 deletions
14
...ain/java/app/revanced/integrations/youtube/patches/DisablePreciseSeekingGesturePatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
package app.revanced.integrations.youtube.patches; | ||
|
||
import android.view.MotionEvent; | ||
import android.view.VelocityTracker; | ||
|
||
import app.revanced.integrations.youtube.settings.Settings; | ||
|
||
@SuppressWarnings("unused") | ||
public final class DisablePreciseSeekingGesturePatch { | ||
/** | ||
* Disables the gesture that is used to seek precisely. | ||
* @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 (Settings.DISABLE_PRECISE_SEEKING_GESTURE.get()) return; | ||
|
||
tracker.addMovement(event); | ||
public static boolean isGestureDisabled() { | ||
return Settings.DISABLE_PRECISE_SEEKING_GESTURE.get(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
app/src/main/java/app/revanced/integrations/youtube/patches/PlayerControlsPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package app.revanced.integrations.youtube.patches; | ||
|
||
import android.view.View; | ||
import android.view.ViewTreeObserver; | ||
import android.widget.ImageView; | ||
|
||
import app.revanced.integrations.shared.Logger; | ||
|
||
@SuppressWarnings("unused") | ||
public class PlayerControlsPatch { | ||
/** | ||
* Injection point. | ||
*/ | ||
public static void setFullscreenCloseButton(ImageView imageButton) { | ||
// Add a global listener, since the protected method | ||
// View#onVisibilityChanged() does not have any call backs. | ||
imageButton.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | ||
int lastVisibility = View.VISIBLE; | ||
|
||
@Override | ||
public void onGlobalLayout() { | ||
try { | ||
final int visibility = imageButton.getVisibility(); | ||
if (lastVisibility != visibility) { | ||
lastVisibility = visibility; | ||
|
||
Logger.printDebug(() -> "fullscreen button visibility: " | ||
+ (visibility == View.VISIBLE ? "VISIBLE" : | ||
visibility == View.GONE ? "GONE" : "INVISIBLE")); | ||
|
||
fullscreenButtonVisibilityChanged(visibility == View.VISIBLE); | ||
} | ||
} catch (Exception ex) { | ||
Logger.printDebug(() -> "OnGlobalLayoutListener failure", ex); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
// noinspection EmptyMethod | ||
public static void fullscreenButtonVisibilityChanged(boolean isVisible) { | ||
// Code added during patching. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.