|
@@ -4342,19 +4342,19 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
|
|
let containerMessage = UIView()
|
|
let containerMessage = UIView()
|
|
cell.contentView.addSubview(containerMessage)
|
|
cell.contentView.addSubview(containerMessage)
|
|
containerMessage.translatesAutoresizingMaskIntoConstraints = false
|
|
containerMessage.translatesAutoresizingMaskIntoConstraints = false
|
|
- containerMessage.topAnchor.constraint(equalTo: cell.contentView.topAnchor, constant: 5).isActive = true
|
|
|
|
- containerMessage.leadingAnchor.constraint(equalTo: profileMessage.trailingAnchor, constant: 5).isActive = true
|
|
|
|
|
|
+ containerMessage.topAnchor.constraint(equalTo: profileMessage.bottomAnchor).isActive = true
|
|
|
|
+ containerMessage.leadingAnchor.constraint(equalTo: cell.contentView.leadingAnchor, constant: 5).isActive = true
|
|
containerMessage.trailingAnchor.constraint(lessThanOrEqualTo: cell.contentView.trailingAnchor, constant: -60).isActive = true
|
|
containerMessage.trailingAnchor.constraint(lessThanOrEqualTo: cell.contentView.trailingAnchor, constant: -60).isActive = true
|
|
containerMessage.widthAnchor.constraint(greaterThanOrEqualToConstant: 46).isActive = true
|
|
containerMessage.widthAnchor.constraint(greaterThanOrEqualToConstant: 46).isActive = true
|
|
- containerMessage.backgroundColor = .grayColor
|
|
|
|
- containerMessage.layer.cornerRadius = 10.0
|
|
|
|
- containerMessage.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMinYCorner, .layerMaxXMaxYCorner]
|
|
|
|
- containerMessage.clipsToBounds = true
|
|
|
|
|
|
+// containerMessage.backgroundColor = .grayColor
|
|
|
|
+// containerMessage.layer.cornerRadius = 10.0
|
|
|
|
+// containerMessage.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMinYCorner, .layerMaxXMaxYCorner]
|
|
|
|
+// containerMessage.clipsToBounds = true
|
|
|
|
|
|
- let timeMessage = UILabel()
|
|
|
|
- cell.contentView.addSubview(timeMessage)
|
|
|
|
- timeMessage.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- timeMessage.leadingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: 8).isActive = true
|
|
|
|
|
|
+// let timeMessage = UILabel()
|
|
|
|
+// cell.contentView.addSubview(timeMessage)
|
|
|
|
+// timeMessage.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
+// timeMessage.leadingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: 8).isActive = true
|
|
|
|
|
|
let messageText = UILabel()
|
|
let messageText = UILabel()
|
|
containerMessage.addSubview(messageText)
|
|
containerMessage.addSubview(messageText)
|
|
@@ -4362,13 +4362,13 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
|
|
messageText.numberOfLines = 0
|
|
messageText.numberOfLines = 0
|
|
messageText.lineBreakMode = .byWordWrapping
|
|
messageText.lineBreakMode = .byWordWrapping
|
|
containerMessage.addSubview(messageText)
|
|
containerMessage.addSubview(messageText)
|
|
- messageText.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 15).isActive = true
|
|
|
|
|
|
+ messageText.topAnchor.constraint(equalTo: containerMessage.topAnchor, constant: 5).isActive = true
|
|
messageText.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
|
|
messageText.leadingAnchor.constraint(equalTo: containerMessage.leadingAnchor, constant: 15).isActive = true
|
|
- messageText.bottomAnchor.constraint(equalTo: containerMessage.bottomAnchor, constant: -15).isActive = true
|
|
|
|
|
|
+ messageText.bottomAnchor.constraint(equalTo: containerMessage.bottomAnchor, constant: -5).isActive = true
|
|
messageText.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
|
|
messageText.trailingAnchor.constraint(equalTo: containerMessage.trailingAnchor, constant: -15).isActive = true
|
|
if category_cc[0].id.contains("level0_") || dataMessages[indexPath.row]["attachment_flag"] != nil && dataMessages[indexPath.row]["attachment_flag"] as! String == "503" {
|
|
if category_cc[0].id.contains("level0_") || dataMessages[indexPath.row]["attachment_flag"] != nil && dataMessages[indexPath.row]["attachment_flag"] as! String == "503" {
|
|
messageText.text = "Welcome to".localized() + " " + dataPerson["name"]!! + " " + "Contact Center".localized()
|
|
messageText.text = "Welcome to".localized() + " " + dataPerson["name"]!! + " " + "Contact Center".localized()
|
|
- // + "\n" + "\n" + "Please select the communication media do you want".localized()
|
|
|
|
|
|
+ + "\n" + "Please choose your desired communication method...".localized()
|
|
} else if category_cc[0].id.contains("level1_") {
|
|
} else if category_cc[0].id.contains("level1_") {
|
|
messageText.text = "Please select your Consultation Topic:".localized()
|
|
messageText.text = "Please select your Consultation Topic:".localized()
|
|
} else if !category_cc[0].id.contains("level1_") && dataMessages[indexPath.row]["attachment_flag"] == nil {
|
|
} else if !category_cc[0].id.contains("level1_") && dataMessages[indexPath.row]["attachment_flag"] == nil {
|
|
@@ -4378,35 +4378,35 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
|
|
} else {
|
|
} 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.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.italicSystemFont(ofSize: 12)
|
|
|
|
|
|
+ messageText.font = UIFont.boldSystemFont(ofSize: 14)
|
|
messageText.textColor = .black
|
|
messageText.textColor = .black
|
|
|
|
|
|
- let date = Date()
|
|
|
|
- let formatter = DateFormatter()
|
|
|
|
- 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.textColor = .lightGray
|
|
|
|
|
|
+// let date = Date()
|
|
|
|
+// let formatter = DateFormatter()
|
|
|
|
+// 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.textColor = .lightGray
|
|
|
|
|
|
let containerButton = UIView()
|
|
let containerButton = UIView()
|
|
cell.contentView.addSubview(containerButton)
|
|
cell.contentView.addSubview(containerButton)
|
|
containerButton.translatesAutoresizingMaskIntoConstraints = false
|
|
containerButton.translatesAutoresizingMaskIntoConstraints = false
|
|
containerButton.topAnchor.constraint(equalTo: containerMessage.bottomAnchor, constant: 5).isActive = true
|
|
containerButton.topAnchor.constraint(equalTo: containerMessage.bottomAnchor, constant: 5).isActive = true
|
|
containerButton.bottomAnchor.constraint(equalTo: cell.contentView.bottomAnchor, constant: -5).isActive = true
|
|
containerButton.bottomAnchor.constraint(equalTo: cell.contentView.bottomAnchor, constant: -5).isActive = true
|
|
- containerButton.leadingAnchor.constraint(equalTo: cell.contentView.leadingAnchor, constant: 55).isActive = true
|
|
|
|
- containerButton.widthAnchor.constraint(equalToConstant: self.view!.frame.size.width * 0.65).isActive = true
|
|
|
|
- containerButton.heightAnchor.constraint(greaterThanOrEqualToConstant: 45).isActive = true
|
|
|
|
|
|
+ containerButton.leadingAnchor.constraint(equalTo: cell.contentView.leadingAnchor, constant: 15).isActive = true
|
|
|
|
+ containerButton.widthAnchor.constraint(equalToConstant: self.view!.frame.size.width * 0.9).isActive = true
|
|
|
|
+ containerButton.heightAnchor.constraint(greaterThanOrEqualToConstant: 55).isActive = true
|
|
containerButton.backgroundColor = .clear
|
|
containerButton.backgroundColor = .clear
|
|
- timeMessage.bottomAnchor.constraint(equalTo:containerButton.topAnchor, constant: -5).isActive = true
|
|
|
|
|
|
+// timeMessage.bottomAnchor.constraint(equalTo:containerButton.topAnchor, constant: -5).isActive = true
|
|
|
|
|
|
|
|
|
|
for i in 0..<category_cc.count {
|
|
for i in 0..<category_cc.count {
|
|
- let buttonChat = UIButton()
|
|
|
|
|
|
+ let buttonChat = UIButton(type: .custom)
|
|
containerButton.addSubview(buttonChat)
|
|
containerButton.addSubview(buttonChat)
|
|
buttonChat.translatesAutoresizingMaskIntoConstraints = false
|
|
buttonChat.translatesAutoresizingMaskIntoConstraints = false
|
|
- buttonChat.widthAnchor.constraint(equalToConstant: self.view!.frame.size.width * 0.65 / 2 - 10).isActive = true
|
|
|
|
- buttonChat.heightAnchor.constraint(greaterThanOrEqualToConstant: 45).isActive = true
|
|
|
|
|
|
+ buttonChat.widthAnchor.constraint(equalToConstant: self.view!.frame.size.width * 0.9 / 2 - 10).isActive = true
|
|
|
|
+ buttonChat.heightAnchor.constraint(greaterThanOrEqualToConstant: 55).isActive = true
|
|
if i % 2 == 0 {
|
|
if i % 2 == 0 {
|
|
if i / 2 + 1 == 1 {
|
|
if i / 2 + 1 == 1 {
|
|
buttonChat.topAnchor.constraint(equalTo: containerButton.topAnchor, constant: 5).isActive = true
|
|
buttonChat.topAnchor.constraint(equalTo: containerButton.topAnchor, constant: 5).isActive = true
|
|
@@ -4444,13 +4444,37 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
|
|
if category_cc[i].isActive {
|
|
if category_cc[i].isActive {
|
|
buttonChat.backgroundColor = .orangeBNI
|
|
buttonChat.backgroundColor = .orangeBNI
|
|
}
|
|
}
|
|
- buttonChat.setTitle(category_cc[i].service_name.localized(), for: .normal)
|
|
|
|
- buttonChat.setTitleColor(.black, for: .normal)
|
|
|
|
- buttonChat.titleLabel?.font = UIFont.systemFont(ofSize: 12)
|
|
|
|
- buttonChat.titleLabel?.numberOfLines = 0
|
|
|
|
- buttonChat.titleLabel?.textAlignment = .center
|
|
|
|
- buttonChat.layer.borderWidth = 1
|
|
|
|
- buttonChat.layer.borderColor = UIColor.lightGray.withAlphaComponent(0.3).cgColor
|
|
|
|
|
|
+ var nameImage = "pb_cc_bg_messaging"
|
|
|
|
+ if i == 1 {
|
|
|
|
+ nameImage = "pb_cc_bg_sms"
|
|
|
|
+ } else if i == 2 {
|
|
|
|
+ nameImage = "pb_cc_bg_voip"
|
|
|
|
+ } else if i == 3 {
|
|
|
|
+ nameImage = "pb_cc_bg_email"
|
|
|
|
+ } else if i == 4 {
|
|
|
|
+ nameImage = "pb_cc_bg_videocall"
|
|
|
|
+ } else if i == 5 {
|
|
|
|
+ nameImage = "pb_cc_bg_gsmcall"
|
|
|
|
+ } else if i == 6 {
|
|
|
|
+ nameImage = "pb_cc_bg_gptchatbot"
|
|
|
|
+ } else if i == 7 {
|
|
|
|
+ nameImage = "pb_cc_bg_whatsapp"
|
|
|
|
+ }
|
|
|
|
+ buttonChat.setImage(resizeImage(image: UIImage(named: nameImage, in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: self.view!.frame.size.width * 0.9 / 2 - 10, height: 55)), for: .normal)
|
|
|
|
+// buttonChat.setTitle(category_cc[i].service_name.localized(), for: .normal)
|
|
|
|
+// buttonChat.setTitleColor(.black, for: .normal)
|
|
|
|
+// buttonChat.setImage(resizeImage(image: UIImage(named: "pb_gpt_bot", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 30, height: 30)), for: .normal)
|
|
|
|
+// buttonChat.contentHorizontalAlignment = .left
|
|
|
|
+// buttonChat.imageEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 0) // Adjust left inset for the image
|
|
|
|
+// buttonChat.titleEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 0) // Adjust left inset for the title
|
|
|
|
+// buttonChat.titleLabel?.font = UIFont.boldSystemFont(ofSize: 12)
|
|
|
|
+// buttonChat.titleLabel?.numberOfLines = 0
|
|
|
|
+// buttonChat.layer.borderWidth = 2
|
|
|
|
+// buttonChat.layer.borderColor = UIColor.white.cgColor
|
|
|
|
+// buttonChat.backgroundColor = .grayColor
|
|
|
|
+// buttonChat.layer.cornerRadius = 8.0
|
|
|
|
+// buttonChat.clipsToBounds = true
|
|
|
|
+
|
|
buttonChat.restorationIdentifier = "\(category_cc[i].id),\(category_cc[i].service_id)"
|
|
buttonChat.restorationIdentifier = "\(category_cc[i].id),\(category_cc[i].service_id)"
|
|
if dataMessages[indexPath.row]["attachment_flag"] != nil {
|
|
if dataMessages[indexPath.row]["attachment_flag"] != nil {
|
|
buttonChat.tag = Int(dataMessages[indexPath.row]["attachment_flag"] as! String)!
|
|
buttonChat.tag = Int(dataMessages[indexPath.row]["attachment_flag"] as! String)!
|