avoid layoutSubviews

This commit is contained in:
qnblackcat
2022-05-04 11:10:06 +07:00
parent feaeb234cc
commit 314efca54b
2 changed files with 28 additions and 21 deletions
+6 -3
View File
@@ -20,9 +20,6 @@
@interface YTLightweightQTMButton : UIView @interface YTLightweightQTMButton : UIView
@end @end
@interface YTELMView : UIView
@end
@interface NIAttributedLabel : UIView @interface NIAttributedLabel : UIView
@end @end
@@ -30,4 +27,10 @@
@end @end
@interface UICollectionViewControllerWrapperView : UIView @interface UICollectionViewControllerWrapperView : UIView
@end
@interface ASScrollView : UIView
@end
@interface ASCollectionView : UIView
@end @end
+22 -18
View File
@@ -205,9 +205,9 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
arg1 = oledColor; arg1 = oledColor;
%orig; %orig;
} }
//- (void)layoutSubviews { //- (void)didMoveToWindow {
// %orig; // %orig;
// if ([self.nextResponder isKindOfClass:%c(YTALDialog)]) // if ([self.nextResponder isKindOfClass:%c(YTALDialog)]) // Connected apps
// self.backgroundColor = oledColor; // self.backgroundColor = oledColor;
//} //}
%end %end
@@ -245,7 +245,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
arg1 = oledColor; arg1 = oledColor;
%orig; %orig;
} }
-(void)layoutSubviews { // Dune - https://github.com/Skittyblock/Dune/blob/9b1df9790230115b7553cc9dbadf36889018d7f9/Tweak.xm#L70 -(void)didMoveToWindow { // Dune - https://github.com/Skittyblock/Dune/blob/9b1df9790230115b7553cc9dbadf36889018d7f9/Tweak.xm#L70
%orig; %orig;
MSHookIvar<UIView *>(self, "_contentView").backgroundColor = oledColor; MSHookIvar<UIView *>(self, "_contentView").backgroundColor = oledColor;
} }
@@ -298,6 +298,10 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
arg1 = oledColor; arg1 = oledColor;
%orig; %orig;
} }
-(void)setTextColor:(id)arg1 {
arg1 = [UIColor whiteColor];
%orig;
}
%end %end
%hook YCHLiveChatActionPanelView %hook YCHLiveChatActionPanelView
@@ -435,7 +439,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
arg1 = oledColor; arg1 = oledColor;
%orig; %orig;
} }
- (void)layoutSubviews {} - (void)didMoveToWindow {}
%end %end
%hook YTLightweightQTMButton %hook YTLightweightQTMButton
@@ -490,13 +494,6 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook YTELMView // upload videos
-(void)layoutSubviews {
%orig;
self.backgroundColor = oledColor;
}
%end
%hook YTMealBarPromoView %hook YTMealBarPromoView
-(void)setBackgroundColor:(id)arg1 { // Offline -(void)setBackgroundColor:(id)arg1 { // Offline
arg1 = oledColor; arg1 = oledColor;
@@ -512,6 +509,20 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook ASScrollView // Explore
-(void)didMoveToWindow {
self.backgroundColor = oledColor;
%orig;
}
%end
%hook ASCollectionView // your videos
-(void)didMoveToWindow {
self.backgroundColor = oledColor;
%orig;
}
%end
//// ////
/* /*
%hook UICollectionView %hook UICollectionView
@@ -536,13 +547,6 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook ASCollectionView
-(void)layoutSubviews {
self.backgroundColor = oledColor;
%orig;
}
%end
%hook YTChannelProfileDescriptionEditorView // edit profile Description %hook YTChannelProfileDescriptionEditorView // edit profile Description
-(void)setBackgroundColor:(id)arg1 { -(void)setBackgroundColor:(id)arg1 {
arg1 = oledColor; arg1 = oledColor;