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 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube): Show video chapter titles without clipping when overlay…
… buttons are enabled (#699)
- Loading branch information
1 parent
f49d634
commit 325cc17
Showing
10 changed files
with
252 additions
and
135 deletions.
There are no files selected for viewing
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
83 changes: 0 additions & 83 deletions
83
app/src/main/java/app/revanced/integrations/youtube/videoplayer/BottomControlButton.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
Oops, something went wrong.