Fix hide fullscreen actions

This commit is contained in:
Bryce Hackel 2024-04-09 23:38:39 -07:00
parent 7967b9617c
commit fbe3c90d66
No known key found for this signature in database
GPG key ID: F031960F08455E88

View file

@ -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