From a0a55ac529f88139a0835ce896f6111d278a16ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eddy=20Lelie=CC=80vre-Berna?= Date: Sun, 8 Jul 2018 20:24:42 +0200 Subject: [PATCH] Fixes disclosure indicators display after orientation --- .../CategoryPickViewController.m | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/piwigo/Upload/Pick Piwigo Album/CategoryPickViewController.m b/piwigo/Upload/Pick Piwigo Album/CategoryPickViewController.m index 2c7fa7edc..2a02c0fbf 100644 --- a/piwigo/Upload/Pick Piwigo Album/CategoryPickViewController.m +++ b/piwigo/Upload/Pick Piwigo Album/CategoryPickViewController.m @@ -178,6 +178,13 @@ -(void)viewWillDisappear:(BOOL)animated } } +-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)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 @@ -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"); @@ -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];