alqindiirsyam пре 3 година
родитељ
комит
5e6f7222c8

+ 12 - 12
appbuilder-ios/AppBuilder/AppBuilder/SceneDelegate.swift

@@ -17,18 +17,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
         // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
         // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
         guard let _ = (scene as? UIWindowScene) else { return }
-    }
-
-    func sceneDidDisconnect(_ scene: UIScene) {
-        // Called as the scene is being released by the system.
-        // This occurs shortly after the scene enters the background, or when its session is discarded.
-        // Release any resources associated with this scene that can be re-created the next time the scene connects.
-        // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
-    }
-
-    func sceneDidBecomeActive(_ scene: UIScene) {
-        // Called when the scene has moved from an inactive state to an active state.
-        // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
         if let launchStoryboardName = InfoPList.launchStoryboardName,
                    let windowScene          = self.window?.windowScene
         {
@@ -64,6 +52,18 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
         }
     }
 
+    func sceneDidDisconnect(_ scene: UIScene) {
+        // Called as the scene is being released by the system.
+        // This occurs shortly after the scene enters the background, or when its session is discarded.
+        // Release any resources associated with this scene that can be re-created the next time the scene connects.
+        // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
+    }
+
+    func sceneDidBecomeActive(_ scene: UIScene) {
+        // Called when the scene has moved from an inactive state to an active state.
+        // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
+    }
+
     func sceneWillResignActive(_ scene: UIScene) {
         // Called when the scene will move from an active state to an inactive state.
         // This may occur due to temporary interruptions (ex. an incoming phone call).

+ 12 - 3
appbuilder-ios/AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -776,9 +776,18 @@ extension SecondTabViewController: UITableViewDelegate, UITableViewDataSource {
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 }
             } else {
-                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
-                    imageView.image = image
-                })
+                if PrefsUtil.getIconDock() != nil {
+                    let dataImage = try? Data(contentsOf: URL(string: PrefsUtil.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                    if dataImage != nil {
+                        getImage(name: data.profile, placeholderImage: UIImage(data: dataImage!), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                            imageView.image = image
+                        })
+                    }
+                } else {
+                    getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                        imageView.image = image
+                    })
+                }
             }
             let titleView = UILabel()
             content.addSubview(titleView)

Разлика између датотеке није приказан због своје велике величине
+ 541 - 300
appbuilder-ios/NexilisLite/Nexilis.swift


+ 8 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -2427,7 +2427,14 @@ extension Nexilis: MessageDelegate {
                     floating.transparency = 0.9
                     
                     if threadIdentifier == "-999" {
-                        profileImage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                        if Utils.getIconDock() != nil {
+                            let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                            if dataImage != nil {
+                                profileImage.image = UIImage(data: dataImage!)
+                            }
+                        } else {
+                            profileImage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                        }
                     } else if profile != "" {
                         profileImage.circle()
                         do {

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

@@ -104,6 +104,17 @@ public final class Utils {
         }
     }
     
+    static func getURLBase() -> String? {
+        return UserDefaults.standard.string(forKey: "app_builder_url_base")
+    }
+    
+    static func getIconDock() -> String? {
+        return UserDefaults.standard.string(forKey: "app_builder_icon_dock")
+    }
+    
+    static func getUrlDock() -> String? {
+        return Utils.getURLBase()! + "dashboardv2/uploads/fb_icon/" + Utils.getIconDock()!
+    }
 }
 public extension UIImage {
     var jpeg: Data? { jpegData(compressionQuality: 1) }  // QUALITY min = 0 / max = 1

+ 8 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -2597,7 +2597,14 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
             
             let pictureImage = dataProfile["image_id"]
             if dataMessages[indexPath.row]["f_pin"] as? String == "-999" {
-                profileMessage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                if Utils.getIconDock() != nil {
+                    let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                    if dataImage != nil {
+                        profileMessage.image = UIImage(data: dataImage!)
+                    }
+                } else {
+                    profileMessage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                }
                 profileMessage.contentMode = .scaleAspectFill
             }
             else if (pictureImage != "" && pictureImage != nil) {

+ 8 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -627,7 +627,14 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
             }
         } else if dataPerson["f_pin"]!! == "-999" {
             viewAppBar.addSubview(imageProfile)
-            imageProfile.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+            if Utils.getIconDock() != nil {
+                let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                if dataImage != nil {
+                    imageProfile.image = UIImage(data: dataImage!)
+                }
+            } else {
+                imageProfile.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+            }
             imageProfile.contentMode = .scaleAspectFit
         }
         else if (pictureImage != "" && pictureImage != nil) {

+ 8 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorStarMessages.swift

@@ -267,7 +267,14 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
             
             let pictureImage = dataProfile["image_id"]
             if dataMessages[indexPath.row]["f_pin"] as! String == "-999" {
-                profileMessage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                if Utils.getIconDock() != nil {
+                    let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                    if dataImage != nil {
+                        profileMessage.image = UIImage(data: dataImage!)
+                    }
+                } else {
+                    profileMessage.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
+                }
                 profileMessage.contentMode = .scaleAspectFit
             }
             if (pictureImage != "" && pictureImage != nil) {

+ 12 - 3
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -683,9 +683,18 @@ extension ContactChatViewController {
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 }
             } else {
-                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
-                    imageView.image = image
-                })
+                if Utils.getIconDock() != nil {
+                    let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                    if dataImage != nil {
+                        getImage(name: data.profile, placeholderImage: UIImage(data: dataImage!), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                            imageView.image = image
+                        })
+                    }
+                } else {
+                    getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                        imageView.image = image
+                    })
+                }
             }
             let titleView = UILabel()
             content.addSubview(titleView)

+ 17 - 5
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/HistoryBroadcastViewController.swift

@@ -141,12 +141,24 @@ class HistoryBroadcastViewController: UIViewController, UITableViewDelegate, UIT
                     imageView.image = UIImage(named: "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
                 }
             } else {
-                getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
-                    imageView.image = image
-                    if !result {
-                        imageView.tintColor = .mainColor
+                if Utils.getIconDock() != nil {
+                    let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                    if dataImage != nil {
+                        getImage(name: data.profile, placeholderImage: UIImage(data: dataImage!), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                            imageView.image = image
+                            if !result {
+                                imageView.tintColor = .mainColor
+                            }
+                        })
                     }
-                })
+                } else {
+                    getImage(name: data.profile, placeholderImage: UIImage(named: data.pin == "-999" ? "pb_button" : "Conversation---Purple", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), isCircle: true, tableView: tableView, indexPath: indexPath, completion: { result, isDownloaded, image in
+                        imageView.image = image
+                        if !result {
+                            imageView.tintColor = .mainColor
+                        }
+                    })
+                }
             }
             let titleView = UILabel()
             content.addSubview(titleView)

Неке датотеке нису приказане због велике количине промена