Commit d59f276c authored by Mike JS. Choi's avatar Mike JS. Choi Committed by Carola Nitz

Settings: Style tableview section header

parent 79ef50e8
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
#import <LocalAuthentication/LocalAuthentication.h> #import <LocalAuthentication/LocalAuthentication.h>
#import "VLC_iOS-Swift.h" #import "VLC_iOS-Swift.h"
CGFloat const SETTINGS_HEADER_HEIGHT = 64.;
NSString * const kVLCSectionTableHeaderViewIdentifier = @"VLCSectionTableHeaderViewIdentifier";
@interface VLCSettingsController ()<PAPasscodeViewControllerDelegate> @interface VLCSettingsController ()<PAPasscodeViewControllerDelegate>
@end @end
...@@ -44,16 +47,18 @@ ...@@ -44,16 +47,18 @@
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_ABOUT", nil) style:UIBarButtonItemStylePlain target:self action:@selector(showAbout)]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_ABOUT", nil) style:UIBarButtonItemStylePlain target:self action:@selector(showAbout)];
self.navigationItem.leftBarButtonItem.accessibilityIdentifier = VLCAccessibilityIdentifier.about; self.navigationItem.leftBarButtonItem.accessibilityIdentifier = VLCAccessibilityIdentifier.about;
self.neverShowPrivacySettings = YES; self.neverShowPrivacySettings = YES;
self.tableView.estimatedRowHeight = 100; self.tableView.estimatedRowHeight = 100;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.rowHeight = UITableViewAutomaticDimension;
[self.tableView registerClass:[VLCSectionTableHeaderView class] forHeaderFooterViewReuseIdentifier:kVLCSectionTableHeaderViewIdentifier];
[self themeDidChange]; [self themeDidChange];
} }
- (void)themeDidChange - (void)themeDidChange
{ {
self.view.backgroundColor = PresentationTheme.current.colors.background; self.view.backgroundColor = PresentationTheme.current.colors.background;
[self setNeedsStatusBarAppearanceUpdate]; [self setNeedsStatusBarAppearanceUpdate];
} }
...@@ -177,4 +182,26 @@ ...@@ -177,4 +182,26 @@
} }
} }
#pragma mark - InAppSettings customization
- (CGFloat)settingsViewController:(id<IASKViewController>)settingsViewController tableView:(UITableView *)tableView heightForHeaderForSection:(NSInteger)section
{
return section == 0. ? 0. : SETTINGS_HEADER_HEIGHT;
}
- (UIView *)settingsViewController:(id<IASKViewController>)settingsViewController tableView:(UITableView *)tableView viewForHeaderForSection:(NSInteger)section
{
if (section == 0) {
return nil;
}
VLCSectionTableHeaderView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:kVLCSectionTableHeaderViewIdentifier];
header.textLabel.text = [self.settingsReader titleForSection:section];
return header;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return nil;
}
@end @end
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