mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 11:52:00 +00:00
Update uYouPlus.xm
This commit is contained in:
parent
2b3705a8fe
commit
08e1e771ac
1 changed files with 10 additions and 48 deletions
|
|
@ -17,39 +17,6 @@ NSBundle *uYouPlusBundle() {
|
||||||
NSBundle *tweakBundle = uYouPlusBundle();
|
NSBundle *tweakBundle = uYouPlusBundle();
|
||||||
//
|
//
|
||||||
|
|
||||||
/*
|
|
||||||
// Disable Live Activities (iOS 16+)
|
|
||||||
@implementation CustomDisableLiveActivities : NSObject
|
|
||||||
- (void)disableLiveActivitiesAndDynamicIsland {
|
|
||||||
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
|
|
||||||
if (@available(iOS 16.0, *)) {
|
|
||||||
if (![bundleIdentifier isEqualToString:@"com.google.ios.youtube"]) {
|
|
||||||
NSLog(@"Handling Live Activities for a different app...");
|
|
||||||
if ([NSClassFromString(@"Activity") respondsToSelector:NSSelectorFromString(@"currentActivity")]) {
|
|
||||||
id activity = [NSClassFromString(@"Activity") performSelector:NSSelectorFromString(@"currentActivity")];
|
|
||||||
[activity performSelector:NSSelectorFromString(@"setContent:") withObject:yourActivityContent];
|
|
||||||
[activity performSelector:NSSelectorFromString(@"updateContent:") withObject:updatedActivityContent];
|
|
||||||
[activity performSelector:NSSelectorFromString(@"endActivity")];
|
|
||||||
} else {
|
|
||||||
NSLog(@"Activity class or methods not found.");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
NSLog(@"Live activities are disabled for the YouTube app.");
|
|
||||||
[UIApplication sharedApplication].applicationSupportsShakeToEdit = NO;
|
|
||||||
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
|
|
||||||
NSLog(@"Dynamic Island notifications are disabled for the YouTube app.");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
NSLog(@"Live activities and Dynamic Island notifications are not applicable.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- (void)viewDidLoad {
|
|
||||||
[super viewDidLoad];
|
|
||||||
[self disableLiveActivitiesAndDynamicIsland];
|
|
||||||
}
|
|
||||||
@end
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Notifications Tab appearance
|
// Notifications Tab appearance
|
||||||
UIImage *resizeImage(UIImage *image, CGSize newSize) {
|
UIImage *resizeImage(UIImage *image, CGSize newSize) {
|
||||||
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
|
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
|
||||||
|
|
@ -1363,22 +1330,17 @@ static int contrastMode() {
|
||||||
// Hide Fullscreen Button - @arichornlover
|
// Hide Fullscreen Button - @arichornlover
|
||||||
%group gHideFullscreenButton
|
%group gHideFullscreenButton
|
||||||
%hook YTInlinePlayerBarContainerView
|
%hook YTInlinePlayerBarContainerView
|
||||||
- (void)hideFullscreenButton {
|
- (BOOL)fullscreenButtonDisabled { return YES; }
|
||||||
if (self.enterFullscreenButton) {
|
- (BOOL)canShowFullscreenButton { return NO; }
|
||||||
self.enterFullscreenButton.hidden = YES;
|
- (BOOL)canShowFullscreenButtonExperimental { return NO; }
|
||||||
[self.enterFullscreenButton removeFromSuperview];
|
// - (void)setFullscreenButtonDisabled:(BOOL) // Might implement this if useful - @arichornlover
|
||||||
}
|
- (void)layoutSubviews {
|
||||||
if (self.exitFullscreenButton) {
|
|
||||||
self.exitFullscreenButton.hidden = YES;
|
|
||||||
[self.exitFullscreenButton removeFromSuperview];
|
|
||||||
}
|
|
||||||
[self setNeedsUpdateConstraints];
|
|
||||||
[self updateConstraintsIfNeeded];
|
|
||||||
}
|
|
||||||
- (void)didMoveToWindow {
|
|
||||||
%orig;
|
%orig;
|
||||||
if (IS_ENABLED(kDisableFullscreenButton)) {
|
if (self.exitFullscreenButton && !self.exitFullscreenButton.hidden) {
|
||||||
[self hideFullscreenButton];
|
self.exitFullscreenButton.hidden = YES;
|
||||||
|
}
|
||||||
|
if (self.enterFullscreenButton && !self.enterFullscreenButton.hidden) {
|
||||||
|
self.enterFullscreenButton.hidden = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue