Bläddra i källkod

work

pull/1/head
Burrit0z 4 år sedan
förälder
incheckning
d6545a96f7
5 ändrade filer med 18 tillägg och 11 borttagningar
  1. +7
    -5
      KAIBatteryCell.mm
  2. +7
    -4
      KAIBatteryPlatter.mm
  3. +2
    -0
      KAIStackView.h
  4. +1
    -1
      Kai.plist
  5. +1
    -1
      Layout/DEBIAN/control

+ 7
- 5
KAIBatteryCell.mm Visa fil

@@ -88,16 +88,19 @@

blurPlatter.translatesAutoresizingMaskIntoConstraints = NO;
if(bannerAlign==2) { //center
[blurPlatter.centerXAnchor constraintEqualToAnchor:self.centerXAnchor constant:horizontalOffset].active = YES;
[blurPlatter.centerXAnchor constraintEqualToAnchor:self.centerXAnchor].active = YES;
} else if(bannerAlign==1) { //left
[blurPlatter.leftAnchor constraintEqualToAnchor:self.leftAnchor constant:horizontalOffset].active = YES;
[blurPlatter.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
} else if(bannerAlign==3) { //right
[blurPlatter.rightAnchor constraintEqualToAnchor:self.rightAnchor constant:horizontalOffset].active = YES;
[blurPlatter.rightAnchor constraintEqualToAnchor:self.rightAnchor].active = YES;
}
[blurPlatter.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
[blurPlatter.widthAnchor constraintEqualToConstant:((self.frame.size.width) + bannerWidthFactor)].active = YES;
[blurPlatter.widthAnchor constraintEqualToConstant:(([[[objc_getClass("CSAdjunctListView") class] sharedListViewForKai] stackView].frame.size.width - 16) + bannerWidthFactor)].active = YES;
[blurPlatter.heightAnchor constraintEqualToConstant:bannerHeight].active = YES;

[self.widthAnchor constraintEqualToAnchor:blurPlatter.widthAnchor].active = YES;

blur.translatesAutoresizingMaskIntoConstraints = NO;
[blur.centerXAnchor constraintEqualToAnchor:blurPlatter.centerXAnchor].active = YES;
[blur.topAnchor constraintEqualToAnchor:blurPlatter.topAnchor].active = YES;
@@ -142,7 +145,6 @@
}

[self.heightAnchor constraintEqualToConstant:(bannerHeight + spacing)].active = YES;
[self.widthAnchor constraintEqualToAnchor:blurPlatter.widthAnchor].active = YES;

}


+ 7
- 4
KAIBatteryPlatter.mm Visa fil

@@ -21,7 +21,6 @@ NSTimer *queueTimer = nil;
[self addSubview:self.stack];
[self setContentSize:self.stack.frame.size];
[self setContentOffset:CGPointMake(0,0)];
//[self setDelegate:self];

[self updateBattery];
}
@@ -129,6 +128,7 @@ long long lastPercentage;
}

-(void)calculateHeight {

self.number = [self.stack.subviews count];

if(self.number==0) {
@@ -160,7 +160,8 @@ long long lastPercentage;
self.stack.heightConstraint.active = YES;
[self setContentSize:self.stack.frame.size];
if(kaiAlign==0) {
[self.stack.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
/*self.stack.widthConstraint = [self.stack.widthAnchor constraintEqualToAnchor:self.widthAnchor constant:bannerWidthFactor];
self.stack.widthConstraint.active = YES;*/
} else {
self.widthConstraint = [self.widthAnchor constraintEqualToConstant:(self.number * (self.frame.size.width + bannerWidthFactor))];
self.widthConstraint.active = YES;
@@ -168,7 +169,9 @@ long long lastPercentage;

} else {
int height = (self.number * (bannerHeight + spacing));
if(kaiAlign!=0) {
if(kaiAlign==0) {
//self.stack.widthConstraint.constant = bannerWidthFactor;
} else {
height = bannerHeight + spacing;
self.widthConstraint.constant = (self.number * (self.frame.size.width + bannerWidthFactor));
}
@@ -206,7 +209,7 @@ long long lastPercentage;
for(BCBatteryDevice *device in devices) {
[device resetKaiCellForNewPrefs];
}
//self.spacing = spacing;
[self updateBattery];
}


+ 2
- 0
KAIStackView.h Visa fil

@@ -1,5 +1,7 @@
@interface KAIStackView : UIStackView
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint;
@property (nonatomic, strong) NSLayoutConstraint *widthConstraint;
@property (nonatomic, strong) NSLayoutConstraint *aligner;
@end

@interface KAIBatteryPlatter : UIScrollView <UIScrollViewDelegate>

+ 1
- 1
Kai.plist Visa fil

@@ -1 +1 @@
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
{ Filter = { Bundles = ( "com.apple.springboard", "com.apple.BatteryCenter" ); }; }

+ 1
- 1
Layout/DEBIAN/control Visa fil

@@ -1,6 +1,6 @@
Package: com.burritoz.kai
Name: Kai
Version: 0.9.9~4
Version: 0.9.95
Architecture: iphoneos-arm
Description: Show charging banners on your lock screen!
Maintainer: burrit0z

Laddar…
Avbryt
Spara