Skip to content

Commit

Permalink
Fixes disclosure indicators display after orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyLB committed Jul 8, 2018
1 parent 12e00ff commit a0a55ac
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion piwigo/Upload/Pick Piwigo Album/CategoryPickViewController.m
Expand Up @@ -178,6 +178,13 @@ -(void)viewWillDisappear:(BOOL)animated
}
}

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];

// Reload tableview on orientation change, to add/remove disclosure indicators
[self.categoriesTableView reloadData];
}

-(void)quitUpload
{
// Leave Upload action and return to Albums and Images
Expand Down Expand Up @@ -384,7 +391,6 @@ -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSI
else if ([Model sharedInstance].hasAdminRights) {
cell.leftText = NSLocalizedString(@"categoryUpload_subAlbum", @"Create Sub-Album");
cell.accessoryType = UITableViewCellAccessoryNone;
cell.accessoryType = UITableViewCellAccessoryNone;
}
else {
cell.leftText = NSLocalizedString(@"categoryUpload_defaultAlbum", @"Set as Default Album");
Expand Down Expand Up @@ -441,6 +447,14 @@ -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSI
cell = [tableView dequeueReusableCellWithIdentifier:kAlbumCell_ID];
}

// Display disclosure indicator on large screens
// See https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
if(self.view.bounds.size.width > 414) { // i.e. larger than iPhones 6,7 Plus
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}

// Determine the depth before setting up the cell
PiwigoAlbumData *categoryData = [self.categories objectAtIndex:indexPath.row];
NSInteger depth = [categoryData getDepthOfCategory];
Expand Down

0 comments on commit a0a55ac

Please sign in to comment.