Commit e815b746 authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Felix Paul Kühne
Browse files

tap twice on navbar for show or hide search bar for media library


Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent e7cc2ed3
......@@ -163,7 +163,10 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
_searchDisplayController.searchResultsDataSource = self;
_searchDisplayController.searchResultsDelegate = self;
_searchBar.delegate = self;
self.tableView.tableHeaderView = _searchBar;
UITapGestureRecognizer *tapTwiceGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[tapTwiceGesture setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:tapTwiceGesture];
}
_searchData = [[NSMutableArray alloc] init];
......@@ -601,7 +604,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
}
}
#pragma mark - table view gestures
#pragma mark - Gesture Action
- (void)swipeRightGestureAction:(UIGestureRecognizer *)recognizer
{
if ([[self.editButtonItem title] isEqualToString:NSLocalizedString(@"BUTTON_CANCEL",@"")])
......@@ -616,6 +619,15 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
}
}
- (void)tapTwiceGestureAction:(UIGestureRecognizer *)recognizer
{
_searchBar.hidden = !_searchBar.hidden;
if (_searchBar.hidden)
self.tableView.tableHeaderView = nil;
else
self.tableView.tableHeaderView = _searchBar;
}
#pragma mark - Collection View
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
......
Supports Markdown
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