mirror of
https://github.com/Burrit0z/kai
synced 2025-07-04 11:26:47 +00:00
ITS WORKING NOW
This commit is contained in:
@ -17,14 +17,6 @@ NSTimer *queueTimer = nil;
|
|||||||
self.oldCountOfDevices = -100;
|
self.oldCountOfDevices = -100;
|
||||||
self.queued = NO;
|
self.queued = NO;
|
||||||
|
|
||||||
if(bannerAlign==2) { //center
|
|
||||||
self.stack.alignment = UIStackViewAlignmentLeading;
|
|
||||||
} else if(bannerAlign==1) { //left
|
|
||||||
self.stack.alignment = UIStackViewAlignmentCenter;
|
|
||||||
} else if(bannerAlign==3) { //right
|
|
||||||
self.stack.alignment = UIStackViewAlignmentTrailing;
|
|
||||||
}
|
|
||||||
|
|
||||||
[self setMinimumZoomScale:1];
|
[self setMinimumZoomScale:1];
|
||||||
[self setMaximumZoomScale:1];
|
[self setMaximumZoomScale:1];
|
||||||
[self addSubview:self.stackHolder];
|
[self addSubview:self.stackHolder];
|
||||||
@ -40,10 +32,20 @@ NSTimer *queueTimer = nil;
|
|||||||
[self.stackHolder.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
|
[self.stackHolder.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
|
||||||
[self.stackHolder.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES;
|
[self.stackHolder.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES;
|
||||||
|
|
||||||
[self.stack.widthAnchor constraintEqualToAnchor:self.stackHolder.widthAnchor].active = YES;
|
if(kaiAlign==0) {
|
||||||
[self.stack.heightAnchor constraintEqualToAnchor:self.stackHolder.heightAnchor].active = YES;
|
if(bannerAlign==2) { //center
|
||||||
[self.stack.widthAnchor constraintEqualToAnchor:self.stackHolder.widthAnchor].active = YES;
|
self.stack.alignment = UIStackViewAlignmentLeading;
|
||||||
[self.stack.centerYAnchor constraintEqualToAnchor:self.stackHolder.centerYAnchor].active = YES;
|
self.subviewAligner = [self.stack.centerXAnchor constraintEqualToAnchor:self.stackHolder.centerXAnchor];
|
||||||
|
} else if(bannerAlign==1) { //left
|
||||||
|
self.stack.alignment = UIStackViewAlignmentCenter;
|
||||||
|
self.subviewAligner = [self.stack.leftAnchor constraintEqualToAnchor:self.stackHolder.leftAnchor];
|
||||||
|
} else if(bannerAlign==3) { //right
|
||||||
|
self.stack.alignment = UIStackViewAlignmentTrailing;
|
||||||
|
self.subviewAligner = [self.stack.rightAnchor constraintEqualToAnchor:self.stackHolder.rightAnchor];
|
||||||
|
}
|
||||||
|
|
||||||
|
self.subviewAligner.active = YES;
|
||||||
|
}
|
||||||
|
|
||||||
[self updateBattery];
|
[self updateBattery];
|
||||||
}
|
}
|
||||||
@ -233,6 +235,23 @@ long long lastPercentage;
|
|||||||
[device resetKaiCellForNewPrefs];
|
[device resetKaiCellForNewPrefs];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(kaiAlign==0) {
|
||||||
|
self.subviewAligner.active = NO;
|
||||||
|
if(bannerAlign==2) { //center
|
||||||
|
self.stack.alignment = UIStackViewAlignmentLeading;
|
||||||
|
self.subviewAligner = [self.stack.centerXAnchor constraintEqualToAnchor:self.stackHolder.centerXAnchor];
|
||||||
|
} else if(bannerAlign==1) { //left
|
||||||
|
self.stack.alignment = UIStackViewAlignmentCenter;
|
||||||
|
self.subviewAligner = [self.stack.leftAnchor constraintEqualToAnchor:self.stackHolder.leftAnchor];
|
||||||
|
} else if(bannerAlign==3) { //right
|
||||||
|
self.stack.alignment = UIStackViewAlignmentTrailing;
|
||||||
|
self.subviewAligner = [self.stack.rightAnchor constraintEqualToAnchor:self.stackHolder.rightAnchor];
|
||||||
|
}
|
||||||
|
|
||||||
|
self.subviewAligner.active = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[self updateBattery];
|
[self updateBattery];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
@property (nonatomic, assign) NSInteger oldCountOfDevices;
|
@property (nonatomic, assign) NSInteger oldCountOfDevices;
|
||||||
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint;
|
@property (nonatomic, strong) NSLayoutConstraint *heightConstraint;
|
||||||
@property (nonatomic, strong) NSLayoutConstraint *widthConstraint;
|
@property (nonatomic, strong) NSLayoutConstraint *widthConstraint;
|
||||||
|
@property (nonatomic, strong) NSLayoutConstraint *subviewAligner;
|
||||||
@property (nonatomic, strong) KAIStackView *stack;
|
@property (nonatomic, strong) KAIStackView *stack;
|
||||||
@property (nonatomic, assign) BOOL isUpdating;
|
@property (nonatomic, assign) BOOL isUpdating;
|
||||||
@property (nonatomic, assign) BOOL queued;
|
@property (nonatomic, assign) BOOL queued;
|
||||||
|
2
Kai.xm
2
Kai.xm
@ -114,6 +114,8 @@ CSAdjunctListView *list;
|
|||||||
//sends the noti to update battery info
|
//sends the noti to update battery info
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil];
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil];
|
||||||
|
|
||||||
|
//[NSException raise:@":vibeok:" format:@"Notification to update kai sent"];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%new
|
%new
|
||||||
|
Reference in New Issue
Block a user