generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube): Do not hide player controls when using double tap to sk…
…ip forward (#4487) Co-authored-by: MarcaDian <tolan.sheremeev@gmail.com>
- Loading branch information
1 parent
3d1dd06
commit 63fe870
Showing
19 changed files
with
372 additions
and
398 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
56 changes: 56 additions & 0 deletions
56
...ube/src/main/java/app/revanced/extension/youtube/sponsorblock/ui/CreateSegmentButton.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,56 @@ | ||
package app.revanced.extension.youtube.sponsorblock.ui; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import app.revanced.extension.shared.Logger; | ||
import app.revanced.extension.youtube.patches.VideoInformation; | ||
import app.revanced.extension.youtube.settings.Settings; | ||
import app.revanced.extension.youtube.videoplayer.PlayerControlButton; | ||
|
||
public class CreateSegmentButton { | ||
@Nullable | ||
private static PlayerControlButton instance; | ||
|
||
public static void hideControls() { | ||
if (instance != null) instance.hide(); | ||
} | ||
|
||
/** | ||
* injection point | ||
*/ | ||
public static void initialize(View controlsView) { | ||
try { | ||
instance = new PlayerControlButton( | ||
controlsView, | ||
"revanced_sb_create_segment_button", | ||
null, | ||
CreateSegmentButton::shouldBeShown, | ||
v -> SponsorBlockViewController.toggleNewSegmentLayoutVisibility(), | ||
null | ||
); | ||
} catch (Exception ex) { | ||
Logger.printException(() -> "initialize failure", ex); | ||
} | ||
} | ||
|
||
/** | ||
* Injection point | ||
*/ | ||
public static void setVisibilityImmediate(boolean visible) { | ||
if (instance != null) instance.setVisibilityImmediate(visible); | ||
} | ||
|
||
/** | ||
* Injection point | ||
*/ | ||
public static void setVisibility(boolean visible, boolean animated) { | ||
if (instance != null) instance.setVisibility(visible, animated); | ||
} | ||
|
||
private static boolean shouldBeShown() { | ||
return Settings.SB_ENABLED.get() && Settings.SB_CREATE_NEW_SEGMENT.get() | ||
&& !VideoInformation.isAtEndOfVideo(); | ||
} | ||
} |
60 changes: 0 additions & 60 deletions
60
...in/java/app/revanced/extension/youtube/sponsorblock/ui/CreateSegmentButtonController.java
This file was deleted.
Oops, something went wrong.
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.