|
@@ -103,9 +103,9 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
UIAction(title: "Call", handler: {[weak self](_) in
|
|
|
self?.callTap()
|
|
|
}),
|
|
|
-// UIAction(title: "New Post", handler: {[weak self](_) in
|
|
|
-//
|
|
|
-// }),
|
|
|
+ UIAction(title: "New Post", handler: {[weak self](_) in
|
|
|
+ self?.postTap()
|
|
|
+ }),
|
|
|
UIAction(title: "Live Streaming", handler: {[weak self](_) in
|
|
|
self?.streamTap()
|
|
|
}),
|
|
@@ -114,7 +114,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
// }),
|
|
|
]
|
|
|
let menu = UIMenu(title: "", children: childrenMenu)
|
|
|
- navigationItem.rightBarButtonItem = UIBarButtonItem(image: resizeImage(image: UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 25, height: 25)).withRenderingMode(.alwaysOriginal), primaryAction: .none, menu: menu)
|
|
|
+ navigationItem.rightBarButtonItem = UIBarButtonItem(image: resizeImage(image: UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 25, height: 25)).withRenderingMode(.alwaysOriginal), primaryAction: .none, menu: menu)
|
|
|
}
|
|
|
if((cpaasMode == PrefsUtil.CPAAS_MODE_DOCKED || cpaasMode == PrefsUtil.CPAAS_MODE_MIX)){
|
|
|
createMidFloatingButton()
|
|
@@ -267,17 +267,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
ViewController.streamingButton.addTarget(self, action: #selector(streamTap), for: .touchUpInside)
|
|
|
|
|
|
ViewController.postButton = UIButton(frame: CGRect(x: self.view.bounds.width / 2 - 30 , y: self.view.bounds.height - 80, width: 45, height: 45))
|
|
|
- ViewController.postButton.setBackgroundImage(UIImage(named: "pb_button_stream", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!.withRenderingMode(.alwaysOriginal), for: .normal)
|
|
|
+ ViewController.postButton.setBackgroundImage(UIImage(named: "pb_button_post", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!.withRenderingMode(.alwaysOriginal), for: .normal)
|
|
|
ViewController.postButton.layer.shadowColor = UIColor.black.cgColor
|
|
|
ViewController.postButton.layer.shadowOpacity = 0.1
|
|
|
ViewController.postButton.layer.shadowOffset = CGSize(width: 4, height: 4)
|
|
|
- ViewController.postButton.addTarget(self, action: #selector(streamTap), for: .touchUpInside)
|
|
|
+ ViewController.postButton.addTarget(self, action: #selector(postTap), for: .touchUpInside)
|
|
|
let buttonCenterX = self.view.bounds.width / 2
|
|
|
let buttonCenterY = self.view.bounds.height - self.tabBar.bounds.height
|
|
|
print("buttonCenterX \(buttonCenterX)")
|
|
|
print("buttonCenterY \(buttonCenterY)")
|
|
|
ViewController.middleButton = UIButton(frame: CGRect(x: buttonCenterX - 40 , y: buttonCenterY - 40, width: 80, height: 80))
|
|
|
- ViewController.middleButton.setBackgroundImage(UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
|
|
|
+ ViewController.middleButton.setBackgroundImage(UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
|
|
|
ViewController.middleButton.layer.shadowColor = UIColor.black.cgColor
|
|
|
ViewController.middleButton.layer.shadowOffset = CGSize(width: 0.0, height: 2.0)
|
|
|
ViewController.middleButton.layer.shadowOpacity = 1.0
|
|
@@ -321,7 +321,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
self?.callTap()
|
|
|
}),
|
|
|
UIAction(title: "New Post", handler: {[weak self](_) in
|
|
|
-
|
|
|
+ self?.postTap()
|
|
|
}),
|
|
|
UIAction(title: "Live Streaming", handler: {[weak self](_) in
|
|
|
self?.streamTap()
|
|
@@ -334,7 +334,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
childrenMenu.append(contentsOf: vc.childrenMenu)
|
|
|
}
|
|
|
let menu = UIMenu(title: "", children: childrenMenu)
|
|
|
- navigationItem.rightBarButtonItem = UIBarButtonItem(image: resizeImage(image: UIImage(named: "pb_ball", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 25, height: 25)).withRenderingMode(.alwaysOriginal), primaryAction: .none, menu: menu)
|
|
|
+ navigationItem.rightBarButtonItem = UIBarButtonItem(image: resizeImage(image: UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)!, targetSize: CGSize(width: 25, height: 25)).withRenderingMode(.alwaysOriginal), primaryAction: .none, menu: menu)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -356,17 +356,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @objc func qmeraLongPress() {
|
|
|
- let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "settingNav") 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
|
|
|
- UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
- }
|
|
|
+// @objc func qmeraLongPress() {
|
|
|
+// let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "settingNav") 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
|
|
|
+// UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
+// }
|
|
|
|
|
|
@objc func ccTap() {
|
|
|
print("ccTap")
|
|
@@ -403,7 +403,9 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if(ViewController.isExpandButton){
|
|
|
+ ViewController.expandButton()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@objc func streamTap() {
|
|
@@ -420,6 +422,9 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
navigationController.view.backgroundColor = .mainColor
|
|
|
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
}
|
|
|
+ if(ViewController.isExpandButton){
|
|
|
+ ViewController.expandButton()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@objc func callTap() {
|
|
@@ -437,6 +442,9 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
navigationController.view.backgroundColor = .mainColor
|
|
|
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
}
|
|
|
+ if(ViewController.isExpandButton){
|
|
|
+ ViewController.expandButton()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@objc func chatTap() {
|
|
@@ -453,18 +461,59 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
navigationController.view.backgroundColor = .mainColor
|
|
|
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
}
|
|
|
+ if(ViewController.isExpandButton){
|
|
|
+ ViewController.expandButton()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- @objc func settingTap() {
|
|
|
- let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "settingNav") 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
|
|
|
- UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
+// @objc func settingTap() {
|
|
|
+// let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "settingNav") 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
|
|
|
+// UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
+// }
|
|
|
+
|
|
|
+ @objc func postTap() {
|
|
|
+ if(ViewController.checkIsChangePerson()){
|
|
|
+ let customTab = PrefsUtil.getCustomTab().split(separator: ",")
|
|
|
+ let cpaasMode = PrefsUtil.getCpaasMode()
|
|
|
+ var i = 0
|
|
|
+ var j = 0
|
|
|
+ print("custom tab post tap = \(customTab)")
|
|
|
+ while j < customTab.count {
|
|
|
+ if(((i == 1 && customTab.count == 3) || i == 2) &&
|
|
|
+ (cpaasMode == PrefsUtil.CPAAS_MODE_DOCKED || cpaasMode == PrefsUtil.CPAAS_MODE_MIX)){
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if customTab[j] == "3" {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ j += 1
|
|
|
+ }
|
|
|
+ i += 1
|
|
|
+ }
|
|
|
+ if(j < customTab.count){
|
|
|
+ self.selectedIndex = i
|
|
|
+
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(1), execute: {
|
|
|
+ let me = UserDefaults.standard.string(forKey: "me")
|
|
|
+ let address = "https://qmera.io/nexilis/pages/tab5-new-post?f_pin=\(me ?? "")"
|
|
|
+ if let url = URL(string: address){
|
|
|
+ self.thirdTab?.webView.evaluateJavaScript("window.location = '\(address)'")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ViewController.isExpandButton){
|
|
|
+ ViewController.expandButton()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static func showDockedButton() {
|
|
@@ -484,6 +533,10 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
}
|
|
|
|
|
|
public static func expandButton() {
|
|
|
+ let cpaasMode = PrefsUtil.getCpaasMode()
|
|
|
+ if cpaasMode != PrefsUtil.CPAAS_MODE_DOCKED && cpaasMode != PrefsUtil.CPAAS_MODE_MIX {
|
|
|
+ return
|
|
|
+ }
|
|
|
if ViewController.alwaysHideButton && !ViewController.isExpandButton {
|
|
|
return
|
|
|
}
|