mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-20 10:52:07 +00:00
update OLED dark theme
This commit is contained in:
parent
5df3bfbdfd
commit
0da6da06af
2 changed files with 135 additions and 96 deletions
|
|
@ -1,9 +1,10 @@
|
|||
#import <YouTubeHeader/YTCommonColorPalette.h>
|
||||
#import <YouTubeHeader/ASCollectionView.h>
|
||||
#import <YouTubeHeader/_ASDisplayView.h>
|
||||
#import "uYouPlus.h"
|
||||
|
||||
@interface YCHLiveChatView : UIView
|
||||
@end
|
||||
// @interface YCHLiveChatView : UIView
|
||||
// @end
|
||||
|
||||
@interface YTFullscreenEngagementOverlayView : UIView
|
||||
@end
|
||||
|
|
@ -11,8 +12,8 @@
|
|||
@interface YTRelatedVideosView : UIView
|
||||
@end
|
||||
|
||||
@interface ELMView : UIView
|
||||
@end
|
||||
// @interface ELMView : UIView
|
||||
// @end
|
||||
|
||||
@interface ASWAppSwitcherCollectionViewCell : UIView
|
||||
@end
|
||||
|
|
@ -26,11 +27,8 @@
|
|||
@interface UIKeyboardDockView : UIView
|
||||
@end
|
||||
|
||||
@interface _ASDisplayView : UIView
|
||||
@end
|
||||
|
||||
@interface YTCommentDetailHeaderCell : UIView
|
||||
@end
|
||||
// @interface YTCommentDetailHeaderCell : UIView
|
||||
// @end
|
||||
|
||||
@interface SponsorBlockSettingsController : UITableViewController
|
||||
@end
|
||||
|
|
@ -44,6 +42,9 @@
|
|||
@interface UIPredictionViewController : UIViewController
|
||||
@end
|
||||
|
||||
@interface TUIEmojiSearchView : UIView
|
||||
@end
|
||||
|
||||
@interface FRPreferences : UITableViewController
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -118,30 +118,37 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Your videos
|
||||
// Download sort
|
||||
%hook GOODialogView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Playlist sort
|
||||
%hook ASCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||
self.superview.backgroundColor = [UIColor blackColor];
|
||||
self.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Sub menu?
|
||||
%hook ELMView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
// %hook ELMView
|
||||
// - (void)didMoveToWindow {
|
||||
// %orig;
|
||||
// if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// // self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
// }
|
||||
// }
|
||||
// %end
|
||||
|
||||
// iSponsorBlock
|
||||
%hook SponsorBlockSettingsController
|
||||
|
|
@ -163,110 +170,135 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
%end
|
||||
|
||||
// Search view
|
||||
%hook YTSearchBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
// %hook YTSearchBarView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blueColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
// History search view
|
||||
%hook YTSearchBoxView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
// %hook YTSearchBoxView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
|
||||
}
|
||||
%end
|
||||
// }
|
||||
// %end
|
||||
|
||||
// Comment view
|
||||
%hook YTCommentView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
// %hook YTCommentView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
%hook YTCreateCommentAccessoryView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
// %hook YTCreateCommentAccessoryView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
%hook YTCreateCommentTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
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
|
||||
// %hook YTCreateCommentTextView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// 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
|
||||
|
||||
%hook YTCommentDetailHeaderCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// self.subviews[2].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
// %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 {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor clearColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
// %hook YTFormattedStringLabel // YT is werid...
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
// Live chat comment
|
||||
%hook YCHLiveChatActionPanelView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
// %hook YCHLiveChatActionPanelView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
%hook YTEmojiTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
// %hook YTEmojiTextView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
%hook YCHLiveChatView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%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 YTCollectionView
|
||||
// - (void)setBackgroundColor:(UIColor *)color {
|
||||
// return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
//
|
||||
%hook YTBackstageCreateRepostDetailView
|
||||
- (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 greenColor]) : %orig;
|
||||
// }
|
||||
// %end
|
||||
|
||||
// Others
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
|
||||
// is this good?
|
||||
UIResponder *responder = self.nextResponder;
|
||||
UIViewController *closestViewController = nil;
|
||||
|
||||
while (responder != nil) {
|
||||
if ([responder isKindOfClass:[UIViewController class]]) {
|
||||
closestViewController = (UIViewController *)responder;
|
||||
break;
|
||||
}
|
||||
responder = responder.nextResponder;
|
||||
}
|
||||
|
||||
if ([NSStringFromClass([closestViewController class]) isEqualToString:@"YTActionSheetDialogViewController"] &&
|
||||
(([NSStringFromClass([self.superview class]) isEqualToString:@"YTELMView"]) ||
|
||||
[NSStringFromClass([self.superview class]) isEqualToString:@"_ASDisplayView"] ||
|
||||
[NSStringFromClass([self.superview class]) isEqualToString:@"ELMView"])) {
|
||||
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
|
||||
}
|
||||
|
||||
// Save video bottom
|
||||
if ([NSStringFromClass([closestViewController class]) isEqualToString:@"YTBottomSheetController"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
|
||||
// if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
// if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { 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.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.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.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.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier hasPrefix:@"id.elements.components.overflow_menu_item_"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
// if ([self.accessibilityIdentifier hasPrefix:@"id.elements.components.overflow_menu_item_"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
|
@ -289,7 +321,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
%orig;
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
self.backgroundColor = raisedColor;
|
||||
// self.subviews[1].backgroundColor = raisedColor;
|
||||
self.superview.backgroundColor = raisedColor;
|
||||
}
|
||||
}
|
||||
|
|
@ -304,6 +335,13 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
# pragma mark - OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
|
||||
|
||||
%group gOLEDKB
|
||||
%hook TUIEmojiSearchView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
self.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UIPredictionViewController
|
||||
- (void)loadView {
|
||||
%orig;
|
||||
|
|
|
|||
Loading…
Reference in a new issue