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

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

@ -21,7 +21,7 @@
[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;
}

@ -38,25 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents];
[self updateNavigationItems];
// Loki: Set gradient background
[LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:NSLocalizedString(@"Sound", @"") customBackButton:NO];
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

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

Loading…
Cancel
Save