From 1c4904d77f484c075080942d87785481b52b6fb2 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期一, 28 十月 2019 14:58:46 +0800
Subject: [PATCH] Revert "Merge branch 'dev-tzy' into DEV_GXC"

---
 ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs |  273 +++++++++++++++++++----------------------------------
 1 files changed, 99 insertions(+), 174 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
index e23911d..b654589 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -13,87 +13,61 @@
             Tag = "Logic";
         }
   
-        public void Show (string titlename)
+        public void Show ()
         {
             var weeklist = new List<string> ();
 
-
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
+            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
+            var topFrameLayout = new FrameLayout
             {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
+                Height = Application.GetRealHeight(140),
+                Y = Application.GetRealHeight(80),
             };
-            this.AddChidren(topRowLayout);
+            AddChidren(topFrameLayout);
 
             var titleName = new Button
             {
-                TextSize = 16,
+                TextID = MyInternationalizationString.cycle,
+                TextSize = 17,
                 TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                Text = titlename,
             };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
+            topFrameLayout.AddChidren (titleName);
+                       
+            var back = new Button {
+                Width = Application.GetRealWidth (110),
+                Height = Application.GetRealHeight (110),
+                X = Application.GetRealWidth (20),
+                Gravity = Gravity.CenterVertical,
+                UnSelectedImagePath = "ZigeeLogic/Back.png",
             };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
+            topFrameLayout.AddChidren (back);
+            back.MouseDownEventHandler += (sender, e) =>
             {
                 RemoveFromParent();
             };
 
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
+            var titlerl = new RowLayout {
+                Height = Application.GetRealHeight (180),
+                Y = Application.GetRealHeight (220),
             };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
-            #endregion
+            AddChidren (titlerl);
 
+            titlerl.AddChidren (
+             new Button {
+                 X = Application.GetRealWidth (40),
+                 //Text = "璇烽�夋嫨閲嶅鎵ц鍛ㄦ湡",
+                 TextID = MyInternationalizationString.repeat,
+                 TextSize = 17,
+                 TextAlignment = TextAlignment.CenterLeft,
+                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+             }
+            );
 
-            var middle = new VerticalScrolViewLayout
-            {
-                Y = topRowLayout.Bottom,
-                Height = Application.GetRealHeight(1920 - 184-260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            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,
-            };
-            saveFramelayout.AddChidren(saveBtn);
+            var middle = new VerticalScrolViewLayout ();
+            middle.Y = titlerl.Bottom;
+            middle.Height = Application.GetRealHeight (1920 - 220 - 180);
+            middle.BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor;
+            this.AddChidren (middle);
 
             if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 5)
             {
@@ -153,70 +127,41 @@
                         Language.StringByID(MyInternationalizationString.sat),
                         Language.StringByID(MyInternationalizationString.sun),
             });
-            foreach (var name in cyclelist)
-            {
-
-                var weekFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+            foreach (var name in cyclelist) {
+                var cyclerwLayout = new RowLayout {
+                    Height = Application.GetRealHeight (180),
                 };
-                middle.AddChidren(weekFramelayout);
+                middle.AddChidren (cyclerwLayout);
 
-                var weekIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(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
-                {
+                var btnname = new Button {
+                    X = Application.GetRealWidth (40),
+                    Width = Application.GetRealWidth (600),
+                    Gravity = Gravity.CenterVertical,
                     TextAlignment = TextAlignment.CenterLeft,
                     Text = name,
                     TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                 };
-                weekRow.AddChidren(weekTextBtn);
+                cyclerwLayout.AddChidren (btnname);
 
-                var selectedBtn = new Button
-                {
-                    X = Application.GetRealWidth(789),
-                    Width = Application.GetMinRealAverage(60),
-                    Height = Application.GetMinRealAverage(60),
-                    UnSelectedImagePath = "ZigeeLogic/selected.png",
+                var btnCheck = new Button {
+                    Width = Application.GetRealWidth (115),
+                    Height = Application.GetRealHeight (110),
                     Gravity = Gravity.CenterVertical,
-                    Visible = false,
+                    X = Application.GetRealWidth (1080-140),
+                    SelectedImagePath = "ZigeeLogic/CheckOn.png",
+                    UnSelectedImagePath = "ZigeeLogic/Check.png",
                 };
-                weekRow.AddChidren(selectedBtn);
+                cyclerwLayout.AddChidren (btnCheck);
 
-                if (Language.StringByID(MyInternationalizationString.sun) == name)
-                {
-                    weekRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+                var str = weeklist.Find ((o) => { return o == name; });
+                if (str != null) {
+                    btnCheck.IsSelected = true;
                 }
-
-                var str = weeklist.Find((o) => { return o == name; });
-                if (str != null)
-                {
-                    selectedBtn.Visible = true;
-                }
+                ///閫変腑鏃堕棿 
                 EventHandler<MouseEventArgs> weekclick = (sender, e) =>
                 {
-                    selectedBtn.Visible = !selectedBtn.Visible;
-                    if (selectedBtn.Visible)
+                    btnCheck.IsSelected = !btnCheck.IsSelected;
+                    if (btnCheck.IsSelected)
                     {
                         var d = weeklist.Find((o) => { return o == name; });
                         if (d == null)
@@ -226,74 +171,54 @@
                     }
                     else
                     {
-                        weeklist.RemoveAll((o) =>
-                        {
+                        weeklist.RemoveAll((o) => {
                             return o == name;
                         });
                     }
+                    int weekvalue = 0;
+                    foreach (var strname in weeklist)
+                    {
+                        if (Language.StringByID(MyInternationalizationString.mon) == strname)
+                        {
+                            weekvalue += 1;
+                        }
+                        else if (Language.StringByID(MyInternationalizationString.tue) == strname)
+                        {
+                            weekvalue += 2;
+                        }
+                        else if (Language.StringByID(MyInternationalizationString.wed) == strname)
+                        {
+                            weekvalue += 4;
+                        }
+                        else if (Language.StringByID(MyInternationalizationString.thu) == strname)
+                        {
+                            weekvalue += 8;
+                        }
+                        else if (Language.StringByID(MyInternationalizationString.frl) == strname)
+                        {
+                            weekvalue += 16;
+                        }
+                        else if (Language.StringByID(MyInternationalizationString.sat) == strname)
+                        {
+                            weekvalue += 32;
+                        }
+                        else if (Language.StringByID(MyInternationalizationString.sun) == strname)
+                        {
+                            weekvalue += 64;
+                        }
+                    }
 
+                    Common.Logic.CurrentLogic.TimeAttribute.Repeat = 5;
+                    Common.Logic.CurrentLogic.TimeAttribute.WeekDay = weekvalue;
                 };
-                weekFramelayout.MouseUpEventHandler += weekclick;
-                weekTextBtn.MouseUpEventHandler += weekclick;
-                selectedBtn.MouseUpEventHandler += weekclick;
-                weekIconBtn.MouseUpEventHandler += weekclick;
-                weekRow.MouseUpEventHandler += weekclick;
-
+                cyclerwLayout.MouseUpEventHandler += weekclick;
+                btnname.MouseUpEventHandler += weekclick;
+                btnCheck.MouseUpEventHandler += weekclick;
+               
             }
 
 
-            saveBtn.MouseUpEventHandler += (sender, e) =>
-            {
-
-                int weekvalue = 0;
-                foreach (var strname in weeklist)
-                {
-                    if (Language.StringByID(MyInternationalizationString.mon) == strname)
-                    {
-                        weekvalue += 1;
-                    }
-                    else if (Language.StringByID(MyInternationalizationString.tue) == strname)
-                    {
-                        weekvalue += 2;
-                    }
-                    else if (Language.StringByID(MyInternationalizationString.wed) == strname)
-                    {
-                        weekvalue += 4;
-                    }
-                    else if (Language.StringByID(MyInternationalizationString.thu) == strname)
-                    {
-                        weekvalue += 8;
-                    }
-                    else if (Language.StringByID(MyInternationalizationString.frl) == strname)
-                    {
-                        weekvalue += 16;
-                    }
-                    else if (Language.StringByID(MyInternationalizationString.sat) == strname)
-                    {
-                        weekvalue += 32;
-                    }
-                    else if (Language.StringByID(MyInternationalizationString.sun) == strname)
-                    {
-                        weekvalue += 64;
-                    }
-                }
-                if (weekvalue == 0)
-                {
-                    var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
-                                                      Language.StringByID(MyInternationalizationString.selectweek),
-                                                  Language.StringByID(MyInternationalizationString.complete));
-
-                    alert.Show();
-                    return;
-                }
-                Common.Logic.CurrentLogic.TimeAttribute.Repeat = 5;
-                Common.Logic.CurrentLogic.TimeAttribute.WeekDay = weekvalue;
-
-                var logicCommunalPage = new LogicCommunalPage { };
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
-            };
+           
 
 
 

--
Gitblit v1.8.0