@@ -114,11 +114,11 @@ long long lastPercentage; | |||
blank.translatesAutoresizingMaskIntoConstraints = NO; | |||
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 | |||
[blank.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES; | |||
[blank.leftAnchor constraintEqualToAnchor:self.leftAnchor constant:horizontalOffset].active = YES; | |||
} 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.widthAnchor constraintEqualToConstant:((self.superview.bounds.size.width - 16) + bannerWidthFactor)].active = YES; | |||
@@ -129,14 +129,14 @@ long long lastPercentage; | |||
percentLabel.translatesAutoresizingMaskIntoConstraints = NO; | |||
[percentLabel.leftAnchor constraintEqualToAnchor:blank.rightAnchor constant:(- 94)].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; | |||
//label.frame = CGRectMake(65.5,27.5 + y,275,25); | |||
label.translatesAutoresizingMaskIntoConstraints = NO; | |||
[label.leftAnchor constraintEqualToAnchor:glyphView.rightAnchor constant:4.5].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; | |||
//glyphView.frame = CGRectMake(20.5,18.5 + y,40,40); |
@@ -55,6 +55,7 @@ double glyphSize; | |||
double bannerHeight; | |||
double cornerRadius; | |||
double bannerWidthFactor; | |||
double horizontalOffset; | |||
#import "KAIBattery.mm" | |||
@@ -106,7 +107,7 @@ static void preferencesChanged() | |||
enabled = boolValueForKey(@"enabled", YES); | |||
spacing = numberForValue(@"spacing", 5); | |||
glyphSize = numberForValue(@"glyphSize", 40); | |||
glyphSize = numberForValue(@"glyphSize", 35); | |||
bannerHeight = numberForValue(@"bannerHeight", 80); | |||
cornerRadius = numberForValue(@"cornerRadius", 13); | |||
disableGlyphs = boolValueForKey(@"disableGlyphs", NO); | |||
@@ -116,6 +117,7 @@ static void preferencesChanged() | |||
bannerWidthFactor = numberForValue(@"bannerWidthFactor", 0); | |||
hideDeviceLabel = boolValueForKey(@"hideDeviceLabel", NO); | |||
bannerAlign = numberForValue(@"bannerAlign", 2); | |||
horizontalOffset = numberForValue(@"horizontalOffset", 0); | |||
if(disableGlyphs) { | |||
glyphSize = 0; |
@@ -101,11 +101,16 @@ | |||
} | |||
%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 { |
@@ -1,6 +1,6 @@ | |||
Package: com.burritoz.kai | |||
Name: Kai | |||
Version: 0.1.0~alpha | |||
Version: 0.1.1~alpha | |||
Architecture: iphoneos-arm | |||
Description: Show charging banners on your lock screen! | |||
Maintainer: burrit0z |
@@ -208,11 +208,35 @@ | |||
<key>cell</key> | |||
<string>PSGroupCell</string> | |||
<key>label</key> | |||
<string>Glyph Size (40)</string> | |||
<string>Horizontal Axis Manual Offset (0)</string> | |||
</dict> | |||
<dict> | |||
<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> | |||
<string>PSSliderCell</string> | |||
<key>min</key> |