|
@@ -147,6 +147,7 @@ public class EditorGroup: UIViewController {
|
|
viewButton.layer.shadowOpacity = 1
|
|
viewButton.layer.shadowOpacity = 1
|
|
viewButton.layer.shadowOffset = .zero
|
|
viewButton.layer.shadowOffset = .zero
|
|
viewButton.layer.shadowRadius = 3
|
|
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)
|
|
// 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)
|
|
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.layer.borderWidth = 1.0
|
|
textFieldSend.text = "Send message".localized()
|
|
textFieldSend.text = "Send message".localized()
|
|
textFieldSend.textColor = UIColor.lightGray
|
|
textFieldSend.textColor = UIColor.lightGray
|
|
|
|
+ textFieldSend.tintColor = self.traitCollection.userInterfaceStyle == .dark ? .white : .black
|
|
textFieldSend.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
|
|
textFieldSend.textContainerInset = UIEdgeInsets(top: 12, left: 20, bottom: 11, right: 40)
|
|
textFieldSend.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
|
|
textFieldSend.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.5).cgColor
|
|
textFieldSend.font = UIFont.systemFont(ofSize: 12)
|
|
textFieldSend.font = UIFont.systemFont(ofSize: 12)
|
|
textFieldSend.delegate = self
|
|
textFieldSend.delegate = self
|
|
|
|
+ textFieldSend.allowsEditingTextAttributes = true
|
|
|
|
|
|
navigationItem.rightBarButtonItem?.tintColor = UIColor.secondaryColor
|
|
navigationItem.rightBarButtonItem?.tintColor = UIColor.secondaryColor
|
|
|
|
|
|
@@ -2217,7 +2220,7 @@ extension EditorGroup: UITextViewDelegate {
|
|
public func textViewDidBeginEditing(_ textView: UITextView) {
|
|
public func textViewDidBeginEditing(_ textView: UITextView) {
|
|
if textView.textColor == UIColor.lightGray {
|
|
if textView.textColor == UIColor.lightGray {
|
|
textView.text = nil
|
|
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" {
|
|
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 {
|
|
if (dataMessages[indexPath!.row]["f_pin"] as! String) == idMe {
|
|
children.insert(info, at: children.count - 1)
|
|
children.insert(info, at: children.count - 1)
|
|
}
|
|
}
|
|
@@ -3439,10 +3442,10 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
|
|
nameSender.textAlignment = .right
|
|
nameSender.textAlignment = .right
|
|
if (dataMessages[indexPath.row]["attachment_flag"] as? String == "11" && dataMessages[indexPath.row]["reff_id"]as? String == "") {
|
|
if (dataMessages[indexPath.row]["attachment_flag"] as? String == "11" && dataMessages[indexPath.row]["reff_id"]as? String == "") {
|
|
containerMessage.backgroundColor = .clear
|
|
containerMessage.backgroundColor = .clear
|
|
- nameSender.textColor = .mainColor
|
|
|
|
|
|
+ nameSender.textColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .lightGray : .mainColor
|
|
} else {
|
|
} else {
|
|
containerMessage.backgroundColor = .blueBubbleColor
|
|
containerMessage.backgroundColor = .blueBubbleColor
|
|
- nameSender.textColor = .mainColor
|
|
|
|
|
|
+ nameSender.textColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .lightGray : .mainColor
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -3681,40 +3684,44 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
messageText.attributedText = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
|
|
messageText.attributedText = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
|
|
|
|
+ modifyText()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
messageText.attributedText = textChat!.richText(group_id: self.dataGroup["group_id"] as! String)
|
|
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)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|