Redesign navigation bar on iOS

This commit is contained in:
Cameron Gutman
2019-08-30 21:15:11 -07:00
parent 97681f3a0d
commit 7e21b131ac
12 changed files with 174 additions and 88 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

@@ -2,11 +2,11 @@
"images" : [
{
"idiom" : "universal",
"filename" : "settings.pdf",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "logo.png",
"scale" : "2x"
},
{
@@ -0,0 +1,70 @@
%PDF-1.5
%µí®û
4 0 obj
<< /Length 5 0 R
/Filter /FlateDecode
>>
stream
xœeTIŽÜ0 ¼óú@‰Z,=#O ÌÌA}Hò ,.== °»d®Å¢j*òûVåqt?èÕ„ßï÷ôýgIï¨]y¤V3ôH­ç2Ù¡?¿ÁøvÐKÞm¹¥Þòåö÷ ƒþ|=òp,EØÏ„ö÷N4vnbjÏGª#OxRå\ÇL¯68Z+€™ß‰ p´÷ä¼*G”iÆî3ÃÕ}ÓQ¯Þã ^Ê‘ûÜÿÄ<O¬ER„úR\¸Jï-ï2G
´2×
OA nŸ;J^CXFR¾V»!PïJ” 8 šÂøv8
Ö,G³Î
<Q°À.¾×¥VÛ|ÄX¯Üa\2zí37)qT+fä‚䌗iGJ‚«¦ílyVîÒÏÖ KiZã¦Wû¦ˆ Î–+¿L·±5jX~µP‚J«šH)»~6xïè
^¼´@i°ŒÎE_wbަ.e‹«%V^PsÙg.ÙâêŒê´^ºrw€J0Ê„—°$Ã!@ ti^[•­µiZØÅ€¬»‡PADt?áTúÃqê"zÔáô¤B횕Ԕ Šz[±²naä·÷*ô Ë "·ÊÁ$úÇ;Hæ®*ò°2á@qlÂóÙÁ³w
ÒωѣV9vYø2ºhžW„«Ê0™1s7pAz(—+©\ÎÞÃÚU=êD±
l èk"
š}Ę•-_²—m }%ßO0ë›®½Ïë»-X·Ëö¾Ùú­€yÖ
¶üÖZÛy^)&†¸nL(¯WÑÿWÓý ¿ ¾?1
endstream
endobj
5 0 obj
608
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:20190830202122-07'00)
>>
endobj
7 0 obj
<< /Type /Catalog
/Pages 1 0 R
>>
endobj
xref
0 8
0000000000 65535 f
0000001010 00000 n
0000000794 00000 n
0000000722 00000 n
0000000015 00000 n
0000000700 00000 n
0000001075 00000 n
0000001191 00000 n
trailer
@@ -2,17 +2,15 @@
"images" : [
{
"idiom" : "universal",
"filename" : "pull-arrow-light-14x31@1x.png",
"filename" : "up_arrow.pdf",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "pull-arrow-light-28x61@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "pull-arrow-light-42x92@3x.png",
"scale" : "3x"
}
],
+70
View File
@@ -0,0 +1,70 @@
%PDF-1.5
%µí®û
4 0 obj
<< /Length 5 0 R
/Filter /FlateDecode
>>
stream
xœUŽQ
ƒ@ Dÿsй€1ÙÍF=†G(…êÇú¡½?-e`ƒÌ$
5Ö¼ZIqh›Ð¾Ó—4qAî¨ó ÓsTdã¹dl>üØH… {º‰n|–KÏâé,Ë}°?‡ê5ôª™ÿ^øÐH;U$}
endstream
endobj
5 0 obj
114
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:20190830203401-07'00)
>>
endobj
7 0 obj
<< /Type /Catalog
/Pages 1 0 R
>>
endobj
xref
0 8
0000000000 65535 f
0000000516 00000 n
0000000300 00000 n
0000000228 00000 n
0000000015 00000 n
0000000206 00000 n
0000000581 00000 n
0000000697 00000 n
trailer
<< /Size 8
/Root 7 0 R
/Info 6 0 R
>>
startxref
749
%%EOF
@@ -18,8 +18,8 @@
@interface MainFrameViewController : UICollectionViewController <DiscoveryCallback, PairCallback, HostCallback, AppCallback, AppAssetCallback, NSURLConnectionDelegate, SWRevealViewControllerDelegate>
#if !TARGET_OS_TV
@property (strong, nonatomic) IBOutlet UIButton *limelightLogoButton;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *computerNameButton;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *settingsButton;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *upButton;
#endif
@end
@@ -50,8 +50,6 @@
bool _background;
#if TARGET_OS_TV
UITapGestureRecognizer* _menuRecognizer;
#else
UIButton* _pullArrow;
#endif
}
static NSMutableSet* hostList;
@@ -126,10 +124,10 @@ static NSMutableSet* hostList;
return;
}
#if TARGET_OS_TV
self.title = host.name;
#else
self->_computerNameButton.title = host.name;
#if !TARGET_OS_TV
[self->_upButton setImage:[UIImage imageNamed:@"UpIcon"]];
#endif
[self.navigationController.navigationBar setNeedsLayout];
@@ -174,10 +172,10 @@ static NSMutableSet* hostList;
return;
}
#if TARGET_OS_TV
self.title = host.name;
#else
self->_computerNameButton.title = host.name;
#if !TARGET_OS_TV
[self->_upButton setImage:[UIImage imageNamed:@"UpIcon"]];
#endif
[self.navigationController.navigationBar setNeedsLayout];
@@ -251,11 +249,13 @@ static NSMutableSet* hostList;
[_appManager stopRetrieving];
_selectedHost = nil;
#if TARGET_OS_TV
self.title = @"Select Host";
#else
_computerNameButton.title = @"No Host Selected";
#if !TARGET_OS_TV
[_upButton setImage:nil];
#endif
[self.collectionView reloadData];
[self.view addSubview:hostScrollView];
}
@@ -651,30 +651,6 @@ static NSMutableSet* hostList;
[(SettingsViewController*)[revealController rearViewController] saveSettings];
}
// Fade out the pull arrow
[UIView animateWithDuration:0.1
animations:^{
self->_pullArrow.alpha = 0.0;
}
completion:^(BOOL finished) {
// Flip the direction of the arrow
if (position == FrontViewPositionLeft) {
// Change the pull arrow back to the default rotation
self->_pullArrow.imageView.transform = CGAffineTransformMakeRotation(0);
}
else {
// Flip the pull arrow when the reveal is toggled
self->_pullArrow.imageView.transform = CGAffineTransformMakeRotation(M_PI);
}
// Fade it back in
[UIView animateWithDuration:0.2
animations:^{
self->_pullArrow.alpha = 1.0;
}
completion:nil];
}];
currentPosition = position;
}
#endif
@@ -705,13 +681,17 @@ static NSMutableSet* hostList;
{
[super viewDidLoad];
self.title = @"Select Host";
#if !TARGET_OS_TV
// Set the side bar button action. When it's tapped, it'll show the sidebar.
[_limelightLogoButton addTarget:self.revealViewController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchDown];
[_settingsButton setTarget:self.revealViewController];
[_settingsButton setAction:@selector(revealToggle:)];
// Set the host name button action. When it's tapped, it'll show the host selection view.
[_computerNameButton setTarget:self];
[_computerNameButton setAction:@selector(showHostSelectionView)];
[_upButton setTarget:self];
[_upButton setAction:@selector(showHostSelectionView)];
[_upButton setImage:nil];
// Set the gesture
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
@@ -724,8 +704,6 @@ static NSMutableSet* hostList;
_menuRecognizer.allowedPressTypes = [[NSArray alloc] initWithObjects:[NSNumber numberWithLong:UIPressTypeMenu], nil];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
self.title = @"Select Host";
#endif
_loadingFrame = [self.storyboard instantiateViewControllerWithIdentifier:@"loadingFrame"];
@@ -755,17 +733,6 @@ static NSMutableSet* hostList;
[hostScrollView setShowsHorizontalScrollIndicator:NO];
hostScrollView.delaysContentTouches = NO;
#if !TARGET_OS_TV
_pullArrow = [[UIButton alloc] init];
[_pullArrow addTarget:self.revealViewController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchDown];
[_pullArrow setImage:[UIImage imageNamed:@"PullArrow"] forState:UIControlStateNormal];
[_pullArrow sizeToFit];
_pullArrow.frame = CGRectMake(0,
self.collectionView.frame.size.height / 6 - _pullArrow.frame.size.height / 2 - self.navigationController.navigationBar.frame.size.height,
_pullArrow.frame.size.width,
_pullArrow.frame.size.height);
#endif
self.collectionView.delaysContentTouches = NO;
self.collectionView.allowsMultipleSelection = NO;
#if !TARGET_OS_TV
@@ -776,9 +743,6 @@ static NSMutableSet* hostList;
_discMan = [[DiscoveryManager alloc] initWithHosts:[hostList allObjects] andCallback:self];
[self.view addSubview:hostScrollView];
#if !TARGET_OS_TV
[self.view addSubview:_pullArrow];
#endif
}
-(void)beginForegroundRefresh:(bool)refreshAppList