Hide home tab option

This commit is contained in:
Bryce Hackel 2024-04-30 09:24:15 -07:00
parent f98e5f7f30
commit 915aac43d2
No known key found for this signature in database
GPG key ID: F031960F08455E88
3 changed files with 30 additions and 0 deletions

View file

@ -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;

View file

@ -1222,6 +1222,24 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *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 <NSString *> *ide
if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) {
%init(uYouAdBlockingWorkaround);
}
if (IS_ENABLED(@"hideHomeTab_enabled")) {
%init(gHideHomeTab);
}
// YTNoModernUI - @arichorn
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");

View file

@ -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.")