Replace updating overlay icon with spinner

This commit is contained in:
Cameron Gutman
2019-08-31 16:02:37 -07:00
parent f6153fe818
commit 9a4cdc9c94
3 changed files with 9 additions and 90 deletions

View File

@@ -1,21 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "updating.pdf",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -1,68 +0,0 @@
%PDF-1.5
%<25><><EFBFBD><EFBFBD>
4 0 obj
<< /Length 5 0 R
/Filter /FlateDecode
>>
stream
x<EFBFBD>mQ<EFBFBD>m1<08><><EFBFBD>i <20>`<60><>e<EFBFBD><65><EFBFBD>R.<2E><>G<EFBFBD><47><EFBFBD>`|<7C><><EFBFBD>"K<>0<18><><EFBFBD>^<5E><>f{<7B>J<EFBFBD><4A><EFBFBD>ox}ϸ<>$<24>T<EFBFBD><13><0E><><.<19><>J<EFBFBD><07>FM<46>p<EFBFBD><70><06>RyR<79><52><EFBFBD><EFBFBD>i<><69>M)W<>JQ<4A><51>`<60><><EFBFBD> N<>¨<<3C><>"d]Qݭ
<EFBFBD><EFBFBD>dY(<28>5<11><1B>:<3A>w<EFBFBD>L<1C><>ݱ<EFBFBD>l<EFBFBD>Vw)X<><58>f<EFBFBD>'<27>e<EFBFBD><04>d<EFBFBD><64><EFBFBD><<3C><>K<EFBFBD>;ej<65><02>8<EFBFBD>}<7D><>s ^<5E>4{<7B>s<EFBFBD><19>[<5B>7<EFBFBD> <11><>xH)<29><>O`<60>[Y^<5E>:<3A>4~<7E><><EFBFBD> <0B>Hby
endstream
endobj
5 0 obj
236
endobj
3 0 obj
<<
/ExtGState <<
/a0 << /CA 1 /ca 1 >>
>>
>>
endobj
2 0 obj
<< /Type /Page % 1
/Parent 1 0 R
/MediaBox [ 0 0 75 75 ]
/Contents 4 0 R
/Group <<
/Type /Group
/S /Transparency
/I true
/CS /DeviceRGB
>>
/Resources 3 0 R
>>
endobj
1 0 obj
<< /Type /Pages
/Kids [ 2 0 R ]
/Count 1
>>
endobj
6 0 obj
<< /Producer (cairo 1.16.0 (https://cairographics.org))
/CreationDate (D:20190830182029-07'00)
>>
endobj
7 0 obj
<< /Type /Catalog
/Pages 1 0 R
>>
endobj
xref
0 8
0000000000 65535 f
0000000638 00000 n
0000000422 00000 n
0000000350 00000 n
0000000015 00000 n
0000000328 00000 n
0000000703 00000 n
0000000819 00000 n
trailer
<< /Size 8
/Root 7 0 R
/Info 6 0 R
>>
startxref
871

View File

@@ -13,6 +13,7 @@
UIButton* _hostButton;
UILabel* _hostLabel;
UIImageView* _hostOverlay;
UIActivityIndicatorView* _hostSpinner;
id<HostCallback> _callback;
CGSize _labelSize;
}
@@ -51,10 +52,14 @@ static const int LABEL_DY = 20;
_hostLabel.textColor = [UIColor whiteColor];
_hostOverlay = [[UIImageView alloc] initWithFrame:CGRectMake(_hostButton.frame.size.width / 3, _hostButton.frame.size.height / 4, _hostButton.frame.size.width / 3, _hostButton.frame.size.height / 3)];
_hostSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[_hostSpinner setFrame:_hostOverlay.frame];
_hostSpinner.hidesWhenStopped = YES;
[self addSubview:_hostButton];
[self addSubview:_hostLabel];
[self addSubview:_hostOverlay];
[self addSubview:_hostSpinner];
return self;
}
@@ -132,6 +137,8 @@ static const int LABEL_DY = 20;
[_hostLabel sizeToFit];
if (host.state == StateOnline) {
[_hostSpinner stopAnimating];
if (host.pairState == PairStateUnpaired) {
[_hostOverlay setImage:[UIImage imageNamed:@"LockedOverlayIcon"]];
}
@@ -140,10 +147,11 @@ static const int LABEL_DY = 20;
}
}
else if (host.state == StateOffline) {
[_hostSpinner stopAnimating];
[_hostOverlay setImage:[UIImage imageNamed:@"ErrorOverlayIcon"]];
}
else {
[_hostOverlay setImage:[UIImage imageNamed:@"UpdatingOverlayIcon"]];
[_hostSpinner startAnimating];
}
float x = _hostButton.frame.origin.x + _hostButton.frame.size.width / 2;