From d86b7cf08c8452cf201afa91c60f68cd4f10c84e Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Wed, 1 May 2024 22:29:49 -0700 Subject: [PATCH] Remove gray background --- Sources/uYouPlus.h | 1 + Sources/uYouPlus.xm | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 7bbe66b..bc35d58 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -60,6 +60,7 @@ // Hide Double tap to seek Overlay @interface YTInlinePlayerDoubleTapIndicatorView : UIView @property (nonatomic, strong) UIView *scrimOverlay; +@property(nonatomic, assign) CABasicAnimation *uYouEnhancedBlankAnimation; @end // Hide Home Tab - @bhackel diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index b0102a9..5de99bb 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -762,15 +762,36 @@ BOOL isAd(YTIElementRenderer *self) { } %end -// Hide double tap to seek overlay - @arichornlover +// Hide double tap to seek overlay - @arichornlover & @bhackel +%group gHideDoubleTapToSeekOverlay %hook YTInlinePlayerDoubleTapIndicatorView -- (void)layoutSubviews { - %orig; - if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) { - self.frame = CGRectZero; - } +%property(nonatomic, assign) CABasicAnimation *uYouEnhancedBlankAnimation; +- (CABasicAnimation *)alphaAnimation { + NSLog(@"bhackel: alphaAnimation 1"); + // Create a new basic animation for the opacity property + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + + // Set both fromValue and toValue to 1.0 - no visible change will occur + NSLog(@"bhackel: alphaAnimation 2"); + animation.fromValue = @0.0; + NSLog(@"bhackel: alphaAnimation 3"); + animation.toValue = @0.0; + + // Set the duration of the animation + NSLog(@"bhackel: alphaAnimation 4"); + animation.duration = 0.0; // The animation will apply immediately + + // Additional properties to ensure the animation does not alter the layer + NSLog(@"bhackel: alphaAnimation 5"); + animation.fillMode = kCAFillModeForwards; + NSLog(@"bhackel: alphaAnimation 6"); + animation.removedOnCompletion = NO; + + NSLog(@"bhackel: alphaAnimation 7"); + return animation; } %end +%end // Disable pull to enter vertical/portrait fullscreen gesture - @bhackel // This was introduced in version 19.XX @@ -1525,6 +1546,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"hideHomeTab_enabled")) { %init(gHideHomeTab); } + if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) { + %init(gHideDoubleTapToSeekOverlay); + } // YTNoModernUI - @arichorn BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");