From 74a9ba8e9a2df9c39f9c2eb212a5ac889a055cd4 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 03 十二月 2019 10:47:51 +0800
Subject: [PATCH] 优化UI细节(请合并最新代码)
---
ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs | 285 ++++++++++++++++++++++++++++++++++----------------------
1 files changed, 173 insertions(+), 112 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
index 444f69b..93d702f 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
@@ -14,183 +14,262 @@
{
Tag = "Logic";
}
- public bool IsDeviceEditor1;
+ public bool IsEditor;
public string str1;
Dictionary<string, string> timeBucketConditionsInfo = new Dictionary<string, string>();
public void Show()
{
- this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
- this.AddChidren(new Button
- {
- Height = Application.GetRealHeight(80),
- });
- var topFrameLayout = new FrameLayout
+ #region 鏈�涓婇潰鐨勫竷灞�浠g爜
+ var topRowLayout = new RowLayout
{
- Height = Application.GetRealHeight(140),
- Y = Application.GetRealHeight(80),
+ BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
+ Height = Application.GetRealHeight(184),
+ LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
};
- AddChidren(topFrameLayout);
+ this.AddChidren(topRowLayout);
var titleName = new Button
{
- Text = Language.StringByID(MyInternationalizationString.addtime),
TextSize = 17,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
TextAlignment = TextAlignment.CenterLeft,
- X = Application.GetRealWidth(150),
+ X = Application.GetRealWidth(176),
+ Width = Application.GetRealWidth(600),
+ Height = Application.GetRealHeight(69),
+ Y = Application.GetRealHeight(92),
+ TextID = MyInternationalizationString.addtime,
};
- topFrameLayout.AddChidren(titleName);
+ 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(110),
- Height = Application.GetRealHeight(110),
- X = Application.GetRealWidth(20),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "ZigeeLogic/Back.png",
+ Width = Application.GetRealWidth(30),
+ Height = Application.GetRealHeight(51),
+ X = Application.GetRealWidth(81),
+ Y = Application.GetRealHeight(98),
+ //Gravity = Gravity.CenterVertical;
+ UnSelectedImagePath = "ZigeeLogic/back.png",
};
- topFrameLayout.AddChidren(back);
- back.MouseDownEventHandler += (sender, e) =>
- {
+ topRowLayout.AddChidren(back);
+ back.MouseDownEventHandler += (sender, e) => {
RemoveFromParent();
- IsDeviceEditor1 = false;
};
+ #endregion
-
- var middle = new VerticalScrolViewLayout();
- middle.Y = topFrameLayout.Bottom;
- middle.Height = Application.GetRealHeight(1920- 220 - 200);
- middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+
+
+ #region 鏈�涓嬮潰鐨勫竷灞�浠g爜
+ var middle = new FrameLayout
+ {
+ Y = topRowLayout.Bottom,
+ Height = Application.GetRealHeight(1920 - 184-260),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
this.AddChidren(middle);
-
- #region -----绔嬪嵆鎵ц
- var row = new RowLayout
+ var fra = new FrameLayout
{
- Height = Application.GetRealHeight(250),
+ Y = middle.Bottom,
+ Height = Application.GetRealHeight(260),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
- middle.AddChidren(row);
-
- var btnTextTitle = new Button
+ this.AddChidren(fra);
+ var btnsave = new Button
{
- Height = Application.GetRealHeight(50),
- Width = Application.GetRealWidth(800),
- Y = Application.GetRealHeight(20),
- X = Application.GetRealWidth(40),
- // Text = "璇烽�夋嫨鏃堕棿绫诲瀷",
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextID = MyInternationalizationString.Selectedtimetype,
+ 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,
};
- row.AddChidren(btnTextTitle);
+ fra.AddChidren(btnsave);
+ #endregion
+
+ #region -----鏃堕棿鑼冨洿 寮�濮嬫椂闂� 缁撴潫鏃堕棿
+ #region -----鏃堕棿鑼冨洿
+
+
+ var typeFramelayout = new FrameLayout
+ {
+ Height = Application.GetRealHeight(160),
+ BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+ };
+ middle.AddChidren(typeFramelayout);
+
+
+ var typeRowlayout = new RowLayout
+ {
+ Y = Application.GetRealHeight(30),
+ Width = Application.GetRealWidth(965),
+ Height = Application.GetRealHeight(130),
+ X = Application.GetRealWidth(58),
+ LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
+ typeFramelayout.AddChidren(typeRowlayout);
var btnTypeTextTitle = new Button
{
- Y = Application.GetRealHeight(20 + 50),
- // Text = "绫诲瀷",
- X = Application.GetRealWidth(40),
+ Text = Language.StringByID(MyInternationalizationString.type),
TextAlignment = TextAlignment.CenterLeft,
- Height = Application.GetRealHeight(180),
- Width = Application.GetRealWidth(400),
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextID = MyInternationalizationString.type,
+ Width = Application.GetRealWidth(265),
+ TextSize = 14,
};
- row.AddChidren(btnTypeTextTitle);
-
- var btnTypeText = new Button
+ typeRowlayout.AddChidren(btnTypeTextTitle);
+
+
+ var btnimmediateexecution = new Button
{
- Y = Application.GetRealHeight(20 + 50),
- X = Application.GetRealWidth(1080 - 500 - 40),
- //Text = "鏃堕棿鑼冨洿",
+ X = btnTypeTextTitle.Right,
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetRealWidth(630),
TextAlignment = TextAlignment.CenterRight,
- Height = Application.GetRealHeight(180),
- Width = Application.GetRealWidth(500),
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
TextID = MyInternationalizationString.timeframe,
+ TextSize = 14,
};
- row.AddChidren(btnTypeText);
+ typeRowlayout.AddChidren(btnimmediateexecution);
+
+
+ var btnimmediateexecutionBack = new Button
+ {
+ Width = Application.GetRealWidth(58),
+ Height = Application.GetRealHeight(58),
+ UnSelectedImagePath = "ZigeeLogic/next.png",
+ X = btnimmediateexecution.Right + Application.GetRealWidth(12),
+ Gravity = Gravity.CenterVertical,
+ };
+ typeRowlayout.AddChidren(btnimmediateexecutionBack);
+
+
#endregion
+
+ #region -----寮�濮嬫椂闂�
+ var timestarFramelayout = new FrameLayout
+ {
+ Height = Application.GetRealHeight(160),
+ BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+ Y= typeFramelayout.Bottom,
+ };
+ middle.AddChidren(timestarFramelayout);
var timestartrow = new RowLayout
{
- Height = Application.GetRealHeight(180),
+ Y = Application.GetRealHeight(30),
+ Width = Application.GetRealWidth(965),
+ Height = Application.GetRealHeight(130),
+ X = Application.GetRealWidth(58),
+ LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
- middle.AddChidren(timestartrow);
+ timestarFramelayout.AddChidren(timestartrow);
var btnstarttimetext = new Button
{
+ Text = Language.StringByID(MyInternationalizationString.starttime),
TextAlignment = TextAlignment.CenterLeft,
- Width = Application.GetRealWidth(300),
- X = Application.GetRealWidth(30),
- TextID = MyInternationalizationString.starttime,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ Width = Application.GetRealWidth(265),
+ TextSize = 14,
+
};
timestartrow.AddChidren(btnstarttimetext);
var btnstarttime = new Button
{
- X = Application.GetRealWidth(330),
+ X = btnstarttimetext.Right,
Gravity = Gravity.CenterVertical,
- Width = Application.GetRealWidth(600),
- TextAlignment = TextAlignment.CenterLeft,
- Tag = "0",
+ Width = Application.GetRealWidth(630),
+ TextAlignment = TextAlignment.CenterRight,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ Tag = "0",
+ TextSize = 14,
};
timestartrow.AddChidren(btnstarttime);
var btnstartback = new Button
{
- Width = Application.GetRealWidth(110),
- Height = Application.GetRealHeight(110),
+ Width = Application.GetRealWidth(58),
+ Height = Application.GetRealHeight(58),
UnSelectedImagePath = "ZigeeLogic/next.png",
- SelectedImagePath = "ZigeeLogic/NextSelecte.png",
- X = Application.GetRealWidth(1080-140),
+ X = btnstarttime.Right + Application.GetRealWidth(12),
Gravity = Gravity.CenterVertical,
};
timestartrow.AddChidren(btnstartback);
+ #endregion
+
+ #region -----缁撴潫鏃堕棿
+ var timeendFramelayout = new FrameLayout
+ {
+ Height = Application.GetRealHeight(160),
+ BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+ Y = timestarFramelayout.Bottom,
+ };
+ middle.AddChidren(timeendFramelayout);
+
var timeendrow = new RowLayout
{
- Height = Application.GetRealHeight(180),
+ Y = Application.GetRealHeight(30),
+ Width = Application.GetRealWidth(965),
+ Height = Application.GetRealHeight(130),
+ X = Application.GetRealWidth(58),
+ LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
};
- middle.AddChidren(timeendrow);
+ timeendFramelayout.AddChidren(timeendrow);
var btnendtimetext = new Button
{
+ Text = Language.StringByID(MyInternationalizationString.endtime),
TextAlignment = TextAlignment.CenterLeft,
- Width = Application.GetRealWidth(300),
- X = Application.GetRealWidth(30),
- TextID = MyInternationalizationString.endtime,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ Width = Application.GetRealWidth(265),
+ TextSize = 14,
+
};
timeendrow.AddChidren(btnendtimetext);
var btnendtime = new Button
{
- X = Application.GetRealWidth(330),
+ X = btnendtimetext.Right,
Gravity = Gravity.CenterVertical,
- Width = Application.GetRealWidth(600),
- TextAlignment = TextAlignment.CenterLeft,
- Tag = "0",
+ Width = Application.GetRealWidth(630),
+ TextAlignment = TextAlignment.CenterRight,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ Tag = "0",
};
timeendrow.AddChidren(btnendtime);
var btnendtimeback = new Button
{
- Width = Application.GetRealWidth(110),
- Height = Application.GetRealHeight(110),
+ Width = Application.GetRealWidth(58),
+ Height = Application.GetRealHeight(58),
UnSelectedImagePath = "ZigeeLogic/next.png",
- SelectedImagePath = "ZigeeLogic/NextSelecte.png",
- X = Application.GetRealWidth(1080-140),
+ X = btnendtime.Right + Application.GetRealWidth(12),
Gravity = Gravity.CenterVertical,
};
timeendrow.AddChidren(btnendtimeback);
+ #endregion
+ #endregion
- if (IsDeviceEditor1)
+ if (IsEditor)
{
if (str1 != null)
{
@@ -245,11 +324,10 @@
}
}
-
EventHandler<MouseEventArgs> stattimeclick = (sender, e) =>
{
- var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
+ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
AddChidren(flMain);
flMain.MouseUpEventHandler += (sender11, e11) =>
{
@@ -319,11 +397,11 @@
btnstarttimetext.MouseUpEventHandler += stattimeclick;
btnstarttime.MouseUpEventHandler += stattimeclick;
btnstartback.MouseUpEventHandler += stattimeclick;
-
+ timestarFramelayout.MouseUpEventHandler += stattimeclick;
EventHandler<MouseEventArgs> endtimeclick = (sender, e) =>
{
- var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
+ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
AddChidren(flMain);
flMain.MouseUpEventHandler += (sender11, e11) =>
{
@@ -394,30 +472,14 @@
btnendtimetext.MouseUpEventHandler += endtimeclick;
btnendtime.MouseUpEventHandler += endtimeclick;
btnendtimeback.MouseUpEventHandler += endtimeclick;
+ timeendFramelayout.MouseUpEventHandler += endtimeclick;
- var fra = new FrameLayout
- {
- Y = middle.Bottom,
- Height = Application.GetRealHeight(200),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- this.AddChidren(fra);
- var btncomplete = new Button
- {
- X = Application.GetRealWidth(290),
- Height = Application.GetRealHeight(150),//194
- Width = Application.GetRealWidth(500),
- Radius = (uint)Application.GetRealHeight(50),
- BackgroundColor = ZigbeeColor.Current.LogicButtonBlueColor,
- TextID = MyInternationalizationString.Save,
- };
- fra.AddChidren(btncomplete);
-
- timeBucketConditionsInfo.Add("Type","5");
- timeBucketConditionsInfo.Add("IsValid", "1");
///瀹屾垚鐐瑰嚮浜嬩欢
EventHandler<MouseEventArgs>completeclick=(sender, e) =>
{
+
+ timeBucketConditionsInfo.Add("Type", "5");
+ timeBucketConditionsInfo.Add("IsValid", "1");
if (string.IsNullOrEmpty(btnstarttime.Text) || string.IsNullOrEmpty(btnendtime.Text))
{
@@ -436,7 +498,7 @@
return;
}
- if (IsDeviceEditor1)
+ if (IsEditor)
{
for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
{
@@ -466,9 +528,8 @@
UserView.HomePage.Instance.PageIndex += 1;
logicCommunalPage.Show(() => { });
};
-
fra.MouseUpEventHandler += completeclick;
- btncomplete.MouseUpEventHandler += completeclick;
+ btnsave.MouseUpEventHandler += completeclick;
}
}
--
Gitblit v1.8.0