diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 60176a8..bf5d832 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -61,6 +61,13 @@ @property (nonatomic, strong) UIView *scrimOverlay; @end +// Hide Home Tab - @bhackel +@interface YTPivotBarItemViewAccessibilityControl : UIControl +@end +@interface YTPivotBarItemView (uYouEnhanced) +@property (nonatomic, strong) YTPivotBarItemViewAccessibilityControl *hitTarget; +@end + // YTTapToSeek - https://github.com/bhackel/YTTapToSeek @interface YTMainAppVideoPlayerOverlayViewController : UIViewController - (CGFloat)totalTime; diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 9d1746a..ade4fc8 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -1222,6 +1222,24 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide %end // Miscellaneous + +// Hide Home Tab - @bhackel +%group gHideHomeTab +%hook YTPivotBarItemView +- (void)layoutSubviews { + %orig; + // Check if this is the home tab button + YTPivotBarItemViewAccessibilityControl *hitTarget = self.hitTarget; + if (!self.hidden && [hitTarget.accessibilityIdentifier isEqualToString:@"id.ui.pivotbar.FEwhat_to_watch.button"]) { + // Hide the home tab button + self.hidden = YES; + self.frame = CGRectZero; + [self removeFromSuperview]; + } +} +%end +%end + // YT startup animation %hook YTColdConfig - (BOOL)mainAppCoreClientIosEnableStartupAnimation { @@ -1490,6 +1508,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) { %init(uYouAdBlockingWorkaround); } + if (IS_ENABLED(@"hideHomeTab_enabled")) { + %init(gHideHomeTab); + } // YTNoModernUI - @arichorn BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled"); diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 7c65317..78f4dea 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -332,6 +332,8 @@ extern NSBundle *uYouPlusBundle(); # pragma mark - UI interface options SECTION_HEADER(LOC(@"UI Interface Options")); + SWITCH_ITEM2(LOC(@"Hide Home Tab"), LOC(@""), @"hideHomeTab_enabled"); + YTSettingsSectionItem *lowContrastMode = [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Low Contrast Mode") titleDescription:LOC(@"This will lower the contrast of texts and buttons, similar to the old YouTube Interface. App restart is required.")