blank.translatesAutoresizingMaskIntoConstraints = NO; | blank.translatesAutoresizingMaskIntoConstraints = NO; | ||||
if(bannerAlign==2) { //center | if(bannerAlign==2) { //center | ||||
[blank.centerXAnchor constraintEqualToAnchor:self.centerXAnchor].active = YES; | |||||
[blank.centerXAnchor constraintEqualToAnchor:self.centerXAnchor constant:horizontalOffset].active = YES; | |||||
} else if(bannerAlign==1) { //left | } else if(bannerAlign==1) { //left | ||||
[blank.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES; | |||||
[blank.leftAnchor constraintEqualToAnchor:self.leftAnchor constant:horizontalOffset].active = YES; | |||||
} else if(bannerAlign==3) { //right | } else if(bannerAlign==3) { //right | ||||
[blank.rightAnchor constraintEqualToAnchor:self.rightAnchor].active = YES; | |||||
[blank.rightAnchor constraintEqualToAnchor:self.rightAnchor constant:horizontalOffset].active = YES; | |||||
} | } | ||||
[blank.topAnchor constraintEqualToAnchor:self.topAnchor constant:y].active = YES; | [blank.topAnchor constraintEqualToAnchor:self.topAnchor constant:y].active = YES; | ||||
[blank.widthAnchor constraintEqualToConstant:((self.superview.bounds.size.width - 16) + bannerWidthFactor)].active = YES; | [blank.widthAnchor constraintEqualToConstant:((self.superview.bounds.size.width - 16) + bannerWidthFactor)].active = YES; | ||||
percentLabel.translatesAutoresizingMaskIntoConstraints = NO; | percentLabel.translatesAutoresizingMaskIntoConstraints = NO; | ||||
[percentLabel.leftAnchor constraintEqualToAnchor:blank.rightAnchor constant:(- 94)].active = YES; | [percentLabel.leftAnchor constraintEqualToAnchor:blank.rightAnchor constant:(- 94)].active = YES; | ||||
[percentLabel.centerYAnchor constraintEqualToAnchor:blank.centerYAnchor].active = YES; | [percentLabel.centerYAnchor constraintEqualToAnchor:blank.centerYAnchor].active = YES; | ||||
[percentLabel.widthAnchor constraintEqualToConstant:36].active = YES; | |||||
[percentLabel.widthAnchor constraintEqualToConstant:35].active = YES; | |||||
[percentLabel.heightAnchor constraintEqualToConstant:12].active = YES; | [percentLabel.heightAnchor constraintEqualToConstant:12].active = YES; | ||||
//label.frame = CGRectMake(65.5,27.5 + y,275,25); | //label.frame = CGRectMake(65.5,27.5 + y,275,25); | ||||
label.translatesAutoresizingMaskIntoConstraints = NO; | label.translatesAutoresizingMaskIntoConstraints = NO; | ||||
[label.leftAnchor constraintEqualToAnchor:glyphView.rightAnchor constant:4.5].active = YES; | [label.leftAnchor constraintEqualToAnchor:glyphView.rightAnchor constant:4.5].active = YES; | ||||
[label.centerYAnchor constraintEqualToAnchor:blank.centerYAnchor].active = YES; | [label.centerYAnchor constraintEqualToAnchor:blank.centerYAnchor].active = YES; | ||||
[label.rightAnchor constraintEqualToAnchor:percentLabel.leftAnchor constant:7].active = YES; | |||||
[label.rightAnchor constraintEqualToAnchor:percentLabel.leftAnchor constant:-4.5].active = YES; | |||||
[label.heightAnchor constraintEqualToConstant:25].active = YES; | [label.heightAnchor constraintEqualToConstant:25].active = YES; | ||||
//glyphView.frame = CGRectMake(20.5,18.5 + y,40,40); | //glyphView.frame = CGRectMake(20.5,18.5 + y,40,40); |
double bannerHeight; | double bannerHeight; | ||||
double cornerRadius; | double cornerRadius; | ||||
double bannerWidthFactor; | double bannerWidthFactor; | ||||
double horizontalOffset; | |||||
#import "KAIBattery.mm" | #import "KAIBattery.mm" | ||||
enabled = boolValueForKey(@"enabled", YES); | enabled = boolValueForKey(@"enabled", YES); | ||||
spacing = numberForValue(@"spacing", 5); | spacing = numberForValue(@"spacing", 5); | ||||
glyphSize = numberForValue(@"glyphSize", 40); | |||||
glyphSize = numberForValue(@"glyphSize", 35); | |||||
bannerHeight = numberForValue(@"bannerHeight", 80); | bannerHeight = numberForValue(@"bannerHeight", 80); | ||||
cornerRadius = numberForValue(@"cornerRadius", 13); | cornerRadius = numberForValue(@"cornerRadius", 13); | ||||
disableGlyphs = boolValueForKey(@"disableGlyphs", NO); | disableGlyphs = boolValueForKey(@"disableGlyphs", NO); | ||||
bannerWidthFactor = numberForValue(@"bannerWidthFactor", 0); | bannerWidthFactor = numberForValue(@"bannerWidthFactor", 0); | ||||
hideDeviceLabel = boolValueForKey(@"hideDeviceLabel", NO); | hideDeviceLabel = boolValueForKey(@"hideDeviceLabel", NO); | ||||
bannerAlign = numberForValue(@"bannerAlign", 2); | bannerAlign = numberForValue(@"bannerAlign", 2); | ||||
horizontalOffset = numberForValue(@"horizontalOffset", 0); | |||||
if(disableGlyphs) { | if(disableGlyphs) { | ||||
glyphSize = 0; | glyphSize = 0; |
} | } | ||||
%end | %end | ||||
%hook _CSSingleBatteryChargingView | |||||
%hook CSBatteryChargingView | |||||
-(void)initWithFrame:(CGRect)arg1 { | |||||
%orig; | |||||
[self removeFromSuperview]; | |||||
+(id)batteryChargingViewWithSingleBattery { | |||||
//NSLog(@"kai: here bro: %@", [NSThread callStackSymbols]); | |||||
//[UIPasteboard generalPasteboard].string = [NSString stringWithFormat:@"kai: here bro: %@", [NSThread callStackSymbols]]; | |||||
return nil; | |||||
} | |||||
+(id)batteryChargingViewWithDoubleBattery { | |||||
return nil; | |||||
} | } | ||||
-(CGFloat)desiredVisibilityDuration { | -(CGFloat)desiredVisibilityDuration { |
Package: com.burritoz.kai | Package: com.burritoz.kai | ||||
Name: Kai | Name: Kai | ||||
Version: 0.1.0~alpha | |||||
Version: 0.1.1~alpha | |||||
Architecture: iphoneos-arm | Architecture: iphoneos-arm | ||||
Description: Show charging banners on your lock screen! | Description: Show charging banners on your lock screen! | ||||
Maintainer: burrit0z | Maintainer: burrit0z |
<key>cell</key> | <key>cell</key> | ||||
<string>PSGroupCell</string> | <string>PSGroupCell</string> | ||||
<key>label</key> | <key>label</key> | ||||
<string>Glyph Size (40)</string> | |||||
<string>Horizontal Axis Manual Offset (0)</string> | |||||
</dict> | </dict> | ||||
<dict> | <dict> | ||||
<key>default</key> | <key>default</key> | ||||
<real>40</real> | |||||
<real>0</real> | |||||
<key>cell</key> | |||||
<string>PSSliderCell</string> | |||||
<key>min</key> | |||||
<real>-300.0</real> | |||||
<key>max</key> | |||||
<real>300</real> | |||||
<key>isSegmented</key> | |||||
<false/> | |||||
<key>showValue</key> | |||||
<true/> | |||||
<key>defaults</key> | |||||
<string>com.burritoz.kaiprefs</string> | |||||
<key>key</key> | |||||
<string>horizontalOffset</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSGroupCell</string> | |||||
<key>label</key> | |||||
<string>Glyph Size (35)</string> | |||||
</dict> | |||||
<dict> | |||||
<key>default</key> | |||||
<real>35</real> | |||||
<key>cell</key> | <key>cell</key> | ||||
<string>PSSliderCell</string> | <string>PSSliderCell</string> | ||||
<key>min</key> | <key>min</key> |