Commit e9044f41 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Generalize 'Play All' button creation

parent 8bd8ee30
...@@ -77,11 +77,8 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier"; ...@@ -77,11 +77,8 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
_tapTwiceGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)]; _tapTwiceGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[_tapTwiceGestureRecognizer setNumberOfTapsRequired:2]; [_tapTwiceGestureRecognizer setNumberOfTapsRequired:2];
UIBarButtonItem *playAllButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(playAllAction:)];
playAllButton.accessibilityLabel = NSLocalizedString(@"PLAY_ALL_BUTTON", nil);
playAllButton.isAccessibilityElement = YES;
self.navigationItem.rightBarButtonItems = @[[UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(menuButtonAction:)], self.navigationItem.rightBarButtonItems = @[[UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(menuButtonAction:)],
playAllButton]; [UIBarButtonItem themedPlayAllButtonWithTarget:self andSelector:@selector(playAllAction:)]];
_searchData = [[NSMutableArray alloc] init]; _searchData = [[NSMutableArray alloc] init];
[_searchData removeAllObjects]; [_searchData removeAllObjects];
......
...@@ -13,4 +13,5 @@ ...@@ -13,4 +13,5 @@
+ (UIBarButtonItem *)themedBackButtonWithTarget:(id)target andSelector:(SEL)selector; + (UIBarButtonItem *)themedBackButtonWithTarget:(id)target andSelector:(SEL)selector;
+ (UIBarButtonItem *)themedRevealMenuButtonWithTarget:(id)target andSelector:(SEL)selector; + (UIBarButtonItem *)themedRevealMenuButtonWithTarget:(id)target andSelector:(SEL)selector;
+ (UIBarButtonItem *)themedDarkToolbarButtonWithTitle: (NSString*) title target:(id)target andSelector:(SEL)selector; + (UIBarButtonItem *)themedDarkToolbarButtonWithTitle: (NSString*) title target:(id)target andSelector:(SEL)selector;
@end + (UIBarButtonItem *)themedPlayAllButtonWithTarget:(id)target andSelector:(SEL)selector;
\ No newline at end of file @end
...@@ -57,4 +57,14 @@ ...@@ -57,4 +57,14 @@
return button; return button;
} }
@end
\ No newline at end of file + (UIBarButtonItem *)themedPlayAllButtonWithTarget:(id)target andSelector:(SEL)selector
{
UIBarButtonItem *playAllButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:target action:selector];
playAllButton.accessibilityLabel = NSLocalizedString(@"PLAY_ALL_BUTTON", nil);
playAllButton.isAccessibilityElement = YES;
return playAllButton;
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment