mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2026-02-10 00:15:11 -05:00
Updated Themes.xm (@arichornlover)
This commit is contained in:
1130
Source/Themes.xm
1130
Source/Themes.xm
@@ -1,417 +1,95 @@
|
|||||||
#import "../YTLitePlus.h"
|
#import "../YTLitePlus.h"
|
||||||
|
|
||||||
static BOOL IsEnabled(NSString *key) {
|
#define IS_DARK_APPEARANCE_ENABLED ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1)
|
||||||
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
#define IS_OLED_DARK_THEME_SELECTED (APP_THEME_IDX == 1)
|
||||||
}
|
#define IS_OLD_DARK_THEME_SELECTED (APP_THEME_IDX == 2)
|
||||||
static BOOL isDarkMode() {
|
#define IS_CUSTOM_DARK_THEME_SELECTED (APP_THEME_IDX == 3)
|
||||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1);
|
|
||||||
}
|
# pragma mark - Old dark theme (lighter grey)
|
||||||
static BOOL oledDarkTheme() {
|
|
||||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 1);
|
|
||||||
}
|
|
||||||
static BOOL oldDarkTheme() {
|
|
||||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Themes.xm - Theme Options
|
|
||||||
// Old dark theme (gray)
|
|
||||||
%group gOldDarkTheme
|
%group gOldDarkTheme
|
||||||
UIColor *customColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
|
|
||||||
%hook YTCommonColorPalette
|
%hook YTCommonColorPalette
|
||||||
- (UIColor *)background1 {
|
- (UIColor *)background1 {
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
}
|
}
|
||||||
- (UIColor *)background2 {
|
- (UIColor *)background2 {
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
}
|
}
|
||||||
- (UIColor *)background3 {
|
- (UIColor *)background3 {
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
}
|
|
||||||
- (UIColor *)brandBackgroundSolid {
|
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)brandBackgroundPrimary {
|
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)brandBackgroundSecondary {
|
|
||||||
return self.pageStyle == 1 ? [customColor colorWithAlphaComponent:0.9] : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)raisedBackground {
|
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)staticBrandBlack {
|
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)generalBackgroundA {
|
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)generalBackgroundB {
|
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
|
||||||
}
|
}
|
||||||
- (UIColor *)baseBackground {
|
- (UIColor *)baseBackground {
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)brandBackgroundSolid {
|
||||||
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)brandBackgroundPrimary {
|
||||||
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)brandBackgroundSecondary {
|
||||||
|
return self.pageStyle == 1 ? [[UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] colorWithAlphaComponent:0.9] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)raisedBackground {
|
||||||
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)staticBrandBlack {
|
||||||
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)generalBackgroundA {
|
||||||
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)generalBackgroundB {
|
||||||
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
}
|
}
|
||||||
- (UIColor *)menuBackground {
|
- (UIColor *)menuBackground {
|
||||||
return self.pageStyle == 1 ? customColor : %orig;
|
return self.pageStyle == 1 ? [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0] : %orig;
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook SponsorBlockSettingsController
|
|
||||||
- (void)viewDidLoad {
|
|
||||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
|
||||||
%orig;
|
|
||||||
self.tableView.backgroundColor = customColor;
|
|
||||||
} else { return %orig; }
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook SponsorBlockViewController
|
|
||||||
- (void)viewDidLoad {
|
|
||||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
|
||||||
%orig;
|
|
||||||
self.view.backgroundColor = customColor;
|
|
||||||
} else { return %orig; }
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTAsyncCollectionView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTRelatedVideosCollectionViewController")]) {
|
|
||||||
color = [UIColor clearColor];
|
|
||||||
} else if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFullscreenMetadataHighlightsCollectionViewController")]) {
|
|
||||||
color = [UIColor clearColor];
|
|
||||||
} else {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)darkBackgroundColor {
|
|
||||||
return isDarkMode() ? customColor : %orig;
|
|
||||||
}
|
|
||||||
- (void)setDarkBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
- (void)layoutSubviews {
|
|
||||||
%orig();
|
|
||||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTWatchNextResultsViewController")]) {
|
|
||||||
if (isDarkMode()) {
|
|
||||||
self.subviews[0].subviews[0].backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Hide separators
|
%hook YTColdConfig
|
||||||
%hook YTCollectionSeparatorView
|
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||||
- (void)setHidden:(BOOL)arg1 {
|
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteTextColorForNative { return NO; }
|
||||||
%orig(YES);
|
- (BOOL)enableCinematicContainerOnClient { return NO; }
|
||||||
}
|
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook ASScrollView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
|
|
||||||
%hook YTPivotBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSubheaderContainerView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTAppView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCollectionView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelListSubMenuView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSettingsCell
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSlideForActionsView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPageView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTWatchView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPlaylistMiniBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTEngagementPanelView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTEngagementPanelHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPlaylistPanelControlsView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTHorizontalCardListView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTWatchMiniBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCreateCommentAccessoryView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCreateCommentTextView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSearchView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSearchBoxView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTTabTitlesView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPrivacyTosFooterView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTOfflineStorageUsageView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTInlineSignInView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTFeedChannelFilterHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YCHLiveChatView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YCHLiveChatActionPanelView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTEmojiTextView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTTopAlignedView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
- (void)layoutSubviews {
|
|
||||||
%orig();
|
|
||||||
if (isDarkMode()) {
|
|
||||||
MSHookIvar<YTTopAlignedView *>(self, "_contentView").backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook GOODialogView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTNavigationBar
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
- (void)setBarTintColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelMobileHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelSubMenuView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTWrapperSplitView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTReelShelfCell
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTReelShelfItemView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTReelShelfView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCommentView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelListSubMenuAvatarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSearchBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTDialogContainerScrollView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTShareTitleView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTShareBusyView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTELMView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTActionSheetHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig(customColor) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTShareMainView
|
|
||||||
- (void)layoutSubviews {
|
|
||||||
%orig();
|
|
||||||
if (isDarkMode()) {
|
|
||||||
MSHookIvar<YTQTMButton *>(self, "_cancelButton").backgroundColor = customColor;
|
|
||||||
MSHookIvar<UIControl *>(self, "_safeArea").backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook _ASDisplayView
|
%hook _ASDisplayView
|
||||||
- (void)layoutSubviews {
|
|
||||||
%orig;
|
|
||||||
if (isDarkMode()) {
|
|
||||||
UIResponder *responder = [self nextResponder];
|
|
||||||
while (responder != nil) {
|
|
||||||
if ([responder isKindOfClass:NSClassFromString(@"YTActionSheetDialogViewController")]) {
|
|
||||||
self.backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
if ([responder isKindOfClass:NSClassFromString(@"YTPanelLoadingStrategyViewController")]) {
|
|
||||||
self.backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
if ([responder isKindOfClass:NSClassFromString(@"YTTabHeaderElementsViewController")]) {
|
|
||||||
self.backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
if ([responder isKindOfClass:NSClassFromString(@"YTEditSheetControllerElementsContentViewController")]) {
|
|
||||||
self.backgroundColor = customColor;
|
|
||||||
}
|
|
||||||
responder = [responder nextResponder];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- (void)didMoveToWindow {
|
- (void)didMoveToWindow {
|
||||||
%orig;
|
%orig;
|
||||||
if (isDarkMode()) {
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = customColor; }
|
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTCinematicContainerView
|
|
||||||
- (void)setHidden:(BOOL)arg1 {
|
%hook ASCollectionView
|
||||||
%orig(YES);
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
self.superview.backgroundColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTFullscreenEngagementOverlayView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTRelatedVideosView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// OLED dark mode by @BandarHL and modified by @arichorn
|
# pragma mark - OLED dark mode by BandarHL
|
||||||
UIColor* raisedColor = [UIColor blackColor];
|
|
||||||
|
UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:1.0];
|
||||||
|
|
||||||
%group gOLED
|
%group gOLED
|
||||||
%hook YTCommonColorPalette
|
%hook YTCommonColorPalette
|
||||||
- (UIColor *)background1 {
|
- (UIColor *)baseBackground {
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)background2 {
|
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)background3 {
|
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
}
|
}
|
||||||
- (UIColor *)brandBackgroundSolid {
|
- (UIColor *)brandBackgroundSolid {
|
||||||
@@ -432,16 +110,39 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||||||
- (UIColor *)generalBackgroundA {
|
- (UIColor *)generalBackgroundA {
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
}
|
}
|
||||||
- (UIColor *)generalBackgroundB {
|
%end
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
|
||||||
}
|
// Explore
|
||||||
- (UIColor *)baseBackground {
|
%hook ASScrollView
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
- (void)didMoveToWindow {
|
||||||
}
|
%orig;
|
||||||
- (UIColor *)menuBackground {
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
// Your videos
|
||||||
|
%hook ASCollectionView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||||
|
self.superview.backgroundColor = [UIColor blackColor];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Sub menu?
|
||||||
|
%hook ELMView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
// self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// iSponsorBlock
|
||||||
%hook SponsorBlockSettingsController
|
%hook SponsorBlockSettingsController
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||||
@@ -450,6 +151,7 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||||||
} else { return %orig; }
|
} else { return %orig; }
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook SponsorBlockViewController
|
%hook SponsorBlockViewController
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||||
@@ -458,294 +160,99 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||||||
} else { return %orig; }
|
} else { return %orig; }
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTAsyncCollectionView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTRelatedVideosCollectionViewController")]) {
|
|
||||||
color = [UIColor clearColor];
|
|
||||||
} else if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFullscreenMetadataHighlightsCollectionViewController")]) {
|
|
||||||
color = [UIColor clearColor];
|
|
||||||
} else {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%orig;
|
|
||||||
}
|
|
||||||
- (UIColor *)darkBackgroundColor {
|
|
||||||
return isDarkMode() ? [UIColor blackColor] : %orig;
|
|
||||||
}
|
|
||||||
- (void)setDarkBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
- (void)layoutSubviews {
|
|
||||||
%orig();
|
|
||||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTWatchNextResultsViewController")]) {
|
|
||||||
if (isDarkMode()) {
|
|
||||||
self.subviews[0].subviews[0].backgroundColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
|
|
||||||
// Hide separators
|
// Search view
|
||||||
%hook YTCollectionSeparatorView
|
|
||||||
- (void)setHidden:(BOOL)arg1 {
|
|
||||||
%orig(YES);
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
|
|
||||||
%hook YTPivotBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
|
|
||||||
%hook ASScrollView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
|
|
||||||
%hook YTHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSubheaderContainerView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTAppView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCollectionView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelListSubMenuView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSettingsCell
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSlideForActionsView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPageView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTWatchView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPlaylistMiniBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTEngagementPanelView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTEngagementPanelHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPlaylistPanelControlsView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTHorizontalCardListView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTWatchMiniBarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCreateCommentAccessoryView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCreateCommentTextView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSearchView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSearchBoxView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTTabTitlesView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTPrivacyTosFooterView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTOfflineStorageUsageView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTInlineSignInView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTFeedChannelFilterHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YCHLiveChatView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YCHLiveChatActionPanelView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTEmojiTextView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTTopAlignedView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
- (void)layoutSubviews {
|
|
||||||
%orig();
|
|
||||||
if (isDarkMode()) {
|
|
||||||
MSHookIvar<YTTopAlignedView *>(self, "_contentView").backgroundColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook GOODialogView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTNavigationBar
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
- (void)setBarTintColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelMobileHeaderView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelSubMenuView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTWrapperSplitView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTReelShelfCell
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTReelShelfItemView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTReelShelfView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTCommentView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTChannelListSubMenuAvatarView
|
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
|
||||||
}
|
|
||||||
%end
|
|
||||||
%hook YTSearchBarView
|
%hook YTSearchBarView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTDialogContainerScrollView
|
|
||||||
|
// History search view
|
||||||
|
%hook YTSearchBoxView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTShareTitleView
|
|
||||||
|
// Comment view
|
||||||
|
%hook YTCommentView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTShareBusyView
|
|
||||||
|
%hook YTCreateCommentAccessoryView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTELMView
|
|
||||||
|
%hook YTCreateCommentTextView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
|
}
|
||||||
|
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor whiteColor]) : %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTActionSheetHeaderView
|
|
||||||
|
%hook YTCommentDetailHeaderCell
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
// self.subviews[2].backgroundColor = [UIColor blackColor];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTFormattedStringLabel // YT is werid...
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor clearColor]) : %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTShareMainView
|
|
||||||
- (void)layoutSubviews {
|
// Live chat comment
|
||||||
%orig();
|
%hook YCHLiveChatActionPanelView
|
||||||
if (isDarkMode()) {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
MSHookIvar<YTQTMButton *>(self, "_cancelButton").backgroundColor = [UIColor blackColor];
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
MSHookIvar<UIControl *>(self, "_safeArea").backgroundColor = [UIColor blackColor];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
%hook YTEmojiTextView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YCHLiveChatView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
// self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTCollectionView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
//
|
||||||
|
%hook YTBackstageCreateRepostDetailView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Others
|
||||||
%hook _ASDisplayView
|
%hook _ASDisplayView
|
||||||
- (void)layoutSubviews {
|
- (void)layoutSubviews {
|
||||||
%orig;
|
%orig;
|
||||||
if (isDarkMode()) {
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
UIResponder *responder = [self nextResponder];
|
UIResponder *responder = [self nextResponder];
|
||||||
while (responder != nil) {
|
while (responder != nil) {
|
||||||
if ([responder isKindOfClass:NSClassFromString(@"YTActionSheetDialogViewController")]) {
|
if ([responder isKindOfClass:NSClassFromString(@"YTActionSheetDialogViewController")]) {
|
||||||
@@ -766,30 +273,305 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||||||
}
|
}
|
||||||
- (void)didMoveToWindow {
|
- (void)didMoveToWindow {
|
||||||
%orig;
|
%orig;
|
||||||
if (isDarkMode()) {
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"brand_promo.view"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"eml.topic_channel_details"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_thread"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.timed_comments_welcome"]) { self.superview.backgroundColor = self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.superview.backgroundColor = self.backgroundColor = [UIColor blackColor]; }
|
||||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
|
if ([self.accessibilityIdentifier hasPrefix:@"id.elements.components.overflow_menu_item_"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%hook YTCinematicContainerView
|
|
||||||
- (void)setHidden:(BOOL)arg1 {
|
// Open link with...
|
||||||
%orig(YES);
|
%hook ASWAppSwitchingSheetHeaderView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(raisedColor) : %orig;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
%hook ASWAppSwitchingSheetFooterView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(raisedColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook ASWAppSwitcherCollectionViewCell
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
self.backgroundColor = raisedColor;
|
||||||
|
// self.subviews[1].backgroundColor = raisedColor;
|
||||||
|
self.superview.backgroundColor = raisedColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Incompatibility with the new YT Dark theme
|
||||||
|
%hook YTColdConfig
|
||||||
|
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||||
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
|
# pragma mark - Custom dark mode by BandarHL
|
||||||
|
|
||||||
|
UIColor *customHexColor;
|
||||||
|
|
||||||
|
%group gCustomTheme
|
||||||
|
%hook YTCommonColorPalette
|
||||||
|
- (UIColor *)baseBackground {
|
||||||
|
return self.pageStyle == 1 ? customHexColor : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)brandBackgroundSolid {
|
||||||
|
return self.pageStyle == 1 ? customHexColor : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)brandBackgroundPrimary {
|
||||||
|
return self.pageStyle == 1 ? customHexColor : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)brandBackgroundSecondary {
|
||||||
|
return self.pageStyle == 1 ? [customHexColor colorWithAlphaComponent:0.9] : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)raisedBackground {
|
||||||
|
return self.pageStyle == 1 ? customHexColor : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)staticBrandBlack {
|
||||||
|
return self.pageStyle == 1 ? customHexColor : %orig;
|
||||||
|
}
|
||||||
|
- (UIColor *)generalBackgroundA {
|
||||||
|
return self.pageStyle == 1 ? customHexColor : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Explore
|
||||||
|
%hook ASScrollView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Your videos
|
||||||
|
%hook ASCollectionView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||||
|
self.superview.backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Sub menu?
|
||||||
|
%hook ELMView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
// self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// iSponsorBlock
|
||||||
|
%hook SponsorBlockSettingsController
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||||
|
%orig;
|
||||||
|
self.tableView.backgroundColor = customHexColor;
|
||||||
|
} else { return %orig; }
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook SponsorBlockViewController
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||||
|
%orig;
|
||||||
|
self.view.backgroundColor = customHexColor;
|
||||||
|
} else { return %orig; }
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Search view
|
||||||
|
%hook YTSearchBarView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// History search view
|
||||||
|
%hook YTSearchBoxView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Comment view
|
||||||
|
%hook YTCommentView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTCreateCommentAccessoryView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTCreateCommentTextView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor whiteColor]) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTCommentDetailHeaderCell
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
// self.subviews[2].backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTFormattedStringLabel // YT is werid...
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor clearColor]) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Live chat comment
|
||||||
|
%hook YCHLiveChatActionPanelView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTEmojiTextView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YCHLiveChatView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
// self.subviews[1].backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YTCollectionView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
//
|
||||||
|
%hook YTBackstageCreateRepostDetailView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(customHexColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Others
|
||||||
|
%hook _ASDisplayView
|
||||||
|
- (void)layoutSubviews {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
UIResponder *responder = [self nextResponder];
|
||||||
|
while (responder != nil) {
|
||||||
|
if ([responder isKindOfClass:NSClassFromString(@"YTActionSheetDialogViewController")]) {
|
||||||
|
self.backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
if ([responder isKindOfClass:NSClassFromString(@"YTPanelLoadingStrategyViewController")]) {
|
||||||
|
self.backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
if ([responder isKindOfClass:NSClassFromString(@"YTTabHeaderElementsViewController")]) {
|
||||||
|
self.backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
if ([responder isKindOfClass:NSClassFromString(@"YTEditSheetControllerElementsContentViewController")]) {
|
||||||
|
self.backgroundColor = customHexColor;
|
||||||
|
}
|
||||||
|
responder = [responder nextResponder];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"brand_promo.view"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"eml.topic_channel_details"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_thread"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.timed_comments_welcome"]) { self.superview.backgroundColor = self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.superview.backgroundColor = self.backgroundColor = customHexColor; }
|
||||||
|
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
|
if ([self.accessibilityIdentifier hasPrefix:@"id.elements.components.overflow_menu_item_"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Open link with...
|
||||||
|
%hook ASWAppSwitchingSheetHeaderView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(raisedColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook ASWAppSwitchingSheetFooterView
|
||||||
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return IS_DARK_APPEARANCE_ENABLED ? %orig(raisedColor) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook ASWAppSwitcherCollectionViewCell
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
|
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||||
|
self.backgroundColor = raisedColor;
|
||||||
|
// self.subviews[1].backgroundColor = raisedColor;
|
||||||
|
self.superview.backgroundColor = raisedColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
// Incompatibility with the new YT Dark theme
|
||||||
|
%hook YTColdConfig
|
||||||
|
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
|
||||||
|
# pragma mark - OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
|
||||||
|
|
||||||
%group gOLEDKB
|
%group gOLEDKB
|
||||||
%hook UIPredictionViewController
|
%hook UIPredictionViewController
|
||||||
- (void)loadView {
|
- (void)loadView {
|
||||||
@@ -824,16 +606,24 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||||||
%end
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
||||||
# pragma mark - ctor
|
|
||||||
%ctor {
|
%ctor {
|
||||||
%init;
|
if (IS_OLED_DARK_THEME_SELECTED) {
|
||||||
if (IsEnabled(@"oledKeyBoard_enabled")) {
|
|
||||||
%init(gOLEDKB);
|
|
||||||
}
|
|
||||||
if (oledDarkTheme()) {
|
|
||||||
%init(gOLED);
|
%init(gOLED);
|
||||||
}
|
}
|
||||||
if (oldDarkTheme()) {
|
if (IS_OLD_DARK_THEME_SELECTED) {
|
||||||
%init(gOldDarkTheme);
|
%init(gOldDarkTheme)
|
||||||
|
}
|
||||||
|
if (IS_ENABLED(@"oledKeyBoard_enabled")) {
|
||||||
|
%init(gOLEDKB);
|
||||||
|
}
|
||||||
|
if (IS_CUSTOM_DARK_THEME_SELECTED) {
|
||||||
|
NSData *colorData = [[NSUserDefaults standardUserDefaults] objectForKey:@"kCustomThemeColor"];
|
||||||
|
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:colorData error:nil];
|
||||||
|
[unarchiver setRequiresSecureCoding:NO];
|
||||||
|
NSString *hexString = [unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey];
|
||||||
|
if (hexString != nil) {
|
||||||
|
customHexColor = [unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey];
|
||||||
|
%init(gCustomTheme);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,8 @@
|
|||||||
#define YT_BUNDLE_ID @"com.google.ios.youtube"
|
#define YT_BUNDLE_ID @"com.google.ios.youtube"
|
||||||
#define YT_NAME @"YouTube"
|
#define YT_NAME @"YouTube"
|
||||||
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10"
|
#define LOWCONTRASTMODE_CUTOFF_VERSION @"17.38.10"
|
||||||
|
#define IS_ENABLED(k) [[NSUserDefaults standardUserDefaults] boolForKey:k]
|
||||||
|
#define APP_THEME_IDX [[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"]
|
||||||
|
|
||||||
// YTSpeed
|
// YTSpeed
|
||||||
@interface YTVarispeedSwitchControllerOption : NSObject
|
@interface YTVarispeedSwitchControllerOption : NSObject
|
||||||
|
|||||||
Reference in New Issue
Block a user