diff --git a/Kai.h b/Kai.h index 8323ceb..76cd870 100644 --- a/Kai.h +++ b/Kai.h @@ -49,6 +49,7 @@ BOOL hidePercent; BOOL showAll; BOOL belowMusic; BOOL hideDeviceLabel; +BOOL hideChargingAnimation; NSInteger bannerStyle; NSInteger bannerAlign; double spacing; @@ -120,6 +121,7 @@ static void preferencesChanged() bannerAlign = numberForValue(@"bannerAlign", 2); horizontalOffset = numberForValue(@"horizontalOffset", 0); belowMusic = boolValueForKey(@"belowMusic", NO); + hideChargingAnimation = boolValueForKey(@"hideChargingAnimation", YES); if(disableGlyphs) { glyphSize = 0; diff --git a/Kai.xm b/Kai.xm index 88eeae5..548f69d 100644 --- a/Kai.xm +++ b/Kai.xm @@ -103,26 +103,12 @@ } %end -%hook CSBatteryChargingView +%hook CSCoverSheetViewController -+(id)batteryChargingViewWithSingleBattery { - NSLog(@"kai: here bro: %@", [NSThread callStackSymbols]); - [UIPasteboard generalPasteboard].string = [NSString stringWithFormat:@"kai: here bro: %@", [NSThread callStackSymbols]]; - return nil; -} - -+(id)batteryChargingViewWithDoubleBattery { - NSLog(@"kai: here bro: %@", [NSThread callStackSymbols]); - [UIPasteboard generalPasteboard].string = [NSString stringWithFormat:@"kai: here bro: %@", [NSThread callStackSymbols]]; - return nil; -} - --(CGFloat)desiredVisibilityDuration { - return 0; -} - --(void)setBatteryVisible:(BOOL)arg1 { - %orig(NO); +-(void)_transitionChargingViewToVisible:(BOOL)arg1 showBattery:(BOOL)arg2 animated:(BOOL)arg3 { + if(hideChargingAnimation) { + %orig(NO,NO,NO); + } } %end diff --git a/kaiprefs/KAIRootListController.m b/kaiprefs/KAIRootListController.m index b547d3f..cbc658f 100644 --- a/kaiprefs/KAIRootListController.m +++ b/kaiprefs/KAIRootListController.m @@ -70,7 +70,7 @@ NSBundle *tweakBundle; CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("com.burritoz.kaiprefs/reload"), nil, nil, true); UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Kai" - message:@"Your settings have been applied. You can now go back to your lockscreen (CoverSheet) to see the changes. \n Note the option to put kai below music requires a respring." + message:@"Your settings have been applied. You can now go back to your lockscreen (CoverSheet) to see the changes. \n Note the option to put kai below music requires a respring, as well as option to hide CoverSheet charge animations." preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"Amazing!" style:UIAlertActionStyleDefault diff --git a/kaiprefs/Resources/Root.plist b/kaiprefs/Resources/Root.plist index 9509dd4..c7cb6ce 100644 --- a/kaiprefs/Resources/Root.plist +++ b/kaiprefs/Resources/Root.plist @@ -24,6 +24,18 @@ label Enable + + cell + PSSwitchCell + default + + defaults + com.burritoz.kaiprefs + key + hideChargingAnimation + label + Hide CoverSheet Charging Animations + cell PSGroupCell