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/AC/ACControl.cs | 108 +++++++++++++++++++++++++++++++----------------------
1 files changed, 63 insertions(+), 45 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index 394f0c2..d984867 100755
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -112,7 +112,15 @@
/// mArcScaleSeekBar
/// </summary>
private ArcScaleSeekBar mArcScaleSeekBar = new ArcScaleSeekBar { };
+ /// <summary>
+ /// 娓呮磥鐘舵��
+ /// </summary>
+ private LeftIconButtonRow cleanStatu;
+ /// <summary>
+ /// IsDrawerLockMode
+ /// </summary>
+ public bool IsDrawerLockMode;
#endregion
#region 鈼� 鎺ュ彛___________________________
@@ -230,6 +238,22 @@
FanSwingModeBtn.IsSelected = true;
}
break;
+
+ case 4097:
+ //杩囪檻缃戞竻娲楁爣蹇�:42
+ ac.CleanStatu = attriButeList[0].AttriButeData == 42;
+ cleanStatu.Visible = ac.CleanStatu;
+ break;
+
+ case 4099:
+ var value = Convert.ToString(attriButeList[0].AttriButeData, 2).PadLeft(16, '0');
+ var modeStr = value.Substring(value.Length - 5, 5);
+ for (int j = 0; j < modeStr.Length; j++)
+ {
+ ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
+ }
+ break;
+
}
}
@@ -334,6 +358,7 @@
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
ZigBee.Device.ZbGateway.StatusList.Add(this);
HomePage.Instance.ScrollEnabled = false;
+
}
#endregion
@@ -350,6 +375,10 @@
//action = null;
RemoveUpdateControlDeviceStatuAction();
HomePage.Instance.ScrollEnabled = true;
+ if (IsDrawerLockMode)
+ {
+ CommonPage.Instance.IsDrawerLockMode = false;
+ }
base.RemoveFromParent();
}
@@ -389,6 +418,8 @@
ac.ReadFanMode();
ac.ReadSystemMode();
ac.ReadSystemFansSwingMode();
+ ac.ReadModeSupport();
+ ac.ReadCleanStatu();
});
}
else
@@ -404,6 +435,8 @@
ac.ReadFanMode();
ac.ReadSystemMode();
ac.ReadSystemFansSwingMode();
+ ac.ReadModeSupport();
+ ac.ReadCleanStatu();
}
}
@@ -417,9 +450,7 @@
collectionBtn.IsSelected = true;
}
-
BindEvent();
-
}
#endregion
@@ -439,7 +470,6 @@
RemoveFromParent();
};
-
var moreBtn = new Button
{
X = Application.GetRealWidth(953),
@@ -451,7 +481,6 @@
top.topView.AddChidren(moreBtn);
moreBtn.MouseUpEventHandler += More;
-
}
/// <summary>
/// AddBodyView
@@ -476,6 +505,11 @@
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
};
bodyFrameLayout.AddChidren(itemView);
+
+ cleanStatu = new LeftIconButtonRow(400, 80, 0, 20);
+ itemView.AddChidren(cleanStatu);
+ cleanStatu.Init("AC/AC_TIP.png", "AC/AC_TIP.png", Language.StringByID(R.MyInternationalizationString.NeedCleanAC), false);
+ cleanStatu.Visible = false;
collectionBtn = new Button()
{
@@ -524,19 +558,16 @@
itemView.AddChidren(mArcScaleSeekBar);
mArcScaleSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
{
- //cool //dry
if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
{
ac.currentCoolingSetpoint = e;
ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
}
- //heat
else if (ac.currentSystemMode == 4)
{
ac.currentHeatingSetpoint = e;
ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
}
- //auto
else if (ac.currentSystemMode == 1)
{
ac.currentAutoSetpoint = e;
@@ -544,7 +575,6 @@
}
};
- //褰撳墠妯″紡
currentModeBtn = new Button()
{
Y = Application.GetRealHeight(599),
@@ -555,7 +585,7 @@
Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode)
};
itemView.AddChidren(currentModeBtn);
- //闄嶄綆娓╁害
+
reduceTemperatureBtn = new Button()
{
X = Application.GetRealWidth(268),
@@ -566,7 +596,6 @@
};
itemView.AddChidren(reduceTemperatureBtn);
- //娣诲姞娓╁害
addTemperatureBtn = new Button()
{
X = Application.GetRealWidth(628),
@@ -577,7 +606,6 @@
};
itemView.AddChidren(addTemperatureBtn);
- //鎵
FanSwingModeBtn = new Button()
{
X = Application.GetRealWidth(156),
@@ -590,7 +618,6 @@
};
itemView.AddChidren(FanSwingModeBtn);
- //妯″紡
modeBtn = new Button()
{
X = Application.GetRealWidth(346),
@@ -603,7 +630,6 @@
};
itemView.AddChidren(modeBtn);
- //寮�鍏�
switchBtn = new Button()
{
X = Application.GetRealWidth(536),
@@ -616,7 +642,6 @@
};
itemView.AddChidren(switchBtn);
- //椋庨��
fanModeBtn = new Button()
{
X = Application.GetRealWidth(729),
@@ -905,13 +930,13 @@
};
closeBGview.AddChidren(changeModeBG);
- var changeModeFL = new FrameLayout()
+ var changeModeFL = new VerticalScrolViewLayout()
{
X = Application.GetRealWidth(230),
Y = Application.GetRealHeight(450),
Height = Application.GetRealHeight(900),
Width = Application.GetRealWidth(modeItem_Width),
- Radius = CommonPage.BigFormRadius,
+ Radius = CommonFormResouce.BigFormRadius,
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
//BackgroundIagePath="AC/SelectedModeBG.png"
};
@@ -935,7 +960,10 @@
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Auto
};
- changeModeFL.AddChidren(mode_Auto);
+ if (ac.listSupportMode[4] == 1)
+ {
+ changeModeFL.AddChidren(mode_Auto);
+ }
mode_Auto.Init("AC/Mode_Auto.png", "AC/Mode_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Auto));
var mode_Cool = new CommonForm.ACLeftIconButtonRowLayout()
@@ -945,7 +973,10 @@
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Cool
};
- changeModeFL.AddChidren(mode_Cool);
+ if (ac.listSupportMode[0] == 1)
+ {
+ changeModeFL.AddChidren(mode_Cool);
+ }
mode_Cool.Init("AC/Mode_Cool.png", "AC/Mode_CoolSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Cool));
var mode_Heat = new CommonForm.ACLeftIconButtonRowLayout()
@@ -955,7 +986,10 @@
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Heat
};
- changeModeFL.AddChidren(mode_Heat);
+ if (ac.listSupportMode[1] == 1)
+ {
+ changeModeFL.AddChidren(mode_Heat);
+ }
mode_Heat.Init("AC/Mode_Heat.png", "AC/Mode_HeatSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Heat));
var mode_Dry = new CommonForm.ACLeftIconButtonRowLayout()
@@ -965,7 +999,10 @@
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Dry
};
- changeModeFL.AddChidren(mode_Dry);
+ if (ac.listSupportMode[3] == 1)
+ {
+ changeModeFL.AddChidren(mode_Dry);
+ }
mode_Dry.Init("AC/Mode_Dry.png", "AC/Mode_DrySelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Dry));
var mode_Fan = new CommonForm.ACLeftIconButtonRowLayout()
@@ -975,8 +1012,12 @@
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.FanOnly
};
- changeModeFL.AddChidren(mode_Fan);
+ if (ac.listSupportMode[2] == 1)
+ {
+ changeModeFL.AddChidren(mode_Fan);
+ }
mode_Fan.Init("AC/Mode_Fan.png", "AC/Mode_FanSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_FanOnly), false);
+
mode_Auto.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
mode_Auto.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
@@ -1071,13 +1112,11 @@
ac.currentSystemMode = (int)acMode;
mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
ac.SetSystemModeAsync(acMode);
-
-
}
#endregion
- #region 鈼� 鍒囨崲鎵___________________________
+ #region 鈼� 鍒囨崲鎵______________________
/// <summary>
@@ -1270,7 +1309,6 @@
mode = ZigBee.Device.AC.FanSwingMode.Fifth;
}
-
ChangeFanSwing(mode);
}
@@ -1310,7 +1348,6 @@
ACControlBase.ShowACIsCloseTip();
return;
}
- //cool //dry
if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
{
if (ac.currentCoolingSetpoint >= ACControlBase.Temperature_High)
@@ -1319,10 +1356,8 @@
}
ac.currentCoolingSetpoint += 1;
ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
- //currentTemperatureBtn.Text = $"{ac.currentCoolingSetpoint} 掳C";
mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
}
- //heat
else if (ac.currentSystemMode == 4)
{
if (ac.currentHeatingSetpoint >= ACControlBase.Temperature_High)
@@ -1331,10 +1366,8 @@
}
ac.currentHeatingSetpoint += 1;
ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
- //currentTemperatureBtn.Text = $"{ac.currentHeatingSetpoint} 掳C";
mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
}
- //auto
else if (ac.currentSystemMode == 1)
{
if (ac.currentAutoSetpoint >= ACControlBase.Temperature_High)
@@ -1343,10 +1376,8 @@
}
ac.currentAutoSetpoint += 1;
ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
- //currentTemperatureBtn.Text = $"{ac.currentAutoSetpoint} 掳C";
mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
}
-
}
#endregion
@@ -1365,7 +1396,6 @@
ACControlBase.ShowACIsCloseTip();
return;
}
- //cool //dry
if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
{
if (ac.currentCoolingSetpoint <= ACControlBase.Temperature_Low)
@@ -1374,11 +1404,8 @@
}
ac.currentCoolingSetpoint -= 1;
ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
-
- //currentTemperatureBtn.Text = $"{ac.currentCoolingSetpoint} 掳C";
mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
}
- //heat
else if (ac.currentSystemMode == 4)
{
if (ac.currentHeatingSetpoint <= ACControlBase.Temperature_Low)
@@ -1387,11 +1414,8 @@
}
ac.currentHeatingSetpoint -= 1;
ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
-
- //currentTemperatureBtn.Text = $"{ac.currentHeatingSetpoint} 掳C";
mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
}
- //auto
else if (ac.currentSystemMode == 1)
{
if (ac.currentAutoSetpoint <= ACControlBase.Temperature_Low)
@@ -1400,11 +1424,8 @@
}
ac.currentAutoSetpoint -= 1;
ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
-
- //currentTemperatureBtn.Text = $"{ac.currentAutoSetpoint} 掳C";
mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
}
-
}
#endregion
@@ -1441,7 +1462,6 @@
/// </summary>
private void RemoveUpdateControlDeviceStatuAction()
{
- //绉婚櫎action
if (zbGateway != null)
{
zbGateway.ReportAction -= UpdateDeviceControllStatu;
@@ -1480,7 +1500,6 @@
/// <param name="e">E.</param>
private void Collection(object sender, MouseEventArgs e)
{
- //collection
if (collectionBtn.IsSelected)
{
Shared.Common.Room.Lists[0].DeleteDevice(device.FileName);
@@ -1505,7 +1524,6 @@
private void BackToRoomHandler(object sender, MouseEventArgs mouseEventArgs)
{
//backToRoom
-
}
#endregion
--
Gitblit v1.8.0