WJC
2020-03-20 133ca903ae9c4df6ff037f5223d5abcd0df926f4
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;