|
@@ -145,109 +145,24 @@ public class FloatingButton: UIView {
|
|
getDefaultButton()
|
|
getDefaultButton()
|
|
} else {
|
|
} else {
|
|
for json in jsonArray {
|
|
for json in jsonArray {
|
|
- if (json["package_id"] as! String).contains("_fb1") {
|
|
|
|
- button_fb1 = UIButton()
|
|
|
|
- button_fb1.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- button_fb1.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async { [self] in
|
|
|
|
- if data != nil {
|
|
|
|
- button_fb1.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
|
|
+ let package_id = json["package_id"] as! String
|
|
|
|
+ let app_id = (json["app_id"] as? String) ?? ""
|
|
|
|
+ let icon = (json["icon"] as? String) ?? ""
|
|
|
|
+ let newButton = UIButton()
|
|
|
|
+ newButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
+ newButton.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
+ DispatchQueue.global().async {
|
|
|
|
+ let data = try? Data(contentsOf: URL(string: "http://\(Nexilis.ADDRESS)/filepalio/image/\(icon)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
+ DispatchQueue.main.async {
|
|
|
|
+ if data != nil {
|
|
|
|
+ newButton.setImage(UIImage(data: data!), for: .normal)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- groupView.addArrangedSubview(button_fb1)
|
|
|
|
- button_fb1.addTarget(self, action: #selector(fb1Tap), for: .touchUpOutside)
|
|
|
|
- } else if (json["package_id"] as! String).contains("_fb2") {
|
|
|
|
- button_fb2 = UIButton()
|
|
|
|
- button_fb2.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- button_fb2.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async { [self] in
|
|
|
|
- if data != nil {
|
|
|
|
- button_fb2.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- groupView.addArrangedSubview(button_fb2)
|
|
|
|
- button_fb2.addTarget(self, action: #selector(fb2Tap), for: .touchUpOutside)
|
|
|
|
- checkCounter()
|
|
|
|
- } else if (json["package_id"] as! String).contains("_fb3") {
|
|
|
|
- button_fb3 = UIButton()
|
|
|
|
- button_fb3.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- button_fb3.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async { [self] in
|
|
|
|
- if data != nil {
|
|
|
|
- button_fb3.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- groupView.addArrangedSubview(button_fb3)
|
|
|
|
- button_fb3.addTarget(self, action: #selector(fb3Tap), for: .touchUpOutside)
|
|
|
|
- } else if (json["package_id"] as! String).contains("_fb4") {
|
|
|
|
- button_fb4 = UIButton()
|
|
|
|
- button_fb4.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- button_fb4.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- iconCC = json["icon"] as! String
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async { [self] in
|
|
|
|
- if data != nil {
|
|
|
|
- button_fb4.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- groupView.addArrangedSubview(button_fb4)
|
|
|
|
- button_fb4.addTarget(self, action: #selector(fb4Tap), for: .touchUpOutside)
|
|
|
|
- } else if (json["package_id"] as! String).contains("_fb5") {
|
|
|
|
- let newButton = UIButton()
|
|
|
|
- newButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- newButton.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- if data != nil {
|
|
|
|
- newButton.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- groupView.addArrangedSubview(newButton)
|
|
|
|
- newButton.addTarget(self, action: #selector(bniBookingTap), for: .touchUpOutside)
|
|
|
|
- } else if (json["package_id"] as! String).contains("_fb6") {
|
|
|
|
- let newButton = UIButton()
|
|
|
|
- newButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- newButton.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- if data != nil {
|
|
|
|
- newButton.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- groupView.addArrangedSubview(newButton)
|
|
|
|
- newButton.addTarget(self, action: #selector(historyBroadcastTap), for: .touchUpOutside)
|
|
|
|
- } else {
|
|
|
|
- let newButton = UIButton()
|
|
|
|
- newButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
|
- newButton.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
- DispatchQueue.global().async {
|
|
|
|
- let data = try? Data(contentsOf: URL(string: "https://\(Nexilis.ADDRESS)/filepalio/image/\(json["icon"]!!)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- if data != nil {
|
|
|
|
- newButton.setImage(UIImage(data: data!), for: .normal)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- groupView.addArrangedSubview(newButton)
|
|
|
|
- newButton.restorationIdentifier = json["app_id"] as? String
|
|
|
|
- newButton.addTarget(self, action: #selector(tapMoreApp(_:)), for: .touchUpOutside)
|
|
|
|
}
|
|
}
|
|
|
|
+ groupView.addArrangedSubview(newButton)
|
|
|
|
+ newButton.restorationIdentifier = package_id
|
|
|
|
+ newButton.accessibilityIdentifier = app_id
|
|
|
|
+ newButton.addTarget(self, action: #selector(fbTap), for: .touchUpOutside)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let countSubviewsAfter = groupView.subviews.count
|
|
let countSubviewsAfter = groupView.subviews.count
|
|
@@ -397,348 +312,37 @@ public class FloatingButton: UIView {
|
|
show(isShow: !isShow)
|
|
show(isShow: !isShow)
|
|
}
|
|
}
|
|
|
|
|
|
- @objc func tapMoreApp(_ sender: UIButton) {
|
|
|
|
- let id = sender.restorationIdentifier
|
|
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if id == nil {
|
|
|
|
- return
|
|
|
|
|
|
+ @objc func fbTap(_ sender: UIButton) {
|
|
|
|
+ let package_id = sender.restorationIdentifier!
|
|
|
|
+ var app_id = sender.accessibilityIdentifier!
|
|
|
|
+ var indexTap = 0
|
|
|
|
+ if package_id.contains("_fb"){
|
|
|
|
+ indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
|
|
}
|
|
}
|
|
- if let url = URL(string: "itms-apps://apple.com/app/\(id!)") {
|
|
|
|
- UIApplication.shared.open(url)
|
|
|
|
|
|
+ if indexTap == 2 {
|
|
|
|
+ app_id = package_id.components(separatedBy: "_")[2]
|
|
}
|
|
}
|
|
|
|
+ Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
hideButton()
|
|
hideButton()
|
|
}
|
|
}
|
|
|
|
|
|
@objc func fb1Tap() {
|
|
@objc func fb1Tap() {
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let isWaitingRequestCC = UserDefaults.standard.bool(forKey: "waitingRequestCC")
|
|
|
|
- if isWaitingRequestCC {
|
|
|
|
- let imageView = UIImageView(image: UIImage(systemName: "info.circle"))
|
|
|
|
- imageView.tintColor = .white
|
|
|
|
- let banner = FloatingNotificationBanner(title: "You have requested Call Center, please wait for response.".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .info, colors: nil, iconPosition: .center)
|
|
|
|
- banner.show()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(identifier: "editorPersonalVC") as! EditorPersonal
|
|
|
|
- controller.isContactCenter = true
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
|
|
+ Nexilis.openContactCenter()
|
|
hideButton()
|
|
hideButton()
|
|
}
|
|
}
|
|
|
|
|
|
@objc func fb2Tap() {
|
|
@objc func fb2Tap() {
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "contactChatNav") as! UINavigationController
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
|
|
+ Nexilis.openChat()
|
|
hideButton()
|
|
hideButton()
|
|
}
|
|
}
|
|
|
|
|
|
@objc func fb3Tap() {
|
|
@objc func fb3Tap() {
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let callContact = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "contactSID")
|
|
|
|
- let navigationController = UINavigationController(rootViewController: callContact)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
|
|
+ Nexilis.openCall()
|
|
hideButton()
|
|
hideButton()
|
|
}
|
|
}
|
|
|
|
|
|
@objc func fb4Tap() {
|
|
@objc func fb4Tap() {
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let navigationController = UINavigationController(rootViewController: QmeraCreateStreamingViewController())
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @objc func bniBookingTap() {
|
|
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let controller = BNIBookingWebView()
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @objc func openCustomURL(url: String) {
|
|
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let controller = BNIBookingWebView()
|
|
|
|
- controller.customUrl = url
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @objc func historyBroadcastTap() {
|
|
|
|
- let isChangeProfile = Utils.getSetProfile()
|
|
|
|
- if !isChangeProfile {
|
|
|
|
- let alert = UIAlertController(title: "Change Profile".localized(), message: "You must change your name to use this feature".localized(), preferredStyle: .alert)
|
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {(_) in
|
|
|
|
- let controller = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "changeNS") as! ChangeNamePassswordViewController
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- }))
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
- hideButton()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let controller = HistoryBroadcastViewController()
|
|
|
|
- let navigationController = UINavigationController(rootViewController: controller)
|
|
|
|
- navigationController.modalPresentationStyle = .fullScreen
|
|
|
|
- navigationController.navigationBar.tintColor = .white
|
|
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
- navigationController.navigationBar.isTranslucent = false
|
|
|
|
- let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
|
|
- navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
- if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
|
|
- UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- } else {
|
|
|
|
- UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }
|
|
|
|
|
|
+ Nexilis.openStreaming()
|
|
hideButton()
|
|
hideButton()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -761,7 +365,7 @@ public class FloatingButton: UIView {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @objc func hideButton() {
|
|
|
|
|
|
+ @objc public func hideButton() {
|
|
if isShow {
|
|
if isShow {
|
|
show(isShow: false)
|
|
show(isShow: false)
|
|
}
|
|
}
|