From 412e0af11df2b1d7986adf002e7997d82344ab3e Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 13 七月 2020 09:47:40 +0800
Subject: [PATCH] 请合并最新版代码
---
ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs | 217 +++++++++++++++++++++++-------------------------------
1 files changed, 92 insertions(+), 125 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
index b654589..79b9b78 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -13,62 +13,27 @@
Tag = "Logic";
}
- public void Show ()
+ public void Show (string titlename)
{
- var weeklist = new List<string> ();
- this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
- var topFrameLayout = new FrameLayout
+ #region 鐣岄潰鐨勫竷灞�浠g爜
+ TopView view = new TopView();
+ this.AddChidren(view.TopRowView());
+ view.toptitleNameBtn.Text=titlename;
+ view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
+ var middle = new VerticalScrolViewLayout
{
- Height = Application.GetRealHeight(140),
- Y = Application.GetRealHeight(80),
+ Y = view.topRowLayout.Bottom,
+ Height = Application.GetRealHeight(Method.H - 184-260),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
- AddChidren(topFrameLayout);
+ this.AddChidren(middle);
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.Y = middle.Bottom;
+ this.AddChidren(saveView.Show());
+ #endregion
- var titleName = new Button
- {
- TextID = MyInternationalizationString.cycle,
- TextSize = 17,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- };
- 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",
- };
- topFrameLayout.AddChidren (back);
- back.MouseDownEventHandler += (sender, e) =>
- {
- RemoveFromParent();
- };
-
- var titlerl = new RowLayout {
- Height = Application.GetRealHeight (180),
- Y = Application.GetRealHeight (220),
- };
- 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 ();
- middle.Y = titlerl.Bottom;
- middle.Height = Application.GetRealHeight (1920 - 220 - 180);
- middle.BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor;
- this.AddChidren (middle);
-
+ var weeklist = new List<string>();
if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 5)
{
string len = "";
@@ -116,7 +81,6 @@
}
}
}
-
var cyclelist = new List<string> ();
cyclelist.AddRange (new string [] {
Language.StringByID(MyInternationalizationString.mon),
@@ -127,41 +91,32 @@
Language.StringByID(MyInternationalizationString.sat),
Language.StringByID(MyInternationalizationString.sun),
});
- foreach (var name in cyclelist) {
- var cyclerwLayout = new RowLayout {
- Height = Application.GetRealHeight (180),
- };
- middle.AddChidren (cyclerwLayout);
+ foreach (var name in cyclelist)
+ {
- var btnname = new Button {
- X = Application.GetRealWidth (40),
- Width = Application.GetRealWidth (600),
- Gravity = Gravity.CenterVertical,
- TextAlignment = TextAlignment.CenterLeft,
- Text = name,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- };
- cyclerwLayout.AddChidren (btnname);
-
- var btnCheck = new Button {
- Width = Application.GetRealWidth (115),
- Height = Application.GetRealHeight (110),
- Gravity = Gravity.CenterVertical,
- X = Application.GetRealWidth (1080-140),
- SelectedImagePath = "ZigeeLogic/CheckOn.png",
- UnSelectedImagePath = "ZigeeLogic/Check.png",
- };
- cyclerwLayout.AddChidren (btnCheck);
-
- var str = weeklist.Find ((o) => { return o == name; });
- if (str != null) {
- btnCheck.IsSelected = true;
- }
- ///閫変腑鏃堕棿
- EventHandler<MouseEventArgs> weekclick = (sender, e) =>
+ 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)
{
- btnCheck.IsSelected = !btnCheck.IsSelected;
- if (btnCheck.IsSelected)
+ 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)
+ {
+ monView.funnextBtn.Visible = true;
+ }
+ monView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
+ {
+ monView.funnextBtn.Visible = !monView.funnextBtn.Visible;
+ if (monView.funnextBtn.Visible)
{
var d = weeklist.Find((o) => { return o == name; });
if (d == null)
@@ -171,54 +126,66 @@
}
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;
};
- cyclerwLayout.MouseUpEventHandler += weekclick;
- btnname.MouseUpEventHandler += weekclick;
- btnCheck.MouseUpEventHandler += weekclick;
-
+
}
+ saveView.clickviewBtn.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 UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.selectweek),
+ Language.StringByID(MyInternationalizationString.confrim));
+ 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