mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-05-17 22:31:57 +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/YTIGuideResponse.h>
|
||||||
#import <YouTubeHeader/YTIGuideResponseSupportedRenderers.h>
|
#import <YouTubeHeader/YTIGuideResponseSupportedRenderers.h>
|
||||||
#import <YouTubeHeader/YTIBrowseRequest.h>
|
#import <YouTubeHeader/YTIBrowseRequest.h>
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
#import <YouTubeHeader/GPBMessage.h>
|
#import <YouTubeHeader/GPBMessage.h>
|
||||||
#import <YouTubeHeader/YTIStringRun.h>
|
#import <YouTubeHeader/YTIStringRun.h>
|
||||||
#import <YouTubeHeader/YTWatchViewController.h>
|
#import <YouTubeHeader/YTWatchViewController.h>
|
||||||
|
#import <YouTubeHeader/YTIPivotBarRenderer.h>
|
||||||
|
|
||||||
// Hide buttons under the video player by @PoomSmart
|
// Hide buttons under the video player by @PoomSmart
|
||||||
#import <YouTubeHeader/ASCollectionElement.h>
|
#import <YouTubeHeader/ASCollectionElement.h>
|
||||||
|
|
@ -61,6 +62,13 @@
|
||||||
@property (nonatomic, strong) UIView *scrimOverlay;
|
@property (nonatomic, strong) UIView *scrimOverlay;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// Hide Home Tab - @bhackel
|
||||||
|
@interface YTPivotBarItemViewAccessibilityControl : UIControl
|
||||||
|
@end
|
||||||
|
@interface YTPivotBarItemView (uYouEnhanced)
|
||||||
|
@property (nonatomic, strong) YTPivotBarItemViewAccessibilityControl *hitTarget;
|
||||||
|
@end
|
||||||
|
|
||||||
// YTTapToSeek - https://github.com/bhackel/YTTapToSeek
|
// YTTapToSeek - https://github.com/bhackel/YTTapToSeek
|
||||||
@interface YTMainAppVideoPlayerOverlayViewController : UIViewController
|
@interface YTMainAppVideoPlayerOverlayViewController : UIViewController
|
||||||
- (CGFloat)totalTime;
|
- (CGFloat)totalTime;
|
||||||
|
|
|
||||||
|
|
@ -1222,6 +1222,38 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Miscellaneous
|
// 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
|
// YT startup animation
|
||||||
%hook YTColdConfig
|
%hook YTColdConfig
|
||||||
- (BOOL)mainAppCoreClientIosEnableStartupAnimation {
|
- (BOOL)mainAppCoreClientIosEnableStartupAnimation {
|
||||||
|
|
@ -1490,6 +1522,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
|
||||||
if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) {
|
if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) {
|
||||||
%init(uYouAdBlockingWorkaround);
|
%init(uYouAdBlockingWorkaround);
|
||||||
}
|
}
|
||||||
|
if (IS_ENABLED(@"hideHomeTab_enabled")) {
|
||||||
|
%init(gHideHomeTab);
|
||||||
|
}
|
||||||
|
|
||||||
// YTNoModernUI - @arichorn
|
// YTNoModernUI - @arichorn
|
||||||
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");
|
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,8 @@ extern NSBundle *uYouPlusBundle();
|
||||||
# pragma mark - UI interface options
|
# pragma mark - UI interface options
|
||||||
SECTION_HEADER(LOC(@"UI Interface Options"));
|
SECTION_HEADER(LOC(@"UI Interface Options"));
|
||||||
|
|
||||||
|
SWITCH_ITEM2(LOC(@"Hide Home Tab"), LOC(@""), @"hideHomeTab_enabled");
|
||||||
|
|
||||||
YTSettingsSectionItem *lowContrastMode = [YTSettingsSectionItemClass
|
YTSettingsSectionItem *lowContrastMode = [YTSettingsSectionItemClass
|
||||||
switchItemWithTitle:LOC(@"Low Contrast Mode")
|
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.")
|
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