From 133ca903ae9c4df6ff037f5223d5abcd0df926f4 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期五, 20 三月 2020 17:55:32 +0800
Subject: [PATCH] 2020-03-20-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs |   96 +++++++++---------------------------------------
 1 files changed, 18 insertions(+), 78 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
index 680359b..c30fa40 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -32,25 +32,9 @@
             };
             this.AddChidren(middle);
 
-            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);
+            LogicView.SaveView saveView = new LogicView.SaveView();
+            saveView.frameLayout.Y = middle.Bottom;
+            this.AddChidren(saveView.Show());
 
             if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 5)
             {
@@ -113,68 +97,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 +136,11 @@
                     }
 
                 };
-                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