pull/253/head
nielsandriesse 5 years ago
parent 8faf099498
commit f6c8f5dcf5

@ -16,7 +16,7 @@
[self updateTableContents]; [self updateTableContents];
[LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:NSLocalizedString(@"Content", @"")] [LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:NSLocalizedString(@"Content", @"") customBackButton:NO];
self.tableView.backgroundColor = UIColor.clearColor; self.tableView.backgroundColor = UIColor.clearColor;
} }

@ -21,7 +21,7 @@
[self updateTableContents]; [self updateTableContents];
[LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:NSLocalizedString(@"vc_notification_settings_title", @"")]; [LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:NSLocalizedString(@"vc_notification_settings_title", @"") customBackButton:YES];
self.tableView.backgroundColor = UIColor.clearColor; self.tableView.backgroundColor = UIColor.clearColor;
} }

@ -38,25 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents]; [self updateTableContents];
[self updateNavigationItems]; [self updateNavigationItems];
// Loki: Set gradient background [LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:NSLocalizedString(@"Sound", @"") customBackButton:NO];
self.tableView.backgroundColor = UIColor.clearColor; self.tableView.backgroundColor = UIColor.clearColor;
LKGradient *gradient = LKGradients.defaultLokiBackground;
self.view.backgroundColor = UIColor.clearColor;
[self.view setGradient:gradient];
// Loki: Set navigation bar background color
UINavigationBar *navigationBar = self.navigationController.navigationBar;
[navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
navigationBar.shadowImage = [UIImage new];
[navigationBar setTranslucent:NO];
navigationBar.barTintColor = LKColors.navigationBarBackground;
// Loki: Customize title
UILabel *titleLabel = [UILabel new];
titleLabel.text = NSLocalizedString(@"Sound", @"");
titleLabel.textColor = LKColors.text;
titleLabel.font = [UIFont boldSystemFontOfSize:LKValues.veryLargeFontSize];
self.navigationItem.titleView = titleLabel;
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated

@ -4,8 +4,8 @@ public final class ViewControllerUtilities : NSObject {
private override init() { } private override init() { }
@objc(setUpDefaultSessionStyleForVC:withTitle:) @objc(setUpDefaultSessionStyleForVC:withTitle:customBackButton:)
public static func setUpDefaultSessionStyle(for vc: UIViewController, title: String) { public static func setUpDefaultSessionStyle(for vc: UIViewController, title: String, hasCustomBackButton: Bool) {
// Set gradient background // Set gradient background
vc.view.backgroundColor = .clear vc.view.backgroundColor = .clear
let gradient = Gradients.defaultLokiBackground let gradient = Gradients.defaultLokiBackground
@ -24,8 +24,10 @@ public final class ViewControllerUtilities : NSObject {
titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize) titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
vc.navigationItem.titleView = titleLabel vc.navigationItem.titleView = titleLabel
// Set up back button // Set up back button
let backButton = UIBarButtonItem(title: "Back", style: .plain, target: nil, action: nil) if hasCustomBackButton {
backButton.tintColor = Colors.text let backButton = UIBarButtonItem(title: "Back", style: .plain, target: nil, action: nil)
vc.navigationItem.backBarButtonItem = backButton backButton.tintColor = Colors.text
vc.navigationItem.backBarButtonItem = backButton
}
} }
} }

Loading…
Cancel
Save