Device battery indicators on your Lock Screen
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435
  1. @implementation KAIStackView
  2. - (id)initWithFrame:(CGRect)arg1 {
  3. self = [super initWithFrame:arg1];
  4. self.translatesAutoresizingMaskIntoConstraints = NO;
  5. return self;
  6. }
  7. - (void)addArrangedSubview:(UIView *)view {
  8. [super addArrangedSubview:view];
  9. [[KAIBatteryPlatter sharedInstance] setContentSize:self.frame.size];
  10. if (textColor == 0 && [view respondsToSelector:@selector(updateInfo)]) {
  11. KAIBatteryCell *cell = (KAIBatteryCell *)view;
  12. if (@available(iOS 12.0, *)) {
  13. if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
  14. [cell.label setTextColor:[UIColor whiteColor]];
  15. [cell.percentLabel setTextColor:[UIColor whiteColor]];
  16. } else if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
  17. [cell.label setTextColor:[UIColor blackColor]];
  18. [cell.percentLabel setTextColor:[UIColor blackColor]];
  19. }
  20. }
  21. }
  22. [[KAIBatteryPlatter sharedInstance] performSelector:@selector(resetOffset) withObject:[KAIBatteryPlatter sharedInstance] afterDelay:0.2];
  23. }
  24. - (void)removeArrangedSubview:(UIView *)subview {
  25. [super removeArrangedSubview:subview];
  26. [[KAIBatteryPlatter sharedInstance] performSelector:@selector(resetOffset) withObject:[KAIBatteryPlatter sharedInstance] afterDelay:0.2];
  27. }
  28. @end