소스 검색

conditional bg item fb

alqindiirsyam 1 년 전
부모
커밋
3ecfcb029c

+ 7 - 5
appbuilder-ios/DigiXLite/DigiXLite/Source/FloatingButton/FloatingButton.swift

@@ -146,11 +146,13 @@ public class FloatingButton: UIView {
         
         scrollView = UIScrollView()
         scrollView.translatesAutoresizingMaskIntoConstraints = false
-//        scrollView.layer.borderWidth = 1.0
-//        scrollView.layer.borderColor = UIColor.white.cgColor
-//        scrollView.layer.cornerRadius = 8.0
-//        scrollView.layer.masksToBounds = true
-//        scrollView.backgroundColor = .black.withAlphaComponent(0.25)
+        if Utils.getFBItemBg() == "1" && Utils.getConfigModeFB() == MODE_VERTICAL_FLOATING_BUTTON {
+            scrollView.layer.borderWidth = 1.0
+            scrollView.layer.borderColor = UIColor.white.cgColor
+            scrollView.layer.cornerRadius = 8.0
+            scrollView.layer.masksToBounds = true
+            scrollView.backgroundColor = .black.withAlphaComponent(0.25)
+        }
         addSubview(scrollView)
         
         if Utils.getConfigModeFB() != MODE_HORIZONTAL_SIDE_TAB {

+ 6 - 0
appbuilder-ios/DigiXLite/DigiXLite/Source/IncomingThread.swift

@@ -250,6 +250,12 @@ class IncomingThread {
                     if json[CoreMessage_TMessageKey.KEY] as! String == "fb_floating_anim" {
                         Utils.setFloatingAnim(value: json[CoreMessage_TMessageKey.VALUE] as! String)
                     }
+                    if json[CoreMessage_TMessageKey.KEY] as! String == "fb_icon_with_bg" {
+                        Utils.setFBIconBg(value: json[CoreMessage_TMessageKey.VALUE] as! String)
+                    }
+                    if json[CoreMessage_TMessageKey.KEY] as! String == "fb_item_with_bg" {
+                        Utils.setFBItemBg(value: json[CoreMessage_TMessageKey.VALUE] as! String)
+                    }
                 }
                 Utils.setFinishInitPrefs(value: true)
             } else {

+ 16 - 0
appbuilder-ios/DigiXLite/DigiXLite/Source/Utils.swift

@@ -253,6 +253,22 @@ public final class Utils {
         return UserDefaults.standard.string(forKey: "fb_floating_anim") ?? "1~1"
     }
     
+    static func setFBIconBg(value: String){
+        UserDefaults.standard.set(value, forKey: "fb_icon_with_bg")
+    }
+    
+    static func getFBIconBg() -> String {
+        return UserDefaults.standard.string(forKey: "fb_icon_with_bg") ?? "1"
+    }
+    
+    static func setFBItemBg(value: String){
+        UserDefaults.standard.set(value, forKey: "fb_item_with_bg")
+    }
+    
+    static func getFBItemBg() -> String {
+        return UserDefaults.standard.string(forKey: "fb_item_with_bg") ?? "1"
+    }
+    
     public static var inTabChats = false
 }
 public extension UIImage {

+ 7 - 5
appbuilder-ios/NexilisLite/NexilisLite/Source/FloatingButton/FloatingButton.swift

@@ -146,11 +146,13 @@ public class FloatingButton: UIView {
         
         scrollView = UIScrollView()
         scrollView.translatesAutoresizingMaskIntoConstraints = false
-//        scrollView.layer.borderWidth = 1.0
-//        scrollView.layer.borderColor = UIColor.white.cgColor
-//        scrollView.layer.cornerRadius = 8.0
-//        scrollView.layer.masksToBounds = true
-//        scrollView.backgroundColor = .black.withAlphaComponent(0.25)
+        if Utils.getFBItemBg() == "1" && Utils.getConfigModeFB() == MODE_VERTICAL_FLOATING_BUTTON {
+            scrollView.layer.borderWidth = 1.0
+            scrollView.layer.borderColor = UIColor.white.cgColor
+            scrollView.layer.cornerRadius = 8.0
+            scrollView.layer.masksToBounds = true
+            scrollView.backgroundColor = .black.withAlphaComponent(0.25)
+        }
         addSubview(scrollView)
         
         if Utils.getConfigModeFB() != MODE_HORIZONTAL_SIDE_TAB {

+ 6 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/IncomingThread.swift

@@ -250,6 +250,12 @@ class IncomingThread {
                     if json[CoreMessage_TMessageKey.KEY] as! String == "fb_floating_anim" {
                         Utils.setFloatingAnim(value: json[CoreMessage_TMessageKey.VALUE] as! String)
                     }
+                    if json[CoreMessage_TMessageKey.KEY] as! String == "fb_icon_with_bg" {
+                        Utils.setFBIconBg(value: json[CoreMessage_TMessageKey.VALUE] as! String)
+                    }
+                    if json[CoreMessage_TMessageKey.KEY] as! String == "fb_item_with_bg" {
+                        Utils.setFBItemBg(value: json[CoreMessage_TMessageKey.VALUE] as! String)
+                    }
                 }
                 Utils.setFinishInitPrefs(value: true)
             } else {

+ 16 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/Utils.swift

@@ -253,6 +253,22 @@ public final class Utils {
         return UserDefaults.standard.string(forKey: "fb_floating_anim") ?? "1~1"
     }
     
+    static func setFBIconBg(value: String){
+        UserDefaults.standard.set(value, forKey: "fb_icon_with_bg")
+    }
+    
+    static func getFBIconBg() -> String {
+        return UserDefaults.standard.string(forKey: "fb_icon_with_bg") ?? "1"
+    }
+    
+    static func setFBItemBg(value: String){
+        UserDefaults.standard.set(value, forKey: "fb_item_with_bg")
+    }
+    
+    static func getFBItemBg() -> String {
+        return UserDefaults.standard.string(forKey: "fb_item_with_bg") ?? "1"
+    }
+    
     public static var inTabChats = false
 }
 public extension UIImage {