Browse Source

fix this :)

pull/1/head
Burrit0z 4 years ago
parent
commit
09bfc1073f
5 changed files with 21 additions and 25 deletions
  1. +0
    -13
      KAIBatteryPlatter.h
  2. +2
    -2
      KAIBatteryPlatter.mm
  3. +14
    -0
      KAIStackView.h
  4. +5
    -0
      KAIStackView.mm
  5. +0
    -10
      Kai.xm

+ 0
- 13
KAIBatteryPlatter.h View File

@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

+ 2
- 2
KAIBatteryPlatter.mm View File

#import "KAIBatteryPlatter.h"


KAIBatteryPlatter *instance; KAIBatteryPlatter *instance;
NSTimer *queueTimer = nil; NSTimer *queueTimer = nil;
if(self.number==0) { if(self.number==0) {
[(UIStackView *)(self.superview) removeArrangedSubview:self]; [(UIStackView *)(self.superview) removeArrangedSubview:self];
} else if(self.number!=0 && !self.superview) { } 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];
} }
} }



+ 14
- 0
KAIStackView.h View File

@interface KAIStackView : UIStackView @interface KAIStackView : UIStackView
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint; @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 @end

+ 5
- 0
KAIStackView.mm View File

[(UIScrollView *)self.superview setContentSize:self.frame.size]; [(UIScrollView *)self.superview setContentSize:self.frame.size];
} }


-(void)layoutSubviews {
[super layoutSubviews];
[(KAIBatteryPlatter *)(self.superview) calculateHeight];
}

@end @end

+ 0
- 10
Kai.xm View File

%orig; %orig;
} }


-(void)removeArrangedSubview:(id)arg1 {
%orig;
[[KAIBatteryPlatter sharedInstance] calculateHeight];
}

-(void)addArrangedSubview:(id)arg1 {
%orig;
[[KAIBatteryPlatter sharedInstance] calculateHeight];
}

-(void)setStackView:(UIStackView *)arg1 { -(void)setStackView:(UIStackView *)arg1 {


if(!KAISelf.hasKai) { if(!KAISelf.hasKai) {

Loading…
Cancel
Save