alqindiirsyam 1 year ago
parent
commit
bc7c243c98

+ 1 - 1
appbuilder-ios/AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -150,7 +150,6 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         tapGesture.cancelsTouchesInView = false
         tapGesture.delegate = self
         self.view.addGestureRecognizer(tapGesture)
-        getData()
     }
     
     @objc func collapseDocked() {
@@ -331,6 +330,7 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
                 }
             }
         })
+        getData()
         DispatchQueue.global().async {
             self.getOpenGroups(listGroups: self.groups, completion: { g in
                 DispatchQueue.main.async {

+ 2 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Extension.swift

@@ -400,7 +400,7 @@ extension UIColor {
     }
     
     public static var mentionColor: UIColor {
-        return renderColor(hex: "#53bdea")
+        return UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? renderColor(hex: "#f6fcae") : renderColor(hex: "#53bdea")
     }
     
     public static var blueBubbleColor: UIColor {
@@ -662,6 +662,7 @@ extension String {
         let boldItalicFont = UIFont.systemFont(ofSize: 12, weight: .semibold)
         let textUTF8 = String(self.utf8)
         let finalText = NSMutableAttributedString(string: textUTF8, attributes: [NSAttributedString.Key.font: font])
+        finalText.addAttribute(.foregroundColor, value: UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? UIColor.white : UIColor.black, range: NSRange(location: 0, length: finalText.string.count))
         let boldSign: Character = "*"
         let italicSign: Character = "_"
         let underlineSign: Character = "^"

+ 10 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Call/AudioViewController.swift

@@ -221,11 +221,21 @@ extension UINavigationController {
             navigationBar.backgroundColor = .clear
             navigationBar.shadowImage = UIImage()
             navigationBar.isTranslucent = true
+            let navBarAppearance = UINavigationBarAppearance()
+            navBarAppearance.configureWithOpaqueBackground()
+            navBarAppearance.backgroundColor = .clear
+            navigationBar.standardAppearance = navBarAppearance
+            navigationBar.scrollEdgeAppearance = navBarAppearance
         } else {
             navigationBar.setBackgroundImage(nil, for: .default)
             navigationBar.backgroundColor = .clear
             navigationBar.shadowImage = nil
             navigationBar.isTranslucent = false
+            let navBarAppearance = UINavigationBarAppearance()
+            navBarAppearance.configureWithOpaqueBackground()
+            navBarAppearance.backgroundColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : UIColor.mainColor
+            navigationBar.standardAppearance = navBarAppearance
+            navigationBar.scrollEdgeAppearance = navBarAppearance
         }
     }
 }

+ 36 - 29
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -147,6 +147,7 @@ public class EditorGroup: UIViewController {
         viewButton.layer.shadowOpacity = 1
         viewButton.layer.shadowOffset = .zero
         viewButton.layer.shadowRadius = 3
+        viewButton.addTopBorder(with: UIColor.lightGray, andWidth: 1.0)
         
 //        buttonVoice.setImage(resizeImage(image: UIImage(named: "Voice-Record", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)), for: .normal)
         buttonSendImage.setImage(resizeImage(image: UIImage(named: "Send-Image", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)).withTintColor(self.traitCollection.userInterfaceStyle == .dark ? .white : .mainColor), for: .normal)
@@ -167,10 +168,12 @@ public class EditorGroup: UIViewController {
         textFieldSend.layer.borderWidth = 1.0
         textFieldSend.text = "Send message".localized()
         textFieldSend.textColor = UIColor.lightGray
+        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.delegate = self
+        textFieldSend.allowsEditingTextAttributes = true
         
         navigationItem.rightBarButtonItem?.tintColor = UIColor.secondaryColor
         
@@ -2217,7 +2220,7 @@ extension EditorGroup: UITextViewDelegate {
     public func textViewDidBeginEditing(_ textView: UITextView) {
         if textView.textColor == UIColor.lightGray {
             textView.text = nil
-            textView.textColor = UIColor.black
+            textView.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white : UIColor.black
         }
     }
     
@@ -2517,7 +2520,7 @@ extension EditorGroup: UIContextMenuInteractionDelegate {
             }
         }
         else if !(dataMessages[indexPath!.row]["image_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["video_id"] as! String).isEmpty || !(dataMessages[indexPath!.row]["file_id"] as! String).isEmpty || dataMessages[indexPath!.row]["attachment_flag"] as! String == "11" {
-            children = [star, reply, forward ,delete]
+            children = [reply ,delete]
             if (dataMessages[indexPath!.row]["f_pin"] as! String) == idMe {
                 children.insert(info, at: children.count - 1)
             }
@@ -3439,10 +3442,10 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
             nameSender.textAlignment = .right
             if (dataMessages[indexPath.row]["attachment_flag"] as? String == "11" && dataMessages[indexPath.row]["reff_id"]as? String == "") {
                 containerMessage.backgroundColor = .clear
-                nameSender.textColor = .mainColor
+                nameSender.textColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .lightGray : .mainColor
             } else {
                 containerMessage.backgroundColor = .blueBubbleColor
-                nameSender.textColor = .mainColor
+                nameSender.textColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .lightGray : .mainColor
             }
             
         } else {
@@ -3681,40 +3684,44 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
             }
             else {
                 messageText.attributedText = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
+                modifyText()
             }
         } else {
             messageText.attributedText = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
+            modifyText()
         }
         
-        messageText.isUserInteractionEnabled = false
-        if !textChat!.isEmpty {
-            if textChat!.contains("■"){
-                textChat = textChat!.components(separatedBy: "■")[0]
-                textChat = textChat!.trimmingCharacters(in: .whitespacesAndNewlines)
-            }
-            let listTextEnter = textChat!.split(separator: "\n")
-            let finalAtribute = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
-            var containsLink = false
-            for j in 0...listTextEnter.count - 1 {
-                let listText = listTextEnter[j].split(separator: " ")
-                if listText.count > 0 {
-                    for i in 0...listText.count - 1 {
-                        if listText[i].lowercased().checkStartWithLink() {
-                            let rangeTapLink = (finalAtribute.string as NSString).range(of: String(listText[i]))
-                            finalAtribute.addAttributes([.foregroundColor: UIColor.blue, .underlineStyle: NSUnderlineStyle.single.rawValue], range: rangeTapLink)
-                            if !containsLink {
-                                containsLink = true
+        func modifyText() {
+            messageText.isUserInteractionEnabled = false
+            if !textChat!.isEmpty {
+                if textChat!.contains("■"){
+                    textChat = textChat!.components(separatedBy: "■")[0]
+                    textChat = textChat!.trimmingCharacters(in: .whitespacesAndNewlines)
+                }
+                let listTextEnter = textChat!.split(separator: "\n")
+                let finalAtribute = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
+                var containsLink = false
+                for j in 0...listTextEnter.count - 1 {
+                    let listText = listTextEnter[j].split(separator: " ")
+                    if listText.count > 0 {
+                        for i in 0...listText.count - 1 {
+                            if listText[i].lowercased().checkStartWithLink() {
+                                let rangeTapLink = (finalAtribute.string as NSString).range(of: String(listText[i]))
+                                finalAtribute.addAttributes([.foregroundColor: UIColor.blue, .underlineStyle: NSUnderlineStyle.single.rawValue], range: rangeTapLink)
+                                if !containsLink {
+                                    containsLink = true
+                                }
                             }
                         }
                     }
                 }
-            }
-            messageText.attributedText = finalAtribute
-            if containsLink && !copySession && !forwardSession && !deleteSession && !self.removed {
-                messageText.isUserInteractionEnabled = true
-                let longPress = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPressLink(_:)))
-                longPress.minimumPressDuration = 0.1
-                containerMessage.addGestureRecognizer(longPress)
+                messageText.attributedText = finalAtribute
+                if containsLink && !copySession && !forwardSession && !deleteSession && !self.removed {
+                    messageText.isUserInteractionEnabled = true
+                    let longPress = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPressLink(_:)))
+                    longPress.minimumPressDuration = 0.1
+                    containerMessage.addGestureRecognizer(longPress)
+                }
             }
         }
         

+ 45 - 44
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -4973,25 +4973,22 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
             if attachmentFlag == "27" || attachmentFlag == "26" { // live streaming
                 let data = textChat
                 if let json = try! JSONSerialization.jsonObject(with: data.data(using: String.Encoding.utf8)!, options: []) as? [String: Any] {
-                    Database().database?.inTransaction({ fmdb, rollback in
-                        let title = json["title"] as? String ?? ""
-                        let description = json["description"] as? String ?? ""
-                        let start = json["time"] as? Int64 ?? 0
-                        let by = json["by"] as? String ?? ""
-                        let textLS = "Live Streaming".localized()
-                        var type = "*\(textLS)*"
-                        if attachmentFlag == "26" {
-                            let textSeminar = "Seminar".localized()
-                            type = "*\(textSeminar)*"
-                        }
-                        if let c = Database().getRecords(fmdb: fmdb, query: "select first_name || ' ' || last_name from BUDDY where f_pin = '\(by)'"), c.next() {
-                            let name = c.string(forColumnIndex: 0)!
-                            messageText.attributedText = "\(type) \nTitle: \(title) \nDescription: \(description) \nStart: \(Date(milliseconds: start).format(dateFormat: "dd/MM/yyyy HH:mm")) \nBroadcaster: \(name)".richText()
-                            c.close()
-                        } else {
-                            messageText.attributedText = ("\(type) \nTitle: \(title) \nDescription: \(description) \nStart: \(Date(milliseconds: start).format(dateFormat: "dd/MM/yyyy HH:mm"))").richText()
-                        }
-                    })
+                    let title = json["title"] as? String ?? ""
+                    let description = json["description"] as? String ?? ""
+                    let start = json["time"] as? Int64 ?? 0
+                    let by = json["by"] as? String ?? ""
+                    let textLS = "Live Streaming".localized()
+                    var type = "*\(textLS)*"
+                    if attachmentFlag == "26" {
+                        let textSeminar = "Seminar".localized()
+                        type = "*\(textSeminar)*"
+                    }
+                    if let c = User.getData(pin: by) {
+                        let name = c.fullName
+                        messageText.attributedText = "\(type) \nTitle: \(title) \nDescription: \(description) \nStart: \(Date(milliseconds: start).format(dateFormat: "dd/MM/yyyy HH:mm")) \nBroadcaster: \(name)".richText()
+                    } else {
+                        messageText.attributedText = ("\(type) \nTitle: \(title) \nDescription: \(description) \nStart: \(Date(milliseconds: start).format(dateFormat: "dd/MM/yyyy HH:mm"))").richText()
+                    }
                 }
             }
             else if attachmentFlag == "11" && (dataMessages[indexPath.row]["lock"] == nil || dataMessages[indexPath.row]["lock"] as! String != "1") && (dataMessages[indexPath.row]["lock"] as? String != "2") {
@@ -5023,40 +5020,44 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
             }
             else {
                 messageText.attributedText = textChat.richText()
+                modifyText()
             }
         } else {
             messageText.attributedText = textChat.richText()
+            modifyText()
         }
         
-        messageText.isUserInteractionEnabled = false
-        if !textChat.isEmpty {
-            if textChat.contains("■"){
-                textChat = textChat.components(separatedBy: "■")[0]
-                textChat = textChat.trimmingCharacters(in: .whitespacesAndNewlines)
-            }
-            let listTextEnter = textChat.split(separator: "\n")
-            let finalAtribute = textChat.richText()
-            var containsLink = false
-            for j in 0...listTextEnter.count - 1 {
-                let listText = listTextEnter[j].split(separator: " ")
-                if listText.count > 0 {
-                    for i in 0...listText.count - 1 {
-                        if listText[i].lowercased().checkStartWithLink() {
-                            let rangeTapLink = (finalAtribute.string as NSString).range(of: String(listText[i]))
-                            finalAtribute.addAttributes([.foregroundColor: UIColor.blue, .underlineStyle: NSUnderlineStyle.single.rawValue], range: rangeTapLink)
-                            if !containsLink {
-                                containsLink = true
+        func modifyText() {
+            messageText.isUserInteractionEnabled = false
+            if !textChat.isEmpty {
+                if textChat.contains("■"){
+                    textChat = textChat.components(separatedBy: "■")[0]
+                    textChat = textChat.trimmingCharacters(in: .whitespacesAndNewlines)
+                }
+                let listTextEnter = textChat.split(separator: "\n")
+                let finalAtribute = textChat.richText()
+                var containsLink = false
+                for j in 0...listTextEnter.count - 1 {
+                    let listText = listTextEnter[j].split(separator: " ")
+                    if listText.count > 0 {
+                        for i in 0...listText.count - 1 {
+                            if listText[i].lowercased().checkStartWithLink() {
+                                let rangeTapLink = (finalAtribute.string as NSString).range(of: String(listText[i]))
+                                finalAtribute.addAttributes([.foregroundColor: UIColor.blue, .underlineStyle: NSUnderlineStyle.single.rawValue], range: rangeTapLink)
+                                if !containsLink {
+                                    containsLink = true
+                                }
                             }
                         }
                     }
                 }
-            }
-            messageText.attributedText = finalAtribute
-            if containsLink && !copySession && !forwardSession && !deleteSession && !self.removed {
-                messageText.isUserInteractionEnabled = true
-                let longPress = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPressLink(_:)))
-                longPress.minimumPressDuration = 0.1
-                containerMessage.addGestureRecognizer(longPress)
+                messageText.attributedText = finalAtribute
+                if containsLink && !copySession && !forwardSession && !deleteSession && !self.removed {
+                    messageText.isUserInteractionEnabled = true
+                    let longPress = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPressLink(_:)))
+                    longPress.minimumPressDuration = 0.1
+                    containerMessage.addGestureRecognizer(longPress)
+                }
             }
         }
         

+ 1 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/PreviewAttachmentImageVideo.swift

@@ -102,6 +102,7 @@ class PreviewAttachmentImageVideo: UIViewController, UIScrollViewDelegate, UITex
             
             textFieldSend.layer.cornerRadius = textFieldSend.maxCornerRadius()
             textFieldSend.layer.borderWidth = 1.0
+            textFieldSend.backgroundColor = .white.withAlphaComponent(0.5)
             if (currentTextTextField == "" || currentTextTextField == nil) {
                 textFieldSend.text = "Send message".localized()
                 textFieldSend.textColor = UIColor.lightGray

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ChangeDeviceViewController.swift

@@ -197,7 +197,7 @@ public class ChangeDeviceViewController: UIViewController {
             checkEmail(email: name)
             return
         }
-        if !name.matches("^[a-zA-Z ]*$") {
+        if !name.matches("^[a-zA-Z0-9 ]*$") {
             let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
             imageView.tintColor = .white
             let banner = FloatingNotificationBanner(title: "Contains prohibited characters. Only alphabetic characters are allowed.".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ChangeNamePassswordViewController.swift

@@ -84,7 +84,7 @@ public class ChangeNamePassswordViewController: UIViewController {
             banner.show()
             return
         }
-        if !name.matches("^[a-zA-Z ]*$") {
+        if !name.matches("^[a-zA-Z0-9 ]*$") {
             let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
             imageView.tintColor = .white
             let banner = FloatingNotificationBanner(title: "Contains prohibited characters. Only alphabetic characters are allowed.".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/SignUpSignIn.swift

@@ -229,7 +229,7 @@ public class SignUpSignIn: UIViewController {
             checkEmail(email: name)
             return
         }
-        if !name.matches("^[a-zA-Z ]*$") {
+        if !name.matches("^[a-zA-Z0-9 ]*$") { 
             let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
             imageView.tintColor = .white
             let banner = FloatingNotificationBanner(title: "Contains prohibited characters. Only alphabetic characters are allowed.".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Streaming/QmeraCreateStreamingViewController.swift

@@ -603,7 +603,7 @@ extension QmeraCreateStreamingViewController: UITextViewDelegate {
     public func textViewDidBeginEditing(_ textView: UITextView) {
         if textView.textColor == UIColor.lightGray {
             textView.text = nil
-            textView.textColor = UIColor.black
+            textView.textColor = self.traitCollection.userInterfaceStyle == .dark ? .white.withAlphaComponent(0.7) : .black
         }
     }