mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-01-11 22:40:19 +00:00
Merge pull request #582 from bhackel/feature/hide-home-tab
Feature/hide home tab
This commit is contained in:
commit
97164998bf
4 changed files with 45 additions and 1 deletions
|
|
@ -1,4 +1,3 @@
|
|||
#import <YouTubeHeader/YTIPivotBarRenderer.h>
|
||||
#import <YouTubeHeader/YTIGuideResponse.h>
|
||||
#import <YouTubeHeader/YTIGuideResponseSupportedRenderers.h>
|
||||
#import <YouTubeHeader/YTIBrowseRequest.h>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#import <YouTubeHeader/GPBMessage.h>
|
||||
#import <YouTubeHeader/YTIStringRun.h>
|
||||
#import <YouTubeHeader/YTWatchViewController.h>
|
||||
#import <YouTubeHeader/YTIPivotBarRenderer.h>
|
||||
|
||||
// Hide buttons under the video player by @PoomSmart
|
||||
#import <YouTubeHeader/ASCollectionElement.h>
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1222,6 +1222,38 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *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 <YTIPivotBarSupportedRenderers *> *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 <NSString *> *ide
|
|||
if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) {
|
||||
%init(uYouAdBlockingWorkaround);
|
||||
}
|
||||
if (IS_ENABLED(@"hideHomeTab_enabled")) {
|
||||
%init(gHideHomeTab);
|
||||
}
|
||||
|
||||
// YTNoModernUI - @arichorn
|
||||
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");
|
||||
|
|
|
|||
|
|
@ -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.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue