diff --git a/Sources/YTReExplore.x b/Sources/YTReExplore.x index e7f329d37f..070f426640 100644 --- a/Sources/YTReExplore.x +++ b/Sources/YTReExplore.x @@ -1,4 +1,3 @@ -#import #import #import #import diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 60176a8d64..7bbe66b8cd 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -34,6 +34,7 @@ #import #import #import +#import // Hide buttons under the video player by @PoomSmart #import @@ -61,6 +62,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 9d1746abce..b0102a90ef 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -1222,6 +1222,38 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide %end // Miscellaneous + +// Hide Home Tab - @bhackel +%group gHideHomeTab +%hook YTPivotBarView +- (void)setRenderer:(YTIPivotBarRenderer *)renderer { + // Iterate over each renderer item + NSLog(@"bhackel: setting renderer"); + NSUInteger indexToRemove = -1; + NSMutableArray *itemsArray = renderer.itemsArray; + NSLog(@"bhackel: starting loop"); + for (NSUInteger i = 0; i < itemsArray.count; i++) { + NSLog(@"bhackel: iterating index %lu", (unsigned long)i); + YTIPivotBarSupportedRenderers *item = itemsArray[i]; + // Check if this is the home tab button + NSLog(@"bhackel: checking identifier"); + YTIPivotBarItemRenderer *pivotBarItemRenderer = item.pivotBarItemRenderer; + NSString *pivotIdentifier = pivotBarItemRenderer.pivotIdentifier; + if ([pivotIdentifier isEqualToString:@"FEwhat_to_watch"]) { + NSLog(@"bhackel: removing home tab button"); + // Remove the home tab button + indexToRemove = i; + break; + } + } + if (indexToRemove != -1) { + [itemsArray removeObjectAtIndex:indexToRemove]; + } + %orig; +} +%end +%end + // YT startup animation %hook YTColdConfig - (BOOL)mainAppCoreClientIosEnableStartupAnimation { @@ -1490,6 +1522,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 7c65317b4a..78f4dea19e 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.")