Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring/bp 251 nav bar #213

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion App/Modules/AppTimeout/AutoLockViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ class AutoLockViewController:BaseViewController {
}()

let cellIdentifier = "TimerCell"

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
weak var delegate:AutoLockViewControllerDelegate?

override func viewDidLoad() {
Expand Down
8 changes: 8 additions & 0 deletions App/Modules/CompanyProducts/ProductsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ class ProductsViewController: BaseViewController {
let viewIdentifer = "ProductDetailView"
let heightCell:CGFloat = 70
let inset:CGFloat = 15
override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
override func viewDidLoad() {
super.viewDidLoad()
title = "BANKEX Products"
Expand Down
23 changes: 8 additions & 15 deletions App/Modules/ContactAdd/AddContactViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class AddContactViewController: BaseViewController,UITextFieldDelegate {
}
}
}
override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .blueStyle
}
set {
super.navigationBarAppearance = newValue
}
}
var service = ContactService()

override func viewDidLoad() {
Expand Down Expand Up @@ -83,10 +91,6 @@ class AddContactViewController: BaseViewController,UITextFieldDelegate {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
state = .noAvailable
navigationController?.navigationBar.barTintColor = UIDevice.isIpad ? .white : UIColor.mainColor
navigationController?.navigationBar.tintColor = .white
UIApplication.shared.statusBarView?.backgroundColor = UIDevice.isIpad ? .clear : UIColor.mainColor
UIApplication.shared.statusBarStyle = UIDevice.isIpad ? .default : .lightContent
doneButton.isHidden = UIDevice.isIpad ? true : false
title = UIDevice.isIpad ? "New Contact" : ""
}
Expand All @@ -96,17 +100,6 @@ class AddContactViewController: BaseViewController,UITextFieldDelegate {
nameContactTextField.becomeFirstResponder()
}

override func willMove(toParentViewController parent: UIViewController?) {
navigationController?.navigationBar.barTintColor = .white
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
//navigationController?.navigationBar.tintColor = UIColor.mainColor
UIApplication.shared.statusBarView?.backgroundColor = .white
UIApplication.shared.statusBarStyle = .default
}

override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
clearInfo()
Expand Down
15 changes: 8 additions & 7 deletions App/Modules/ContactDetails/ProfileContactViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ class ProfileContactViewController: BaseViewController,UITextFieldDelegate,UITex
alertVC.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .default))
return alertVC
}()
override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
var state:State = .loading {
didSet {
switch state {
Expand Down Expand Up @@ -169,16 +177,9 @@ class ProfileContactViewController: BaseViewController,UITextFieldDelegate,UITex
private func manageTop(isHide:Bool = true) {
if isHide {
navigationController?.setNavigationBarHidden(isHide, animated: false)
navigationController?.navigationBar.barTintColor = UIColor.mainColor
navigationController?.navigationBar.tintColor = .white
UIApplication.shared.statusBarView?.backgroundColor = UIDevice.isIpad ? .white : UIColor.mainColor
UIApplication.shared.statusBarStyle = UIDevice.isIpad ? .default : .lightContent
return
}
navigationController?.isNavigationBarHidden = isHide
navigationController?.navigationBar.barTintColor = .white
navigationController?.navigationBar.tintColor = UIColor.mainColor
UIApplication.shared.statusBarStyle = .default
}

@IBAction func seeAll() {
Expand Down
18 changes: 8 additions & 10 deletions App/Modules/ContactEdit/EditViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ class EditViewController: BaseViewController {
}
}
}
override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .blueStyle
}
set {
super.navigationBarAppearance = newValue
}
}
let service = ContactService()
override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -58,19 +66,9 @@ class EditViewController: BaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
title = UIDevice.isIpad ? "Edit Contact" : ""
navigationController?.navigationBar.barTintColor = UIDevice.isIpad ? UIColor.white : UIColor.mainColor
navigationController?.navigationBar.tintColor = .white
UIApplication.shared.statusBarView?.backgroundColor = UIDevice.isIpad ? nil : UIColor.mainColor
UIApplication.shared.statusBarStyle = .lightContent
updateUI()
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
UIApplication.shared.statusBarStyle = UIDevice.isIpad ? .lightContent : .default
navigationController?.navigationBar.barTintColor = .white
navigationController?.navigationBar.tintColor = UIColor.mainColor
}

private func prepareTFs() {
[nameTextField,addrTextField].forEach {
Expand Down
11 changes: 8 additions & 3 deletions App/Modules/ContactList/ListContactsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ class ListContactsViewController: BaseViewController,UISearchBarDelegate {
tableView.reloadData()
}
}
override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
@IBOutlet weak var searchBar:UISearchBar!
@IBOutlet weak var emptyView:UIView!

Expand All @@ -58,9 +66,6 @@ class ListContactsViewController: BaseViewController,UISearchBarDelegate {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
navigationController?.navigationBar.barTintColor = .white
navigationController?.navigationBar.tintColor = UIColor.mainColor
UIApplication.shared.statusBarView?.backgroundColor = .white
if fromSendScreen {
addLeftBtn()
hideAddRightButton()
Expand Down
14 changes: 9 additions & 5 deletions App/Modules/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class HomeViewController: BaseViewController {
}
}
}
override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}

private struct ViewModel {

Expand Down Expand Up @@ -183,7 +191,6 @@ class HomeViewController: BaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
TokenShortService.arrayTokensShort.removeAll()
setupStatusBarColor()
state = isFromContact ? .fromContact : .home
updateTableView()
}
Expand Down Expand Up @@ -232,10 +239,7 @@ class HomeViewController: BaseViewController {
@IBAction func unwindToHome(_ unwindSegue: UIStoryboardSegue) {}

//Methods
fileprivate func setupStatusBarColor() {
UIApplication.shared.statusBarView?.backgroundColor = .white
UIApplication.shared.statusBarStyle = .default
}


func catchUserActivity() {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
Expand Down
2 changes: 1 addition & 1 deletion App/Modules/Menu/MenuPad.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--Navigation Controller-->
<scene sceneID="JmZ-3e-wvL">
<objects>
<navigationController id="4hC-js-yC4" sceneMemberID="viewController">
<navigationController id="4hC-js-yC4" customClass="NavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="xmt-t1-43m">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
8 changes: 4 additions & 4 deletions App/Modules/Menu/MenuPhone.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<!--Settings-->
<scene sceneID="DEp-oT-BDe">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="MuH-9v-MBg" customClass="BaseNavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="MuH-9v-MBg" customClass="NavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Settings" image="Setting" id="Jzc-3t-aFH">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="accessibilityLabel" value="SettingsTab"/>
Expand All @@ -56,7 +56,7 @@
<!--Wallet-->
<scene sceneID="hXX-Cg-fyl">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" navigationBarHidden="YES" id="NSD-iW-Ldc" customClass="BaseNavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" navigationBarHidden="YES" id="NSD-iW-Ldc" customClass="NavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Wallet" id="6xJ-zx-tSj"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="B5k-kj-bJP">
Expand All @@ -74,7 +74,7 @@
<!--Contacts-->
<scene sceneID="Eg6-X9-t5b">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="WRA-cJ-AhY" customClass="BaseNavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="WRA-cJ-AhY" customClass="NavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Contacts" id="GG0-KF-d2d"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="fPu-hk-WUa">
Expand All @@ -93,7 +93,7 @@
<!--History-->
<scene sceneID="FfT-MI-U9F">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="pjl-Ef-vbh" customClass="BaseNavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="pjl-Ef-vbh" customClass="NavigationController" customModule="BankexWallet" customModuleProvider="target" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="History" id="Zw0-MQ-ub7"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="3l7-QJ-sQ1">
Expand Down
9 changes: 8 additions & 1 deletion App/Modules/NetworkAdd/CreateNetworkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ class CreateNetworkViewController: UITableViewController,UITextFieldDelegate {
@IBOutlet weak var networkIDTextField:UITextField!
@IBOutlet var textFields:[UITextField]!


override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
var joinButton = UIBarButtonItem(title: NSLocalizedString("Join", comment: ""), style: .done, target: self, action: #selector(joinToConnection))
var state:State = .unavailable {
didSet {
Expand Down
10 changes: 9 additions & 1 deletion App/Modules/QRCodeGeneration/AddressQRCodeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ class AddressQRCodeController: BaseViewController {
clipView.backgroundColor = UIColor(hex: "B8BFC9")
return clipView
}()

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setupClipboardView()
Expand Down
11 changes: 8 additions & 3 deletions App/Modules/SettingsMain/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ class SettingsViewController: UITableViewController {
let walletService = SingleKeyServiceImplementation()
let networkService = NetworksServiceImplementation()
var selectedSection:Int!

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}


override func viewDidLoad() {
Expand All @@ -38,7 +45,6 @@ class SettingsViewController: UITableViewController {

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIApplication.shared.statusBarView?.backgroundColor = .white
walletService.updateSelectedWallet()
updateUI()
}
Expand Down Expand Up @@ -95,7 +101,6 @@ class SettingsViewController: UITableViewController {

private func prepareNavbar() {
navigationItem.title = NSLocalizedString("Settings", comment: "")
navigationController?.navigationBar.shadowImage = UIImage()
}


Expand Down
9 changes: 8 additions & 1 deletion App/Modules/SettingsNetworks/NetworksViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ class NetworksViewController: BaseViewController {
enum NetworksSections:Int,CaseIterable {
case CurrentNetwork = 0,DefaultNetwork,CustomNetwork
}

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
weak var delegate:NetworkDelegate?

var selectedNetwork:CustomNetwork {
Expand Down
9 changes: 8 additions & 1 deletion App/Modules/SettingsSecurity/SecurityViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ class SecurityViewController: UITableViewController {
enum SecuritySections:Int {
case First = 0,Second,Third
}

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}
override func viewDidLoad() {
super.viewDidLoad()
setupNavbar()
Expand Down
9 changes: 8 additions & 1 deletion App/Modules/TokenAddConfirmation/TokenInfoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ class TokenInfoController: BaseViewController, UITableViewDelegate, UITableViewD
let tokensService: CustomERC20TokensService = CustomERC20TokensServiceImplementation()
var token: ERC20TokenModel?
let utilsService = CustomTokenUtilsServiceImplementation()

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}

var forAdding: Bool = false

Expand Down
10 changes: 8 additions & 2 deletions App/Modules/TokenAddSearch/CreateTokenController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ class CreateTokenController: BaseViewController {
label.textAlignment = .center
return label
}()

override var navigationBarAppearance: NavigationBarAppearance? {
get {
return super.navigationBarAppearance ?? .whiteStyle
}
set {
super.navigationBarAppearance = newValue
}
}


override func viewDidLoad() {
Expand Down Expand Up @@ -77,7 +84,6 @@ class CreateTokenController: BaseViewController {

fileprivate func setupNavBar() {
navigationController?.navigationBar.topItem?.title = NSLocalizedString("Wallet", comment: "")
navigationController?.navigationBar.shadowImage = UIImage()
}

private func showScanner() {
Expand Down
Loading