Browse Source

almost

pull/1/head
Burrit0z 4 years ago
parent
commit
cbbbb6c827
15 changed files with 95 additions and 26 deletions
  1. +0
    -0
      DragonMake
  2. +0
    -0
      KAIBatteryCell.h
  3. +8
    -2
      KAIBatteryCell.mm
  4. +0
    -0
      KAIBatteryStack copy.mm
  5. +0
    -0
      KAIBatteryStack.h
  6. +14
    -10
      KAIBatteryStack.mm
  7. +2
    -0
      Kai.h
  8. +0
    -0
      Kai.plist
  9. +2
    -1
      Kai.xm
  10. +2
    -2
      Layout/DEBIAN/control
  11. +0
    -0
      MobileGestalt.h
  12. +0
    -0
      NSTask.h
  13. +4
    -0
      kaiprefs/KAIRootListController.h
  14. +43
    -11
      kaiprefs/KAIRootListController.m
  15. +20
    -0
      kaiprefs/Resources/Root.plist

+ 0
- 0
DragonMake View File


+ 0
- 0
KAIBatteryCell.h View File


+ 8
- 2
KAIBatteryCell.mm View File

self.label.translatesAutoresizingMaskIntoConstraints = NO; self.label.translatesAutoresizingMaskIntoConstraints = NO;
[self.label.leftAnchor constraintEqualToAnchor:self.glyphView.rightAnchor constant:4.5].active = YES; [self.label.leftAnchor constraintEqualToAnchor:self.glyphView.rightAnchor constant:4.5].active = YES;
[self.label.centerYAnchor constraintEqualToAnchor:blurPlatter.centerYAnchor].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.label.heightAnchor constraintEqualToConstant:25].active = YES;


self.glyphView.translatesAutoresizingMaskIntoConstraints = NO; self.glyphView.translatesAutoresizingMaskIntoConstraints = NO;
[self.battery.widthAnchor constraintEqualToConstant:20].active = YES; [self.battery.widthAnchor constraintEqualToConstant:20].active = YES;
[self.battery.heightAnchor constraintEqualToConstant:10].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; return self;
self.battery.chargePercent = (batteryPercentage*0.01); self.battery.chargePercent = (batteryPercentage*0.01);


[self.glyphView setImage:[self.device glyph]]; [self.glyphView setImage:[self.device glyph]];
[self.heightAnchor constraintEqualToConstant:(bannerHeight + spacing)].active = YES;
[self.heightAnchor constraintEqualToConstant:(bannerHeight)].active = YES;


/*if(!self.height) { /*if(!self.height) {

+ 0
- 0
KAIBatteryStack copy.mm View File


+ 0
- 0
KAIBatteryStack.h View File


+ 14
- 10
KAIBatteryStack.mm View File

self.displayingDevices = [[NSMutableArray alloc] init]; self.displayingDevices = [[NSMutableArray alloc] init];
self.axis = 1; self.axis = 1;
self.distribution = 0; self.distribution = 0;
self.spacing = 0;
self.spacing = spacing;
self.alignment = 0; self.alignment = 0;
self.oldCountOfDevices = -100; self.oldCountOfDevices = -100;
self.queued = NO; self.queued = NO;


self.number = [self.subviews count]; 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:^{ [UIView animateWithDuration:0.3 animations:^{


if(!self.heightConstraint) { if(!self.heightConstraint) {
self.heightConstraint.active = YES; self.heightConstraint.active = YES;


} else { } else {
int height = (self.number * (bannerHeight + spacing));
int height = (arg1 * (bannerHeight + spacing)) - spacing;
self.heightConstraint.constant = height; self.heightConstraint.constant = height;


UIStackView *s = (UIStackView *)(self.superview); UIStackView *s = (UIStackView *)(self.superview);
} }


}]; }];
if([self.superview.superview.superview respondsToSelector:@selector(fixComplicationsViewFrame)]) {
[(NCNotificationListView *)(self.superview.superview.superview) fixComplicationsViewFrame];
}
});

} }


-(void)addArrangedSubview:(UIView *)view { -(void)addArrangedSubview:(UIView *)view {
self.heightConstraint.active = YES; self.heightConstraint.active = YES;


} else { } 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.active = NO; //deactivation
self.heightConstraint.constant = height; self.heightConstraint.constant = height;
//self.heightConstraint.active = YES; //forcing reactivation //self.heightConstraint.active = YES; //forcing reactivation
self.heightConstraint.active = YES; self.heightConstraint.active = YES;


} else { } 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.active = NO; //deactivation
self.heightConstraint.constant = height; self.heightConstraint.constant = height;
//self.heightConstraint.active = YES; //forcing reactivation //self.heightConstraint.active = YES; //forcing reactivation
for(BCBatteryDevice *device in devices) { for(BCBatteryDevice *device in devices) {
[device resetKaiCellForNewPrefs]; [device resetKaiCellForNewPrefs];
} }
self.spacing = spacing;
[self updateBattery]; [self updateBattery];
} }



+ 2
- 0
Kai.h View File

@interface CSAdjunctListView : UIView @interface CSAdjunctListView : UIView
@property (nonatomic, assign) BOOL hasKai; @property (nonatomic, assign) BOOL hasKai;
-(UIStackView *)stackView; -(UIStackView *)stackView;
-(void)_layoutStackView;
-(void)setStackView:(UIStackView *)arg1; -(void)setStackView:(UIStackView *)arg1;
@end @end


isUpdating = YES; isUpdating = YES;


[[KAIBatteryStack sharedInstance] refreshForPrefs]; //so hard (not) [[KAIBatteryStack sharedInstance] refreshForPrefs]; //so hard (not)
[(CSAdjunctListView *)([KAIBatteryStack sharedInstance].superview.superview) _layoutStackView];


isUpdating = NO; isUpdating = NO;



+ 0
- 0
Kai.plist View File


+ 2
- 1
Kai.xm View File



[[KAIBatteryStack sharedInstance] updateBattery]; [[KAIBatteryStack sharedInstance] updateBattery];
if([KAISelf.superview respondsToSelector:@selector(fixComplicationsViewFrame)]) { 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; isUpdating = NO;

+ 2
- 2
Layout/DEBIAN/control View File

Package: com.burritoz.kai Package: com.burritoz.kai
Name: Kai Name: Kai
Version: 0.2.6~alpha4
Version: 0.9.9~1
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
Author: burrit0z Author: burrit0z
Section: Tweaks Section: Tweaks
Depends: mobilesubstrate (>= 0.9.5000), preferenceloader
Depends: mobilesubstrate (>= 0.9.5000), preferenceloader, xyz.burritoz.thomz.multipla (>=1.2.0)

+ 0
- 0
MobileGestalt.h View File


+ 0
- 0
NSTask.h View File


+ 4
- 0
kaiprefs/KAIRootListController.h View File

@interface KAIRootListController : PSListController @interface KAIRootListController : PSListController
@property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *iconView; @property (nonatomic, strong) UIImageView *iconView;
-(void)followMeOnRedditBurritoz;
@end

@interface Thomz_TwitterCell : PSTableCell
@end @end


@protocol PreferencesTableCustomView @protocol PreferencesTableCustomView

+ 43
- 11
kaiprefs/KAIRootListController.m View File

} }


-(void)viewWillAppear:(BOOL)arg1 { -(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]]; [[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]]; [[UISwitch appearanceWhenContainedInInstancesOfClasses:@[self.class]] setOnTintColor:[UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00]];


} }


- (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 { -(void)viewDidLoad {
} }
} }


-(void)followMeOnRedditBurritoz {
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://reddit.com/user/Burrit0z_dev"]];
}

@end @end


@implementation KaiHeaderCell // Header Cell @implementation KaiHeaderCell // Header Cell
[versionLabel setFont:[UIFont systemFontOfSize:22 weight: UIFontWeightMedium] ]; [versionLabel setFont:[UIFont systemFontOfSize:22 weight: UIFontWeightMedium] ];
versionLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.8]; versionLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.8];
versionLabel.alpha = 0.8; versionLabel.alpha = 0.8;
versionLabel.text = @"alpha";
versionLabel.text = @"1.0.0";


NSBundle *bundle = [[NSBundle alloc]initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"]; NSBundle *bundle = [[NSBundle alloc]initWithPath:@"/Library/PreferenceBundles/kaiPrefs.bundle"];
UIImage *phone = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"kai" ofType:@"png"]]; UIImage *phone = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"kai" ofType:@"png"]];
} }


@end @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

+ 20
- 0
kaiprefs/Resources/Root.plist View File

<key>key</key> <key>key</key>
<string>bannerAlpha</string> <string>bannerAlpha</string>
</dict> </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> </array>
<key>title</key> <key>title</key>
<string>kai</string> <string>kai</string>

Loading…
Cancel
Save