Преглед на файлове

update menu configure floating button

alqindiirsyam преди 5 месеца
родител
ревизия
931da15ba7

+ 8 - 8
AppBuilder/AppBuilder/FourthTabViewController.swift

@@ -258,7 +258,7 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
         
         Item.menus["Config"] = [
             Item(icon: UIImage(systemName: "iphone"), title: "Create Your Own App".localized()),
-//            Item(icon: UIImage(systemName: "gearshape.circle"), title: "Configure Floating Button".localized())
+            Item(icon: UIImage(systemName: "gearshape.circle"), title: "Configure Floating Button".localized())
         ]
         if !isChangeProfile || Utils.getEnableMobileBuilder() != "1" {
             if Item.menus["Config"]!.count > 1 {
@@ -267,13 +267,13 @@ public class FourthTabViewController: UIViewController, UITableViewDelegate, UIT
                 Item.menus["Config"]!.removeAll()
             }
         }
-//        if !Nexilis.showButtonFB {
-//            if Item.menus["Config"]!.count > 1 {
-//                Item.menus["Config"]!.remove(at: 1)
-//            } else {
-//                Item.menus["Config"]!.removeAll()
-//            }
-//        }
+        if !Nexilis.showButtonFB || !Nexilis.checkingAccess(key: "can_config_fb") {
+            if Item.menus["Config"]!.count > 1 {
+                Item.menus["Config"]!.remove(at: 1)
+            } else {
+                Item.menus["Config"]!.removeAll()
+            }
+        }
         if Utils.getIsLoadThemeFromOther() {
             Item.menus["Config"]?.insert(Item(icon: UIImage(systemName: "iphone"), title: "Back to Company App".localized()), at: 1)
         }

+ 2 - 2
NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -510,7 +510,7 @@ public class Nexilis: NSObject {
     public static func checkingAccess(key: String) -> Bool {
         let dataAccess = Utils.getFeatureAccess()
         if dataAccess.isEmpty {
-            if key == "battery_optimization_force" || key == "backup_restore" || key == "check_sim_swap" || key == "admin_features" {
+            if key == "sms" || key == "email" || key == "whatsapp" || key == "battery_optimization_force" || key == "backup_restore" || key == "check_sim_swap" || key == "admin_features" || key == "can_config_fb" {
                 return false
             } else {
                 return true
@@ -519,7 +519,7 @@ public class Nexilis: NSObject {
             if jsonArray[key] != nil {
                 return jsonArray[key] as! String == "1"
             } else {
-                if key == "sms" || key == "email" || key == "whatsapp" || key == "battery_optimization_force" || key == "backup_restore" || key == "check_sim_swap" || key == "admin_features" {
+                if key == "sms" || key == "email" || key == "whatsapp" || key == "battery_optimization_force" || key == "backup_restore" || key == "check_sim_swap" || key == "admin_features" || key == "can_config_fb" {
                     return false
                 } else {
                     return true

+ 11 - 11
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -7806,17 +7806,17 @@ extension UITableView {
     
     func scrollToBottom(isAnimated:Bool = true){
         
-        DispatchQueue.main.asyncAfter(deadline: .now() + (isAnimated ? 0 : 0.6), execute: {
-            if self.numberOfSections == 0 {
-                return
-            }
-            let indexPath = IndexPath(
-                row: self.numberOfRows(inSection:  self.numberOfSections-1) - 1,
-                section: self.numberOfSections - 1)
-            if indexPath.row != -1 {
-                self.scrollToRow(at: indexPath, at: .bottom, animated: isAnimated)
-            }
-        })
+        DispatchQueue.main.asyncAfter(deadline: .now() + (isAnimated ? 0 : 0.6)) { [weak self] in
+            guard let self = self, self.numberOfSections > 0 else { return }
+            
+            let lastSection = self.numberOfSections - 1
+            let numberOfRows = self.numberOfRows(inSection: lastSection)
+            
+            guard numberOfRows > 0 else { return }
+            
+            let indexPath = IndexPath(row: numberOfRows - 1, section: lastSection)
+            self.scrollToRow(at: indexPath, at: .bottom, animated: isAnimated)
+        }
     }
     
     func scrollToTop(isAnimated:Bool = true) {

+ 8 - 8
NexilisLite/NexilisLite/Source/View/Control/SettingTableViewController.swift

@@ -226,7 +226,7 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
         
         Item.menus["Config"] = [
             Item(icon: UIImage(systemName: "iphone"), title: "Create Your Own App".localized()),
-//            Item(icon: UIImage(systemName: "gearshape.circle"), title: "Configure Floating Button".localized())
+            Item(icon: UIImage(systemName: "gearshape.circle"), title: "Configure Floating Button".localized())
         ]
         if !isChangeProfile || Utils.getEnableMobileBuilder() != "1" {
             if Item.menus["Config"]!.count > 1 {
@@ -235,13 +235,13 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                 Item.menus["Config"]!.removeAll()
             }
         }
-//        if !Nexilis.showButtonFB {
-//            if Item.menus["Config"]!.count > 1 {
-//                Item.menus["Config"]!.remove(at: 1)
-//            } else {
-//                Item.menus["Config"]!.removeAll()
-//            }
-//        }
+        if !Nexilis.showButtonFB || !Nexilis.checkingAccess(key: "can_config_fb") {
+            if Item.menus["Config"]!.count > 1 {
+                Item.menus["Config"]!.remove(at: 1)
+            } else {
+                Item.menus["Config"]!.removeAll()
+            }
+        }
         if Utils.getIsLoadThemeFromOther() {
             Item.menus["Config"]?.insert(Item(icon: UIImage(systemName: "iphone"), title: "Back to Company App".localized()), at: 1)
         }