From 163777d8a2cb7cfa469f54a7042528870ebc10a3 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 09 十二月 2019 17:46:20 +0800 Subject: [PATCH] 一个新版本 --- ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 44 ++++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs index 89cc2bb..4aaf309 100755 --- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs @@ -1742,11 +1742,11 @@ #endregion #region 鈼� 鑷姩鍖朹_________________________ - + /// <summary> - /// 鑷姩鍖� + /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙� /// </summary> - private async void ShowAutotion() + private void ShowAutotion() { functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; @@ -1760,7 +1760,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), @@ -1781,7 +1781,7 @@ TextID = MyInternationalizationString.logictemplate, Gravity = Gravity.CenterVertical, TextColor = ZigbeeColor.Current.LogicBtnSelectedColor, - TextSize=15, + TextSize = 15, }; bjFrameLayout.AddChidren(recommendtextBtn); @@ -1806,7 +1806,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, @@ -1815,8 +1815,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) => { @@ -1907,14 +1906,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++) { @@ -1930,14 +1946,13 @@ //鑷姩鍖� Automationview(logicScrolView); CommonPage.Loading.Hide(); - - } + } /// <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) @@ -2066,7 +2081,7 @@ } /// <summary> - /// 鏄剧ず鍥炬爣鐨勯鑹� + /// 鏄剧ず鑷姩鍖栬緭鍑哄姛鑳芥ā鍧楀浘鏍囩殑棰滆壊 /// </summary> /// <param name="logic"></param> /// <param name="logicRowlayout"></param> @@ -2465,6 +2480,7 @@ } } } + #endregion #region 鈼� 鎺у埗鐘舵�乢________________________ -- Gitblit v1.8.0