mirror of
https://github.com/Burrit0z/kai
synced 2025-07-05 22:46:47 +00:00
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
#import "KAIStackView.h"
|
|
|
|
@implementation KAIStackView
|
|
|
|
-(id)initWithFrame:(CGRect)arg1 {
|
|
self = [super initWithFrame:arg1];
|
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
|
return self;
|
|
}
|
|
|
|
-(void)addSubview:(UIView *)view {
|
|
[super addSubview:view];
|
|
[(UIScrollView *)self.superview.superview setContentSize:self.frame.size];
|
|
|
|
if(textColor==0 && [view respondsToSelector:@selector(updateInfo)]) {
|
|
KAIBatteryCell *cell = (KAIBatteryCell *)view;
|
|
if(@available(iOS 12.0, *)) {
|
|
if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
|
[cell.label setTextColor:[UIColor whiteColor]];
|
|
[cell.percentLabel setTextColor:[UIColor whiteColor]];
|
|
} else if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
|
|
[cell.label setTextColor:[UIColor blackColor]];
|
|
[cell.percentLabel setTextColor:[UIColor blackColor]];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
-(void)layoutSubviews {
|
|
[super layoutSubviews];
|
|
[(KAIBatteryPlatter *)(self.superview.superview) calculateHeight];
|
|
}
|
|
|
|
@end |