From 652243206427f35a256400a149a1734085824cb9 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 02 九月 2020 17:35:03 +0800
Subject: [PATCH] 2020-09-02-4

---
 ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs |  109 +++++++++++-------------------------------------------
 1 files changed, 22 insertions(+), 87 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
old mode 100644
new mode 100755
index 680359b..79b9b78
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -15,43 +15,25 @@
   
         public void Show (string titlename)
         {
-            var weeklist = new List<string> ();
 
-            #region  涓婇潰鐨勫竷灞�浠g爜
+            #region  鐣岄潰鐨勫竷灞�浠g爜
             TopView view = new TopView();
             this.AddChidren(view.TopRowView());
             view.toptitleNameBtn.Text=titlename;
             view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
-            #endregion
-
             var middle = new VerticalScrolViewLayout
             {
                 Y = view.topRowLayout.Bottom,
-                Height = Application.GetRealHeight(1920 - 184-260),
+                Height = Application.GetRealHeight(Method.H - 184-260),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
+            LogicView.SaveView saveView = new LogicView.SaveView();
+            saveView.frameLayout.Y = middle.Bottom;
+            this.AddChidren(saveView.Show());
+            #endregion
 
-            var saveFramelayout = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(saveFramelayout);
-            var saveBtn= new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            saveFramelayout.AddChidren(saveBtn);
-
+            var weeklist = new List<string>();
             if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 5)
             {
                 string len = "";
@@ -99,7 +81,6 @@
                     }
                 }
             }
-
             var cyclelist = new List<string> ();
             cyclelist.AddRange (new string [] {
                         Language.StringByID(MyInternationalizationString.mon),
@@ -113,68 +94,29 @@
             foreach (var name in cyclelist)
             {
 
-                var weekFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                };
-                middle.AddChidren(weekFramelayout);
-
-                var weekIconBtn = new Button
-                {
-                    Width = Application.GetMinRealAverage(81),
-                    Height = Application.GetMinRealAverage(81),
-                    UnSelectedImagePath = "ZigeeLogic/point.png",
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(55),
-                };
-                weekFramelayout.AddChidren(weekIconBtn);
-
-                var weekRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                };
-                weekFramelayout.AddChidren(weekRow);
-
-
-                var weekTextBtn = new Button
-                {
-                    TextAlignment = TextAlignment.CenterLeft,
-                    Text = name,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    TextSize = 15,
-                };
-                weekRow.AddChidren(weekTextBtn);
-
-                var selectedBtn = new Button
-                {
-                    X = Application.GetRealWidth(789),
-                    Width = Application.GetMinRealAverage(60),
-                    Height = Application.GetMinRealAverage(60),
-                    UnSelectedImagePath = "ZigeeLogic/selected.png",
-                    Gravity = Gravity.CenterVertical,
-                    Visible = false,
-                };
-                weekRow.AddChidren(selectedBtn);
-
+                FunView monView = new FunView();
+                monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
+                monView.funnameBtn.Text= name;
+                monView.funnextBtn.Width = Application.GetMinRealAverage(60);
+                monView.funnextBtn.Height = Application.GetMinRealAverage(60);
+                monView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
+                monView.funnextBtn.Visible = false;
+                middle.AddChidren(monView.FunFrameView());
                 if (Language.StringByID(MyInternationalizationString.sun) == name)
                 {
-                    weekRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+                    monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+                    monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
                 }
 
                 var str = weeklist.Find((o) => { return o == name; });
                 if (str != null)
                 {
-                    selectedBtn.Visible = true;
+                    monView.funnextBtn.Visible = true;
                 }
-                EventHandler<MouseEventArgs> weekclick = (sender, e) =>
+                monView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
                 {
-                    selectedBtn.Visible = !selectedBtn.Visible;
-                    if (selectedBtn.Visible)
+                    monView.funnextBtn.Visible = !monView.funnextBtn.Visible;
+                    if (monView.funnextBtn.Visible)
                     {
                         var d = weeklist.Find((o) => { return o == name; });
                         if (d == null)
@@ -191,16 +133,9 @@
                     }
 
                 };
-                weekFramelayout.MouseUpEventHandler += weekclick;
-                weekTextBtn.MouseUpEventHandler += weekclick;
-                selectedBtn.MouseUpEventHandler += weekclick;
-                weekIconBtn.MouseUpEventHandler += weekclick;
-                weekRow.MouseUpEventHandler += weekclick;
 
             }
-
-
-            saveBtn.MouseUpEventHandler += (sender, e) =>
+            saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
 
                 int weekvalue = 0;

--
Gitblit v1.8.0