iOS 13 compatibility - hostIcon & lockIcon

This commit is contained in:
TrueZhuanjia
2025-07-19 22:12:46 +08:00
parent 334788c26f
commit ac66ffe302
6 changed files with 73 additions and 7 deletions
BIN
View File
Binary file not shown.
+8 -7
View File
@@ -59,7 +59,7 @@ static const float REFRESH_CYCLE = 2.0f;
if (self) {
buttonLabelFontSize = 15*_sizeFactor;
longPressFired = false;
computerIconMonitorCenterYOffset = [self isIPhone] ? -3.62*_sizeFactor : -4.175*_sizeFactor;
computerIconMonitorCenterYOffset = [self isIPhone] ? -2.75*_sizeFactor : -3.2*_sizeFactor;
iconAndButtonSpacing = 37*_sizeFactor;
buttonHeight = 39*_sizeFactor;
defaultBlue = [ThemeManager appPrimaryColor];
@@ -195,7 +195,7 @@ static const float REFRESH_CYCLE = 2.0f;
self.hostIconView.translatesAutoresizingMaskIntoConstraints = NO;
self.hostIconView.contentMode = UIViewContentModeScaleAspectFit;
if (@available(iOS 13.0, *)) {
self.hostIconView.image = [UIImage systemImageNamed:@"display"];
self.hostIconView.image = [[UIImage imageNamed:@"display"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
} else {
self.hostIconView.image = [UIImage imageNamed:@"Computer"];
[NSLayoutConstraint activateConstraints:@[
@@ -208,8 +208,8 @@ static const float REFRESH_CYCLE = 2.0f;
[NSLayoutConstraint activateConstraints:@[
[self.hostIconView.centerXAnchor constraintEqualToAnchor:self.iconBackgroundView.centerXAnchor constant:0],
[self.hostIconView.centerYAnchor constraintEqualToAnchor:self.iconBackgroundView.centerYAnchor constant:0],
[self.hostIconView.heightAnchor constraintEqualToConstant:63*_sizeFactor],
[self.hostIconView.widthAnchor constraintEqualToConstant:63*_sizeFactor],
[self.hostIconView.heightAnchor constraintEqualToConstant:53.9*_sizeFactor],
[self.hostIconView.widthAnchor constraintEqualToConstant:53.9*_sizeFactor],
]];
// [self.iconBackgroundView layoutIfNeeded];
// [self.iconImageView layoutIfNeeded];
@@ -236,8 +236,9 @@ static const float REFRESH_CYCLE = 2.0f;
// lockIcon
lockIconView =[[UIImageView alloc] init];
lockIconView.translatesAutoresizingMaskIntoConstraints = NO;
lockIconView.contentMode = UIViewContentModeScaleAspectFit;
if (@available(iOS 13.0, *)) {
lockIconView.image = [UIImage systemImageNamed:@"lock.fill"];
lockIconView.image = [[UIImage imageNamed:@"lock.fill"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
} else {
lockIconView.image = [UIImage imageNamed:@"LockedOverlayIcon"];
computerIconMonitorCenterYOffset = -5 * _sizeFactor;
@@ -247,8 +248,8 @@ static const float REFRESH_CYCLE = 2.0f;
[NSLayoutConstraint activateConstraints:@[
[lockIconView.centerXAnchor constraintEqualToAnchor:_iconBackgroundView.centerXAnchor constant:0],
[lockIconView.centerYAnchor constraintEqualToAnchor:_iconBackgroundView.centerYAnchor constant:computerIconMonitorCenterYOffset],
[lockIconView.widthAnchor constraintEqualToConstant:22*_sizeFactor],
[lockIconView.heightAnchor constraintEqualToConstant:22*_sizeFactor]
[lockIconView.widthAnchor constraintEqualToConstant:18.5*_sizeFactor],
[lockIconView.heightAnchor constraintEqualToConstant:18.5*_sizeFactor]
]];
lockIconView.hidden = true;
+21
View File
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "display.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generator: Apple Native CoreSVG 341-->
<!DOCTYPE svg
PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 232.812 203.613">
<g>
<rect height="203.613" opacity="0" width="232.812" x="0" y="0"/>
<path d="M22.7539 153.223C18.457 153.223 15.7227 150.488 15.7227 146.191L15.7227 29.5898C15.7227 25.1953 18.457 22.5586 22.7539 22.5586L210.059 22.5586C214.355 22.5586 217.09 25.1953 217.09 29.5898L217.09 146.191C217.09 150.488 214.355 153.223 210.059 153.223Z" fill="white" fill-opacity="0.25"/>
<path d="M22.4609 168.945L210.254 168.945C224.316 168.945 232.812 160.449 232.812 146.387L232.812 29.2969C232.812 15.2344 224.316 6.83594 210.254 6.83594L22.4609 6.83594C8.49609 6.83594 0 15.2344 0 29.2969L0 146.387C0 160.449 8.49609 168.945 22.4609 168.945ZM22.7539 153.223C18.457 153.223 15.7227 150.488 15.7227 146.191L15.7227 29.5898C15.7227 25.1953 18.457 22.5586 22.7539 22.5586L210.059 22.5586C214.355 22.5586 217.09 25.1953 217.09 29.5898L217.09 146.191C217.09 150.488 214.355 153.223 210.059 153.223ZM85.5469 192.188L147.266 192.188L147.266 167.676L85.5469 167.676ZM84.9609 203.613L147.852 203.613C152.148 203.613 155.664 200.098 155.664 195.703C155.664 191.309 152.148 187.793 147.852 187.793L84.9609 187.793C80.6641 187.793 77.0508 191.309 77.0508 195.703C77.0508 200.098 80.6641 203.613 84.9609 203.613Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "lock.fill.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generator: Apple Native CoreSVG 341-->
<!DOCTYPE svg
PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 133.301 196.777">
<g>
<rect height="196.777" opacity="0" width="133.301" x="0" y="0"/>
<path d="M21.9727 191.602L111.328 191.602C125.684 191.602 133.301 183.789 133.301 168.359L133.301 101.074C133.301 85.6445 125.684 77.9297 111.328 77.9297L21.9727 77.9297C7.61719 77.9297 0 85.6445 0 101.074L0 168.359C0 183.789 7.61719 191.602 21.9727 191.602ZM17.0898 85.4492L32.6172 85.4492L32.6172 52.4414C32.6172 27.832 48.3398 14.7461 66.6016 14.7461C84.8633 14.7461 100.781 27.832 100.781 52.4414L100.781 85.4492L116.211 85.4492L116.211 54.5898C116.211 17.8711 92.1875 0 66.6016 0C41.1133 0 17.0898 17.8711 17.0898 54.5898Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 947 B