Browse Source

move

pull/1/head
Burrit0z 4 years ago
parent
commit
03af76d40c
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      KAIBatteryPlatter.mm

+ 5
- 6
KAIBatteryPlatter.mm View File

[self.stackHolder.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES; [self.stackHolder.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
[self.stackHolder.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES; [self.stackHolder.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES;


[self.stack.widthAnchor constraintEqualToAnchor:self.stackHolder.widthAnchor].active = YES;
[self.stack.heightAnchor constraintEqualToAnchor:self.stackHolder.heightAnchor].active = YES;
[self.stack.widthAnchor constraintEqualToAnchor:self.stackHolder.widthAnchor].active = YES;
[self.stack.centerYAnchor constraintEqualToAnchor:self.stackHolder.centerYAnchor].active = YES;

[self updateBattery]; [self updateBattery];
} }
return self; return self;
long long lastPercentage; long long lastPercentage;


-(void)updateBattery { -(void)updateBattery {
if(!self.stack.widthAnchor) {
[self.stack.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
[self.stack.heightAnchor constraintEqualToAnchor:self.heightAnchor].active = YES;
[self.stack.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
[self.stack.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES;
}
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
BCBatteryDeviceController *bcb = [BCBatteryDeviceController sharedInstance]; BCBatteryDeviceController *bcb = [BCBatteryDeviceController sharedInstance];
NSArray *devices = MSHookIvar<NSArray *>(bcb, "_sortedDevices"); NSArray *devices = MSHookIvar<NSArray *>(bcb, "_sortedDevices");

Loading…
Cancel
Save