Update uYouPlusSettings.xm
This commit is contained in:
parent
378bc63a59
commit
ab00a8bd7a
1 changed files with 8 additions and 11 deletions
|
|
@ -473,23 +473,20 @@ extern NSBundle *uYouPlusBundle();
|
||||||
@"hideFullscreenActions_enabled",
|
@"hideFullscreenActions_enabled",
|
||||||
({
|
({
|
||||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||||
Class YTVersionUtilsClass = %c(YTVersionUtils);
|
// Show alert if the option is not compatible with iPad
|
||||||
NSString *appVersion = [YTVersionUtilsClass performSelector:@selector(appVersion)];
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"iPad Compatibility Issue" message:@"This option is only compatible with iPhone devices." preferredStyle:UIAlertControllerStyleAlert];
|
||||||
NSComparisonResult result = [appVersion compare:@"19.22.6" options:NSNumericSearch];
|
|
||||||
if (result == NSOrderedAscending) {
|
|
||||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"iPad is using an Incompatible YouTube Version" message:@"This Option is only compatible with YouTube version 19.22.6 and higher on iPad devices." preferredStyle:UIAlertControllerStyleAlert];
|
|
||||||
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
|
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
|
||||||
[alert addAction:okAction];
|
[alert addAction:okAction];
|
||||||
[settingsViewController presentViewController:alert animated:YES completion:nil];
|
[settingsViewController presentViewController:alert animated:YES completion:nil];
|
||||||
return NO;
|
return NO;
|
||||||
} else {
|
} else {
|
||||||
|
// Normal Behavior (iPhone)
|
||||||
[[NSUserDefaults standardUserDefaults] setBool:enable forKey:@"hideFullscreenActions_enabled"];
|
[[NSUserDefaults standardUserDefaults] setBool:enable forKey:@"hideFullscreenActions_enabled"];
|
||||||
[settingsViewController reloadData];
|
[settingsViewController reloadData];
|
||||||
SHOW_RELAUNCH_YT_SNACKBAR;
|
SHOW_RELAUNCH_YT_SNACKBAR;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
})
|
|
||||||
);
|
);
|
||||||
SWITCH_ITEM2(LOC(@"HIDE_SUGGESTED_VIDEO"), LOC(@"HIDE_SUGGESTED_VIDEO_DESC"), @"noSuggestedVideo_enabled");
|
SWITCH_ITEM2(LOC(@"HIDE_SUGGESTED_VIDEO"), LOC(@"HIDE_SUGGESTED_VIDEO_DESC"), @"noSuggestedVideo_enabled");
|
||||||
SWITCH_ITEM2(LOC(@"HIDE_HEATWAVES_BAR"), LOC(@"HIDE_HEATWAVES_BAR_DESC"), @"hideHeatwaves_enabled");
|
SWITCH_ITEM2(LOC(@"HIDE_HEATWAVES_BAR"), LOC(@"HIDE_HEATWAVES_BAR_DESC"), @"hideHeatwaves_enabled");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue