refactor(YouTube - Exit fullscreen mode): Improve logging

This commit is contained in:
LisoUseInAIKyrios 2024-12-27 18:19:43 +04:00
parent b61c8ec8da
commit 6531273ac0
2 changed files with 10 additions and 5 deletions

View File

@ -28,16 +28,20 @@ public class ExitFullscreenPatch {
} }
if (PlayerType.getCurrent() == PlayerType.WATCH_WHILE_FULLSCREEN) { if (PlayerType.getCurrent() == PlayerType.WATCH_WHILE_FULLSCREEN) {
if (Utils.isLandscapeOrientation()) { if (mode != FullscreenMode.PORTRAIT_LANDSCAPE) {
if (mode == FullscreenMode.PORTRAIT) { if (Utils.isLandscapeOrientation()) {
if (mode == FullscreenMode.PORTRAIT) {
return;
}
} else if (mode == FullscreenMode.LANDSCAPE) {
return; return;
} }
} else if (mode == FullscreenMode.LANDSCAPE) {
return;
} }
ImageView fullscreenButton = PlayerControlsPatch.fullscreenButtonRef.get(); ImageView fullscreenButton = PlayerControlsPatch.fullscreenButtonRef.get();
if (fullscreenButton != null) { if (fullscreenButton == null) {
Logger.printDebug(() -> "Fullscreen button is null, cannot click");
} else {
Logger.printDebug(() -> "Clicking fullscreen button"); Logger.printDebug(() -> "Clicking fullscreen button");
fullscreenButton.performClick(); fullscreenButton.performClick();
} }

View File

@ -22,6 +22,7 @@ public class PlayerControlsPatch {
*/ */
public static void setFullscreenCloseButton(ImageView imageButton) { public static void setFullscreenCloseButton(ImageView imageButton) {
fullscreenButtonRef = new WeakReference<>(imageButton); fullscreenButtonRef = new WeakReference<>(imageButton);
Logger.printDebug(() -> "Fullscreen button set");
if (!fullscreenButtonVisibilityCallbacksExist()) { if (!fullscreenButtonVisibilityCallbacksExist()) {
return; return;