From fbe3c90d666c1e2416dd73c2e1304f80daf49811 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Tue, 9 Apr 2024 23:38:39 -0700 Subject: [PATCH 1/2] Fix hide fullscreen actions --- Sources/uYouPlus.xm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index d7dbc1dfc6..bad3783efa 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -554,7 +554,7 @@ BOOL isAd(YTIElementRenderer *self) { %group hideFullscreenActions %hook YTMainAppVideoPlayerOverlayViewController - (BOOL)isFullscreenActionsEnabled { -// This didn't work on its own - weird + // Attempt 1 return IS_ENABLED(@"hideFullscreenActions_enabled") ? NO : %orig; } %end @@ -563,12 +563,17 @@ BOOL isAd(YTIElementRenderer *self) { // Attempt 2 return IS_ENABLED(@"hideFullscreenActions_enabled") ? NO : %orig; } -- (void)removeFromSuperview { +- (void)layoutSubviews { // Attempt 3 if (IS_ENABLED(@"hideFullscreenActions_enabled")) { - [self removeFromSuperview]; + // Check if already removed from superview + if (self.superview) { + [self removeFromSuperview]; + } + self.hidden = YES; + self.frame = CGRectZero; } -%orig; + %orig; } %end %end From 99b55876b93de5de5910b2d9db655a1a0e14e885 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:28:10 -0700 Subject: [PATCH 2/2] Reformat --- Sources/uYouPlus.xm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index bad3783efa..737d9054fd 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -554,25 +554,20 @@ BOOL isAd(YTIElementRenderer *self) { %group hideFullscreenActions %hook YTMainAppVideoPlayerOverlayViewController - (BOOL)isFullscreenActionsEnabled { - // Attempt 1 - return IS_ENABLED(@"hideFullscreenActions_enabled") ? NO : %orig; + return NO; } %end %hook YTFullscreenActionsView - (BOOL)enabled { - // Attempt 2 - return IS_ENABLED(@"hideFullscreenActions_enabled") ? NO : %orig; + return NO; } - (void)layoutSubviews { - // Attempt 3 - if (IS_ENABLED(@"hideFullscreenActions_enabled")) { - // Check if already removed from superview - if (self.superview) { - [self removeFromSuperview]; - } - self.hidden = YES; - self.frame = CGRectZero; + // Check if already removed from superview + if (self.superview) { + [self removeFromSuperview]; } + self.hidden = YES; + self.frame = CGRectZero; %orig; } %end