Skip to content

Commit

Permalink
option to hide the upper bar #713
Browse files Browse the repository at this point in the history
  • Loading branch information
qnblackcat committed Jan 7, 2023
1 parent 3076e10 commit b4ea59f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
10 changes: 10 additions & 0 deletions Settings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ extern NSBundle *uYouPlusBundle();
}
settingItemId:0],

[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_CHIP_BAR")
titleDescription:LOC(@"HIDE_CHIP_BAR_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"hideChipBar_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideChipBar_enabled"];
return YES;
}
settingItemId:0],

[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"NEW_MINIPLAYER_STYLE")
titleDescription:LOC(@"NEW_MINIPLAYER_STYLE_DESC")
accessibilityIdentifier:nil
Expand Down
45 changes: 32 additions & 13 deletions uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -809,20 +809,13 @@ void DEMC_centerRenderingView() {
%hook MLHAMQueuePlayer
- (void)setRate:(float)rate {
MSHookIvar<float>(self, "_rate") = rate;
MSHookIvar<float>(self, "_preferredRate") = rate;

id player = MSHookIvar<HAMPlayerInternal *>(self, "_player");
[player setRate: rate];

id stickySettings = MSHookIvar<MLPlayerStickySettings *>(self, "_stickySettings");
[stickySettings setRate: rate];
id ytPlayer = MSHookIvar<HAMPlayerInternal *>(self, "_player");
[ytPlayer setRate:rate];

[self.playerEventCenter broadcastRateChange: rate];

YTSingleVideoController *singleVideoController = self.delegate;
[singleVideoController playerRateDidChange: rate];
[self.playerEventCenter broadcastRateChange:rate];
}
%end
%end

%hook YTPlayerViewController
%property float playbackRate;
Expand Down Expand Up @@ -1308,6 +1301,29 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%end
%end

// Hide the Chip Bar (Upper Bar) in Home feed
%group gHideChipBar
%hook YTMySubsFilterHeaderView
- (void)setChipFilterView:(id)arg1 {}
%end

%hook YTHeaderContentComboView
- (void)enableSubheaderBarWithView:(id)arg1 {}
%end

%hook YTHeaderContentComboView
- (void)setFeedHeaderScrollMode:(int)arg1 { %orig(0); }
%end

// Hide the chip bar under the video player?
// %hook YTChipCloudCell //
// - (void)didMoveToWindow {
// %orig;
// self.hidden = YES;
// }
// %end
%end

# pragma mark - ctor
%ctor {
// Load uYou first so its functions are available for hooks.
Expand Down Expand Up @@ -1339,13 +1355,16 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%init(gOLED);
}
if (oldDarkTheme()) {
%init(gOldDarkTheme)
%init(gOldDarkTheme)
}
if (IsEnabled(@"oledKeyBoard_enabled")) {
%init(gOLEDKB);
}
if (IsEnabled(@"disableHints_enabled")) {
%init(gDisableHints);
%init(gDisableHints);
}
if (IsEnabled(@"hideChipBar_enabled")) {
%init(gHideChipBar);
}

// Disable updates
Expand Down

0 comments on commit b4ea59f

Please # to comment.