Update “Enable Notifications Tab” Option

Also added customization options for it for Nostalgic purposes.
This commit is contained in:
aricloverEXALT 2025-01-14 04:06:53 -06:00 committed by GitHub
parent 167420d8bb
commit 831b55c6bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,6 +101,9 @@ static int contrastMode() {
static int appVersionSpoofer() { // App Version Spoofer
return [[NSUserDefaults standardUserDefaults] integerForKey:@"versionSpoofer"];
}
static int getNotificationIconStyle() { // Notifications Tab
return [[NSUserDefaults standardUserDefaults] integerForKey:@"notificationIconStyle"];
}
static const NSInteger uYouPlusSection = 500;
@interface YTSettingsSectionItemManager (uYouPlus)
@ -1112,6 +1115,51 @@ NSString *cacheDescription = [NSString stringWithFormat:@"%@", GetCacheSize()];
SWITCH2(LOC(@"HIDE_ISPONSORBLOCK"), nil, kHideiSponsorBlockButton);
SWITCH(LOC(@"HIDE_CHIP_BAR"), LOC(@"HIDE_CHIP_BAR_DESC"), kHideChipBar);
SWITCH2(LOC(@"Enable Notifications Tab"), LOC(@"Makes the Notifications Tab appear back onto the Pivot Bar, experimental: Testing customization options."), kShowNotificationsTab);
YTSettingsSectionItem *notificationIconStyle = [%c(YTSettingsSectionItem)
itemWithTitle:LOC(@"Notifications Tab nostalgic customization")
accessibilityIdentifier:nil
detailTextBlock:^NSString *() {
switch (getNotificationIconStyle()) {
case 1:
return @"Thin Outline (2020+)";
case 2:
return @"Filled (2018+)";
case 3:
return @"Classic/Inbox (2014+)";
case 0:
default:
return @"Default";
}
}
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
NSArray <YTSettingsSectionItem *> *rows = @[
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Default" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"notificationIconStyle"];
[settingsViewController reloadData];
return YES;
}],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Thin Outline (2020+)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"notificationIconStyle"];
[settingsViewController reloadData];
return YES;
}],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Filled (2018+)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"notificationIconStyle"];
[settingsViewController reloadData];
return YES;
}],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Classic/Inbox (2014+)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:3 forKey:@"notificationIconStyle"];
[settingsViewController reloadData];
return YES;
}]
];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"Notifications Tab nostalgic customization") pickerSectionTitle:nil rows:rows selectedItemIndex:getNotificationIconStyle() parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];
return YES;
}
];
[sectionItems addObject:notificationIconStyle];
SWITCH(LOC(@"HIDE_PLAY_NEXT_IN_QUEUE"), LOC(@"HIDE_PLAY_NEXT_IN_QUEUE_DESC"), kHidePlayNextInQueue);
SWITCH2(LOC(@"HIDE_COMMUNITY_POSTS"), LOC(@"HIDE_COMMUNITY_POSTS_DESC"), kHideCommunityPosts);
SWITCH2(LOC(@"HIDE_HEADER_LINKS_UNDER_PROFILE"), LOC(@"HIDE_HEADER_LINKS_UNDER_PROFILE_DESC"), kHideChannelHeaderLinks);