Merge pull request #1318 from qnblackcat/update-OLED

please, work :/
This commit is contained in:
Nguyễn Đạt
2024-02-24 11:36:02 +07:00
committed by GitHub
2 changed files with 135 additions and 96 deletions
+10 -9
View File
@@ -1,9 +1,10 @@
#import <YouTubeHeader/YTCommonColorPalette.h> #import <YouTubeHeader/YTCommonColorPalette.h>
#import <YouTubeHeader/ASCollectionView.h> #import <YouTubeHeader/ASCollectionView.h>
#import <YouTubeHeader/_ASDisplayView.h>
#import "uYouPlus.h" #import "uYouPlus.h"
@interface YCHLiveChatView : UIView // @interface YCHLiveChatView : UIView
@end // @end
@interface YTFullscreenEngagementOverlayView : UIView @interface YTFullscreenEngagementOverlayView : UIView
@end @end
@@ -11,8 +12,8 @@
@interface YTRelatedVideosView : UIView @interface YTRelatedVideosView : UIView
@end @end
@interface ELMView : UIView // @interface ELMView : UIView
@end // @end
@interface ASWAppSwitcherCollectionViewCell : UIView @interface ASWAppSwitcherCollectionViewCell : UIView
@end @end
@@ -26,11 +27,8 @@
@interface UIKeyboardDockView : UIView @interface UIKeyboardDockView : UIView
@end @end
@interface _ASDisplayView : UIView // @interface YTCommentDetailHeaderCell : UIView
@end // @end
@interface YTCommentDetailHeaderCell : UIView
@end
@interface SponsorBlockSettingsController : UITableViewController @interface SponsorBlockSettingsController : UITableViewController
@end @end
@@ -44,6 +42,9 @@
@interface UIPredictionViewController : UIViewController @interface UIPredictionViewController : UIViewController
@end @end
@interface TUIEmojiSearchView : UIView
@end
@interface FRPreferences : UITableViewController @interface FRPreferences : UITableViewController
@end @end
+125 -87
View File
@@ -118,30 +118,37 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
- (void)didMoveToWindow { - (void)didMoveToWindow {
%orig; %orig;
if (IS_DARK_APPEARANCE_ENABLED) { if (IS_DARK_APPEARANCE_ENABLED) {
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor blackColor];
} }
} }
%end %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 %hook ASCollectionView
- (void)didMoveToWindow { - (void)didMoveToWindow {
%orig; %orig;
if (IS_DARK_APPEARANCE_ENABLED && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) { if (IS_DARK_APPEARANCE_ENABLED && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
self.superview.backgroundColor = [UIColor blackColor]; self.backgroundColor = [UIColor blackColor];
} }
} }
%end %end
// Sub menu? // Sub menu?
%hook ELMView // %hook ELMView
- (void)didMoveToWindow { // - (void)didMoveToWindow {
%orig; // %orig;
if (IS_DARK_APPEARANCE_ENABLED) { // if (IS_DARK_APPEARANCE_ENABLED) {
// self.subviews[0].backgroundColor = [UIColor clearColor]; // // self.subviews[0].backgroundColor = [UIColor clearColor];
} // }
} // }
%end // %end
// iSponsorBlock // iSponsorBlock
%hook SponsorBlockSettingsController %hook SponsorBlockSettingsController
@@ -163,110 +170,135 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%end %end
// Search view // Search view
%hook YTSearchBarView // %hook YTSearchBarView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blueColor]) : %orig;
} // }
%end // %end
// History search view // History search view
%hook YTSearchBoxView // %hook YTSearchBoxView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
} // }
%end // %end
// Comment view // Comment view
%hook YTCommentView // %hook YTCommentView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
} // }
%end // %end
%hook YTCreateCommentAccessoryView // %hook YTCreateCommentAccessoryView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
} // }
%end // %end
%hook YTCreateCommentTextView // %hook YTCreateCommentTextView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %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 // - (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor whiteColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor whiteColor]) : %orig;
} // }
%end // %end
%hook YTCommentDetailHeaderCell // %hook YTCommentDetailHeaderCell
- (void)didMoveToWindow { // - (void)didMoveToWindow {
%orig; // %orig;
if (IS_DARK_APPEARANCE_ENABLED) { // if (IS_DARK_APPEARANCE_ENABLED) {
// self.subviews[2].backgroundColor = [UIColor blackColor]; // // self.subviews[2].backgroundColor = [UIColor blackColor];
} // }
} // }
%end // %end
%hook YTFormattedStringLabel // YT is werid... // %hook YTFormattedStringLabel // YT is werid...
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor clearColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
} // }
%end // %end
// Live chat comment // Live chat comment
%hook YCHLiveChatActionPanelView // %hook YCHLiveChatActionPanelView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
} // }
%end // %end
%hook YTEmojiTextView // %hook YTEmojiTextView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
} // }
%end // %end
%hook YCHLiveChatView // %hook YCHLiveChatView
- (void)didMoveToWindow { // - (void)didMoveToWindow {
%orig; // %orig;
if (IS_DARK_APPEARANCE_ENABLED) { // if (IS_DARK_APPEARANCE_ENABLED) {
// self.subviews[1].backgroundColor = [UIColor blackColor]; // // self.subviews[1].backgroundColor = [UIColor blackColor];
} // }
} // }
%end // %end
%hook YTCollectionView // %hook YTCollectionView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
} // }
%end // %end
// //
%hook YTBackstageCreateRepostDetailView // %hook YTBackstageCreateRepostDetailView
- (void)setBackgroundColor:(UIColor *)color { // - (void)setBackgroundColor:(UIColor *)color {
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig; // return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor greenColor]) : %orig;
} // }
%end // %end
// Others // Others
%hook _ASDisplayView %hook _ASDisplayView
- (void)didMoveToWindow { - (void)didMoveToWindow {
%orig; %orig;
if (IS_DARK_APPEARANCE_ENABLED) { 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:@"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.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.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.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.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]; } // if ([self.accessibilityIdentifier hasPrefix:@"id.elements.components.overflow_menu_item_"]) { self.backgroundColor = [UIColor clearColor]; }
} }
} }
%end %end
@@ -289,7 +321,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
%orig; %orig;
if (IS_DARK_APPEARANCE_ENABLED) { if (IS_DARK_APPEARANCE_ENABLED) {
self.backgroundColor = raisedColor; self.backgroundColor = raisedColor;
// self.subviews[1].backgroundColor = raisedColor;
self.superview.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 # pragma mark - OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
%group gOLEDKB %group gOLEDKB
%hook TUIEmojiSearchView
- (void)didMoveToWindow {
%orig;
self.backgroundColor = [UIColor blackColor];
}
%end
%hook UIPredictionViewController %hook UIPredictionViewController
- (void)loadView { - (void)loadView {
%orig; %orig;