Fix animation glitch in blocking window.

This commit is contained in:
Matthew Chen 2018-04-13 13:00:08 -04:00
parent df685da497
commit 115235d1b4
3 changed files with 22 additions and 10 deletions

View file

@ -514,10 +514,6 @@ const UIWindowLevel UIWindowLevel_Background = -1.f;
UIView *rootView = self.screenBlockingViewController.view;
[NSLayoutConstraint deactivateConstraints:self.screenBlockingConstraints];
NSMutableArray<NSLayoutConstraint *> *screenBlockingConstraints = [NSMutableArray new];
BOOL shouldHaveScreenLock = desiredUIState == ScreenLockUIStateScreenLock;
NSString *signature = [NSString stringWithFormat:@"%d %d", shouldHaveScreenLock, self.isShowingScreenLockUI];
if ([NSObject isNullableObject:self.screenBlockingSignature equalTo:signature]) {
@ -525,6 +521,10 @@ const UIWindowLevel UIWindowLevel_Background = -1.f;
return;
}
[NSLayoutConstraint deactivateConstraints:self.screenBlockingConstraints];
NSMutableArray<NSLayoutConstraint *> *screenBlockingConstraints = [NSMutableArray new];
self.screenBlockingButton.hidden = !shouldHaveScreenLock;
if (self.isShowingScreenLockUI) {

View file

@ -118,6 +118,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value);
- (void)addRedBorderRecursively;
#ifdef DEBUG
- (void)logFrame;
- (void)logFrameWithLabel:(NSString *)label;
- (void)logFrameLater;
- (void)logFrameLaterWithLabel:(NSString *)label;
- (void)logHierarchyUpwardLaterWithLabel:(NSString *)label;

View file

@ -452,6 +452,21 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
}
}
- (void)logFrame
{
[self logFrameWithLabel:@""];
}
- (void)logFrameWithLabel:(NSString *)label
{
DDLogVerbose(@"%@ %@ frame: %@, hidden: %d, opacity: %f",
self.logTag,
label,
NSStringFromCGRect(self.frame),
self.hidden,
self.layer.opacity);
}
- (void)logFrameLater
{
[self logFrameLaterWithLabel:@""];
@ -460,12 +475,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
- (void)logFrameLaterWithLabel:(NSString *)label
{
dispatch_async(dispatch_get_main_queue(), ^{
DDLogVerbose(@"%@ %@ frame: %@, hidden: %d, opacity: %f",
self.logTag,
label,
NSStringFromCGRect(self.frame),
self.hidden,
self.layer.opacity);
[self logFrameWithLabel:label];
});
}