alqindiirsyam před 2 roky
rodič
revize
407803705a

+ 19 - 2
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -1579,7 +1579,24 @@ extension EditorGroup: UIDocumentPickerDelegate, DocumentPickerDelegate, QLPrevi
 }
 
 extension EditorGroup: UITextViewDelegate {
-    public func textViewDidChange(_ textView: UITextView) {
+    public func textViewDidChangeSelection(_ textView: UITextView) {
+        let cursorPosition = textView.caretRect(for: self.textFieldSend.selectedTextRange!.start).origin
+        let currentLine = Int(cursorPosition.y / self.textFieldSend.font!.lineHeight)
+        UIView.animate(withDuration: 0.3) {
+            print("MEME \(self.heightTextFieldSend.constant)")
+            if self.heightTextFieldSend.constant < 95.0 && currentLine >= 4 {
+                self.heightTextFieldSend.constant = 95.0
+            }
+            if currentLine < 4 && self.heightTextFieldSend.constant < 95.0 {
+                if (self.textFieldSend.text.count > 0) {
+                    self.heightTextFieldSend.constant = self.textFieldSend.contentSize.height
+                }
+            }
+            let countBreakLine = textView.text.split(separator: "\n").count
+            if countBreakLine > 1 && self.heightTextFieldSend.constant != CGFloat(40 + (countBreakLine * 18)) {
+                self.heightTextFieldSend.constant = CGFloat(40 + (countBreakLine * 18))
+            }
+        }
         if allowTyping {
             allowTyping = false
             if dataTopic["chat_id"] as! String == "" {
@@ -1854,7 +1871,7 @@ extension EditorGroup: UITextViewDelegate {
                     }
                 }
             }
-            let countBreakLine = text.split(separator: "\n").count
+            let countBreakLine = textView.text.split(separator: "\n").count
             if countBreakLine > 1 && self.heightTextFieldSend.constant != CGFloat(40 + (countBreakLine * 18)) {
                 self.heightTextFieldSend.constant = CGFloat(40 + (countBreakLine * 18))
             }

+ 19 - 7
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -2846,7 +2846,24 @@ extension EditorPersonal: UIDocumentPickerDelegate, DocumentPickerDelegate, QLPr
 
 //ETV
 extension EditorPersonal: UITextViewDelegate {
-    public func textViewDidChange(_ textView: UITextView) {
+    public func textViewDidChangeSelection(_ textView: UITextView) {
+        let cursorPosition = textView.caretRect(for: self.textFieldSend.selectedTextRange!.start).origin
+        let currentLine = Int(cursorPosition.y / self.textFieldSend.font!.lineHeight)
+        UIView.animate(withDuration: 0.3) {
+            print("MEME \(self.heightTextFieldSend.constant)")
+            if self.heightTextFieldSend.constant < 95.0 && currentLine >= 4 {
+                self.heightTextFieldSend.constant = 95.0
+            }
+            if currentLine < 4 && self.heightTextFieldSend.constant < 95.0 {
+                if (self.textFieldSend.text.count > 0) {
+                    self.heightTextFieldSend.constant = self.textFieldSend.contentSize.height
+                }
+            }
+            let countBreakLine = textView.text.split(separator: "\n").count
+            if countBreakLine > 1 && self.heightTextFieldSend.constant != CGFloat(40 + (countBreakLine * 18)) {
+                self.heightTextFieldSend.constant = CGFloat(40 + (countBreakLine * 18))
+            }
+        }
         if allowTyping {
             allowTyping = false
             if isContactCenter && !fPinContacCenter.isEmpty {
@@ -3101,11 +3118,6 @@ extension EditorPersonal: UITextViewDelegate {
             if currentLine == 0 && text != "\n" {
                 self.heightTextFieldSend.constant = 40
             } else if currentLine < 4 {
-//                DispatchQueue.main.async {
-//                    if (self.currentIndexpath != nil) {
-//                        self.tableChatView.scrollToRow(at: IndexPath(row: self.currentIndexpath!.row, section: self.currentIndexpath!.section), at: .none, animated: false)
-//                    }
-//                }
                 if (text == "\n" && self.textFieldSend.text.count > 0) {
                     self.heightTextFieldSend.constant = self.textFieldSend.contentSize.height + 18
                 }
@@ -3123,7 +3135,7 @@ extension EditorPersonal: UITextViewDelegate {
                     }
                 }
             }
-            let countBreakLine = text.split(separator: "\n").count
+            let countBreakLine = textView.text.split(separator: "\n").count
             if countBreakLine > 1 && self.heightTextFieldSend.constant != CGFloat(40 + (countBreakLine * 18)) {
                 self.heightTextFieldSend.constant = CGFloat(40 + (countBreakLine * 18))
             }

+ 2 - 2
src/mainPalio4.py

@@ -239,7 +239,7 @@ def change_package(path_dest, package, enable_location):
             counter2 = 0
             for line in lines:
                 if "fordigisales1" in line:
-                    counter1 = 128
+                    counter1 = 132
                 elif "fordigisales2" in line:
                     counter2 = 27
                 elif counter1 > 0:
@@ -518,7 +518,7 @@ def change_fms_file(path_dest, fms_enable, package_id):
 def run_build(path_dest):
     gradlew = os.path.join(path_dest, "gradlew")
     error = ""
-    ret = subprocess.run([gradlew, 'assembleRelease'], capture_output=True)
+    ret = subprocess.run([gradlew, 'clean', 'assembleRelease'], capture_output=True)
     if ret.returncode == 0:
         ret = subprocess.run([gradlew, 'bundleRelease'], capture_output=True)
         if ret.returncode != 0: