Device battery indicators on your Lock Screen
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123 行
4.6KB

  1. #include "KAIRootListController.h"
  2. NSBundle *tweakBundle;
  3. @implementation KAIRootListController
  4. - (NSArray *)specifiers {
  5. if (!_specifiers) {
  6. _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
  7. }
  8. return _specifiers;
  9. }
  10. -(void)viewWillAppear:(BOOL)arg1 {
  11. self.navigationController.navigationController.navigationBar.barTintColor = [UIColor colorWithRed: 0.00 green: 0.77 blue: 0.95 alpha: 1.00];
  12. [self.navigationController.navigationController.navigationBar setShadowImage: [UIImage new]];
  13. self.navigationController.navigationController.navigationBar.tintColor = [UIColor whiteColor];
  14. self.navigationController.navigationController.navigationBar.translucent = NO;
  15. [[UISegmentedControl appearanceWhenContainedInInstancesOfClasses:@[self.class]] setTintColor:[UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00]];
  16. [[UISwitch appearanceWhenContainedInInstancesOfClasses:@[self.class]] setOnTintColor:[UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00]];
  17. [[UISlider appearanceWhenContainedInInstancesOfClasses:@[self.class]] setTintColor:[UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00]];
  18. }
  19. - (void)viewWillDisappear:(BOOL)animated {
  20. [super viewWillDisappear:animated];
  21. [self.navigationController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor blackColor]}];
  22. }
  23. @end
  24. @implementation KaiHeaderCell // Header Cell
  25. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(id)reuseIdentifier specifier:(id)specifier {
  26. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];
  27. if (self) {
  28. packageNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,90,self.contentView.bounds.size.width+30,50)];
  29. [packageNameLabel setTextAlignment:NSTextAlignmentRight];
  30. [packageNameLabel setFont:[UIFont systemFontOfSize:50 weight: UIFontWeightSemibold] ];
  31. packageNameLabel.textColor = [UIColor whiteColor];
  32. packageNameLabel.text = @"kai";
  33. developerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,50,self.contentView.bounds.size.width+30,50)];
  34. [developerLabel setTextAlignment:NSTextAlignmentRight];
  35. [developerLabel setFont:[UIFont systemFontOfSize:22.5 weight: UIFontWeightMedium] ];
  36. developerLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.85];
  37. developerLabel.alpha = 0.8;
  38. developerLabel.text = @"Burrit0z";
  39. versionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,130,self.contentView.bounds.size.width+30,50)];
  40. [versionLabel setTextAlignment:NSTextAlignmentRight];
  41. [versionLabel setFont:[UIFont systemFontOfSize:22 weight: UIFontWeightMedium] ];
  42. versionLabel.textColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.8];
  43. versionLabel.alpha = 0.8;
  44. versionLabel.text = @"alpha";
  45. NSBundle *bundle = [[NSBundle alloc]initWithPath:@"/Library/PreferenceBundles/KaiPrefs.bundle"];
  46. UIImage *phone = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"kai" ofType:@"png"]];
  47. UIImageView *phoneImage = [[UIImageView alloc]initWithImage:phone];
  48. [phoneImage setFrame:self.frame];
  49. bgView.backgroundColor = [UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00];
  50. [self addSubview:packageNameLabel];
  51. [self addSubview:developerLabel];
  52. [self addSubview:versionLabel];
  53. [self addSubview:phoneImage];
  54. }
  55. return self;
  56. }
  57. - (instancetype)initWithSpecifier:(PSSpecifier *)specifier {
  58. return [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"KaiHeaderCell" specifier:specifier];
  59. }
  60. - (void)setFrame:(CGRect)frame {
  61. frame.origin.x = 0;
  62. //frame.origin.y = 43;
  63. [super setFrame:frame];
  64. }
  65. - (CGFloat)preferredHeightForWidth:(CGFloat)arg1{
  66. return 200.0f;
  67. }
  68. -(void)layoutSubviews{
  69. [super layoutSubviews];
  70. bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.bounds.size.width, 200)];
  71. UIColor *topColor = [UIColor colorWithRed: 0.00 green: 0.82 blue: 1.00 alpha: 1.00];
  72. UIColor *bottomColor = [UIColor colorWithRed: 0.23 green: 0.48 blue: 0.84 alpha: 1.00];
  73. CAGradientLayer *theViewGradient = [CAGradientLayer layer];
  74. theViewGradient.colors = [NSArray arrayWithObjects: (id)topColor.CGColor, (id)bottomColor.CGColor, nil];
  75. theViewGradient.startPoint = CGPointMake(0.5, 0.0);
  76. theViewGradient.endPoint = CGPointMake(0.5, 1.0);
  77. theViewGradient.frame = bgView.bounds;
  78. //Add gradient to view
  79. [bgView.layer insertSublayer:theViewGradient atIndex:0];
  80. [self insertSubview:bgView atIndex:0];
  81. }
  82. - (CGFloat)preferredHeightForWidth:(CGFloat)width inTableView:(id)tableView {
  83. return [self preferredHeightForWidth:width];
  84. }
  85. @end