From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 十二月 2019 13:32:33 +0800
Subject: [PATCH] 2019-12-30-1

---
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs |   77 +++++++++++++++++++++++++++++++-------
 1 files changed, 63 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index 49660bf..6122be0 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -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++)
@@ -1899,30 +1898,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,17 +1944,66 @@
                 }
             }
             //鑷姩鍖�
-            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)
             {
 
@@ -2039,7 +2088,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 +2110,7 @@
                         if (e1)
                         {
                             Common.Logic.LogicList.Remove(logic);
-                            Automationview(refresview);
+                            Automationview(refresview,no);
                             Logic.Send.DelLogic(logic.LogicId);
                         }
                     };

--
Gitblit v1.8.0