Browse Source

idk

pull/1/head
Burrit0z 4 years ago
parent
commit
b9d77455ae
2 changed files with 10 additions and 3 deletions
  1. +3
    -3
      KAIBatteryStack.mm
  2. +7
    -0
      Kai.xm

+ 3
- 3
KAIBatteryStack.mm View File



} else { } else {
int height; 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)); height = (self.number * (bannerHeight + spacing));
} else {*/
} else {
height = (self.number * (bannerHeight + spacing)) - spacing; height = (self.number * (bannerHeight + spacing)) - spacing;
//}
}
self.heightConstraint.constant = height; self.heightConstraint.constant = height;


UIStackView *s = (UIStackView *)(self.superview); UIStackView *s = (UIStackView *)(self.superview);

+ 7
- 0
Kai.xm View File

dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{


[[KAIBatteryStack sharedInstance] updateBattery]; [[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)]) { 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.35];
//[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.5]; //[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.5];

Loading…
Cancel
Save