|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface CSAdjunctListView : UIView |
|
|
@interface CSAdjunctListView : UIView |
|
|
@property (nonatomic, assign) BOOL hasKai; |
|
|
@property (nonatomic, assign) BOOL hasKai; |
|
|
@property (nonatomic, assign) NSInteger previousKaiCount; |
|
|
|
|
|
-(UIStackView *)stackView; |
|
|
-(UIStackView *)stackView; |
|
|
-(void)setStackView:(UIStackView *)arg1; |
|
|
-(void)setStackView:(UIStackView *)arg1; |
|
|
-(void)KaiUpdate; |
|
|
-(void)KaiUpdate; |
|
|
|
|
|
|
|
|
@interface NCNotificationListView : UIView |
|
|
@interface NCNotificationListView : UIView |
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
BOOL setFrame = NO; |
|
|
|
|
|
CGRect original = CGRectMake(0,0,0,0); |
|
|
CGRect original = CGRectMake(0,0,0,0); |
|
|
CGRect originalBattery; |
|
|
CGRect originalBattery; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%hook CSAdjunctListView |
|
|
%hook CSAdjunctListView |
|
|
%property (nonatomic, assign) BOOL hasKai; |
|
|
%property (nonatomic, assign) BOOL hasKai; |
|
|
%property (nonatomic, assign) NSInteger previousKaiCount; |
|
|
|
|
|
|
|
|
|
|
|
-(void)_layoutStackView { |
|
|
-(void)_layoutStackView { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
-(void)setStackView:(UIStackView *)arg1 { |
|
|
-(void)setStackView:(UIStackView *)arg1 { |
|
|
//NSLog(@"Kai: Updating setting stack view"); |
|
|
|
|
|
|
|
|
|
|
|
if(!self.hasKai) { |
|
|
if(!self.hasKai) { |
|
|
KAIBattery *battery = [[KAIBattery alloc] initWithFrame:CGRectMake(8, 0, UIScreen.mainScreen.bounds.size.width, 85)]; |
|
|
|
|
|
|
|
|
KAIBattery *battery = [[KAIBattery alloc] init]; |
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
[battery.leftAnchor constraintEqualToAnchor:battery.leftAnchor constant:0].active = YES; |
|
|
|
|
|
[battery.topAnchor constraintEqualToAnchor:battery.topAnchor constant:0].active = YES; |
|
|
|
|
|
[battery.widthAnchor constraintEqualToConstant:[self stackView].frame.size.width - 16].active = YES; |
|
|
|
|
|
|
|
|
//[battery.widthAnchor constraintEqualToAnchor:[self stackView].widthAnchor].active = YES; |
|
|
|
|
|
//[battery.heightAnchor constraintEqualToConstant:(battery.number * 85)].active = YES; |
|
|
|
|
|
[battery.heightAnchor constraintEqualToConstant:100].active = YES; |
|
|
originalBattery = battery.frame; |
|
|
originalBattery = battery.frame; |
|
|
original = [self stackView].frame; |
|
|
original = [self stackView].frame; |
|
|
setFrame = YES; |
|
|
|
|
|
self.previousKaiCount = 0; |
|
|
|
|
|
self.hasKai = YES; |
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self |
|
|
[[NSNotificationCenter defaultCenter] addObserver:self |
|
|
selector:@selector(KaiInfo) |
|
|
selector:@selector(KaiInfo) |
|
|
name:@"KaiInfoChanged" |
|
|
name:@"KaiInfoChanged" |
|
|
object:nil]; |
|
|
object:nil]; |
|
|
//[self addSubview:[KAIBattery sharedInstance]]; |
|
|
|
|
|
|
|
|
self.hasKai = YES; |
|
|
[[KAIBattery sharedInstance] darkLightMode]; |
|
|
[[KAIBattery sharedInstance] darkLightMode]; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UIStackView *newView = arg1; |
|
|
UIStackView *newView = arg1; |
|
|
|
|
|
|
|
|
if(![arg1.subviews containsObject:[KAIBattery sharedInstance]]) { |
|
|
|
|
|
[newView addArrangedSubview:[KAIBattery sharedInstance]]; |
|
|
|
|
|
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,359,80)]; |
|
|
|
|
|
[view setBackgroundColor:[UIColor redColor]]; |
|
|
|
|
|
//[view setIntrinsicContentSize:CGSizeMake(359,80)]; |
|
|
|
|
|
[newView addArrangedSubview:view]; |
|
|
|
|
|
|
|
|
if(![arg1.subviews containsObject:battery]) { |
|
|
|
|
|
[newView addArrangedSubview:battery]; |
|
|
|
|
|
//UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,359,80)]; |
|
|
|
|
|
//[view setBackgroundColor:[UIColor redColor]]; |
|
|
|
|
|
//[newView addArrangedSubview:view]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%orig(newView); |
|
|
%orig(newView); |
|
|
//%orig(arg1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%new |
|
|
%new |
|
|
|
|
|
|
|
|
[[KAIBattery sharedInstance] darkLightMode]; |
|
|
[[KAIBattery sharedInstance] darkLightMode]; |
|
|
KAIBattery *battery = [KAIBattery sharedInstance]; |
|
|
KAIBattery *battery = [KAIBattery sharedInstance]; |
|
|
//battery.translatesAutoresizingMaskIntoConstraints = YES; |
|
|
//battery.translatesAutoresizingMaskIntoConstraints = YES; |
|
|
battery.frame = CGRectMake( |
|
|
|
|
|
|
|
|
/*battery.frame = CGRectMake( |
|
|
originalBattery.origin.x, |
|
|
originalBattery.origin.x, |
|
|
originalBattery.origin.y, |
|
|
originalBattery.origin.y, |
|
|
originalBattery.size.width, |
|
|
originalBattery.size.width, |
|
|
(battery.number * 85) |
|
|
(battery.number * 85) |
|
|
); |
|
|
|
|
|
|
|
|
);*/ |
|
|
|
|
|
|
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
battery.translatesAutoresizingMaskIntoConstraints = NO; |
|
|
[battery.leftAnchor constraintEqualToAnchor:battery.leftAnchor constant:0].active = YES; |
|
|
|
|
|
[battery.topAnchor constraintEqualToAnchor:battery.topAnchor constant:0].active = YES; |
|
|
|
|
|
[battery.widthAnchor constraintEqualToConstant:[self stackView].frame.size.width - 16].active = YES; |
|
|
|
|
|
[battery.heightAnchor constraintEqualToConstant:(battery.number * 85)].active = YES; |
|
|
|
|
|
|
|
|
//[battery.widthAnchor constraintEqualToAnchor:[self stackView].widthAnchor].active = YES; |
|
|
|
|
|
//[battery.heightAnchor constraintEqualToConstant:(battery.number * 85)].active = YES; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%new |
|
|
%new |