diff options
| author | Joel Fischer <joeljfischer@gmail.com> | 2017-12-18 16:22:36 -0500 |
|---|---|---|
| committer | Joel Fischer <joeljfischer@gmail.com> | 2017-12-18 16:22:36 -0500 |
| commit | cd21bff384e180b2cbb83fc36b54a06fe8df783a (patch) | |
| tree | 265add2cbae0cc83f166e251a8e32d17bfc9019e | |
| parent | 09a4816b163649a3ff182bd19b8f5ffd1ee54ada (diff) | |
| download | sdl_ios-feature/issue_798_rpc_notifications_serial_queue.tar.gz | |
Force re-layout of lock screen to occur on main queuefeature/issue_798_rpc_notifications_serial_queue
| -rw-r--r-- | SmartDeviceLink/SDLLockScreenViewController.m | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/SmartDeviceLink/SDLLockScreenViewController.m b/SmartDeviceLink/SDLLockScreenViewController.m index c69b059bb..27cc98797 100644 --- a/SmartDeviceLink/SDLLockScreenViewController.m +++ b/SmartDeviceLink/SDLLockScreenViewController.m @@ -71,37 +71,39 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Layout - (void)sdl_layoutViews { - UIColor *iconColor = [self.class sdl_accentColorBasedOnColor:self.backgroundColor]; - - self.sdlIconImageView.image = [self.class sdl_imageWithName:@"sdl_logo_black"]; - self.sdlIconImageView.tintColor = iconColor; - - self.arrowUpImageView.image = [self.class sdl_imageWithName:@"lock_arrow_up_black"]; - self.arrowUpImageView.tintColor = iconColor; - - self.arrowDownImageView.image = [self.class sdl_imageWithName:@"lock_arrow_down_black"]; - self.arrowDownImageView.tintColor = iconColor; - - self.lockedLabel.textColor = iconColor; - - if (self.vehicleIcon != nil && self.appIcon != nil) { - [self sdl_setVehicleAndAppIconsLayout]; - } else if (self.vehicleIcon != nil) { - [self sdl_setVehicleIconOnlyLayout]; - } else if (self.appIcon != nil) { - [self sdl_setAppIconOnlyLayout]; - } else { - [self sdl_setNoIconsLayout]; - } - - // HAX: The autolayout doesn't scale for 4s, so hide a view so it doesn't look like garbage. - if (CGRectGetHeight([UIScreen mainScreen].bounds) == 480) { - self.sdlIconImageView.hidden = YES; - } else { - self.sdlIconImageView.hidden = NO; - } - - [self.view layoutIfNeeded]; + dispatch_async(dispatch_get_main_queue(), ^{ + UIColor *iconColor = [self.class sdl_accentColorBasedOnColor:self.backgroundColor]; + + self.sdlIconImageView.image = [self.class sdl_imageWithName:@"sdl_logo_black"]; + self.sdlIconImageView.tintColor = iconColor; + + self.arrowUpImageView.image = [self.class sdl_imageWithName:@"lock_arrow_up_black"]; + self.arrowUpImageView.tintColor = iconColor; + + self.arrowDownImageView.image = [self.class sdl_imageWithName:@"lock_arrow_down_black"]; + self.arrowDownImageView.tintColor = iconColor; + + self.lockedLabel.textColor = iconColor; + + if (self.vehicleIcon != nil && self.appIcon != nil) { + [self sdl_setVehicleAndAppIconsLayout]; + } else if (self.vehicleIcon != nil) { + [self sdl_setVehicleIconOnlyLayout]; + } else if (self.appIcon != nil) { + [self sdl_setAppIconOnlyLayout]; + } else { + [self sdl_setNoIconsLayout]; + } + + // HAX: The autolayout doesn't scale for 4s, so hide a view so it doesn't look like garbage. + if (CGRectGetHeight([UIScreen mainScreen].bounds) == 480) { + self.sdlIconImageView.hidden = YES; + } else { + self.sdlIconImageView.hidden = NO; + } + + [self.view layoutIfNeeded]; + }); } - (void)sdl_setVehicleAndAppIconsLayout { |
