Re-added “Hide uYou Tab” Option
Issue #45 suggested to reinject the option but this time it should actually work.
This commit is contained in:
parent
c80d2edaec
commit
43899908ce
1 changed files with 33 additions and 0 deletions
33
uYouPlus.xm
33
uYouPlus.xm
|
|
@ -510,6 +510,36 @@ BOOL isAd(id node) {
|
|||
%end
|
||||
%end
|
||||
|
||||
%group gHideuYouTab
|
||||
%hook YTPivotBarView
|
||||
- (void)setRenderer:(YTIPivotBarRenderer *)renderer {
|
||||
NSMutableArray<YTIPivotBarSupportedRenderers *> *items = [renderer itemsArray];
|
||||
|
||||
NSUInteger index = [items indexOfObjectPassingTest:^BOOL(YTIPivotBarSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
||||
return [[[renderers pivotBarItemRenderer] pivotIdentifier] isEqualToString:@"com.miro.uyou"];
|
||||
}];
|
||||
if (index != NSNotFound) {
|
||||
[items removeObjectAtIndex:index];
|
||||
}
|
||||
|
||||
%orig;
|
||||
}
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
|
||||
NSMutableArray<YTIPivotBarSupportedRenderers *> *items = [[self renderer] itemsArray];
|
||||
|
||||
NSUInteger index = [items indexOfObjectPassingTest:^BOOL(YTIPivotBarSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
||||
return [[[renderers pivotBarItemRenderer] pivotIdentifier] isEqualToString:@"com.miro.uyou"];
|
||||
}];
|
||||
if (index != NSNotFound) {
|
||||
YTIPivotBarSupportedRenderers *renderers = [items objectAtIndex:index];
|
||||
[renderers setHidden:YES];
|
||||
}
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
# pragma mark - Hide Notification Button && SponsorBlock Button
|
||||
%hook YTRightNavigationButtons
|
||||
- (void)layoutSubviews {
|
||||
|
|
@ -1452,6 +1482,9 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
if (IsEnabled(@"hideHeatwaves_enabled")) {
|
||||
%init(gHideHeatwaves);
|
||||
}
|
||||
if (IsEnabled(@"hideuYouTab_enabled")) {
|
||||
%init(gHideuYouTab);
|
||||
}
|
||||
if (IsEnabled(@"ytNoModernUI_enabled")) {
|
||||
%init(gYTNoModernUI);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue