if(!self.isUpdating) { | if(!self.isUpdating) { | ||||
self.isUpdating = YES; | self.isUpdating = YES; | ||||
self.number = 0; | self.number = 0; | ||||
float y = 0; | |||||
BCBatteryDeviceController *bcb = [BCBatteryDeviceController sharedInstance]; | BCBatteryDeviceController *bcb = [BCBatteryDeviceController sharedInstance]; | ||||
NSArray *devices = MSHookIvar<NSArray *>(bcb, "_sortedDevices"); | NSArray *devices = MSHookIvar<NSArray *>(bcb, "_sortedDevices"); | ||||
BOOL charging = MSHookIvar<long long>(device, "_charging"); | BOOL charging = MSHookIvar<long long>(device, "_charging"); | ||||
BOOL LPM = MSHookIvar<BOOL>(device, "_batterySaverModeActive"); | BOOL LPM = MSHookIvar<BOOL>(device, "_batterySaverModeActive"); | ||||
float y; | |||||
if(charging) { | if(charging) { | ||||
UIVisualEffectView *blank = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]]; | UIVisualEffectView *blank = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]]; |
setFrame = YES; | setFrame = YES; | ||||
batteryWidget = self; | batteryWidget = self; | ||||
} | } | ||||
[self KaiUpdate]; | |||||
} | } | ||||
%new | %new | ||||
-(void)KaiUpdate { | -(void)KaiUpdate { | ||||
[UIView animateWithDuration:0.3 animations:^{ | |||||
self.frame = CGRectMake( | self.frame = CGRectMake( | ||||
original.origin.x, | original.origin.x, | ||||
original.origin.y + (self.battery.number * 85), | original.origin.y + (self.battery.number * 85), | ||||
original.size.height | original.size.height | ||||
); | ); | ||||
/*self.battery.frame = CGRectMake( | |||||
self.battery.frame = CGRectMake( | |||||
originalBattery.origin.x, | originalBattery.origin.x, | ||||
originalBattery.origin.y - (self.battery.number * 85) + 85, | originalBattery.origin.y - (self.battery.number * 85) + 85, | ||||
originalBattery.size.width, | originalBattery.size.width, | ||||
originalBattery.size.height | originalBattery.size.height | ||||
);*/ | |||||
); | |||||
}]; | |||||
} | } | ||||
%end | %end | ||||
}); | }); | ||||
} | } | ||||
%end | |||||
%hook CSScrollView | |||||
%end | %end |