pull/253/head
nielsandriesse 5 years ago
parent 80bcef142c
commit 580a9f2c09

@ -672,23 +672,8 @@ typedef enum : NSUInteger {
[self applyTheme]; [self applyTheme];
[self.conversationViewModel viewDidLoad]; [self.conversationViewModel viewDidLoad];
// Loki: Set gradient background [LKViewControllerUtilities setUpDefaultSessionStyleForVC:self withTitle:nil customBackButton:YES];
self.collectionView.backgroundColor = UIColor.clearColor; self.collectionView.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: Set up navigation bar buttons
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Back", "") style:UIBarButtonItemStylePlain target:nil action:nil];
backButton.tintColor = LKColors.text;
self.navigationItem.backBarButtonItem = backButton;
UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Gear"] style:UIBarButtonItemStylePlain target:self action:@selector(showConversationSettings)]; UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Gear"] style:UIBarButtonItemStylePlain target:self action:@selector(showConversationSettings)];
settingsButton.tintColor = LKColors.text; settingsButton.tintColor = LKColors.text;
self.navigationItem.rightBarButtonItem = settingsButton; self.navigationItem.rightBarButtonItem = settingsButton;

@ -5,7 +5,7 @@ public final class ViewControllerUtilities : NSObject {
private override init() { } private override init() { }
@objc(setUpDefaultSessionStyleForVC:withTitle:customBackButton:) @objc(setUpDefaultSessionStyleForVC:withTitle:customBackButton:)
public static func setUpDefaultSessionStyle(for vc: UIViewController, title: String, hasCustomBackButton: Bool) { 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
@ -18,11 +18,13 @@ public final class ViewControllerUtilities : NSObject {
navigationBar.barTintColor = Colors.navigationBarBackground navigationBar.barTintColor = Colors.navigationBarBackground
} }
// Customize title // Customize title
let titleLabel = UILabel() if let title = title {
titleLabel.text = title let titleLabel = UILabel()
titleLabel.textColor = Colors.text titleLabel.text = title
titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize) titleLabel.textColor = Colors.text
vc.navigationItem.titleView = titleLabel titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
vc.navigationItem.titleView = titleLabel
}
// Set up back button // Set up back button
if hasCustomBackButton { if hasCustomBackButton {
let backButton = UIBarButtonItem(title: "Back", style: .plain, target: nil, action: nil) let backButton = UIBarButtonItem(title: "Back", style: .plain, target: nil, action: nil)

Loading…
Cancel
Save