From 9c6bd67d66859e48f0e794cd2746aef9310ce71d Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期五, 13 十二月 2019 18:01:37 +0800
Subject: [PATCH] 2019-12-13-2

---
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs |   60 +++++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index 3169618..7cf94cd 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -667,12 +667,11 @@
         /// <param name="sender">Sender.</param>
         /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
         private void AutomationBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
-        {
-            ///绗竴娆¤繘鏉ュ垵濮嬪寲璁惧鍒楄〃锛�
-            Common.Logic.LogicDviceList.Clear();
-            if (Common.Logic.LogicDviceList.Count == 0)
-            {
-                Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
+        {
+            Common.Logic.LogicDviceList.Clear();
+            if (Common.Logic.LogicDviceList.Count == 0)
+            {
+                Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
             }
             functionBtn.IsSelected = false;
             sceneBtn.IsSelected = false;
@@ -762,7 +761,6 @@
             {
                 HidenFloor(true);
                 ShowAutotion();
-
             }
         }
 
@@ -1524,8 +1522,6 @@
                         ShowSameTypeFunction(functionTypeIMG.ImageBtn, null);
                     }
                 }
-
-
             }
         }
 
@@ -1744,11 +1740,12 @@
         #endregion
 
         #region 鈼� 鑷姩鍖朹_________________________
+      
         /// <summary>
-        /// 鑷姩鍖�
+        /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
         /// </summary>
-        private async void ShowAutotion()
-        {
+        private  void ShowAutotion()
+        {
 
             functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             var bjFrameLayout = new FrameLayout
@@ -1761,7 +1758,7 @@
                 Y = Application.GetRealHeight(30),
             };
             functionSceneAutoBodyView.AddChidren(bjFrameLayout);
-            bjFrameLayout.SetCornerWithSameRadius(25, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft);
+            bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
             var sigBtn = new Button
             {
                 Width = Application.GetMinRealAverage(84),
@@ -1782,7 +1779,7 @@
                 TextID = MyInternationalizationString.logictemplate,
                 Gravity = Gravity.CenterVertical,
                 TextColor = ZigbeeColor.Current.LogicBtnSelectedColor,
-                TextSize=15,
+                TextSize = 15,
             };
             bjFrameLayout.AddChidren(recommendtextBtn);
 
@@ -1807,7 +1804,7 @@
             };
             functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
 
-            var logicScrolView = new VerticalScrolViewLayout
+            var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
             {
                 Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
@@ -1816,8 +1813,7 @@
                 Y = scenehorizontalScrol.Bottom,
             };
             functionSceneAutoBodyView.AddChidren(logicScrolView);
-            logicScrolView.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft);
-
+            logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
 
             recommendswitchBtn.MouseUpEventHandler += (sender, e) =>
             {
@@ -1908,14 +1904,31 @@
                 logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
                 Automationview(logicScrolView);
             };
+            logicScrolView.BeginHeaderRefreshingAction += () =>
+            {
+                //閲嶆柊鍒锋柊logic鍒楄〃
+                Common.Logic.LogicList.Clear();
+                Read(logicScrolView);
+                //鍏抽棴鍒锋柊View锛�
+                logicScrolView.EndHeaderRefreshing();
+            };
+           
+            Read(logicScrolView);
 
+        }
+        /// <summary>
+        /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱
+        /// </summary>
+        /// <param name="logicScrolView"></param>
+        private async void Read(VerticalRefreshLayout logicScrolView)
+        {
             CommonPage.Loading.Start();
             if (Common.Logic.LogicList.Count == 0)
             {
                 var Idlist = await Logic.Send.GetLogicId(0);
                 if (Idlist.Count != 0)
                 {
-                    var listlogic = await Logic.Send.ReadList(Idlist.Count,0);
+                    var listlogic = await Logic.Send.ReadList(Idlist.Count, 0);
                     //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆�
                     for (int j = 0; j < listlogic.Count; j++)
                     {
@@ -1934,10 +1947,10 @@
 
         }
         /// <summary>
-        /// 鑷姩鍖栧垪琛ㄧ晫闈�
+        /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
         /// </summary>
         /// <param name="refresview">Refresview.</param>
-        private async void Automationview(VerticalScrolViewLayout refresview)
+        private async void Automationview(VerticalRefreshLayout refresview)
         {
             refresview.RemoveAll();
             foreach (var logic in Common.Logic.LogicList)
@@ -1947,7 +1960,7 @@
                 var logicRowlayout = new RowLayout
                 {
                     Height = Application.GetRealHeight(190 + 30),
-                    Width = Application.GetRealWidth(1080),
+                    Width = Application.GetRealWidth(1080-58),
                     LineColor = ZigbeeColor.Current.LogicBackgroundColor,
                     BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                 };
@@ -2066,7 +2079,7 @@
 
         }
         /// <summary>
-        /// 鏄剧ず鍥炬爣鐨勯鑹�
+        /// 鏄剧ず鑷姩鍖栬緭鍑哄姛鑳芥ā鍧楀浘鏍囩殑棰滆壊
         /// </summary>
         /// <param name="logic"></param>
         /// <param name="logicRowlayout"></param>
@@ -2465,6 +2478,7 @@
                 }
             }
         }
+
         #endregion
 
         #region 鈼� 鎺у埗鐘舵�乢________________________
@@ -2539,6 +2553,6 @@
 
         #endregion
 
-
+   
     }
 }

--
Gitblit v1.8.0