mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-01-11 22:40:19 +00:00
Fix Notifications Tab Option (uYouPlus.xm)
It wasn’t working as intended. It should be fixed now.
This commit is contained in:
parent
b2e68d28a3
commit
f984595077
1 changed files with 19 additions and 16 deletions
|
|
@ -18,29 +18,28 @@ NSBundle *tweakBundle = uYouPlusBundle();
|
|||
//
|
||||
|
||||
// Notifications Tab - @arichornlover & @dayanch96
|
||||
%group gShowNotificationsTab
|
||||
%hook YTPivotBarView
|
||||
- (void)setRenderer:(YTIPivotBarRenderer *)renderer {
|
||||
@try {
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"kShowNotificationsTab"]) {
|
||||
YTIBrowseEndpoint *endPoint = [[%c(YTIBrowseEndpoint) alloc] init];
|
||||
[endPoint setBrowseId:@"FEnotifications_inbox"];
|
||||
YTICommand *command = [[%c(YTICommand) alloc] init];
|
||||
[command setBrowseEndpoint:endPoint];
|
||||
YTIBrowseEndpoint *endPoint = [[%c(YTIBrowseEndpoint) alloc] init];
|
||||
[endPoint setBrowseId:@"FEnotifications_inbox"];
|
||||
YTICommand *command = [[%c(YTICommand) alloc] init];
|
||||
[command setBrowseEndpoint:endPoint];
|
||||
|
||||
YTIPivotBarItemRenderer *itemBar = [[%c(YTIPivotBarItemRenderer) alloc] init];
|
||||
[itemBar setPivotIdentifier:@"FEnotifications_inbox"];
|
||||
YTIIcon *icon = [itemBar icon];
|
||||
[icon setIconType:NOTIFICATIONS];
|
||||
[itemBar setNavigationEndpoint:command];
|
||||
YTIPivotBarItemRenderer *itemBar = [[%c(YTIPivotBarItemRenderer) alloc] init];
|
||||
[itemBar setPivotIdentifier:@"FEnotifications_inbox"];
|
||||
YTIIcon *icon = [itemBar icon];
|
||||
[icon setIconType:YTIconTypeNOTIFICATIONS];
|
||||
[itemBar setNavigationEndpoint:command];
|
||||
|
||||
YTIFormattedString *formatString = [%c(YTIFormattedString) formattedStringWithString:@"Notifications"];
|
||||
[itemBar setTitle:formatString];
|
||||
YTIFormattedString *formatString = [%c(YTIFormattedString) formattedStringWithString:@"Notifications"];
|
||||
[itemBar setTitle:formatString];
|
||||
|
||||
YTIPivotBarSupportedRenderers *barSupport = [[%c(YTIPivotBarSupportedRenderers) alloc] init];
|
||||
[barSupport setPivotBarItemRenderer:itemBar];
|
||||
YTIPivotBarSupportedRenderers *barSupport = [[%c(YTIPivotBarSupportedRenderers) alloc] init];
|
||||
[barSupport setPivotBarItemRenderer:itemBar];
|
||||
|
||||
[renderer.itemsArray addObject:barSupport];
|
||||
}
|
||||
[renderer.itemsArray addObject:barSupport];
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"Error setting renderer: %@", exception.reason);
|
||||
}
|
||||
|
|
@ -66,6 +65,7 @@ NSBundle *tweakBundle = uYouPlusBundle();
|
|||
}
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// LEGACY VERSION ⚠️
|
||||
// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version)
|
||||
|
|
@ -1878,6 +1878,9 @@ static int contrastMode() {
|
|||
if (IS_ENABLED(kHideChipBar)) {
|
||||
%init(gHideChipBar);
|
||||
}
|
||||
if (IS_ENABLED(kShowNotificationsTab)) {
|
||||
%init(gShowNotificationsTab);
|
||||
}
|
||||
if (IS_ENABLED(kPortraitFullscreen)) {
|
||||
%init(gPortraitFullscreen);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue