Commit 3456dd8c authored by Carola Nitz's avatar Carola Nitz

set activityindicator position in gdrive and dropboxcontroller correctly when...

set activityindicator position in gdrive and dropboxcontroller correctly when rotating device. Fix bug where not all files in a gdrive folder where displayed
parent 439865a9
......@@ -104,8 +104,11 @@
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
_activityIndicator.hidesWhenStopped = YES;
_activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_activityIndicator];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0]];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -116,12 +119,6 @@
[self updateViewAfterSessionChange];
[super viewWillAppear:animated];
CGRect aiFrame = _activityIndicator.frame;
CGSize tvSize = self.tableView.frame.size;
aiFrame.origin.x = (tvSize.width - aiFrame.size.width) / 2.;
aiFrame.origin.y = (tvSize.height - aiFrame.size.height) / 2.;
_activityIndicator.frame = aiFrame;
[self.cloudStorageLogo sizeToFit];
self.cloudStorageLogo.center = self.view.center;
}
......
......@@ -128,7 +128,8 @@
query = [GTLQueryDrive queryForFilesList];
query.pageToken = _nextPageToken;
query.maxResults = 100;
//the results don't come in alphabetical order when paging. So the maxresult (default 100) is set to INT_max in order to get all files at once.
query.maxResults = INT_MAX;
if (![_folderId isEqualToString:@""]) {
query.q = [NSString stringWithFormat:@"'%@' in parents", [_folderId lastPathComponent]];
}
......
......@@ -103,8 +103,11 @@
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
_activityIndicator.hidesWhenStopped = YES;
_activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_activityIndicator];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0]];
}
- (GTMOAuth2ViewControllerTouch *)createAuthController
......@@ -137,12 +140,6 @@
[self updateViewAfterSessionChange];
[super viewWillAppear:animated];
CGRect aiFrame = _activityIndicator.frame;
CGSize tvSize = self.tableView.frame.size;
aiFrame.origin.x = (tvSize.width - aiFrame.size.width) / 2.;
aiFrame.origin.y = (tvSize.height - aiFrame.size.height) / 2.;
_activityIndicator.frame = aiFrame;
[self.cloudStorageLogo sizeToFit];
self.cloudStorageLogo.center = self.view.center;
}
......
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