Commit bb2f3799 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk

status bar: move status bar color setting into viewWillAppear

- moves the changing of the status bar color from viewDidLoad
  to viewWillAppear to avoid bugs when unstacking view controllers

Change-Id: I72e892fd20bd5b8b704d4d45ebe636a790e821e8
Reviewed-by: Kateryna Kostiuk's avatarKateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
parent 9743691c
......@@ -59,7 +59,6 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased {
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .lightContent
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(screenTapped))
self.mainView.addGestureRecognizer(tapGestureRecognizer)
self.infoContainer.backgroundColor = UIColor.black.withAlphaComponent(0.3)
......@@ -73,6 +72,11 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased {
initCallAnimation()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .lightContent
}
func initCallAnimation() {
self.callPulse.alpha = 0.5
self.callPulse.layer.cornerRadius = self.callPulse.frame.size.width / 2
......
......@@ -40,6 +40,11 @@ class EditProfileViewController: UIViewController, UITextFieldDelegate, UIImageP
self.setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .lightContent
}
func setupUI() {
self.model.image.asObservable()
......
......@@ -38,8 +38,6 @@ class ContactRequestsViewController: UIViewController, StoryboardBased, ViewMode
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.applyShadow()
self.tableView.rx.modelSelected(ContactRequestItem.self)
.subscribe({ [unowned self] item in
......@@ -52,6 +50,7 @@ class ContactRequestsViewController: UIViewController, StoryboardBased, ViewMode
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
self.setupTableView()
self.setupBindings()
}
......
......@@ -41,8 +41,6 @@ class ConversationViewController: UIViewController, UITextFieldDelegate, Storybo
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.applyShadow()
self.setupUI()
......@@ -60,6 +58,11 @@ class ConversationViewController: UIViewController, UITextFieldDelegate, Storybo
view.addGestureRecognizer(tap)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
}
@objc func dismissKeyboard() {
self.becomeFirstResponder()
}
......
......@@ -57,8 +57,6 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.setupDataSources()
self.setupTableViews()
self.setupSearchBar()
......@@ -75,6 +73,7 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
self.navigationController?.navigationBar.layer.shadowColor = UIColor.clear.cgColor
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
}
......
......@@ -33,8 +33,6 @@ class LinkNewDeviceViewController: UIViewController, StoryboardBased, ViewModelB
self.view.backgroundColor = UIColor.white.withAlphaComponent(0.0)
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.showInitialAlert()
self.viewModel.observableState
......@@ -55,6 +53,11 @@ class LinkNewDeviceViewController: UIViewController, StoryboardBased, ViewModelB
}).disposed(by: self.disposeBag)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
}
private func showProgress() {
HUD.show(.labeledProgress(title: L10n.Linkdevice.hudMessage, subtitle: nil))
}
......
......@@ -34,14 +34,15 @@ class BlockListViewController: UIViewController, StoryboardBased, ViewModelBased
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.applyShadow()
self.navigationItem.title = L10n.Accountpage.blockedContacts
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
self.setupTableView()
self.viewModel.contactListNotEmpty
......
......@@ -40,8 +40,6 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.navigationItem.title = L10n.Global.meTabBarTitle
self.configureBindings()
self.applyShadow()
......@@ -49,6 +47,7 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
}
func configureBindings() {
......
......@@ -52,8 +52,6 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
// L10n
self.applyL10n()
......@@ -67,6 +65,11 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB
self.adaptToKeyboardState(for: self.scrollView, with: self.disposeBag)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
}
private func applyL10n() {
self.createAccountTitle.text = self.viewModel.createAccountTitle
self.createAccountButton.setTitle(self.viewModel.createAccountButton, for: .normal)
......
......@@ -23,8 +23,6 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
// Bind ViewModel to View
self.viewModel.skipButtonTitle.asObservable().bind(to: self.skipButton.rx.title(for: .normal)).disposed(by: self.disposeBag)
......@@ -45,4 +43,9 @@ class CreateProfileViewController: EditProfileViewController, StoryboardBased, V
self.viewModel.proceedWithAccountCreationOrDeviceLink()
}).disposed(by: self.disposeBag)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
}
}
......@@ -34,8 +34,6 @@ class LinkDeviceViewController: UIViewController, StoryboardBased, ViewModelBase
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
self.applyL10n()
//bind view model to view
......@@ -79,6 +77,11 @@ class LinkDeviceViewController: UIViewController, StoryboardBased, ViewModelBase
self.passwordTextField.rx.text.orEmpty.bind(to: self.viewModel.password).disposed(by: self.disposeBag)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
}
private func applyL10n() {
self.linkButton.setTitle(L10n.Linktoaccount.linkButtonTitle, for: .normal)
self.pinLabel.text = L10n.Linktoaccount.pinLabel
......
......@@ -39,8 +39,6 @@ class WelcomeViewController: UIViewController, StoryboardBased, ViewModelBased {
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
// Bind ViewModel to View
self.viewModel.welcomeText.bind(to: self.welcomeTextLabel.rx.text).disposed(by: self.disposeBag)
self.viewModel.createAccount.bind(to: self.createAccountButton.rx.title(for: .normal)).disposed(by: self.disposeBag)
......@@ -58,6 +56,7 @@ class WelcomeViewController: UIViewController, StoryboardBased, ViewModelBased {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarStyle = .default
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
......
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