mirror of
https://github.com/Burrit0z/kai
synced 2025-07-03 13:16:46 +00:00
so close to beta 1
This commit is contained in:
24
Kai.xm
24
Kai.xm
@ -50,6 +50,21 @@
|
||||
-(void)KaiUpdate {
|
||||
KAIBatteryStack *battery = [KAIBatteryStack sharedInstance];
|
||||
//battery.number = [battery.subviews count];
|
||||
BCBatteryDeviceController *bcb = [BCBatteryDeviceController sharedInstance];
|
||||
NSArray *devices = MSHookIvar<NSArray *>(bcb, "_sortedDevices");
|
||||
for(KAIBatteryCell *cell in battery.subviews) {
|
||||
//BCBatteryDevice *device = cell.device;
|
||||
[cell updateInfo];
|
||||
if(![devices containsObject:cell.device]) {
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
cell.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[cell removeFromSuperview];
|
||||
[battery removeArrangedSubview:cell];
|
||||
cell.alpha = 1;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
|
||||
@ -130,6 +145,15 @@
|
||||
|
||||
return self.kaiCell;
|
||||
}
|
||||
|
||||
%new
|
||||
-(void)resetKaiCellForNewPrefs {
|
||||
self.kaiCell = [[KAIBatteryCell alloc] initWithFrame:CGRectMake(0,0,[KAIBatteryStack sharedInstance].frame.size.width,0) device:self];
|
||||
((KAIBatteryCell *)self.kaiCell).translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[((KAIBatteryCell *)self.kaiCell).heightAnchor constraintEqualToConstant:bannerHeight].active = YES;
|
||||
|
||||
[(KAIBatteryCell *)self.kaiCell updateInfo];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook KAICSTarget //Again, not a class
|
||||
|
Reference in New Issue
Block a user