mirror of
https://github.com/Burrit0z/kai
synced 2025-07-01 17:26:47 +00:00
not gay
This commit is contained in:
@ -20,7 +20,7 @@ long long batteryPercentage;
|
||||
long long lastPercentage;
|
||||
|
||||
-(void)updateBattery {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//NSLog(@"kai: battery platter called to update");
|
||||
if(!self.isUpdating) {
|
||||
self.isUpdating = YES;
|
||||
@ -56,6 +56,12 @@ long long lastPercentage;
|
||||
|
||||
KAIBatteryCell *cell = [KAIBatteryCell cellForDeviceIfExists:device frameToCreateNew:CGRectMake(0, y, self.frame.size.width, bannerHeight)];
|
||||
|
||||
if(cell) {
|
||||
cell.device = device;
|
||||
cell.frame = cell.frame = CGRectMake(0, y, self.frame.size.width, bannerHeight); //bro im like creating my own stack view
|
||||
[cell updateInfo];
|
||||
}
|
||||
|
||||
if(shouldAdd && [deviceName length]!=0) {
|
||||
if(![self.subviews containsObject:cell]) {
|
||||
cell.frame = CGRectMake(0, y, self.frame.size.width, bannerHeight);
|
||||
@ -70,8 +76,9 @@ long long lastPercentage;
|
||||
//[self.heightAnchor constraintEqualToConstant:(self.number * 85)].active = YES;
|
||||
self.isUpdating = NO;
|
||||
self.number = [self.subviews count];
|
||||
[(CSAdjunctListView *)self.superview KaiUpdate];
|
||||
}
|
||||
});
|
||||
//});
|
||||
}
|
||||
|
||||
-(void)removeAllAndRefresh {
|
||||
|
@ -24,7 +24,7 @@
|
||||
@end
|
||||
|
||||
@interface BCBatteryDevice : NSObject
|
||||
@property (nonatomic, strong) NSString *accessoryIdentifier;
|
||||
@property (nonatomic, strong) NSString *identifier;
|
||||
-(id)glyph;
|
||||
@end
|
||||
|
||||
|
@ -150,7 +150,7 @@ NSMutableArray *deviceInstances = [[NSMutableArray alloc] init];
|
||||
//NSString *deviceName = MSHookIvar<NSString *>(device, "_name");
|
||||
|
||||
for(KAIBatteryCell *cell in deviceInstances) {
|
||||
if(cell.device == device || [cell.device.accessoryIdentifier isEqualToString:device.accessoryIdentifier]) {
|
||||
if(cell.device == device || [cell.device.identifier isEqualToString:device.identifier]) {
|
||||
foundCell = cell;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user