mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-22 04:31:59 +00:00
fix YTCastconfirm, code clean up
This commit is contained in:
parent
2e6c19c060
commit
ec7eec660b
1 changed files with 31 additions and 37 deletions
24
uYouPlus.xm
24
uYouPlus.xm
|
|
@ -112,9 +112,9 @@ BOOL ytMiniPlayer() {
|
|||
%end
|
||||
|
||||
//YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
|
||||
%group gYTCastconfirm
|
||||
%hook MDXPlaybackRouteButtonController
|
||||
- (void)didPressButton:(id)arg1 {
|
||||
if (castConfirm()) {
|
||||
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting"
|
||||
message:@"Are you sure you want to start casting?"
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
|
@ -125,8 +125,9 @@ BOOL ytMiniPlayer() {
|
|||
UIAlertAction* noButton = [%c(UIAlertAction)
|
||||
actionWithTitle:@"Cancel"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler: ^(UIAlertAction * action) { return; }
|
||||
];
|
||||
handler: ^(UIAlertAction * action) {
|
||||
return;
|
||||
}];
|
||||
|
||||
[alertController addAction:defaultAction];
|
||||
[alertController addAction:noButton];
|
||||
|
|
@ -142,10 +143,10 @@ BOOL ytMiniPlayer() {
|
|||
rootViewController = [rootViewController presentedViewController];
|
||||
}
|
||||
[rootViewController presentViewController:alertController animated:YES completion:nil];
|
||||
return %orig;
|
||||
} else { return %orig; }
|
||||
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/12
|
||||
%hook YTAdsInnerTubeContextDecorator
|
||||
|
|
@ -317,9 +318,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.tableView.backgroundColor = oledColor;
|
||||
} else {
|
||||
return %orig();
|
||||
}
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -417,9 +416,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
%hook YTCollectionSeparatorView
|
||||
- (void)didMoveToWindow {
|
||||
if (isDarkMode()) {}
|
||||
else {
|
||||
return %orig();
|
||||
}
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -443,8 +440,8 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
%hook ASWAppSwitcherCollectionViewCell
|
||||
- (void)didMoveToWindow {
|
||||
if (isDarkMode()) {
|
||||
%orig;
|
||||
self.subviews[1].backgroundColor = oledColor;
|
||||
%orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
|
@ -568,7 +565,4 @@ static void replaceTab(YTIGuideResponse *response) {
|
|||
if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) {
|
||||
%init(Main);
|
||||
}
|
||||
if (castConfirm()) {
|
||||
%init(gYTCastconfirm);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue