only show the option on iPad

This commit is contained in:
Nguyễn Đạt 2023-02-05 13:18:49 +07:00 committed by GitHub
parent 7139db47bc
commit c7be5fa51a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,7 +92,7 @@ extern NSBundle *uYouPlusBundle();
return YES;
}
settingItemId:0],
];
];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_PLAYER_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];
return YES;
@ -211,8 +211,7 @@ extern NSBundle *uYouPlusBundle();
return YES;
}
settingItemId:0],
];
];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];
return YES;
@ -291,7 +290,7 @@ extern NSBundle *uYouPlusBundle();
return YES;
}
settingItemId:0],
];
];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"SHORTS_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];
return YES;
@ -398,16 +397,6 @@ extern NSBundle *uYouPlusBundle();
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT")
titleDescription:LOC(@"IPHONE_LAYOUT_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"iPhoneLayout_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"iPhoneLayout_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"NEW_MINIPLAYER_STYLE")
titleDescription:LOC(@"NEW_MINIPLAYER_STYLE_DESC")
@ -428,7 +417,22 @@ extern NSBundle *uYouPlusBundle();
return YES;
}
settingItemId:0],
];
];
if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
YTSettingsSectionItem *ipadItem = [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT")
titleDescription:LOC(@"IPHONE_LAYOUT_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"iPhoneLayout_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"iPhoneLayout_enabled"];
return YES;
}
settingItemId:0];
rows = [rows arrayByAddingObject:ipadItem];
}
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"MISCELLANEOUS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];
return YES;