From 94e4e5b9fd3da964c44b7b14227d6fe2bbb426d7 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 02 四月 2020 13:56:39 +0800 Subject: [PATCH] 2020-04-02-2 --- ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 159 +++++++++++++++++++++++----------------------------- 1 files changed, 70 insertions(+), 89 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs old mode 100755 new mode 100644 index 9bb4cd1..e87c0be --- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs @@ -123,30 +123,7 @@ #endregion #region 鈼� 鎺ュ彛____________________________ - /// <summary> - /// 璇ユ帴鍙e皢寮冪敤 鏀圭敤DeviceInfoChange() - /// </summary> - /// <param name="common">Common.</param> - public void Changed(CommonDevice common) - { - - } - /// <summary> - /// Changeds the IL ogic status. - /// </summary> - /// <param name="logic">Logic.</param> - public void ChangedILogicStatus(ZigBee.Device.Logic logic) - { - - } - /// <summary> - /// Changeds the IS cene status. - /// </summary> - /// <param name="scene">Scene.</param> - public void ChangedISceneStatus(Scene scene) - { - - } + /// <summary> /// 璁惧鐘舵�佹洿鏂版帴鍙� /// <para>type锛氬鏋滀负 DeviceInComingRespon:璁惧鏂颁笂鎶�</para> @@ -812,14 +789,15 @@ /// </summary> private void Add_Automation() { - //new涓�涓柊閫昏緫瀵硅薄锛� - Common.Logic.CurrentLogic = new Common.Logic(); - Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 - Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); - var addLogicPage = new Shared.Phone.Device.Logic.AddLogicPage(); - UserView.HomePage.Instance.AddChidren(addLogicPage); - UserView.HomePage.Instance.PageIndex += 1; - addLogicPage.Show(); + ////new涓�涓柊閫昏緫瀵硅薄锛� + //Common.Logic.CurrentLogic = new Common.Logic(); + //Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 + //Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); + //var addLogicPage = new Shared.Phone.Device.Logic.AddLogicPage(); + //UserView.HomePage.Instance.AddChidren(addLogicPage); + //UserView.HomePage.Instance.PageIndex += 1; + //addLogicPage.Show(); + Shared.Phone.Device.Logic.SkipView.SkipAddLogic(0); } /// <summary> /// HidenFloor @@ -1955,11 +1933,11 @@ functionSceneBodyView.AddChidren(sceneScrolView); foreach (var scene in sceneList) { - var sceneView = new SceneCategoryView(0, 0); + var sceneView = new SceneCategoryView(); sceneScrolView.AddChidren(sceneView); - sceneView.Init(scene, room); - GetDelayScene(sceneScrolView); - } + sceneView.InitControl(scene, room); + } + GetDelayScene(sceneScrolView); } } @@ -2014,6 +1992,10 @@ for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++) { var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView; + if (sceneView == null) + { + continue; + } foreach (var delayScenesListResponseInfo in delayList) { if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id) @@ -2021,21 +2003,26 @@ sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime; var remainTime = delayScenesListResponseInfo.RemainTime; if (remainTime > 0) - { + { + //寮�鍚唴閮ㄥ欢鏃舵椂闂寸嚎绋�(鏃ㄥ湪鍏ㄩ儴鍦版柟鐨勫悓涓�鍦烘櫙鏃堕棿鍚屾) + HdlSceneLogic.Current.StartDelayTimeThread(sceneView.scene); new System.Threading.Thread(() => { - while (remainTime-- > 0) + while (remainTime > 0 && this.Parent != null) { System.Threading.Thread.Sleep(1000); Application.RunOnMainThread(() => { sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime)); }); + remainTime--; } Application.RunOnMainThread(() => { - sceneView.scene.RemainTime = 0; - sceneView.SetTimeImage(); + if (this.Parent != null) + { + sceneView.SetTimeImage(); + } }); }) { IsBackground = true }.Start(); @@ -2044,31 +2031,19 @@ } } } - } - - /// <summary> - /// GetExecScene - /// </summary> - /// <param name="scrolViewLayout"></param> - private void GetExecScene(VerticalScrolViewLayout scrolViewLayout) - { - new System.Threading.Thread(() => - { - - }) - { IsBackground = true }.Start(); - } + } + #endregion - + #region 鈼� 鑷姩鍖朹_________________________ - + /// <summary> /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙� /// </summary> - private void ShowAutotion() + private void ShowAutotion() { - // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; - + // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + var bjFrameLayout = new FrameLayout { Width = Application.GetRealWidth(1080 - 58), @@ -2226,25 +2201,25 @@ } logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight; logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; - Automationview(logicScrolView,no); + Automationview(logicScrolView, no); }; logicScrolView.BeginHeaderRefreshingAction += () => { //閲嶆柊鍒锋柊logic鍒楄〃 Common.Logic.LogicList.Clear(); - Read(logicScrolView,no); + Read(logicScrolView, no); //鍏抽棴鍒锋柊View锛� logicScrolView.EndHeaderRefreshing(); - }; - - Read(logicScrolView,no); + }; + + Read(logicScrolView, no); } /// <summary> /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱 /// </summary> /// <param name="logicScrolView"></param> - private async void Read(VerticalRefreshLayout logicScrolView,bool no) + private async void Read(VerticalRefreshLayout logicScrolView, bool no) { CommonPage.Loading.Start(); if (Common.Logic.LogicList.Count == 0) @@ -2266,23 +2241,23 @@ } } //鑷姩鍖� - Automationview(logicScrolView,no); + Automationview(logicScrolView, no); CommonPage.Loading.Hide(); } /// <summary> /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈� /// </summary> /// <param name="refresview">Refresview.</param> - private async void Automationview(VerticalRefreshLayout refresview,bool no) + private async void Automationview(VerticalRefreshLayout refresview, bool no) { refresview.RemoveAll(); - if (Common.Logic.LogicList.Count == 0&&no==false) + if (Common.Logic.LogicList.Count == 0 && no == false) { //灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣; refresview.BackgroundColor = 0x00000000; var noFrameLayout = new FrameLayout { - Height = Application.GetRealHeight(434+ 200+32+160), + Height = Application.GetRealHeight(434 + 200 + 32 + 160), //BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; refresview.AddChidren(noFrameLayout); @@ -2290,7 +2265,7 @@ var noIconBtn = new Button { - Y=Application.GetRealHeight(160), + Y = Application.GetRealHeight(160), Width = Application.GetMinRealAverage(756), Height = Application.GetMinRealAverage(434), UnSelectedImagePath = "Item/NoFunction.png", @@ -2301,14 +2276,14 @@ var noTextBtn = new Button() { Y = noIconBtn.Bottom, - Height = Application.GetRealHeight(200)+Application.GetRealHeight(32), + Height = Application.GetRealHeight(200) + Application.GetRealHeight(32), Width = Application.GetRealWidth(700), //Gravity = Gravity.CenterHorizontal, Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"), TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextAlignment = TextAlignment.Center, IsMoreLines = true, - X = Application.GetRealWidth(190-58), + X = Application.GetRealWidth(190 - 58), }; noFrameLayout.AddChidren(noTextBtn); @@ -2328,17 +2303,23 @@ } foreach (var logic in Common.Logic.LogicList) { - - + var fLayout = new FrameLayout + { + Height = Application.GetRealHeight(190 + 30), + Width = Application.GetRealWidth(1080 - 58), + BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + }; + refresview.AddChidren(fLayout); + var logicRowlayout = new RowLayout { Height = Application.GetRealHeight(190 + 30), - Width = Application.GetRealWidth(1080-58), - LineColor = ZigbeeColor.Current.LogicBackgroundColor, - BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor, - + Width = Application.GetRealWidth(1080 - 58), + LineColor = ZigbeeColor.Current.LogicBackgroundColor, + BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + }; - refresview.AddChidren(logicRowlayout); + fLayout.AddChidren(logicRowlayout); @@ -2411,9 +2392,9 @@ var logicCommunalPage = new Logic.LogicCommunalPage(); HomePage.Instance.AddChidren(logicCommunalPage); HomePage.Instance.PageIndex += 1; - logicCommunalPage.Show(() => { + logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; - Automationview(refresview,no); + Automationview(refresview, no); }); }; @@ -2443,13 +2424,13 @@ }; var line = new Button { - Y = Application.GetRealHeight(215), - Height = Application.GetRealHeight(5), + Y = fLayout.Height - 1, + Height = 1, + X = Application.GetRealWidth(58), Width = Application.GetRealWidth(1080 - 58), BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - X = Application.GetRealWidth(58), }; - logicRowlayout.AddChidren(line); + fLayout.AddChidren(line); } } @@ -2924,10 +2905,10 @@ { commonDeviceList.Add(common); } - } - + } + #endregion - - + + } } -- Gitblit v1.8.0