From 0a0d7ec5080cd1f1802d9fcc96b08102b9b551f1 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 29 五月 2020 11:15:19 +0800
Subject: [PATCH] 2020-05-29-2
---
ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs | 171 ++++++++++-----------------------------------------------
1 files changed, 30 insertions(+), 141 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 d1a0f0f..79b9b78
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -15,88 +15,25 @@
public void Show (string titlename)
{
- var weeklist = new List<string> ();
-
- #region 鏈�涓婇潰鐨勫竷灞�浠g爜
- var topRowLayout = new RowLayout
- {
- BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
- Height = Application.GetRealHeight(184),
- LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
- };
- this.AddChidren(topRowLayout);
-
- var titleName = new Button
- {
- TextSize = 17,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- X = Application.GetRealWidth(176),
- Width = Application.GetRealWidth(600),
- Height = Application.GetRealHeight(69),
- Y = Application.GetRealHeight(92),
- Text = titlename,
- IsBold = true,
- };
- topRowLayout.AddChidren(titleName);
-
- var clickBtn = new Button
- {
- Width = Application.GetRealWidth(81 + 51),
- Height = Application.GetRealHeight(58 + 40),
- Y = Application.GetRealHeight(98 - 40),
- };
- topRowLayout.AddChidren(clickBtn);
- clickBtn.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",
- };
- topRowLayout.AddChidren(back);
- back.MouseDownEventHandler += (sender, e) => {
- RemoveFromParent();
- };
- #endregion
-
-
+ #region 鐣岄潰鐨勫竷灞�浠g爜
+ TopView view = new TopView();
+ this.AddChidren(view.TopRowView());
+ view.toptitleNameBtn.Text=titlename;
+ view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
var middle = new VerticalScrolViewLayout
{
- Y = topRowLayout.Bottom,
- Height = Application.GetRealHeight(1920 - 184-260),
+ Y = view.topRowLayout.Bottom,
+ 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 = "";
@@ -144,7 +81,6 @@
}
}
}
-
var cyclelist = new List<string> ();
cyclelist.AddRange (new string [] {
Language.StringByID(MyInternationalizationString.mon),
@@ -158,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.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
- {
- 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)
@@ -236,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;
@@ -282,10 +172,9 @@
}
if (weekvalue == 0)
{
- var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
- Language.StringByID(MyInternationalizationString.selectweek),
- Language.StringByID(MyInternationalizationString.confrim));
-
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.selectweek),
+ Language.StringByID(MyInternationalizationString.confrim));
alert.Show();
return;
}
--
Gitblit v1.8.0