Commit fd3eccb7 authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Carola Nitz

VLCLocalNetworkListViewController : add activity indicator when tableview loading

(cherry picked from commit 679c264a)
parent 5eed3d6f
...@@ -20,6 +20,7 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier"; ...@@ -20,6 +20,7 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
{ {
NSMutableArray *_searchData; NSMutableArray *_searchData;
UITapGestureRecognizer *_tapTwiceGestureRecognizer; UITapGestureRecognizer *_tapTwiceGestureRecognizer;
UIActivityIndicatorView *_activityIndicator;
} }
@end @end
...@@ -46,6 +47,13 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier"; ...@@ -46,6 +47,13 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.indicatorStyle = UIScrollViewIndicatorStyleWhite; _tableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
self.view = _tableView; self.view = _tableView;
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
_activityIndicator.center = _tableView.center;
_activityIndicator.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin;
_activityIndicator.hidesWhenStopped = YES;
[_activityIndicator startAnimating];
[self.view addSubview:_activityIndicator];
} }
- (void)viewDidLoad - (void)viewDidLoad
...@@ -156,6 +164,9 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier"; ...@@ -156,6 +164,9 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
{ {
UIColor *color = (indexPath.row % 2 == 0)? [UIColor blackColor]: [UIColor VLCDarkBackgroundColor]; UIColor *color = (indexPath.row % 2 == 0)? [UIColor blackColor]: [UIColor VLCDarkBackgroundColor];
cell.backgroundColor = cell.titleLabel.backgroundColor = cell.folderTitleLabel.backgroundColor = cell.subtitleLabel.backgroundColor = color; cell.backgroundColor = cell.titleLabel.backgroundColor = cell.folderTitleLabel.backgroundColor = cell.subtitleLabel.backgroundColor = color;
if ([indexPath row] == ((NSIndexPath *)[[tableView indexPathsForVisibleRows] lastObject]).row)
[_activityIndicator stopAnimating];
} }
#pragma mark - Search Controller Delegate #pragma mark - Search Controller Delegate
......
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