From 45d7c5536bd9b4516feb1401753e61717d7dd888 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 08 九月 2020 11:41:44 +0800
Subject: [PATCH] 2020-09-08 1.更新

---
 SmartHome/SmartHome/UI/SimpleControl/MainPage.cs |   72 +++++++++++++++++++++++++++--------
 1 files changed, 55 insertions(+), 17 deletions(-)

diff --git a/SmartHome/SmartHome/UI/SimpleControl/MainPage.cs b/SmartHome/SmartHome/UI/SimpleControl/MainPage.cs
index 9b0d536..1307ee2 100644
--- a/SmartHome/SmartHome/UI/SimpleControl/MainPage.cs
+++ b/SmartHome/SmartHome/UI/SimpleControl/MainPage.cs
@@ -48,9 +48,9 @@
         public static string sendTime = "";
         public static string recTime = "";
 #if wallon
-        public static string CodeIDString = "202005281";
+        public static string CodeIDString = "202006051";
 #else
-        public static string CodeIDString = "2.505281";
+        public static string CodeIDString = "2.506051";
 #endif
         public static UserInfo LoginUser;
         public static string RequestSource = "1"; //0:Zigbee銆�1:HdlOn銆�2:GraphicsMonitor銆�3:BusproSoft銆�4:AgentWeb
@@ -146,33 +146,69 @@
             }
         }
 
-        static Button btnTipMsg = new Button () {
-            Height = Application.GetRealHeight (126), BackgroundColor = SkinStyle.Current.AddTipButtonColor,
-            Y = Application.GetRealHeight(30),
-            TextAlignment = TextAlignment.Center,
-        };
+        static Button btnTipMsg;
 
         public static void AddTip (string tip, int time = 3000)
         {
+
             if (MainFrameLayout == null) {
                 return;
             }
             Application.RunOnMainThread (() => {
-                btnTipMsg.Text = tip;
-                MainFrameLayout.AddChidren (btnTipMsg);
-                btnTipMsg.MouseUpEventHandler += (sender, e) => {
-                    if (btnTipMsg.Parent != null)
-                        btnTipMsg.RemoveFromParent ();
-                };
-                System.Threading.Tasks.Task.Run (() => {
-                    System.Threading.Thread.Sleep (time);
-                    Application.RunOnMainThread (() => {
+                try {
+                    if (btnTipMsg == null) {
+                        btnTipMsg = new Button () {
+                            Height = Application.GetRealHeight (90),
+                            BackgroundColor = SkinStyle.Current.AddTipButtonColor,
+                            Y = Application.GetRealHeight (36),
+                            TextAlignment = TextAlignment.Center,
+                        };
+                    }
+
+                    btnTipMsg.Text = tip;
+                    MainFrameLayout.AddChidren (btnTipMsg);
+                    btnTipMsg.MouseUpEventHandler += (sender, e) => {
                         if (btnTipMsg.Parent != null)
                             btnTipMsg.RemoveFromParent ();
+                    };
+                    System.Threading.Tasks.Task.Run (() => {
+                        System.Threading.Thread.Sleep (time);
+                        Application.RunOnMainThread (() => {
+                            if (btnTipMsg.Parent != null)
+                                btnTipMsg.RemoveFromParent ();
+                        });
                     });
-                });
+                } catch { }
             });
         }
+
+        //static Button btnTipMsg = new Button () {
+        //    Height = Application.GetRealHeight (126), BackgroundColor = SkinStyle.Current.AddTipButtonColor,
+        //    Y = Application.GetRealHeight(30),
+        //    TextAlignment = TextAlignment.Center,
+        //};
+
+        //public static void AddTip (string tip, int time = 3000)
+        //{
+        //    if (MainFrameLayout == null) {
+        //        return;
+        //    }
+        //    Application.RunOnMainThread (() => {
+        //        btnTipMsg.Text = tip;
+        //        MainFrameLayout.AddChidren (btnTipMsg);
+        //        btnTipMsg.MouseUpEventHandler += (sender, e) => {
+        //            if (btnTipMsg.Parent != null)
+        //                btnTipMsg.RemoveFromParent ();
+        //        };
+        //        System.Threading.Tasks.Task.Run (() => {
+        //            System.Threading.Thread.Sleep (time);
+        //            Application.RunOnMainThread (() => {
+        //                if (btnTipMsg.Parent != null)
+        //                    btnTipMsg.RemoveFromParent ();
+        //            });
+        //        });
+        //    });
+        //}
 
         /// <summary>
         /// 璇锋眰鏈嶅姟鍣ㄦ柟娉�
@@ -282,6 +318,8 @@
 
         public static bool checeInternet ()
         {
+            return true;
+
             byte [] bytes = null;
             var dateTime = DateTime.Now;
             System.Threading.Tasks.Task.Run (() => {

--
Gitblit v1.8.0