From b304a3c78df10b6e9b867e677d3e4719f1d4a7aa Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 24 三月 2020 09:12:15 +0800
Subject: [PATCH] 2020-03-23-3

---
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs |  458 ++++++++++++--------------------------------------------
 1 files changed, 102 insertions(+), 356 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..a770748
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -17,7 +17,6 @@
     /// </summary>
     public class Category : FrameLayout, ZigBee.Common.IStatus
     {
-
         #region 鈼� 鍙橀噺____________________________
         /// <summary>
         /// The instance.
@@ -35,10 +34,14 @@
         /// 鍦烘櫙
         /// </summary>
         private ButtonLineForm sceneBtn;
+        ///// <summary>
+        ///// 鑷姩鍖�
+        ///// </summary>
+        //private ButtonLineForm automationBtn;
         /// <summary>
         /// 鑷姩鍖�
         /// </summary>
-        private ButtonLineForm automationBtn;
+        public  static  ButtonLineForm automationBtn;
         /// <summary>
         /// 鍦烘櫙鍔熻兘涓儴鑳屾櫙bodyView
         /// </summary>
@@ -123,30 +126,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>
@@ -1955,11 +1935,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 +1994,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 +2005,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 +2033,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),
@@ -2077,9 +2054,11 @@
                 X = Application.GetRealWidth(58),
                 //Radius = (uint)Application.GetRealHeight(50),
                 Y = Application.GetRealHeight(30),
+
             };
             functionSceneAutoBodyView.AddChidren(bjFrameLayout);
             bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
+            //鍥炬爣鎺т欢
             var sigBtn = new Button
             {
                 Width = Application.GetMinRealAverage(84),
@@ -2089,7 +2068,7 @@
                 Gravity = Gravity.CenterVertical,
             };
             bjFrameLayout.AddChidren(sigBtn);
-
+            //鎺ㄨ崘妯℃澘鏂囨湰鎺т欢
             var recommendtextBtn = new Button
             {
                 Width = Application.GetMinRealAverage(300),
@@ -2103,19 +2082,19 @@
                 TextSize = 15,
             };
             bjFrameLayout.AddChidren(recommendtextBtn);
-
+            //鎺ㄨ崘妯℃澘寮�鍏虫帶浠�
             var recommendswitchBtn = new Button
             {
-                Width = Application.GetMinRealAverage(104),
-                Height = Application.GetMinRealAverage(63),
+                Width = Application.GetRealWidth(104),
+                Height = Application.GetRealHeight(63),
                 UnSelectedImagePath = "ZigeeLogic/logicclose.png",
                 SelectedImagePath = "ZigeeLogic/logicopen.png",
                 X = bjFrameLayout.Width - Application.GetRealWidth(104 + 58),
                 Gravity = Gravity.CenterVertical,
             };
             bjFrameLayout.AddChidren(recommendswitchBtn);
-
-
+            #endregion
+            //榛樿鎺ㄨ崘妯℃澘宸﹀彸鍙粦鎺т欢
             var scenehorizontalScrol = new HorizontalScrolViewLayout
             {
                 Width = Application.GetRealWidth(1080 - 58),
@@ -2124,7 +2103,7 @@
                 Height = Application.GetRealHeight(0),
             };
             functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
-
+            //鏄剧ず鑷姩鍖栧垪琛ㄤ笂涓嬪彲婊戞帶浠�
             var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
             {
                 Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
@@ -2135,6 +2114,7 @@
             functionSceneAutoBodyView.AddChidren(logicScrolView);
             logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
             bool no = false;
+            //鏄剧ず榛樿妯℃澘鐨勭晫闈簨浠�
             recommendswitchBtn.MouseUpEventHandler += (sender, e) =>
             {
                 int Yheight = 0;
@@ -2226,25 +2206,36 @@
                 }
                 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);
+                //鍏抽棴鍒锋柊View锛�
+                logicScrolView.EndHeaderRefreshing();
             };
             logicScrolView.BeginHeaderRefreshingAction += () =>
             {
                 //閲嶆柊鍒锋柊logic鍒楄〃
                 Common.Logic.LogicList.Clear();
-                Read(logicScrolView,no);
+                Read(logicScrolView, no);
                 //鍏抽棴鍒锋柊View锛�
                 logicScrolView.EndHeaderRefreshing();
-            };
-           
-            Read(logicScrolView,no);
+            };
+
+            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 +2257,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 +2281,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 +2292,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);
 
@@ -2326,21 +2317,27 @@
                     refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                 }
             }
+
             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),
+                    Width = Application.GetRealWidth(1080 - 58),
                     LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                   BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor,
-                   
+                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+                    SubViewWidth = Application.GetRealWidth(184),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
+
                 };
-                refresview.AddChidren(logicRowlayout);
-
-
+                fLayout.AddChidren(logicRowlayout);
 
                 var logicnameBtn = new Button
                 {
@@ -2355,7 +2352,6 @@
                 };
                 logicRowlayout.AddChidren(logicnameBtn);
 
-
                 var logicswitchBtn = new Button
                 {
                     Width = Application.GetMinRealAverage(104),
@@ -2364,10 +2360,9 @@
                     SelectedImagePath = "ZigeeLogic/logicopen.png",
                     X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
                     Y = Application.GetRealHeight(58 + 30 + 9 + 30),
+
                 };
                 logicRowlayout.AddChidren(logicswitchBtn);
-
-
 
                 logicswitchBtn.MouseUpEventHandler += (sender1, e1) =>
                 {
@@ -2411,13 +2406,9 @@
                     var logicCommunalPage = new Logic.LogicCommunalPage();
                     HomePage.Instance.AddChidren(logicCommunalPage);
                     HomePage.Instance.PageIndex += 1;
-                    logicCommunalPage.Show(() => { 
-                        logicnameBtn.Text = logic.LogicName;
-                        Automationview(refresview,no);
-                    });
+                    logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview, no); });
 
                 };
-
 
                 ///鍒犻櫎
                 var del = new Button
@@ -2429,27 +2420,28 @@
                 logicRowlayout.AddRightView(del);
                 del.MouseUpEventHandler += (sender, e) =>
                 {
-                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
-                      Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                      Language.StringByID(MyInternationalizationString.confrim));
-                    alert.Show();
-                    alert.ConfirmClickEvent += () =>
-                    {
-                        Common.Logic.LogicList.Remove(logic);
-                        Automationview(refresview, no);
-                        Logic.Send.DelLogic(logic.LogicId);
+                    var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                                             Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
+                    alert.ResultEventHandler += (sender1, e1) =>
+                    {
+                        if (e1)
+                        {
+                            Common.Logic.LogicList.Remove(logic);
+                            Automationview(refresview, no);
+                            Logic.Send.DelLogic(logic.LogicId);
+                        }
                     };
 
                 };
                 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);
             }
 
         }
@@ -2474,254 +2466,8 @@
             logicRowlayout.AddChidren(logictimeBtn);
 
             ///鏄剧ず鎵ц鍛ㄦ湡
-            switch (logic.TimeAttribute.Repeat)
-            {
-                ///0:鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆;1,浠婂勾鍐呮墽琛�;2锛氭瘡澶╂墽琛�;3锛氭瘡鏈堟墽琛�;4锛氭瘡骞存墽琛�;5锛氬懆閲嶅銆�
-                case 0:
-                    {
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.executeonce);
-                    }; break;
-                case 1: { }; break;
-                case 2:
-                    {
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyday);
-                    }; break;
-                case 3:
-                    {
+            Logic.Method.UpdateWeek(logictimeBtn, logic);
 
-                        string len = "", value = "";
-                        var stringvalue = Convert.ToString(logic.TimeAttribute.MonthDate, 2);
-                        var str = stringvalue.Insert(0, new string('0', 32 - stringvalue.Length));
-                        for (int j = 31; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                value += (j + 1).ToString() + ",";
-                            }
-                        }
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.monthly) + value.TrimEnd(',') + Language.StringByID(MyInternationalizationString.day);
-
-                    }; break;
-                case 4:
-                    {
-
-                        Dictionary<int, int> dictionary = new Dictionary<int, int>();
-                        ///鎵惧嚭鎵ц鐨勬湀浠藉拰澶╂暟
-                        if (logic.TimeAttribute.SelectMonDate.Count != 0)
-                        {
-                            for (int i = 0; i < logic.TimeAttribute.SelectMonDate.Count; i++)
-                            {
-                                var dayvalue = logic.TimeAttribute.SelectMonDate[i];
-                                if (dayvalue != 0)
-                                {
-                                    dictionary.Add(i + 1, dayvalue);
-                                }
-                            }
-                        }
-                        if (dictionary.Count != 0 && dictionary.Count == 1)
-                        {
-                            string len = "", leng = "";
-                            int minvalue = 0, Maximum = 0;
-                            foreach (var value in dictionary)
-                            {
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        minvalue = j + 1;
-                                        break;
-                                    }
-                                }
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        Maximum = j + 1;
-                                    }
-                                }
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-                                if (minvalue == Maximum)
-                                {
-                                    logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString());
-                                }
-                                else
-                                {
-                                    logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-" + leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-                                }
-                            }
-
-                        }
-                        else
-                        {
-                            int b = 0;
-                            string stringtext = "";
-                            foreach (var value in dictionary)
-                            {
-                                string len = "", leng = "";
-                                int minvalue = 0, Maximum = 0;
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-
-
-
-                                if (b == 0)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            minvalue = j + 1;
-                                            break;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-";
-
-                                }
-
-                                if (b == dictionary.Count - 1)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            Maximum = j + 1;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-
-                                }
-                                b++;
-                            }
-                            logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + stringtext;
-                        }
-
-                    }; break;
-                case 5:
-                    {
-                        string len = "", text = "";
-                        List<int> listvalueInt = new List<int>();
-                        listvalueInt.Clear();
-                        var maxvalue = Convert.ToString(logic.TimeAttribute.WeekDay, 2);
-                        var str = maxvalue.Insert(0, new string('0', 8 - maxvalue.Length));
-                        for (int j = 7; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                listvalueInt.Add(j + 1);
-
-
-                                if ((j + 1) == 1)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.mon1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.mon) + ",";
-                                }
-                                else if ((j + 1) == 2)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.tue1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.tue) + ",";
-                                }
-                                else if ((j + 1) == 3)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.wed1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.wed) + ",";
-                                }
-                                else if ((j + 1) == 4)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.thu1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.thu) + ",";
-                                }
-                                else if ((j + 1) == 5)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.frl1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.frl) + ",";
-                                }
-                                else if ((j + 1) == 6)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sat1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sat) + ",";
-                                }
-                                else if ((j + 1) == 7)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sun1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sun) + ",";
-                                }
-
-
-                            }
-                        }
-                        //鏆傛椂闅愯棌鎺夛紝闇�瑕佹樉绀哄懆鏈拰宸ヤ綔鏃ュ啀鏀惧紑锛�
-                        //if (listvalueInt.Count == 5 && !listvalueInt.Contains(6) && !listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.workingday);
-                        //}
-                        //else if (listvalueInt.Count == 2 && listvalueInt.Contains(6) && listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.weekend);
-                        //}
-                        //else if (listvalueInt.Count == 7)
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
-                        //}
-                        //else
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //}
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //btndisplaycycle.Text = text.TrimEnd(',');
-                    }; break;
-            }
 
             List<string> indexlist = new List<string>();
             List<string> iconIndexlist = new List<string>();
@@ -2755,19 +2501,19 @@
                 var iconindex = iconIndexlist[i];
                 var typebjBtn = new FrameLayout
                 {
-                    Width = Application.GetRealWidth(82),
-                    Height = Application.GetRealHeight(82),
+                    Width = Application.GetMinRealAverage(82),
+                    Height = Application.GetMinRealAverage(82),
                     X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
                     Y = Application.GetRealHeight(58 + 30 + 30),
-                    Radius = (uint)Application.GetRealHeight(41),
+                    Radius = (uint)Application.GetMinRealAverage(41),
                     BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                 };
                 logicRowlayout.AddChidren(typebjBtn);
 
                 var typeIconBtn = new Button
                 {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
+                    Width = Application.GetMinRealAverage(58),
+                    Height = Application.GetMinRealAverage(58),
                     Gravity = Gravity.Center,
 
                 };
@@ -2924,10 +2670,10 @@
             {
                 commonDeviceList.Add(common);
             }
-        }
-
+        }
+
         #endregion
-
-   
+
+
     }
 }

--
Gitblit v1.8.0