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/Category/Category.cs | 94 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 73 insertions(+), 21 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs index 49660bf..a55530b 100644 --- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs @@ -722,8 +722,8 @@ //new涓�涓柊閫昏緫瀵硅薄锛� Common.Logic.CurrentLogic = new Common.Logic(); Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 - Common.Logic.CurrentLogic.LogicCustomPushText = Language.StringByID(MyInternationalizationString.defaulttext); Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); + //Common.Logic.CurrentLogic.LogicCustomPushText =Common.Logic.CurrentLogic.LogicName+Language.StringByID(MyInternationalizationString.defaulttext); var addLogicPage = new Shared.Phone.Device.Logic.AddLogicPage(); UserView.HomePage.Instance.AddChidren(addLogicPage); UserView.HomePage.Instance.PageIndex += 1; @@ -1747,8 +1747,7 @@ /// </summary> private void ShowAutotion() { - - functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; var bjFrameLayout = new FrameLayout { @@ -1809,14 +1808,13 @@ var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout { Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30), - BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + //BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,/ X = Application.GetRealWidth(58), - //Radius = (uint)Application.GetRealHeight(50), Y = scenehorizontalScrol.Bottom, }; functionSceneAutoBodyView.AddChidren(logicScrolView); logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); - + bool no = false; recommendswitchBtn.MouseUpEventHandler += (sender, e) => { int Yheight = 0; @@ -1824,6 +1822,7 @@ scenehorizontalScrol.RemoveAll(); if (recommendswitchBtn.IsSelected) { + no = true; scenehorizontalScrol.Height = Application.GetRealHeight(246); Yheight = 20; for (int i = 1; i < 4; i++) @@ -1876,7 +1875,8 @@ Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 if (logiciocnBtn.Tag.ToString() == "3") { - Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;// Language.StringByID(MyInternationalizationString.automation1); + Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text; + //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext); var addLogicPage = new Logic.AddLogicPage(); HomePage.Instance.AddChidren(addLogicPage); HomePage.Instance.PageIndex += 1; @@ -1886,6 +1886,7 @@ { Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text; + //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext); Logic.TemplatePage templatePage = new Logic.TemplatePage(); Logic.TemplatePage.s = logiciocnBtn.Tag.ToString(); HomePage.Instance.AddChidren(templatePage); @@ -1899,30 +1900,31 @@ } else { + no = false; scenehorizontalScrol.Height = Application.GetRealHeight(0); Yheight = 0; } logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight; logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; - Automationview(logicScrolView); + Automationview(logicScrolView,no); }; logicScrolView.BeginHeaderRefreshingAction += () => { //閲嶆柊鍒锋柊logic鍒楄〃 Common.Logic.LogicList.Clear(); - Read(logicScrolView); + Read(logicScrolView,no); //鍏抽棴鍒锋柊View锛� logicScrolView.EndHeaderRefreshing(); }; - Read(logicScrolView); + Read(logicScrolView,no); } /// <summary> /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱 /// </summary> /// <param name="logicScrolView"></param> - private async void Read(VerticalRefreshLayout logicScrolView) + private async void Read(VerticalRefreshLayout logicScrolView,bool no) { CommonPage.Loading.Start(); if (Common.Logic.LogicList.Count == 0) @@ -1944,27 +1946,77 @@ } } //鑷姩鍖� - Automationview(logicScrolView); + Automationview(logicScrolView,no); CommonPage.Loading.Hide(); - } /// <summary> /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈� /// </summary> /// <param name="refresview">Refresview.</param> - private async void Automationview(VerticalRefreshLayout refresview) + private async void Automationview(VerticalRefreshLayout refresview,bool no) { refresview.RemoveAll(); + if (Common.Logic.LogicList.Count == 0&&no==false) + { + //灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣; + refresview.BackgroundColor = 0x00000000; + var noFrameLayout = new FrameLayout + { + Height = Application.GetRealHeight(434+ 200+32+160), + //BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + }; + refresview.AddChidren(noFrameLayout); + + + var noIconBtn = new Button + { + Y=Application.GetRealHeight(160), + Width = Application.GetMinRealAverage(756), + Height = Application.GetMinRealAverage(434), + UnSelectedImagePath = "Item/NoFunction.png", + X = Application.GetRealWidth(104), + }; + noFrameLayout.AddChidren(noIconBtn); + + var noTextBtn = new Button() + { + Y = noIconBtn.Bottom, + 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), + }; + noFrameLayout.AddChidren(noTextBtn); + + } + else + { + + if (Common.Logic.LogicList.Count == 0 && no == true) + { + ///鏀瑰彉婊戝姩view鐨勯鑹诧紱 + refresview.BackgroundColor = 0x00000000; + } + else + { + refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; + } + } foreach (var logic in Common.Logic.LogicList) { - + var logicRowlayout = new RowLayout { Height = Application.GetRealHeight(190 + 30), Width = Application.GetRealWidth(1080-58), LineColor = ZigbeeColor.Current.LogicBackgroundColor, - BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor, + }; refresview.AddChidren(logicRowlayout); @@ -1990,7 +2042,7 @@ Height = Application.GetMinRealAverage(63), UnSelectedImagePath = "ZigeeLogic/logicclose.png", SelectedImagePath = "ZigeeLogic/logicopen.png", - X = logicRowlayout.Width - Application.GetRealWidth(104 + 58 + 58), + X = logicRowlayout.Width - Application.GetRealWidth(104 + 58), Y = Application.GetRealHeight(58 + 30 + 9 + 30), }; logicRowlayout.AddChidren(logicswitchBtn); @@ -2039,7 +2091,7 @@ var logicCommunalPage = new Logic.LogicCommunalPage(); HomePage.Instance.AddChidren(logicCommunalPage); HomePage.Instance.PageIndex += 1; - logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview); }); + logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview,no); }); }; @@ -2061,7 +2113,7 @@ if (e1) { Common.Logic.LogicList.Remove(logic); - Automationview(refresview); + Automationview(refresview,no); Logic.Send.DelLogic(logic.LogicId); } }; @@ -2071,7 +2123,7 @@ var line = new Button { Y = Application.GetRealHeight(215), - Height = Application.GetRealHeight(5), + Height = Application.GetRealHeight(5), Width = Application.GetRealWidth(1080 - 58), BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, X = Application.GetRealWidth(58), @@ -2092,7 +2144,7 @@ var logictimeBtn = new Button { Height = Application.GetRealHeight(58), - Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350 + 58), + Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350), Y = Application.GetRealHeight(30), X = Application.GetRealWidth(365), TextAlignment = TextAlignment.CenterRight, -- Gitblit v1.8.0