Browse Source

update view APIS

alqindiirsyam 1 year ago
parent
commit
79d6a3694d

+ 3 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/APIS.swift

@@ -466,6 +466,8 @@ public class APIS: NSObject {
     
     public static func openSetting() {
         let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "settingNav") as! UINavigationController
+        let vc = navigationController.rootViewController as! SettingTableViewController
+        vc.fromAPI = true
         Utils.addBackground(view: navigationController.view)
         navigationController.defaultStyle()
         if UIApplication.shared.visibleViewController?.navigationController != nil {
@@ -484,6 +486,7 @@ public class APIS: NSObject {
         let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "profileView") as! ProfileViewController
         controller.data = UserDefaults.standard.string(forKey: "me")!
         controller.flag = .me
+        controller.fromAPI = true
         controller.dismissImage = { image, imageName in
             var dataImage: [AnyHashable : Any] = [:]
             dataImage["name"] = imageName

+ 7 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Contact/ContactCallViewController.swift

@@ -70,6 +70,13 @@ class ContactCallViewController: UIViewController {
         if (isAddParticipantVideo) {
             title = "Friends".localized()
         } else {
+            let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 16.0), NSAttributedString.Key.foregroundColor: UIColor.white]
+            let navBarAppearance = UINavigationBarAppearance()
+            navBarAppearance.configureWithOpaqueBackground()
+            navBarAppearance.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : UIColor.mainColor
+            navBarAppearance.titleTextAttributes = attributes
+            navigationController?.navigationBar.standardAppearance = navBarAppearance
+            navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
             let cancel = UIBarButtonItem(title: "Cancel".localized(), style: .plain, target: self, action: #selector(didTapCancel(sender:)))
             navigationItem.leftBarButtonItem = cancel
         }

+ 8 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/HistoryBroadcastViewController.swift

@@ -30,6 +30,14 @@ class HistoryBroadcastViewController: UIViewController, UITableViewDelegate, UIT
         
         navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancel(sender:)))
         
+        let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 16.0), NSAttributedString.Key.foregroundColor: UIColor.white]
+        let navBarAppearance = UINavigationBarAppearance()
+        navBarAppearance.configureWithOpaqueBackground()
+        navBarAppearance.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : UIColor.mainColor
+        navBarAppearance.titleTextAttributes = attributes
+        navigationController?.navigationBar.standardAppearance = navBarAppearance
+        navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
+        
         let me = UserDefaults.standard.string(forKey: "me")!
         Database.shared.database?.inTransaction({ fmdb, rollback in
             if let cursor = Database.shared.getRecords(fmdb: fmdb, query: "select FIRST_NAME, LAST_NAME, IMAGE_ID, USER_TYPE from BUDDY where F_PIN = '\(me)'"), cursor.next() {

+ 14 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ProfileViewController.swift

@@ -66,6 +66,8 @@ public class ProfileViewController: UITableViewController {
     
     var publicBanner = FloatingNotificationBanner()
     
+    var fromAPI = false
+    
     private func reload() {
         if let user = self.user {
             self.navigationController?.navigationBar.topItem?.title = "\(user.firstName) \(user.lastName)"
@@ -196,6 +198,18 @@ public class ProfileViewController: UITableViewController {
         profile.isUserInteractionEnabled = true
         profile.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(profileTapped)))
         
+        if fromAPI {
+            let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 16.0), NSAttributedString.Key.foregroundColor: UIColor.white]
+            let navBarAppearance = UINavigationBarAppearance()
+            navBarAppearance.configureWithOpaqueBackground()
+            navBarAppearance.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : UIColor.mainColor
+            navBarAppearance.titleTextAttributes = attributes
+            navigationController?.navigationBar.standardAppearance = navBarAppearance
+            navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
+            let backButton = UIBarButtonItem(image: UIImage(systemName: "chevron.backward"), style: .plain, target: self, action: #selector(self.didTapExit))
+            self.navigationItem.leftBarButtonItem = backButton
+        }
+        
 //        self.view.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .black : .white
         
         if fromRootViewController {

+ 11 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/SettingTableViewController.swift

@@ -33,6 +33,8 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
     
     var notInTab = false
     
+    var fromAPI = false
+    
     public override func viewDidLoad() {
         super.viewDidLoad()
         
@@ -45,6 +47,11 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
 //        tableView.separatorColor = .gray
         tableView.separatorStyle = .none
         
+        if fromAPI {
+            let backButton = UIBarButtonItem(image: UIImage(systemName: "chevron.backward"), style: .plain, target: self, action: #selector(self.didTapExit))
+            self.navigationItem.leftBarButtonItem = backButton
+        }
+        
         switchVibrateMode.tintColor = .gray
         switchSaveToGallery.tintColor = .gray
         switchAutoDownload.tintColor = .gray
@@ -67,6 +74,10 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
         switchSaveToGallery.addTarget(self, action: #selector(saveToGallerySwitch), for: .valueChanged)
         switchAutoDownload.addTarget(self, action: #selector(autoDownloadSwitch), for: .valueChanged)
     }
+    
+    @objc func didTapExit() {
+        self.dismiss(animated: true)
+    }
 
     public override func viewWillDisappear(_ animated: Bool) {
         separatorBackupRestore.removeFromSuperview()