Browse Source

Update KAIBattery.mm

pull/1/head
Burrit0z 4 years ago
parent
commit
741e736bab
1 changed files with 0 additions and 9 deletions
  1. +0
    -9
      KAIBattery.mm

+ 0
- 9
KAIBattery.mm View File

blank.frame = CGRectMake(0, 0 + y, self.frame.size.width, 80); blank.frame = CGRectMake(0, 0 + y, self.frame.size.width, 80);
blank.layer.masksToBounds = YES; blank.layer.masksToBounds = YES;
blank.layer.cornerRadius = 13; blank.layer.cornerRadius = 13;
blank.alpha = 0;
//[blank setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1]]; //[blank setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1]];


NSString *labelText = [NSString stringWithFormat:@"%@", deviceName]; NSString *labelText = [NSString stringWithFormat:@"%@", deviceName];
[label setTextColor:[UIColor whiteColor]]; [label setTextColor:[UIColor whiteColor]];
label.lineBreakMode = NSLineBreakByWordWrapping; label.lineBreakMode = NSLineBreakByWordWrapping;
label.numberOfLines = 0; label.numberOfLines = 0;
label.alpha = 0;
[label setText:labelText]; [label setText:labelText];


_UIBatteryView *battery = [[_UIBatteryView alloc] init]; _UIBatteryView *battery = [[_UIBatteryView alloc] init];
battery.chargePercent = (batteryPercentage*0.01); battery.chargePercent = (batteryPercentage*0.01);
UILabel *percentLabel = [[UILabel alloc] init]; UILabel *percentLabel = [[UILabel alloc] init];
percentLabel.alpha = 0;
battery.alpha = 0;
battery.showsPercentage = NO; battery.showsPercentage = NO;
[percentLabel setFont:[UIFont systemFontOfSize:14]]; [percentLabel setFont:[UIFont systemFontOfSize:14]];
[percentLabel setTextColor:[UIColor whiteColor]]; [percentLabel setTextColor:[UIColor whiteColor]];


UIImage *glyph = [device glyph]; UIImage *glyph = [device glyph];
UIImageView *glyphView = [[UIImageView alloc] init]; UIImageView *glyphView = [[UIImageView alloc] init];
glyphView.alpha = 0;
glyphView.contentMode = UIViewContentModeScaleAspectFit; glyphView.contentMode = UIViewContentModeScaleAspectFit;
[glyphView setImage:glyph]; [glyphView setImage:glyph];


[self addSubview:battery]; [self addSubview:battery];
[self addSubview:glyphView]; [self addSubview:glyphView];
blank.alpha = 0.8; blank.alpha = 0.8;
percentLabel.alpha = 1;
battery.alpha = 1;
label.alpha = 1;
glyphView.alpha = 1;
} }
} }
self.isUpdating = NO; self.isUpdating = NO;

Loading…
Cancel
Save