Explorar el Código

Ringtone Video Call & Audio Call

kevin hace 5 meses
padre
commit
70e918ca29

+ 69 - 15
AppBuilder/AppBuilder/FourthTabViewController.swift

@@ -14,8 +14,11 @@ import Photos
 public class FourthTabViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate, UIGestureRecognizerDelegate {
     
     var language: [[String: String]] = [["Indonesia": "id"],["English": "en"]]
+    var fontSizeSelection: [[String: String]] = [["Small": "0"],["Medium": "4"],["Large": "6"]]
     var alert: UIAlertController?
     var textFields = [UITextField]()
+    var languagePickerView = UIPickerView()
+    var fontSizePickerView = UIPickerView()
     
     var switchVibrateMode = UISwitch()
     var switchSaveToGallery = UISwitch()
@@ -144,6 +147,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
             Item.menus["Personal"] = [
                 Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                 Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                 Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Sign-Up/Sign-In".localized()),
             ]
         } else {
@@ -154,6 +158,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                         Item.menus["Personal"] = [
                             Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                             Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                            Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
 //                            Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Change Admin / Internal Password".localized()),
                             Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Sign-In to Web".localized()),
 //                            Item(icon: UIImage(named: "ic_internal", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, title: "Set Internal Account".localized()),
@@ -163,12 +168,14 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                         Item.menus["Personal"] = [
                             Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                             Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                            Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                             Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Sign-In to Web".localized()),
                         ]
                     } else {
                         Item.menus["Personal"] = [
                             Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                             Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                            Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
 //                            Item(icon: UIImage(systemName: "person.badge.key"), title: "Access Admin / Internal Features".localized()),
                         ]
                     }
@@ -222,6 +229,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                     Item.menus["Personal"] = [
                         Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                         Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                        Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
 //                        Item(icon: UIImage(systemName: "person.badge.key"), title: "Access Admin / Internal Features".localized()),
                     ]
                     Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Sign-Up/Sign-In".localized()))
@@ -499,6 +507,8 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                 cell.accessoryType = .disclosureIndicator
             case "Change Language".localized():
                 cell.accessoryType = .disclosureIndicator
+            case "Change Font Size".localized():
+                cell.accessoryType = .disclosureIndicator
             case "Set Internal Account".localized():
                 cell.accessoryType = .disclosureIndicator
             case "Set CS Account".localized():
@@ -621,21 +631,21 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
         } else if item.title == "Change Language".localized() {
             let vc = UIViewController()
             vc.preferredContentSize = CGSize(width: UIScreen.main.bounds.width - 10, height: 150)
-            let pickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 150))
-            pickerView.dataSource = self
-            pickerView.delegate = self
+            languagePickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 150))
+            languagePickerView.dataSource = self
+            languagePickerView.delegate = self
             
             let lang: String = SecureUserDefaults.shared.value(forKey: "i18n_language") ?? "en"
             var index = 1
             if lang == "id" {
                 index = 0
             }
-            pickerView.selectRow(index, inComponent: 0, animated: false)
+            languagePickerView.selectRow(index, inComponent: 0, animated: false)
             
-            vc.view.addSubview(pickerView)
-            pickerView.translatesAutoresizingMaskIntoConstraints = false
-            pickerView.centerXAnchor.constraint(equalTo: vc.view.centerXAnchor).isActive = true
-            pickerView.centerYAnchor.constraint(equalTo: vc.view.centerYAnchor).isActive = true
+            vc.view.addSubview(languagePickerView)
+            languagePickerView.translatesAutoresizingMaskIntoConstraints = false
+            languagePickerView.centerXAnchor.constraint(equalTo: vc.view.centerXAnchor).isActive = true
+            languagePickerView.centerYAnchor.constraint(equalTo: vc.view.centerYAnchor).isActive = true
             
             let alert = LibAlertController(title: "Select Language".localized(), message: "", preferredStyle: .actionSheet)
             
@@ -644,17 +654,51 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
             }))
             
             alert.addAction(UIAlertAction(title: "Select".localized(), style: .default, handler: { (UIAlertAction) in
-                let selectedIndex = pickerView.selectedRow(inComponent: 0)
+                let selectedIndex = self.languagePickerView.selectedRow(inComponent: 0)
                 let lang = self.language[selectedIndex].values.first
                 SecureUserDefaults.shared.set(lang, forKey: "i18n_language")
                 self.navigationController?.navigationBar.topItem?.title = "Settings".localized();
                 self.navigationController?.navigationBar.setNeedsLayout()
                 self.makeMenu()
                 self.tableView.reloadData()
-                FirstTabViewController.forceRefresh = true
-                ThirdTabViewController.forceRefresh = true
-                FirstTabViewController.showModal = false
-                ThirdTabViewController.showModal = false
+            }))
+            self.present(alert, animated: true, completion: nil)
+        } else if item.title == "Change Font Size".localized() {
+            let vc = UIViewController()
+            vc.preferredContentSize = CGSize(width: UIScreen.main.bounds.width - 10, height: 150)
+            fontSizePickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 150))
+            fontSizePickerView.dataSource = self
+            fontSizePickerView.delegate = self
+            
+            let fontSize: String = SecureUserDefaults.shared.value(forKey: "font_size") ?? "0"
+            var index = 0
+            if fontSize == "2" {
+                index = 1
+            }
+            else if fontSize == "4"{
+                index = 2
+            }
+            fontSizePickerView.selectRow(index, inComponent: 0, animated: false)
+            
+            vc.view.addSubview(fontSizePickerView)
+            fontSizePickerView.translatesAutoresizingMaskIntoConstraints = false
+            fontSizePickerView.centerXAnchor.constraint(equalTo: vc.view.centerXAnchor).isActive = true
+            fontSizePickerView.centerYAnchor.constraint(equalTo: vc.view.centerYAnchor).isActive = true
+            
+            let alert = LibAlertController(title: "Select Font Size".localized(), message: "", preferredStyle: .actionSheet)
+            
+            alert.setValue(vc, forKey: "contentViewController")
+            alert.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel, handler: { (UIAlertAction) in
+            }))
+            
+            alert.addAction(UIAlertAction(title: "Select".localized(), style: .default, handler: { (UIAlertAction) in
+                let selectedIndex = self.fontSizePickerView.selectedRow(inComponent: 0)
+                let lang = self.fontSizeSelection[selectedIndex].values.first
+                SecureUserDefaults.shared.set(lang, forKey: "font_size")
+                self.navigationController?.navigationBar.topItem?.title = "Settings".localized();
+                self.navigationController?.navigationBar.setNeedsLayout()
+                self.makeMenu()
+                self.tableView.reloadData()
             }))
             self.present(alert, animated: true, completion: nil)
         } else if item.title == "Sign-In".localized() {
@@ -1275,7 +1319,12 @@ extension FourthTabViewController: UIPickerViewDelegate, UIPickerViewDataSource
     }
     
     public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
-        return language.count
+        if pickerView == languagePickerView {
+            return language.count
+        }
+        else {
+            return fontSizeSelection.count
+        }
     }
     
     public func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
@@ -1284,7 +1333,12 @@ extension FourthTabViewController: UIPickerViewDelegate, UIPickerViewDataSource
     
     public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
         let label = UILabel(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 30))
-        label.text = (language[row]).keys.first
+        if pickerView == languagePickerView {
+            label.text = (language[row]).keys.first
+        }
+        else {
+            label.text = (fontSizeSelection[row]).keys.first
+        }
         label.sizeToFit()
         return label
     }

+ 1 - 1
NexilisLite/NexilisLite.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |spec|
   spec.name         = "NexilisLite"
-  spec.version      = "5.0.6"
+  spec.version      = "5.0.7"
   spec.summary      = "NexilisLite Framework"
   spec.description  = <<-DESC
   NexilisLite Framework, embed Contact Center, Live Streaming, Push Notifications, Instant Messaging, Video and VoIP Calling features into your mobile apps within minutes...

+ 2 - 0
NexilisLite/NexilisLite/Resource/id.lproj/Localizable.strings

@@ -77,6 +77,7 @@
 "Change Admin / Internal Password" = "Ubah Sandi Admin / Internal";
 "Change Device" = "Ubah Perangkat";
 "Change Language" = "Ubah Bahasa";
+"Change Font Size" = "Ubah Ukuran Font";
 "Notification Message(s)" = "Pesan Notifikasi";
 "Notification Message(s) Group" = "Grup Pesan Notifikasi";
 "Vibrate Mode" = "Mode Getar";
@@ -394,3 +395,4 @@
 "Enable Notification" = "Aktifkan Notifikasi";
 "Go to Settings" = "Buka Pengaturan";
 "To stay updated, please enable notification in the Settings." = "Untuk tetap mendapatkan informasi terbaru, harap aktifkan notifikasi di Pengaturan.";
+"Change Font Size" = "Ubah Ukuran Font";

+ 22 - 0
NexilisLite/NexilisLite/Source/View/Call/QmeraAudioViewController.swift

@@ -408,6 +408,7 @@ class QmeraAudioViewController: UIViewController {
     }
     
     private func outgoingView() {
+        Nexilis.playRingbacktoneCall()
         status.text = "Connecting..."
         view.addSubview(end)
         end.anchor(bottom: view.bottomAnchor, paddingBottom: 60, centerX: view.centerXAnchor, width: buttonSize, height: buttonSize)
@@ -416,6 +417,7 @@ class QmeraAudioViewController: UIViewController {
     }
     
     private func incomingView() {
+        Nexilis.playRingtoneCall()
         status.text = "Incoming..."
         
         stack.spacing = buttonSize
@@ -656,6 +658,8 @@ class QmeraAudioViewController: UIViewController {
     }
     
     @objc func didPressEnd(sender: Any?) {
+        Nexilis.stopRingtoneCall()
+        Nexilis.stopRingbacktoneCall()
         let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
         if !onGoingCC.isEmpty {
             self.isEndByMe = true
@@ -681,6 +685,8 @@ class QmeraAudioViewController: UIViewController {
     }
     
     @objc func didEnd(sender: Any?) {
+        Nexilis.stopRingtoneCall()
+        Nexilis.stopRingbacktoneCall()
         poweredByView.isHidden = true
         let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
         if !onGoingCC.isEmpty {
@@ -884,6 +890,10 @@ class QmeraAudioViewController: UIViewController {
                     }
                 }
             } else if state == Nexilis.AUDIO_CALL_OFFHOOK || (!ticketId.isEmpty && state == Nexilis.VIDEO_CALL_OFFHOOK) {
+                DispatchQueue.main.async {
+                    Nexilis.stopRingtoneCall()
+                    Nexilis.stopRingbacktoneCall()
+                }
                 if users.count == 1 && firstCall {
                     DispatchQueue.main.async {
                         if !self.ticketId.isEmpty {
@@ -909,6 +919,10 @@ class QmeraAudioViewController: UIViewController {
                     self.users.append(user)
                 }
             } else if state == Nexilis.AUDIO_CALL_END || (!ticketId.isEmpty && state == Nexilis.VIDEO_CALL_END) {
+                DispatchQueue.main.async {
+                    Nexilis.stopRingtoneCall()
+                    Nexilis.stopRingbacktoneCall()
+                }
                 let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
                 if let pin = arrayMessage.first, let index = users.firstIndex(of: User(pin: String(pin))) {
                     users.remove(at: index)
@@ -999,6 +1013,10 @@ class QmeraAudioViewController: UIViewController {
 //                    }
 //                }
             } else if state == Nexilis.OFFLINE { // Offline
+                DispatchQueue.main.async {
+                    Nexilis.stopRingtoneCall()
+                    Nexilis.stopRingbacktoneCall()
+                }
                 let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
                 if let pin = arrayMessage.first, let index = users.firstIndex(of: User(pin: String(pin))) {
                     users.remove(at: index)
@@ -1031,6 +1049,10 @@ class QmeraAudioViewController: UIViewController {
                     }
                 }
             } else if state == Nexilis.BUSY { // Busy
+                DispatchQueue.main.async {
+                    Nexilis.stopRingtoneCall()
+                    Nexilis.stopRingbacktoneCall()
+                }
                 let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
                 if let pin = arrayMessage.first, let index = users.firstIndex(of: User(pin: String(pin))) {
                     users.remove(at: index)

+ 22 - 0
NexilisLite/NexilisLite/Source/View/Call/QmeraVideoViewController.swift

@@ -406,6 +406,7 @@ class QmeraVideoViewController: UIViewController {
             labelIncomingOutgoing.centerXAnchor.constraint(equalTo: view.centerXAnchor)
         ])
         if isInisiator {
+            Nexilis.playRingbacktoneCall()
             labelIncomingOutgoing.text = "Connecting".localized()
             if ticketId.isEmpty {
                 if callFCM {
@@ -447,6 +448,7 @@ class QmeraVideoViewController: UIViewController {
                 }
             }
         } else {
+            Nexilis.playRingtoneCall()
             labelIncomingOutgoing.text = "Incoming video call".localized() + "..."
         }
         labelIncomingOutgoing.font = UIFont.systemFont(ofSize: 12)
@@ -551,6 +553,8 @@ class QmeraVideoViewController: UIViewController {
                         _ = Nexilis.getWhiteboardDelegate()?.terminate()
                     }
                 }
+                Nexilis.stopRingtoneCall()
+                Nexilis.stopRingbacktoneCall()
                 self.endAllCall()
                 self.dismiss(animated: true, completion: nil)
             }))
@@ -559,6 +563,8 @@ class QmeraVideoViewController: UIViewController {
             let alert = LibAlertController(title: "End Video Call".localized(), message: "Are you sure you want to end video call?".localized(), preferredStyle: .alert)
             alert.addAction(UIAlertAction(title: "No".localized(), style: UIAlertAction.Style.default, handler: nil))
             alert.addAction(UIAlertAction(title: "Yes".localized(), style: UIAlertAction.Style.default, handler: {(_) in
+                Nexilis.stopRingtoneCall()
+                Nexilis.stopRingbacktoneCall()
                 if self.labelIncomingOutgoing.isDescendant(of: self.view) {
                     self.labelIncomingOutgoing.text = "Video call is over".localized()
                 }
@@ -1089,6 +1095,10 @@ class QmeraVideoViewController: UIViewController {
             }
         }
         else if (state == Nexilis.VIDEO_CALL_OFFHOOK) {
+            DispatchQueue.main.async {
+                Nexilis.stopRingtoneCall()
+                Nexilis.stopRingbacktoneCall()
+            }
             let channel = arrayMessage[3]
             remoteChannel[String(channel)] = String(arrayMessage[5])
             DispatchQueue.main.async {
@@ -1222,6 +1232,10 @@ class QmeraVideoViewController: UIViewController {
                 }
             }
         } else if (state == Nexilis.VIDEO_CALL_END || state == Nexilis.AUDIO_CALL_END) {
+            DispatchQueue.main.async {
+                Nexilis.stopRingtoneCall()
+                Nexilis.stopRingbacktoneCall()
+            }
             let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
             if !onGoingCC.isEmpty {
                 let requester = onGoingCC.components(separatedBy: ",")[0]
@@ -1371,6 +1385,10 @@ class QmeraVideoViewController: UIViewController {
                 }
             }
         } else if (state == Nexilis.OFFLINE) {
+            DispatchQueue.main.async {
+                Nexilis.stopRingtoneCall()
+                Nexilis.stopRingbacktoneCall()
+            }
             let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
             DispatchQueue.main.async {
                 if (self.dataPerson.count == 1) {
@@ -1443,6 +1461,10 @@ class QmeraVideoViewController: UIViewController {
                 }
             }
         } else if (state == Nexilis.BUSY) {
+            DispatchQueue.main.async {
+                Nexilis.stopRingtoneCall()
+                Nexilis.stopRingbacktoneCall()
+            }
             let onGoingCC: String = SecureUserDefaults.shared.value(forKey: "onGoingCC") ?? ""
             DispatchQueue.main.async { [self] in
                 if (self.dataPerson.count == 1) {

+ 12 - 7
NexilisLite/NexilisLite/Source/View/Chat/ChatGPTBotView.swift

@@ -74,6 +74,11 @@ public class ChatGPTBotView: UIViewController, UIGestureRecognizerDelegate {
         let payload : [[String: String]]
     }
     
+    func offset() -> CGFloat{
+        guard let fontSize = Int(SecureUserDefaults.shared.value(forKey: "font_size") ?? "0") else { return 0 }
+        return CGFloat(fontSize)
+    }
+    
     public override func viewDidDisappear(_ animated: Bool) {
         if self.isMovingFromParent {
             SecureUserDefaults.shared.removeValue(forKey: "inEditorPersonal")
@@ -129,7 +134,7 @@ public class ChatGPTBotView: UIViewController, UIGestureRecognizerDelegate {
         textFieldSend.tintColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
         textFieldSend.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
         textFieldSend.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
-        textFieldSend.font = UIFont.systemFont(ofSize: 12)
+        textFieldSend.font = UIFont.systemFont(ofSize: 12 + offset())
         textFieldSend.delegate = self
         textFieldSend.allowsEditingTextAttributes = true
         
@@ -564,7 +569,7 @@ public class ChatGPTBotView: UIViewController, UIGestureRecognizerDelegate {
             viewAppBar.addSubview(titleNavigation)
             titleNavigation.text = "GPT SmartBot"
             titleNavigation.textColor = .white
-            titleNavigation.font = UIFont.systemFont(ofSize: 12).bold
+            titleNavigation.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             
             navigationItem.titleView = viewAppBar
             titleText = titleNavigation.text
@@ -1114,7 +1119,7 @@ public class ChatGPTBotView: UIViewController, UIGestureRecognizerDelegate {
             labelCounter.trailingAnchor.constraint(equalTo: indicatorCounterBSTB.trailingAnchor, constant: -2),
             labelCounter.centerXAnchor.constraint(equalTo: indicatorCounterBSTB.centerXAnchor),
         ])
-        labelCounter.font = UIFont.systemFont(ofSize: 11)
+        labelCounter.font = UIFont.systemFont(ofSize: 11 + offset())
         labelCounter.text = "\(counter)"
         labelCounter.textColor = .secondaryColor
         labelCounter.textAlignment = .center
@@ -1756,7 +1761,7 @@ extension ChatGPTBotView: UITableViewDelegate, UITableViewDataSource {
         ])
         labelDate.textAlignment = .center
         labelDate.textColor = .secondaryColor
-        labelDate.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+        labelDate.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
         labelDate.text = dataDates[section]
         if listViewOnSection.count == 0 || listViewOnSection.count - 1 < section {
             listViewOnSection.append(containerView)
@@ -1861,7 +1866,7 @@ extension ChatGPTBotView: UITableViewDelegate, UITableViewDataSource {
                 ])
                 labelNewMessages.textAlignment = .center
                 labelNewMessages.textColor = .secondaryColor
-                labelNewMessages.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+                labelNewMessages.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
                 labelNewMessages.text = "Unread Messages".localized()
                 
             } else {
@@ -1920,7 +1925,7 @@ extension ChatGPTBotView: UITableViewDelegate, UITableViewDataSource {
             let topMarginText = messageText.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15)
             topMarginText.isActive = true
             messageText.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-            messageText.font = .systemFont(ofSize: 12)
+            messageText.font = .systemFont(ofSize: 12 + offset())
             messageText.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
             messageText.bottomAnchor.constraint(equalTo: containerMessage.bottomAnchor, constant: -15).isActive = true
             messageText.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
@@ -1978,7 +1983,7 @@ extension ChatGPTBotView: UITableViewDelegate, UITableViewDataSource {
             formatter.locale = NSLocale(localeIdentifier: "id") as Locale?
             timeMessage.text = formatter.string(from: date as Date)
             timeMessage.textColor = .lightGray
-            timeMessage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+            timeMessage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
         }
         return cell
     }

+ 32 - 27
NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -117,6 +117,11 @@ public class EditorGroup: UIViewController, CLLocationManagerDelegate {
     var timers: [IndexPath: Timer] = [:]
     var playingIndexPath: IndexPath?
     
+    func offset() -> CGFloat{
+        guard let fontSize = Int(SecureUserDefaults.shared.value(forKey: "font_size") ?? "0") else { return 0 }
+        return CGFloat(fontSize)
+    }
+    
     public override func viewDidDisappear(_ animated: Bool) {
         if self.isMovingFromParent {
             removeAllObjectBeforeDismissVC()
@@ -204,7 +209,7 @@ public class EditorGroup: UIViewController, CLLocationManagerDelegate {
         textFieldSend.tintColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
         textFieldSend.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
         textFieldSend.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
-        textFieldSend.font = UIFont.systemFont(ofSize: 12)
+        textFieldSend.font = UIFont.systemFont(ofSize: 12 + offset())
         textFieldSend.delegate = self
         textFieldSend.customDelegate = self
         textFieldSend.allowsEditingTextAttributes = true
@@ -884,7 +889,7 @@ public class EditorGroup: UIViewController, CLLocationManagerDelegate {
                 titleNavigation.text = (dataGroup["f_name"] as? String ?? "") + " (\(dataTopic["title"] as? String ?? ""))"
             }
             titleNavigation.textColor = .white
-            titleNavigation.font = UIFont.systemFont(ofSize: 12).bold
+            titleNavigation.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             
             navigationItem.titleView = viewAppBar
             titleText = titleNavigation.text
@@ -1383,7 +1388,7 @@ public class EditorGroup: UIViewController, CLLocationManagerDelegate {
                         labelKicked.centerXAnchor.constraint(equalTo: containerActionGroup.centerXAnchor),
                     ])
                     labelKicked.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-                    labelKicked.font = UIFont.systemFont(ofSize: 12).bold
+                    labelKicked.font = UIFont.systemFont(ofSize: 12 + offset()).bold
                     if contactChatNav.viewIfLoaded?.window != nil {
                         contactChatNav.dismiss(animated: true)
                     }
@@ -1970,7 +1975,7 @@ public class EditorGroup: UIViewController, CLLocationManagerDelegate {
             labelDisable.centerXAnchor.constraint(equalTo: containerAction.centerXAnchor),
         ])
         labelDisable.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-        labelDisable.font = UIFont.systemFont(ofSize: 12).bold
+        labelDisable.font = UIFont.systemFont(ofSize: 12 + offset()).bold
         labelDisable.text = "Call Center Session has ended".localized()
     }
     
@@ -2022,7 +2027,7 @@ public class EditorGroup: UIViewController, CLLocationManagerDelegate {
             labelCounter.trailingAnchor.constraint(equalTo: indicatorCounterBSTB.trailingAnchor, constant: -2),
             labelCounter.centerXAnchor.constraint(equalTo: indicatorCounterBSTB.centerXAnchor),
         ])
-        labelCounter.font = UIFont.systemFont(ofSize: 11)
+        labelCounter.font = UIFont.systemFont(ofSize: 11 + offset())
         labelCounter.text = "\(counter)"
         labelCounter.textColor = .secondaryColor
         labelCounter.textAlignment = .center
@@ -2834,7 +2839,7 @@ extension EditorGroup: UITextViewDelegate, CustomTextViewPasteDelegate {
         descPreview.topAnchor.constraint(equalTo: titlePreview.bottomAnchor).isActive = true
         descPreview.trailingAnchor.constraint(equalTo: self.containerLink.trailingAnchor, constant: -80.0).isActive = true
         descPreview.text = description
-        descPreview.font = UIFont.systemFont(ofSize: 12.0)
+        descPreview.font = UIFont.systemFont(ofSize: 12.0 + offset())
         descPreview.textColor = .gray
         descPreview.numberOfLines = 1
         
@@ -2849,7 +2854,7 @@ extension EditorGroup: UITextViewDelegate, CustomTextViewPasteDelegate {
         linkPreview.topAnchor.constraint(equalTo: descPreview.bottomAnchor, constant: 8.0).isActive = true
         linkPreview.trailingAnchor.constraint(equalTo: self.containerLink.trailingAnchor, constant: -80.0).isActive = true
         linkPreview.text = stringURl
-        linkPreview.font = UIFont.systemFont(ofSize: 10.0)
+        linkPreview.font = UIFont.systemFont(ofSize: 10.0 + offset())
         linkPreview.textColor = .gray
         linkPreview.numberOfLines = 1
         
@@ -3335,7 +3340,7 @@ extension EditorGroup: UIContextMenuInteractionDelegate {
             editTextView.tintColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
             editTextView.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
             editTextView.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
-            editTextView.font = UIFont.systemFont(ofSize: 12)
+            editTextView.font = UIFont.systemFont(ofSize: 12 + offset())
             editTextView.delegate = self
             editTextView.allowsEditingTextAttributes = true
             editTextView.backgroundColor = .clear
@@ -3416,7 +3421,7 @@ extension EditorGroup: UIContextMenuInteractionDelegate {
             messageText.bottomAnchor.constraint(equalTo: viewMessage.bottomAnchor, constant: -15).isActive = true
             messageText.trailingAnchor.constraint(equalTo: viewMessage.trailingAnchor, constant: -15).isActive = true
             messageText.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-            messageText.font = .systemFont(ofSize: 12)
+            messageText.font = .systemFont(ofSize: 12 + offset())
             messageText.text = oldText
         }
         editVC.modalTransitionStyle = .crossDissolve
@@ -4078,7 +4083,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         ])
         labelDate.textAlignment = .center
         labelDate.textColor = .secondaryColor
-        labelDate.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+        labelDate.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
         labelDate.text = dataDates[section]
         return containerView
     }
@@ -4218,7 +4223,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         if tableView == tableMention {
             let cellMention = tableView.dequeueReusableCell(withIdentifier: "cellMention", for: indexPath as IndexPath)
             var content = cellMention.defaultContentConfiguration()
-            content.textProperties.font = UIFont.systemFont(ofSize: 11)
+            content.textProperties.font = UIFont.systemFont(ofSize: 11 + offset())
             content.imageProperties.tintColor = .black
             content.imageProperties.maximumSize = CGSize(width: 24, height: 24)
             if indexPath.row < listMentionWithText.count {
@@ -4401,7 +4406,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
             nameSender.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15).isActive = true
             nameSender.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
             nameSender.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
-            nameSender.font = UIFont.systemFont(ofSize: 12).bold
+            nameSender.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             nameSender.text = dataProfile["name"]
             nameSender.textAlignment = .right
             if (dataMessages[indexPath.row]["attachment_flag"] as? String == "11" && dataMessages[indexPath.row]["reff_id"]as? String == "") {
@@ -4473,7 +4478,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                 ])
                 labelNewMessages.textAlignment = .center
                 labelNewMessages.textColor = .secondaryColor
-                labelNewMessages.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+                labelNewMessages.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
                 labelNewMessages.text = "Unread Messages".localized()
                 
             } else {
@@ -4506,7 +4511,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
             nameSender.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15).isActive = true
             nameSender.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
             nameSender.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
-            nameSender.font = UIFont.systemFont(ofSize: 12).bold
+            nameSender.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             if dataMessages[indexPath.row]["f_pin"] as? String == "-999" {
                 nameSender.text = "Bot"
             }
@@ -4584,7 +4589,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         if dataMessages[indexPath.row][TypeDataMessage.last_edit] != nil && dataMessages[indexPath.row][TypeDataMessage.last_edit] as! Int64 != 0 {
             let editedText = UILabel()
             editedText.text = "Edited".localized()
-            editedText.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+            editedText.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
             editedText.textColor = .lightGray
             cellMessage.contentView.addSubview(editedText)
             editedText.translatesAutoresizingMaskIntoConstraints = false
@@ -4621,7 +4626,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         messageText.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
         
         messageText.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-        messageText.font = .systemFont(ofSize: 12)
+        messageText.font = .systemFont(ofSize: 12 + offset())
         
         var textChat = dataMessages[indexPath.row]["message_text"] as? String ?? ""
         let originalMessageText = textChat
@@ -4758,7 +4763,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                 timeMessage.text = formatter.string(from: date as Date)
                 timeMessage.textColor = .lightGray
             }
-            timeMessage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+            timeMessage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
         }
         
         let imageThumb = UIImageView()
@@ -4790,7 +4795,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
             
             let timeLabelAudio = UILabel()
             timeLabelAudio.text = "0:00"
-            timeLabelAudio.font = .systemFont(ofSize: 10)
+            timeLabelAudio.font = .systemFont(ofSize: 10 + offset())
             timeLabelAudio.textColor = .gray
             containerMessage.addSubview(timeLabelAudio)
             timeLabelAudio.anchor(top: playButtonAudio.bottomAnchor, left: playButtonAudio.rightAnchor, paddingLeft: 10, width: 100, height: 12)
@@ -4928,7 +4933,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                     formatter.locale = NSLocale(localeIdentifier: "id") as Locale?
                     timeInImage.text = formatter.string(from: date as Date)
                     timeInImage.textColor = .white
-                    timeInImage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+                    timeInImage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
                     
                     if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
                         let statusInImage = UIImageView()
@@ -5218,7 +5223,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
             nameFile.translatesAutoresizingMaskIntoConstraints = false
             nameFile.centerYAnchor.constraint(equalTo: containerViewFile.centerYAnchor).isActive = true
             nameFile.widthAnchor.constraint(lessThanOrEqualToConstant: 200).isActive = true
-            nameFile.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+            nameFile.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
             nameFile.textColor = .white
             nameFile.text = originalMessageText.components(separatedBy: "|")[0]
             
@@ -5328,7 +5333,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                         titlePreview.topAnchor.constraint(equalTo: containerLinkMessage.topAnchor, constant: 10.0).isActive = true
                         titlePreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -5.0).isActive = true
                         titlePreview.text = title
-                        titlePreview.font = UIFont.systemFont(ofSize: 14.0, weight: .bold)
+                        titlePreview.font = UIFont.systemFont(ofSize: 14.0 + offset(), weight: .bold)
                         titlePreview.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
                         
                         let descPreview = UILabel()
@@ -5342,7 +5347,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                         descPreview.topAnchor.constraint(equalTo: titlePreview.bottomAnchor).isActive = true
                         descPreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -5.0).isActive = true
                         descPreview.text = description
-                        descPreview.font = UIFont.systemFont(ofSize: 12.0)
+                        descPreview.font = UIFont.systemFont(ofSize: 12.0 + offset())
                         descPreview.textColor = .gray
                         descPreview.numberOfLines = 1
                         
@@ -5357,7 +5362,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                         linkPreview.topAnchor.constraint(equalTo: descPreview.bottomAnchor, constant: 8.0).isActive = true
                         linkPreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -5.0).isActive = true
                         linkPreview.text = link
-                        linkPreview.font = UIFont.systemFont(ofSize: 10.0)
+                        linkPreview.font = UIFont.systemFont(ofSize: 10.0 + offset())
                         linkPreview.textColor = .gray
                         linkPreview.numberOfLines = 1
                         
@@ -5477,7 +5482,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                 titleReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
                 titleReply.topAnchor.constraint(equalTo: containerReply.topAnchor, constant: 10).isActive = true
                 titleReply.trailingAnchor.constraint(lessThanOrEqualTo: containerReply.trailingAnchor, constant: -20).isActive = true
-                titleReply.font = UIFont.systemFont(ofSize: 12).bold
+                titleReply.font = UIFont.systemFont(ofSize: 12 + offset()).bold
                 if (data["f_pin"] as? String == idMe) {
                     titleReply.text = "You".localized()
                     if dataMessages[indexPath.row]["f_pin"] as? String == idMe {
@@ -5508,7 +5513,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
                 contentReply.translatesAutoresizingMaskIntoConstraints = false
                 contentReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
                 contentReply.bottomAnchor.constraint(equalTo: containerReply.bottomAnchor, constant: -10).isActive = true
-                contentReply.font = UIFont.systemFont(ofSize: 10)
+                contentReply.font = UIFont.systemFont(ofSize: 10 + offset())
                 let message_text = data["message_text"] as? String ?? ""
                 let attachment_flag = data["attachment_flag"] as? String  ?? ""
                 let thumb_chat = data["thumb_id"] as? String ?? ""
@@ -6298,7 +6303,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         titleReply.translatesAutoresizingMaskIntoConstraints = false
         titleReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
         titleReply.topAnchor.constraint(equalTo: self.containerPreviewReply.topAnchor, constant: 10).isActive = true
-        titleReply.font = UIFont.systemFont(ofSize: 12).bold
+        titleReply.font = UIFont.systemFont(ofSize: 12 + offset()).bold
         let idMe = User.getMyPin() as String?
         if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
             titleReply.text = "You".localized()
@@ -6317,7 +6322,7 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource, AVAudioPlayer
         contentReply.translatesAutoresizingMaskIntoConstraints = false
         contentReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
         contentReply.topAnchor.constraint(equalTo: titleReply.bottomAnchor).isActive = true
-        contentReply.font = UIFont.systemFont(ofSize: 10)
+        contentReply.font = UIFont.systemFont(ofSize: 10 + offset())
         let message_text = dataMessages[indexPath.row]["message_text"]  as? String ?? ""
         let attachment_flag = dataMessages[indexPath.row]["attachment_flag"]  as? String ?? ""
         let thumb_chat = dataMessages[indexPath.row]["thumb_id"]  as? String ?? ""

+ 34 - 29
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -128,6 +128,11 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
     var timers: [IndexPath: Timer] = [:]
     var playingIndexPath: IndexPath?
     
+    func offset() -> CGFloat{
+        guard let fontSize = Int(SecureUserDefaults.shared.value(forKey: "font_size") ?? "0") else { return 0 }
+        return CGFloat(fontSize)
+    }
+    
     public override func viewDidDisappear(_ animated: Bool) {
         if self.isMovingFromParent {
             removeAllObjectBeforeDismissVC()
@@ -204,7 +209,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
         textFieldSend.tintColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
         textFieldSend.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
         textFieldSend.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
-        textFieldSend.font = UIFont.systemFont(ofSize: 12)
+        textFieldSend.font = UIFont.systemFont(ofSize: 12 + offset())
         textFieldSend.delegate = self
         textFieldSend.customDelegate = self
         textFieldSend.allowsEditingTextAttributes = true
@@ -715,7 +720,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
             labelChatbot.centerXAnchor.constraint(equalTo: containerChatbot.centerXAnchor),
         ])
         labelChatbot.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-        labelChatbot.font = UIFont.systemFont(ofSize: 12).bold
+        labelChatbot.font = UIFont.systemFont(ofSize: 12 + offset()).bold
         labelChatbot.text = "Interactive chatbot. Coming soon".localized()
     }
     
@@ -852,7 +857,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                 }
             }
             titleNavigation.textColor = .white
-            titleNavigation.font = UIFont.systemFont(ofSize: 12).bold
+            titleNavigation.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             navigationItem.titleView = viewAppBar
             titleText = titleNavigation.text
         } else {
@@ -1789,7 +1794,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
             labelDisable.centerXAnchor.constraint(equalTo: containerAction.centerXAnchor),
         ])
         labelDisable.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-        labelDisable.font = UIFont.systemFont(ofSize: 12).bold
+        labelDisable.font = UIFont.systemFont(ofSize: 12 + offset()).bold
         labelDisable.text = "Call center session is over".localized()
     }
     
@@ -1983,7 +1988,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                         labelUnfriend.centerXAnchor.constraint(equalTo: containerAction.centerXAnchor),
                     ])
                     labelUnfriend.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-                    labelUnfriend.font = UIFont.systemFont(ofSize: 12).bold
+                    labelUnfriend.font = UIFont.systemFont(ofSize: 12 + offset()).bold
                     labelUnfriend.text = "You have unfriended this user".localized()
                     NotificationCenter.default.post(name: NSNotification.Name(rawValue: "reloadTabChats"), object: nil, userInfo: nil)
                     if contactChatNav.viewIfLoaded?.window != nil {
@@ -2036,7 +2041,7 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
             labelBlocked.centerXAnchor.constraint(equalTo: containerAction.centerXAnchor),
         ])
         labelBlocked.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-        labelBlocked.font = UIFont.systemFont(ofSize: 12).bold
+        labelBlocked.font = UIFont.systemFont(ofSize: 12 + offset()).bold
         if blocked == "1" {
             labelBlocked.text = "You blocked this user".localized()
         } else {
@@ -3872,7 +3877,7 @@ extension EditorPersonal: UITextViewDelegate, CustomTextViewPasteDelegate {
         titlePreview.topAnchor.constraint(equalTo: self.containerLink.topAnchor, constant: 25.0).isActive = true
         titlePreview.trailingAnchor.constraint(equalTo: self.containerLink.trailingAnchor, constant: -80.0).isActive = true
         titlePreview.text = title
-        titlePreview.font = UIFont.systemFont(ofSize: 14.0, weight: .bold)
+        titlePreview.font = UIFont.systemFont(ofSize: 14.0 + offset(), weight: .bold)
         titlePreview.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
         
         let descPreview = UILabel()
@@ -3886,7 +3891,7 @@ extension EditorPersonal: UITextViewDelegate, CustomTextViewPasteDelegate {
         descPreview.topAnchor.constraint(equalTo: titlePreview.bottomAnchor).isActive = true
         descPreview.trailingAnchor.constraint(equalTo: self.containerLink.trailingAnchor, constant: -80.0).isActive = true
         descPreview.text = description
-        descPreview.font = UIFont.systemFont(ofSize: 12.0)
+        descPreview.font = UIFont.systemFont(ofSize: 12.0 + offset())
         descPreview.textColor = .gray
         descPreview.numberOfLines = 1
         
@@ -3901,7 +3906,7 @@ extension EditorPersonal: UITextViewDelegate, CustomTextViewPasteDelegate {
         linkPreview.topAnchor.constraint(equalTo: descPreview.bottomAnchor, constant: 8.0).isActive = true
         linkPreview.trailingAnchor.constraint(equalTo: self.containerLink.trailingAnchor, constant: -80.0).isActive = true
         linkPreview.text = stringURl
-        linkPreview.font = UIFont.systemFont(ofSize: 10.0)
+        linkPreview.font = UIFont.systemFont(ofSize: 10.0 + offset())
         linkPreview.textColor = .gray
         linkPreview.numberOfLines = 1
         
@@ -4375,7 +4380,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
             editTextView.tintColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
             editTextView.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
             editTextView.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
-            editTextView.font = UIFont.systemFont(ofSize: 12)
+            editTextView.font = UIFont.systemFont(ofSize: 12 + offset())
             editTextView.delegate = self
             editTextView.allowsEditingTextAttributes = true
             editTextView.backgroundColor = .clear
@@ -4456,7 +4461,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
             messageText.bottomAnchor.constraint(equalTo: viewMessage.bottomAnchor, constant: -15).isActive = true
             messageText.trailingAnchor.constraint(equalTo: viewMessage.trailingAnchor, constant: -15).isActive = true
             messageText.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-            messageText.font = .systemFont(ofSize: 12)
+            messageText.font = .systemFont(ofSize: 12 + offset())
             messageText.text = oldText
         }
         editVC.modalTransitionStyle = .crossDissolve
@@ -5251,7 +5256,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
         ])
         labelDate.textAlignment = .center
         labelDate.textColor = .secondaryColor
-        labelDate.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+        labelDate.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
         labelDate.text = dataDates[section]
         if listViewOnSection.count == 0 || listViewOnSection.count - 1 < section {
             listViewOnSection.append(containerView)
@@ -5337,7 +5342,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                 } else {
                     messageText.text = "Sorry, currently all our representatives are busy helping other customers. Do you want us to get back to you as soon as one of them is available?".localized()
                 }
-                messageText.font = UIFont.systemFont(ofSize: 14, weight: .medium)
+                messageText.font = UIFont.systemFont(ofSize: 14 + offset(), weight: .medium)
                 messageText.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
                 
 //                let date = Date()
@@ -5450,7 +5455,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                 messageWait.rightAnchor.constraint(equalTo: cell.contentView.rightAnchor, constant: -10).isActive = true
                 messageWait.text = dataMessages[indexPath.row]["category_cc"] as? String ?? dataMessages[indexPath.row]["message_text"] as? String ?? ""
                 messageWait.numberOfLines = 0
-                messageWait.font = UIFont.systemFont(ofSize: 12)
+                messageWait.font = UIFont.systemFont(ofSize: 12 + offset())
                 messageWait.textColor = .gray
                 messageWait.textAlignment = .center
             }
@@ -5507,7 +5512,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
             } else {
                 nameSender.topAnchor.constraint(equalTo: cell.contentView.topAnchor, constant: 5).isActive = true
             }
-            nameSender.font = UIFont.systemFont(ofSize: 12, weight: UIFont.Weight(800))
+            nameSender.font = UIFont.systemFont(ofSize: 12 + offset(), weight: UIFont.Weight(800))
             nameSender.text = user?.fullName ?? ""
             nameSender.textAlignment = .right
             if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
@@ -5662,7 +5667,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                 ])
                 labelNewMessages.textAlignment = .center
                 labelNewMessages.textColor = .secondaryColor
-                labelNewMessages.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+                labelNewMessages.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
                 labelNewMessages.text = "Unread Messages".localized()
                 
             } else {
@@ -5762,7 +5767,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
         if dataMessages[indexPath.row][TypeDataMessage.last_edit] != nil && dataMessages[indexPath.row][TypeDataMessage.last_edit] as! Int64 != 0 {
             let editedText = UILabel()
             editedText.text = "Edited".localized()
-            editedText.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+            editedText.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
             editedText.textColor = .lightGray
             cell.contentView.addSubview(editedText)
             editedText.translatesAutoresizingMaskIntoConstraints = false
@@ -5787,7 +5792,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
         messageText.translatesAutoresizingMaskIntoConstraints = false
         let topMarginText = messageText.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15)
         messageText.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
-        messageText.font = .systemFont(ofSize: 12)
+        messageText.font = .systemFont(ofSize: 12 + offset())
         if dataMessages[indexPath.row]["attachment_flag"] as? String == "27" || dataMessages[indexPath.row]["attachment_flag"] as? String == "26" ||
             dataMessages[indexPath.row]["attachment_flag"] as? String == "25" || dataMessages[indexPath.row]["message_scope_id"] as? String == "18" {
             messageText.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 85).isActive = true
@@ -5993,7 +5998,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                 timeMessage.text = formatter.string(from: date as Date)
                 timeMessage.textColor = .lightGray
             }
-            timeMessage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+            timeMessage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
         }
         
         let imageThumb = UIImageView()
@@ -6025,7 +6030,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
             
             let timeLabelAudio = UILabel()
             timeLabelAudio.text = "0:00"
-            timeLabelAudio.font = .systemFont(ofSize: 10)
+            timeLabelAudio.font = .systemFont(ofSize: 10 + offset())
             timeLabelAudio.textColor = .gray
             containerMessage.addSubview(timeLabelAudio)
             timeLabelAudio.anchor(top: playButtonAudio.bottomAnchor, left: playButtonAudio.rightAnchor, paddingLeft: 10, width: 100, height: 12)
@@ -6163,7 +6168,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                     formatter.locale = NSLocale(localeIdentifier: "id") as Locale?
                     timeInImage.text = formatter.string(from: date as Date)
                     timeInImage.textColor = .white
-                    timeInImage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+                    timeInImage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
                     
                     if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
                         let statusInImage = UIImageView()
@@ -6449,7 +6454,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
             nameFile.translatesAutoresizingMaskIntoConstraints = false
             nameFile.centerYAnchor.constraint(equalTo: containerViewFile.centerYAnchor).isActive = true
             nameFile.widthAnchor.constraint(lessThanOrEqualToConstant: 200).isActive = true
-            nameFile.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+            nameFile.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
             nameFile.textColor = .white
             nameFile.text = originalMessageText.components(separatedBy: "|")[0]
             
@@ -6554,7 +6559,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                         titlePreview.topAnchor.constraint(equalTo: containerLinkMessage.topAnchor, constant: 10.0).isActive = true
                         titlePreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -5.0).isActive = true
                         titlePreview.text = title
-                        titlePreview.font = UIFont.systemFont(ofSize: 14.0, weight: .bold)
+                        titlePreview.font = UIFont.systemFont(ofSize: 14.0 + offset(), weight: .bold)
                         titlePreview.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
                         
                         let descPreview = UILabel()
@@ -6568,7 +6573,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                         descPreview.topAnchor.constraint(equalTo: titlePreview.bottomAnchor).isActive = true
                         descPreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -5.0).isActive = true
                         descPreview.text = description
-                        descPreview.font = UIFont.systemFont(ofSize: 12.0)
+                        descPreview.font = UIFont.systemFont(ofSize: 12.0 + offset())
                         descPreview.textColor = .gray
                         descPreview.numberOfLines = 1
                         
@@ -6583,7 +6588,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                         linkPreview.topAnchor.constraint(equalTo: descPreview.bottomAnchor, constant: 8.0).isActive = true
                         linkPreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -5.0).isActive = true
                         linkPreview.text = link
-                        linkPreview.font = UIFont.systemFont(ofSize: 10.0)
+                        linkPreview.font = UIFont.systemFont(ofSize: 10.0 + offset())
                         linkPreview.textColor = .gray
                         linkPreview.numberOfLines = 1
                         
@@ -6703,7 +6708,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                 titleReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
                 titleReply.topAnchor.constraint(equalTo: containerReply.topAnchor, constant: 10).isActive = true
                 titleReply.trailingAnchor.constraint(lessThanOrEqualTo: containerReply.trailingAnchor, constant: -20).isActive = true
-                titleReply.font = UIFont.systemFont(ofSize: 12).bold
+                titleReply.font = UIFont.systemFont(ofSize: 12 + offset()).bold
                 if (data["f_pin"] as? String == idMe) {
                     titleReply.text = "You".localized()
                     if dataMessages[indexPath.row]["f_pin"] as? String == idMe {
@@ -6734,7 +6739,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
                 contentReply.translatesAutoresizingMaskIntoConstraints = false
                 contentReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
                 contentReply.bottomAnchor.constraint(equalTo: containerReply.bottomAnchor, constant: -10).isActive = true
-                contentReply.font = UIFont.systemFont(ofSize: 10)
+                contentReply.font = UIFont.systemFont(ofSize: 10 + offset())
                 let message_text = data["message_text"]  as? String ?? ""
                 let attachment_flag = data["attachment_flag"]  as? String ?? ""
                 let thumb_chat = data["thumb_id"]  as? String ?? ""
@@ -7586,7 +7591,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
         titleReply.translatesAutoresizingMaskIntoConstraints = false
         titleReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
         titleReply.topAnchor.constraint(equalTo: self.containerPreviewReply.topAnchor, constant: 10).isActive = true
-        titleReply.font = UIFont.systemFont(ofSize: 12).bold
+        titleReply.font = UIFont.systemFont(ofSize: 12 + offset()).bold
         let idMe = User.getMyPin() as String?
         if (dataMessages[indexPath.row]["f_pin"] as? String == idMe) {
             titleReply.text = "You".localized()
@@ -7605,7 +7610,7 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource, AVAudioPla
         contentReply.translatesAutoresizingMaskIntoConstraints = false
         contentReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
         contentReply.topAnchor.constraint(equalTo: titleReply.bottomAnchor).isActive = true
-        contentReply.font = UIFont.systemFont(ofSize: 10)
+        contentReply.font = UIFont.systemFont(ofSize: 10 + offset())
         let message_text = dataMessages[indexPath.row]["message_text"]  as? String ?? ""
         let attachment_flag = dataMessages[indexPath.row]["attachment_flag"]  as? String ?? ""
         let thumb_chat = dataMessages[indexPath.row]["thumb_id"]  as? String ?? ""

+ 14 - 9
NexilisLite/NexilisLite/Source/View/Chat/EditorStarMessages.swift

@@ -22,6 +22,11 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
     var showMenuContext = false
     var touchedSubview = UIView()
     var lastTouchPoint: CGPoint = .zero
+    
+    func offset() -> CGFloat{
+        guard let fontSize = Int(SecureUserDefaults.shared.value(forKey: "font_size") ?? "0") else { return 0 }
+        return CGFloat(fontSize)
+    }
 
     public override func viewDidLoad() {
         super.viewDidLoad()
@@ -120,7 +125,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
         ])
         labelDate.textAlignment = .center
         labelDate.textColor = .secondaryColor
-        labelDate.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+        labelDate.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
         labelDate.text = dataDates[section]
         return containerView
     }
@@ -234,7 +239,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
             nameSender.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15).isActive = true
             nameSender.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
             nameSender.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
-            nameSender.font = UIFont.systemFont(ofSize: 12).bold
+            nameSender.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             nameSender.text = dataProfile["name"]
             nameSender.textAlignment = .right
             if (dataMessages[indexPath.row]["attachment_flag"] as? String == "11" && dataMessages[indexPath.row]["reff_id"]as? String == "") {
@@ -296,7 +301,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
             nameSender.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15).isActive = true
             nameSender.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
             nameSender.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
-            nameSender.font = UIFont.systemFont(ofSize: 12).bold
+            nameSender.font = UIFont.systemFont(ofSize: 12 + offset()).bold
             nameSender.text = dataProfile["name"]
             nameSender.textAlignment = .left
             nameSender.textColor = .mainColor
@@ -395,7 +400,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
         } else {
             modifyText()
         }
-        messageText.font = UIFont.systemFont(ofSize: 12)
+        messageText.font = UIFont.systemFont(ofSize: 12 + offset())
         
         func modifyText() {
             if !textChat!.isEmpty {
@@ -436,7 +441,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
         formatter.dateFormat = "HH:mm"
         formatter.locale = NSLocale(localeIdentifier: "id") as Locale?
         timeMessage.text = formatter.string(from: date as Date)
-        timeMessage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+        timeMessage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
         timeMessage.textColor = .lightGray
         
         let thumbChat = dataMessages[indexPath.row]["thumb_id"] as! String
@@ -620,7 +625,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
             nameFile.translatesAutoresizingMaskIntoConstraints = false
             nameFile.centerYAnchor.constraint(equalTo: containerViewFile.centerYAnchor).isActive = true
             nameFile.widthAnchor.constraint(lessThanOrEqualToConstant: 200).isActive = true
-            nameFile.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+            nameFile.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
             nameFile.textColor = .white
             nameFile.text = textChat?.components(separatedBy: "|")[0]
             
@@ -725,7 +730,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                         titlePreview.topAnchor.constraint(equalTo: containerLinkMessage.topAnchor, constant: 25.0).isActive = true
                         titlePreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -80.0).isActive = true
                         titlePreview.text = title
-                        titlePreview.font = UIFont.systemFont(ofSize: 14.0, weight: .bold)
+                        titlePreview.font = UIFont.systemFont(ofSize: 14.0 + offset(), weight: .bold)
                         titlePreview.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
                         
                         let descPreview = UILabel()
@@ -739,7 +744,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                         descPreview.topAnchor.constraint(equalTo: titlePreview.bottomAnchor).isActive = true
                         descPreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -80.0).isActive = true
                         descPreview.text = description
-                        descPreview.font = UIFont.systemFont(ofSize: 12.0)
+                        descPreview.font = UIFont.systemFont(ofSize: 12.0 + offset())
                         descPreview.textColor = .gray
                         descPreview.numberOfLines = 1
                         
@@ -754,7 +759,7 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                         linkPreview.topAnchor.constraint(equalTo: descPreview.bottomAnchor, constant: 8.0).isActive = true
                         linkPreview.trailingAnchor.constraint(equalTo: containerLinkMessage.trailingAnchor, constant: -80.0).isActive = true
                         linkPreview.text = link
-                        linkPreview.font = UIFont.systemFont(ofSize: 10.0)
+                        linkPreview.font = UIFont.systemFont(ofSize: 10.0 + offset())
                         linkPreview.textColor = .gray
                         linkPreview.numberOfLines = 1
                         

+ 20 - 15
NexilisLite/NexilisLite/Source/View/Chat/MessageInfo.swift

@@ -18,6 +18,11 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
     var dataGroup: [String: Any?] = [:]
     var isPersonal = true
     let geocoder = CLGeocoder()
+    
+    func offset() -> CGFloat{
+        guard let fontSize = Int(SecureUserDefaults.shared.value(forKey: "font_size") ?? "0") else { return 0 }
+        return CGFloat(fontSize)
+    }
 
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -157,7 +162,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
         imageStatus.anchor(left: viewStatus.leftAnchor, bottom: viewStatus.bottomAnchor, paddingLeft: 15, paddingBottom: 5, width: 15, height: 15)
         
         let textStatus = UILabel()
-        textStatus.font = .systemFont(ofSize: 12)
+        textStatus.font = .systemFont(ofSize: 12 + offset())
         textStatus.textColor = .white
         viewStatus.addSubview(textStatus)
         textStatus.anchor(left: imageStatus.rightAnchor, bottom: viewStatus.bottomAnchor, paddingLeft: 5.0, paddingBottom: 5.0)
@@ -195,7 +200,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
             ])
             labelDate.textAlignment = .center
             labelDate.textColor = .secondaryColor
-            labelDate.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+            labelDate.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
             labelDate.text = dateMessage
             return containerView
         } else if section == 1 {
@@ -311,7 +316,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                             let titleTime = UILabel()
                             viewTimeStatus.addSubview(titleTime)
                             titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                            titleTime.font = .systemFont(ofSize: 12)
+                            titleTime.font = .systemFont(ofSize: 12 + offset())
                             titleTime.text = "\(chatDate(stringDate: dataStatusAck[indexPath.row]["time_ack"] as! String)) \(time)"
                             
                             cell.accessoryView = viewTimeStatus
@@ -342,7 +347,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                             let titleTime = UILabel()
                             viewTimeStatus.addSubview(titleTime)
                             titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                            titleTime.font = .systemFont(ofSize: 12)
+                            titleTime.font = .systemFont(ofSize: 12 + offset())
                             titleTime.text = "\(chatDate(stringDate: dataStatusRead[indexPath.row]["time_read"] as! String)) \(time)"
                             
                             cell.accessoryView = viewTimeStatus
@@ -374,7 +379,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                         let titleTime = UILabel()
                         viewTimeStatus.addSubview(titleTime)
                         titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                        titleTime.font = .systemFont(ofSize: 12)
+                        titleTime.font = .systemFont(ofSize: 12 + offset())
                         titleTime.text = "\(chatDate(stringDate: dataStatusRead[indexPath.row]["time_read"] as! String)) \(time)"
                         
                         cell.accessoryView = viewTimeStatus
@@ -405,7 +410,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                         let titleTime = UILabel()
                         viewTimeStatus.addSubview(titleTime)
                         titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                        titleTime.font = .systemFont(ofSize: 12)
+                        titleTime.font = .systemFont(ofSize: 12 + offset())
                         titleTime.text = "\(chatDate(stringDate: dataStatusDelivered[indexPath.row]["time_delivered"] as! String)) \(time)"
                         
                         cell.accessoryView = viewTimeStatus
@@ -419,7 +424,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
         if indexPath.row != 0 {
             cell.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .white
             var content = cell.defaultContentConfiguration()
-            content.textProperties.font = UIFont.systemFont(ofSize: 14)
+            content.textProperties.font = UIFont.systemFont(ofSize: 14 + offset())
             content.imageProperties.maximumSize = CGSize(width: 24, height: 24)
             
             let noStatus = UIImageView(frame: CGRect(x: 0, y: cell.frame.height / 2, width: 50, height: 20))
@@ -450,7 +455,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                             let titleTime = UILabel()
                             viewTimeStatus.addSubview(titleTime)
                             titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                            titleTime.font = .systemFont(ofSize: 12)
+                            titleTime.font = .systemFont(ofSize: 12 + offset())
                             titleTime.text = "\(chatDate(stringDate: dataStatus[0]["time_ack"] as! String)) \(time)"
                             
                             cell.accessoryView = viewTimeStatus
@@ -475,7 +480,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                             let titleTime = UILabel()
                             viewTimeStatus.addSubview(titleTime)
                             titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                            titleTime.font = .systemFont(ofSize: 12)
+                            titleTime.font = .systemFont(ofSize: 12 + offset())
                             titleTime.text = "\(chatDate(stringDate: dataStatus[0]["time_read"] as! String)) \(time)"
                             
                             cell.accessoryView = viewTimeStatus
@@ -501,7 +506,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                         let titleTime = UILabel()
                         viewTimeStatus.addSubview(titleTime)
                         titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                        titleTime.font = .systemFont(ofSize: 12)
+                        titleTime.font = .systemFont(ofSize: 12 + offset())
                         titleTime.text = "\(chatDate(stringDate: dataStatus[0]["time_read"] as! String)) \(time)"
                         
                         cell.accessoryView = viewTimeStatus
@@ -525,7 +530,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                     let titleTime = UILabel()
                     viewTimeStatus.addSubview(titleTime)
                     titleTime.anchor(centerX: viewTimeStatus.centerXAnchor, centerY: viewTimeStatus.centerYAnchor)
-                    titleTime.font = .systemFont(ofSize: 12)
+                    titleTime.font = .systemFont(ofSize: 12 + offset())
                     titleTime.text = "\(chatDate(stringDate: dataStatus[0]["time_delivered"] as! String)) \(time)"
                     
                     cell.accessoryView = viewTimeStatus
@@ -762,7 +767,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                 formatter.dateFormat = "HH:mm"
                 formatter.locale = NSLocale(localeIdentifier: "id") as Locale?
                 timeMessage.text = formatter.string(from: date as Date)
-                timeMessage.font = UIFont.systemFont(ofSize: 10, weight: .medium)
+                timeMessage.font = UIFont.systemFont(ofSize: 10 + offset(), weight: .medium)
                 timeMessage.textColor = .lightGray
             }
             
@@ -946,7 +951,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                 nameFile.translatesAutoresizingMaskIntoConstraints = false
                 nameFile.centerYAnchor.constraint(equalTo: containerViewFile.centerYAnchor).isActive = true
                 nameFile.widthAnchor.constraint(lessThanOrEqualToConstant: 200).isActive = true
-                nameFile.font = UIFont.systemFont(ofSize: 12, weight: .medium)
+                nameFile.font = UIFont.systemFont(ofSize: 12 + offset(), weight: .medium)
                 nameFile.textColor = .white
                 nameFile.text = textChat.components(separatedBy: "|")[0]
                 
@@ -1030,7 +1035,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                     titleReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
                     titleReply.topAnchor.constraint(equalTo: containerReply.topAnchor, constant: 10).isActive = true
                     titleReply.trailingAnchor.constraint(lessThanOrEqualTo: containerReply.trailingAnchor, constant: -20).isActive = true
-                    titleReply.font = UIFont.systemFont(ofSize: 12).bold
+                    titleReply.font = UIFont.systemFont(ofSize: 12 + offset()).bold
                     if (data["f_pin"] as? String == idMe) {
                         titleReply.text = "You".localized()
                         if data["f_pin"] as? String == idMe {
@@ -1053,7 +1058,7 @@ class MessageInfo: UIViewController, UITableViewDelegate, UITableViewDataSource,
                     contentReply.translatesAutoresizingMaskIntoConstraints = false
                     contentReply.leadingAnchor.constraint(equalTo: leftReply.leadingAnchor, constant: 10).isActive = true
                     contentReply.bottomAnchor.constraint(equalTo: containerReply.bottomAnchor, constant: -10).isActive = true
-                    contentReply.font = UIFont.systemFont(ofSize: 10)
+                    contentReply.font = UIFont.systemFont(ofSize: 10 + offset())
                     let message_text = data["message_text"] as! String
                     let attachment_flag = data["attachment_flag"] as! String
                     let thumb_chat = data["thumb_id"] as! String

+ 69 - 11
NexilisLite/NexilisLite/Source/View/Control/SettingTableViewController.swift

@@ -13,8 +13,11 @@ import Photos
 public class SettingTableViewController: UITableViewController, UIGestureRecognizerDelegate {
     
     var language: [[String: String]] = [["Indonesia": "id"],["English": "en"]]
+    var fontSizeSelection: [[String: String]] = [["Small": "0"],["Medium": "2"],["Large": "4"]]
     var alert: UIAlertController?
     var textFields = [UITextField]()
+    var languagePickerView = UIPickerView()
+    var fontSizePickerView = UIPickerView()
     
     var switchVibrateMode = UISwitch()
     var switchSaveToGallery = UISwitch()
@@ -103,6 +106,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
             Item.menus["Personal"] = [
                 Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                 Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                 Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Sign-Up/Sign-In".localized()),
             ]
         } else {
@@ -114,6 +118,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                             Item.menus["Personal"] = [
                                 Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                                 Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                                Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                                 Item(icon: UIImage(systemName: "lock"), title: "Secure Folder"),
 //                                Item(icon: UIImage(systemName: "person.crop.rectangle"), title: "Change Admin / Internal Password".localized()),
                                 Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Sign-In to Web".localized()),
@@ -124,6 +129,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                             Item.menus["Personal"] = [
                                 Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                                 Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                                Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                                 Item(icon: UIImage(systemName: "lock"), title: "Secure Folder"),
                                 Item(icon: UIImage(systemName: "laptopcomputer.and.iphone"), title: "Sign-In to Web".localized()),
                             ]
@@ -131,6 +137,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                             Item.menus["Personal"] = [
                                 Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                                     Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                                Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                                 Item(icon: UIImage(systemName: "lock"), title: "Secure Folder"),
 //                                Item(icon: UIImage(systemName: "person.badge.key"), title: "Access Admin / Internal Features".localized()),
                             ]
@@ -185,6 +192,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                         Item.menus["Personal"] = [
                             Item(icon: UIImage(systemName: "person"), title: "Personal Information".localized()),
                                 Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
+                            Item(icon: UIImage(systemName: "textformat.size"), title: "Change Font Size".localized()),
                             Item(icon: UIImage(systemName: "lock"), title: "Secure Folder"),
 //                            Item(icon: UIImage(systemName: "person.badge.key"), title: "Access Admin / Internal Features".localized()),
                         ]
@@ -344,6 +352,8 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                 cell.accessoryType = .disclosureIndicator
             case "Change Language".localized():
                 cell.accessoryType = .disclosureIndicator
+            case "Change Font Size".localized():
+                cell.accessoryType = .disclosureIndicator
             case "Set Internal Account".localized():
                 cell.accessoryType = .disclosureIndicator
             case "Set CS Account".localized():
@@ -468,21 +478,21 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
         } else if item.title == "Change Language".localized() {
             let vc = UIViewController()
             vc.preferredContentSize = CGSize(width: UIScreen.main.bounds.width - 10, height: 150)
-            let pickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 150))
-            pickerView.dataSource = self
-            pickerView.delegate = self
+            languagePickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 150))
+            languagePickerView.dataSource = self
+            languagePickerView.delegate = self
             
             let lang: String = SecureUserDefaults.shared.value(forKey: "i18n_language") ?? "en"
             var index = 1
             if lang == "id" {
                 index = 0
             }
-            pickerView.selectRow(index, inComponent: 0, animated: false)
+            languagePickerView.selectRow(index, inComponent: 0, animated: false)
             
-            vc.view.addSubview(pickerView)
-            pickerView.translatesAutoresizingMaskIntoConstraints = false
-            pickerView.centerXAnchor.constraint(equalTo: vc.view.centerXAnchor).isActive = true
-            pickerView.centerYAnchor.constraint(equalTo: vc.view.centerYAnchor).isActive = true
+            vc.view.addSubview(languagePickerView)
+            languagePickerView.translatesAutoresizingMaskIntoConstraints = false
+            languagePickerView.centerXAnchor.constraint(equalTo: vc.view.centerXAnchor).isActive = true
+            languagePickerView.centerYAnchor.constraint(equalTo: vc.view.centerYAnchor).isActive = true
             
             let alert = LibAlertController(title: "Select Language".localized(), message: "", preferredStyle: .actionSheet)
             
@@ -491,7 +501,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
             }))
             
             alert.addAction(UIAlertAction(title: "Select".localized(), style: .default, handler: { (UIAlertAction) in
-                let selectedIndex = pickerView.selectedRow(inComponent: 0)
+                let selectedIndex = self.languagePickerView.selectedRow(inComponent: 0)
                 let lang = self.language[selectedIndex].values.first
                 SecureUserDefaults.shared.set(lang, forKey: "i18n_language")
                 self.navigationController?.navigationBar.topItem?.title = "Settings".localized();
@@ -500,6 +510,44 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                 self.tableView.reloadData()
             }))
             self.present(alert, animated: true, completion: nil)
+        } else if item.title == "Change Font Size".localized() {
+            let vc = UIViewController()
+            vc.preferredContentSize = CGSize(width: UIScreen.main.bounds.width - 10, height: 150)
+            fontSizePickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 150))
+            fontSizePickerView.dataSource = self
+            fontSizePickerView.delegate = self
+            
+            let fontSize: String = SecureUserDefaults.shared.value(forKey: "font_size") ?? "0"
+            var index = 0
+            if fontSize == "2" {
+                index = 1
+            }
+            else if fontSize == "4"{
+                index = 2
+            }
+            fontSizePickerView.selectRow(index, inComponent: 0, animated: false)
+            
+            vc.view.addSubview(fontSizePickerView)
+            fontSizePickerView.translatesAutoresizingMaskIntoConstraints = false
+            fontSizePickerView.centerXAnchor.constraint(equalTo: vc.view.centerXAnchor).isActive = true
+            fontSizePickerView.centerYAnchor.constraint(equalTo: vc.view.centerYAnchor).isActive = true
+            
+            let alert = LibAlertController(title: "Select Font Size".localized(), message: "", preferredStyle: .actionSheet)
+            
+            alert.setValue(vc, forKey: "contentViewController")
+            alert.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel, handler: { (UIAlertAction) in
+            }))
+            
+            alert.addAction(UIAlertAction(title: "Select".localized(), style: .default, handler: { (UIAlertAction) in
+                let selectedIndex = self.fontSizePickerView.selectedRow(inComponent: 0)
+                let lang = self.fontSizeSelection[selectedIndex].values.first
+                SecureUserDefaults.shared.set(lang, forKey: "font_size")
+                self.navigationController?.navigationBar.topItem?.title = "Settings".localized();
+                self.navigationController?.navigationBar.setNeedsLayout()
+                self.makeMenu()
+                self.tableView.reloadData()
+            }))
+            self.present(alert, animated: true, completion: nil)
         } else if item.title == "Sign-In".localized() {
             let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeDevice") as! ChangeDeviceViewController
             controller.isDismiss = { newThumb in
@@ -1104,7 +1152,12 @@ extension SettingTableViewController: UIPickerViewDelegate, UIPickerViewDataSour
     }
     
     public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
-        return language.count
+        if pickerView == languagePickerView {
+            return language.count
+        }
+        else {
+            return fontSizeSelection.count
+        }
     }
     
     public func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
@@ -1113,7 +1166,12 @@ extension SettingTableViewController: UIPickerViewDelegate, UIPickerViewDataSour
     
     public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
         let label = UILabel(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width - 10, height: 30))
-        label.text = (language[row]).keys.first
+        if pickerView == languagePickerView {
+            label.text = (language[row]).keys.first
+        }
+        else {
+            label.text = (fontSizeSelection[row]).keys.first
+        }
         label.sizeToFit()
         return label
     }