Hide shadows on hidden app tiles

This commit is contained in:
Cameron Gutman
2020-11-14 16:45:43 -06:00
parent 9b8a179f4a
commit f5e0443abb
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -220,6 +220,11 @@ static UIImage* noImage;
[self updateAppImage]; [self updateAppImage];
} }
// Show no shadow for hidden apps. Because we adjust the opacity of the
// cells for hidden apps, it makes them look bad when the shadow draws
// through the app tile.
self.superview.layer.shadowOpacity = _app.hidden ? 0.0f : 0.5f;
// Update opacity if neccessary // Update opacity if neccessary
[self setAlpha:_app.hidden ? 0.4 : 1.0]; [self setAlpha:_app.hidden ? 0.4 : 1.0];
@@ -1298,12 +1298,12 @@ static NSMutableSet* hostList;
[cell.subviews.firstObject removeFromSuperview]; // Remove a view that was previously added [cell.subviews.firstObject removeFromSuperview]; // Remove a view that was previously added
[cell addSubview:appView]; [cell addSubview:appView];
// Shadow opacity is controlled inside UIAppView based on whether the app
// is hidden or not during the update cycle.
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:cell.bounds]; UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:cell.bounds];
cell.layer.masksToBounds = NO; cell.layer.masksToBounds = NO;
cell.layer.shadowColor = [UIColor blackColor].CGColor; cell.layer.shadowColor = [UIColor blackColor].CGColor;
cell.layer.shadowOffset = CGSizeMake(1.0f, 5.0f); cell.layer.shadowOffset = CGSizeMake(1.0f, 5.0f);
cell.layer.shadowOpacity = 0.5f;
cell.layer.shadowPath = shadowPath.CGPath; cell.layer.shadowPath = shadowPath.CGPath;
#if !TARGET_OS_TV #if !TARGET_OS_TV