mirror of
https://github.com/Burrit0z/kai
synced 2025-07-01 10:46:48 +00:00
almost
This commit is contained in:
0
DragonMake
Normal file → Executable file
0
DragonMake
Normal file → Executable file
0
KAIBatteryCell.h
Normal file → Executable file
0
KAIBatteryCell.h
Normal file → Executable file
10
KAIBatteryCell.mm
Normal file → Executable file
10
KAIBatteryCell.mm
Normal file → Executable file
@ -113,7 +113,9 @@
|
||||
self.label.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self.label.leftAnchor constraintEqualToAnchor:self.glyphView.rightAnchor constant:4.5].active = YES;
|
||||
[self.label.centerYAnchor constraintEqualToAnchor:blurPlatter.centerYAnchor].active = YES;
|
||||
[self.label.rightAnchor constraintEqualToAnchor:self.percentLabel.leftAnchor constant:-4.5].active = YES;
|
||||
if(!hidePercent) {
|
||||
[self.label.rightAnchor constraintEqualToAnchor:self.percentLabel.leftAnchor constant:-4.5].active = YES;
|
||||
}
|
||||
[self.label.heightAnchor constraintEqualToConstant:25].active = YES;
|
||||
|
||||
self.glyphView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
@ -128,6 +130,10 @@
|
||||
[self.battery.widthAnchor constraintEqualToConstant:20].active = YES;
|
||||
[self.battery.heightAnchor constraintEqualToConstant:10].active = YES;
|
||||
|
||||
if(hidePercent) {
|
||||
[self.label.rightAnchor constraintEqualToAnchor:self.battery.leftAnchor constant:-4.5].active = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
@ -170,7 +176,7 @@
|
||||
self.battery.chargePercent = (batteryPercentage*0.01);
|
||||
|
||||
[self.glyphView setImage:[self.device glyph]];
|
||||
[self.heightAnchor constraintEqualToConstant:(bannerHeight + spacing)].active = YES;
|
||||
[self.heightAnchor constraintEqualToConstant:(bannerHeight)].active = YES;
|
||||
|
||||
/*if(!self.height) {
|
||||
|
||||
|
0
KAIBatteryStack copy.mm
Normal file → Executable file
0
KAIBatteryStack copy.mm
Normal file → Executable file
0
KAIBatteryStack.h
Normal file → Executable file
0
KAIBatteryStack.h
Normal file → Executable file
24
KAIBatteryStack.mm
Normal file → Executable file
24
KAIBatteryStack.mm
Normal file → Executable file
@ -13,7 +13,7 @@ NSTimer *queueTimer = nil;
|
||||
self.displayingDevices = [[NSMutableArray alloc] init];
|
||||
self.axis = 1;
|
||||
self.distribution = 0;
|
||||
self.spacing = 0;
|
||||
self.spacing = spacing;
|
||||
self.alignment = 0;
|
||||
self.oldCountOfDevices = -100;
|
||||
self.queued = NO;
|
||||
@ -99,6 +99,15 @@ long long lastPercentage;
|
||||
|
||||
self.number = [self.subviews count];
|
||||
|
||||
if([self.superview.superview.superview respondsToSelector:@selector(fixComplicationsViewFrame)]) {
|
||||
[(NCNotificationListView *)(self.superview.superview.superview) fixComplicationsViewFrame];
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
-(void)setNumber:(NSInteger)arg1 {
|
||||
_number = arg1;
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
|
||||
if(!self.heightConstraint) {
|
||||
@ -107,7 +116,7 @@ long long lastPercentage;
|
||||
self.heightConstraint.active = YES;
|
||||
|
||||
} else {
|
||||
int height = (self.number * (bannerHeight + spacing));
|
||||
int height = (arg1 * (bannerHeight + spacing)) - spacing;
|
||||
self.heightConstraint.constant = height;
|
||||
|
||||
UIStackView *s = (UIStackView *)(self.superview);
|
||||
@ -116,11 +125,6 @@ long long lastPercentage;
|
||||
}
|
||||
|
||||
}];
|
||||
if([self.superview.superview.superview respondsToSelector:@selector(fixComplicationsViewFrame)]) {
|
||||
[(NCNotificationListView *)(self.superview.superview.superview) fixComplicationsViewFrame];
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
-(void)addArrangedSubview:(UIView *)view {
|
||||
@ -140,7 +144,7 @@ long long lastPercentage;
|
||||
self.heightConstraint.active = YES;
|
||||
|
||||
} else {
|
||||
int height = (self.number * (bannerHeight + spacing)); //big brain math
|
||||
int height = (self.number * (bannerHeight + spacing)) - spacing; //big brain math
|
||||
//self.heightConstraint.active = NO; //deactivation
|
||||
self.heightConstraint.constant = height;
|
||||
//self.heightConstraint.active = YES; //forcing reactivation
|
||||
@ -183,7 +187,7 @@ long long lastPercentage;
|
||||
self.heightConstraint.active = YES;
|
||||
|
||||
} else {
|
||||
int height = (self.number * (bannerHeight + spacing)); //big brain math
|
||||
int height = (self.number * (bannerHeight + spacing)) - spacing; //big brain math
|
||||
//self.heightConstraint.active = NO; //deactivation
|
||||
self.heightConstraint.constant = height;
|
||||
//self.heightConstraint.active = YES; //forcing reactivation
|
||||
@ -210,7 +214,7 @@ long long lastPercentage;
|
||||
for(BCBatteryDevice *device in devices) {
|
||||
[device resetKaiCellForNewPrefs];
|
||||
}
|
||||
|
||||
self.spacing = spacing;
|
||||
[self updateBattery];
|
||||
}
|
||||
|
||||
|
2
Kai.h
Normal file → Executable file
2
Kai.h
Normal file → Executable file
@ -13,6 +13,7 @@
|
||||
@interface CSAdjunctListView : UIView
|
||||
@property (nonatomic, assign) BOOL hasKai;
|
||||
-(UIStackView *)stackView;
|
||||
-(void)_layoutStackView;
|
||||
-(void)setStackView:(UIStackView *)arg1;
|
||||
@end
|
||||
|
||||
@ -138,6 +139,7 @@ static void applyPrefs()
|
||||
isUpdating = YES;
|
||||
|
||||
[[KAIBatteryStack sharedInstance] refreshForPrefs]; //so hard (not)
|
||||
[(CSAdjunctListView *)([KAIBatteryStack sharedInstance].superview.superview) _layoutStackView];
|
||||
|
||||
isUpdating = NO;
|
||||
|
||||
|
3
Kai.xm
Normal file → Executable file
3
Kai.xm
Normal file → Executable file
@ -60,7 +60,8 @@
|
||||
|
||||
[[KAIBatteryStack sharedInstance] updateBattery];
|
||||
if([KAISelf.superview respondsToSelector:@selector(fixComplicationsViewFrame)]) {
|
||||
[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.2];
|
||||
[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.35];
|
||||
//[KAISelf.superview performSelector:@selector(fixComplicationsViewFrame) withObject:KAISelf.superview afterDelay:0.5];
|
||||
}
|
||||
|
||||
isUpdating = NO;
|
||||
|
@ -1,9 +1,9 @@
|
||||
Package: com.burritoz.kai
|
||||
Name: Kai
|
||||
Version: 0.2.6~alpha4
|
||||
Version: 0.9.9~1
|
||||
Architecture: iphoneos-arm
|
||||
Description: Show charging banners on your lock screen!
|
||||
Maintainer: burrit0z
|
||||
Author: burrit0z
|
||||
Section: Tweaks
|
||||
Depends: mobilesubstrate (>= 0.9.5000), preferenceloader
|
||||
Depends: mobilesubstrate (>= 0.9.5000), preferenceloader, xyz.burritoz.thomz.multipla (>=1.2.0)
|
||||
|
0
MobileGestalt.h
Normal file → Executable file
0
MobileGestalt.h
Normal file → Executable file
@ -19,6 +19,10 @@
|
||||
@interface KAIRootListController : PSListController
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UIImageView *iconView;
|
||||
-(void)followMeOnRedditBurritoz;
|
||||
@end
|
||||
|
||||
@interface Thomz_TwitterCell : PSTableCell
|
||||
@end
|
||||
|
||||
@protocol PreferencesTableCustomView
|
||||
|
@ -13,10 +13,6 @@ NSBundle *tweakBundle;
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)arg1 {
|
||||
self.navigationController.navigationController.navigationBar.barTintColor = [UIColor colorWithRed: 0.00 green: 0.735 blue: 0.965 alpha: 1.00];
|
||||
[self.navigationController.navigationController.navigationBar setShadowImage: [UIImage new]];
|
||||
self.navigationController.navigationController.navigationBar.tintColor = [UIColor whiteColor];
|
||||
self.navigationController.navigationController.navigationBar.translucent = NO;
|
||||
|
||||
[[UISegmentedControl appearanceWhenContainedInInstancesOfClasses:@[self.class]] setTintColor:[UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00]];
|
||||
[[UISwitch appearanceWhenContainedInInstancesOfClasses:@[self.class]] setOnTintColor:[UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00]];
|
||||
@ -24,12 +20,9 @@ NSBundle *tweakBundle;
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
||||
[super viewWillDisappear:animated];
|
||||
|
||||
[self.navigationController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor blackColor]}];
|
||||
|
||||
-(void)viewWillDisappear:(BOOL)arg1 {
|
||||
[super viewWillDisappear:arg1];
|
||||
//[NSException raise:@"DE" format:@"DEU"];
|
||||
}
|
||||
|
||||
-(void)viewDidLoad {
|
||||
@ -96,6 +89,10 @@ NSBundle *tweakBundle;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)followMeOnRedditBurritoz {
|
||||
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://reddit.com/user/Burrit0z_dev"]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation KaiHeaderCell // Header Cell
|
||||
@ -124,7 +121,7 @@ NSBundle *tweakBundle;
|
||||
[versionLabel setFont:[UIFont systemFontOfSize:22 weight: UIFontWeightMedium] ];
|
||||
versionLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.8];
|
||||
versionLabel.alpha = 0.8;
|
||||
versionLabel.text = @"alpha";
|
||||
versionLabel.text = @"1.0.0";
|
||||
|
||||
NSBundle *bundle = [[NSBundle alloc]initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"];
|
||||
UIImage *phone = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"kai" ofType:@"png"]];
|
||||
@ -185,3 +182,38 @@ NSBundle *tweakBundle;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation Thomz_TwitterCell // lil copy of HBTwitterCell from Cephei
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
|
||||
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];
|
||||
|
||||
if (self)
|
||||
{
|
||||
UILabel *User = [[UILabel alloc] initWithFrame:CGRectMake(70,15,200,20)];
|
||||
[User setText:specifier.properties[@"user"]];
|
||||
[User setFont:[User.font fontWithSize:15]];
|
||||
|
||||
UILabel *Description = [[UILabel alloc]initWithFrame:CGRectMake(70,35,200,20)];
|
||||
[Description setText:specifier.properties[@"description"]];
|
||||
[Description setFont:[Description.font fontWithSize:10]];
|
||||
|
||||
NSBundle *bundle = [[NSBundle alloc]initWithPath:@"/Library/PreferenceBundles/MultiplaPrefs.bundle"];
|
||||
|
||||
UIImage *profilePicture;
|
||||
profilePicture = [UIImage imageWithContentsOfFile:[bundle pathForResource:specifier.properties[@"image"] ofType:@"jpg"]];
|
||||
UIImageView *profilePictureView = [[UIImageView alloc] initWithImage:profilePicture];
|
||||
[profilePictureView.layer setMasksToBounds:YES];
|
||||
[profilePictureView.layer setCornerRadius:20];
|
||||
[profilePictureView setFrame:CGRectMake(15,15,40,40)];
|
||||
|
||||
[self addSubview:User];
|
||||
[self addSubview:Description];
|
||||
[self addSubview:profilePictureView];
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
@ -366,6 +366,26 @@
|
||||
<key>key</key>
|
||||
<string>bannerAlpha</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSButtonCell</string>
|
||||
<key>cellClass</key>
|
||||
<string>Thomz_TwitterCell</string>
|
||||
<key>user</key>
|
||||
<string>Burrit0z</string>
|
||||
<key>description</key>
|
||||
<string>Developer</string>
|
||||
<key>height</key>
|
||||
<integer>70</integer>
|
||||
<key>image</key>
|
||||
<string>burritoz</string>
|
||||
<key>action</key>
|
||||
<string>followMeOnRedditBurritoz</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>title</key>
|
||||
<string>kai</string>
|
||||
|
Reference in New Issue
Block a user