From c6ff92e84b6cb2815cb98065ecb0ecf95d0689c3 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 15 一月 2020 09:42:29 +0800
Subject: [PATCH] 2020-01-15-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs |   64 ++++++++++++++-----------------
 1 files changed, 29 insertions(+), 35 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs
index 0f27e05..84aaeb7 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs
@@ -94,16 +94,43 @@
                 Text = "50",
             };
             middle.AddChidren(textBtn);
+            string s1 = "";
+            string s2 = "";
             textBox.TextChangeEventHandler += (sender, e) =>
             {
                 var leng = e.Length;
                 if (leng > 50)
                 {
                     var substring = e.Substring(0, 50);
-                    textBox.Text = substring;
+                    s1 = substring;
+                    if (s1 == s2)
+                    {
+                        s2 = s1;
+                    }
+                    else
+                    {
+                        if (s2 == "")
+                        {
+                            s2 = s1;
+                        }
+                        else
+                        {
+                            s1 = s2;
+                        }
+                    }
+                    textBox.Text = s2;
                 }
                 else
                 {
+                    if (leng == 50)
+                    {
+                        s2 = e.Substring(0, 50);
+                    }
+                    else
+                    {
+                        s1 = "";
+                        s2 = "";
+                    }
                     textBtn.Text = (50 - leng).ToString();
                 }
             };
@@ -141,40 +168,7 @@
              };
 
 
-            //var txtInput = new EditTextView();
-            //txtInput.Width = bodyFrameLayout.Width - ControlCommonResourse.XXLeft * 2;
-            //txtInput.Height = Application.GetRealHeight(470);
-            //txtInput.Y = Application.GetRealHeight(32);
-            //txtInput.TextAlignment = TextAlignment.TopLeft;
-            //txtInput.Gravity = Gravity.CenterHorizontal;
-            //txtInput.TextColor = UserCenterColor.Current.TextColor1;
-            //txtInput.PlaceholderTextColor = UserCenterColor.Current.TextGrayColor1;
-            //txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uYouSuggestionMsg);
-            //frameInput.AddChidren(txtInput);
-            //txtInput.TextChangeEventHandler += (sender, txtvalue) =>
-            //{
-            //    if (this.suggestionCount <= 0)
-            //    {
-            //        return;
-            //    }
-
-            //    int length = txtvalue.Length;
-            //    if (length > 500)
-            //    {
-            //        if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; }
-            //        btnFild.Text = "0";
-            //        return;
-            //    }
-            //    if (length == 0)
-            //    {
-            //        if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; }
-            //    }
-            //    else
-            //    {
-            //        if (btnSubmit.CanClick == false) { btnSubmit.CanClick = true; }
-            //    }
-            //    btnFild.Text = (500 - length).ToString();
-            //};
+        
 
         }
     }

--
Gitblit v1.8.0