1
0
mirror of https://github.com/Burrit0z/kai synced 2025-07-01 17:16:47 +00:00
This commit is contained in:
Burrit0z
2020-05-30 11:44:16 -04:00
parent 846e54966f
commit b9d77455ae
2 changed files with 10 additions and 3 deletions

View File

@ -117,11 +117,11 @@ long long lastPercentage;
} else {
int height;
/*if([self.superview.subviews objectAtIndex:([self.superview.subviews count] - 1)] == self) {
if([self.superview.subviews objectAtIndex:([self.superview.subviews count] - 1)] == self) {
height = (self.number * (bannerHeight + spacing));
} else {*/
} else {
height = (self.number * (bannerHeight + spacing)) - spacing;
//}
}
self.heightConstraint.constant = height;
UIStackView *s = (UIStackView *)(self.superview);

7
Kai.xm
View File

@ -61,6 +61,13 @@
dispatch_async(dispatch_get_main_queue(), ^{
[[KAIBatteryStack sharedInstance] updateBattery];
if([KAIBatteryStack sharedInstance].number == 0) {
[[KAIBatteryStack sharedInstance] removeFromSuperview];
[[self stackView] removeArrangedSubview:[KAIBatteryStack sharedInstance]];
} else if(![[self stackView].subviews containsObject:[KAIBatteryStack sharedInstance]]) {
[[self stackView] addSubview:[KAIBatteryStack sharedInstance]];
[[self stackView] addArrangedSubview:[KAIBatteryStack sharedInstance]];
}
if([KAISelf.superview respondsToSelector:@selector(fixComplicationsViewFrame)]) {
[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.35];
//[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.5];