diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 2746a10..929ea58 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -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 *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);