1
0
mirror of https://github.com/Burrit0z/kai synced 2025-07-01 07:36:48 +00:00

fix this :)

This commit is contained in:
Burrit0z
2020-06-03 09:52:33 -04:00
parent f30b2c6954
commit 09bfc1073f
5 changed files with 21 additions and 25 deletions

View File

@ -1,13 +0,0 @@
@interface KAIBatteryPlatter : UIScrollView <UIScrollViewDelegate>
@property (nonatomic, assign) NSInteger number;
@property (nonatomic, assign) NSInteger oldCountOfDevices;
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint;
@property (nonatomic, strong) KAIStackView *stack;
@property (nonatomic, assign) BOOL isUpdating;
@property (nonatomic, assign) BOOL queued;
+(KAIBatteryPlatter *)sharedInstance;
-(instancetype)initWithFrame:(CGRect)arg1;
-(void)refreshForPrefs;
-(void)updateBattery;
-(void)calculateHeight;
@end

View File

@ -1,4 +1,3 @@
#import "KAIBatteryPlatter.h"
KAIBatteryPlatter *instance;
NSTimer *queueTimer = nil;
@ -192,7 +191,8 @@ long long lastPercentage;
if(self.number==0) {
[(UIStackView *)(self.superview) removeArrangedSubview:self];
} else if(self.number!=0 && !self.superview) {
[[[objc_getClass("CSAdjunctListView") class] sharedListViewForKai] addArrangedSubview:self];
[[[[objc_getClass("CSAdjunctListView") class] sharedListViewForKai] stackView] addArrangedSubview:self];
[self performSelector:@selector(calculateHeight) withObject:self afterDelay:0.1];
}
}

View File

@ -1,3 +1,17 @@
@interface KAIStackView : UIStackView
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint;
@end
@interface KAIBatteryPlatter : UIScrollView <UIScrollViewDelegate>
@property (nonatomic, assign) NSInteger number;
@property (nonatomic, assign) NSInteger oldCountOfDevices;
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint;
@property (nonatomic, strong) KAIStackView *stack;
@property (nonatomic, assign) BOOL isUpdating;
@property (nonatomic, assign) BOOL queued;
+(KAIBatteryPlatter *)sharedInstance;
-(instancetype)initWithFrame:(CGRect)arg1;
-(void)refreshForPrefs;
-(void)updateBattery;
-(void)calculateHeight;
@end

View File

@ -13,4 +13,9 @@
[(UIScrollView *)self.superview setContentSize:self.frame.size];
}
-(void)layoutSubviews {
[super layoutSubviews];
[(KAIBatteryPlatter *)(self.superview) calculateHeight];
}
@end

10
Kai.xm
View File

@ -31,16 +31,6 @@ CSAdjunctListView *list;
%orig;
}
-(void)removeArrangedSubview:(id)arg1 {
%orig;
[[KAIBatteryPlatter sharedInstance] calculateHeight];
}
-(void)addArrangedSubview:(id)arg1 {
%orig;
[[KAIBatteryPlatter sharedInstance] calculateHeight];
}
-(void)setStackView:(UIStackView *)arg1 {
if(!KAISelf.hasKai) {