From ff3cfcf62632bf43e51a6b6098c203bf0f5cddbc Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 24 十二月 2019 19:53:29 +0800
Subject: [PATCH] 2019.12.24
---
ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 77 +++++++++++++++++++++++++++++++++-----
1 files changed, 67 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
index 6d52a0a..c8c1092 100644
--- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -67,6 +67,15 @@
/// IsDrawerLockMode
/// </summary>
public bool IsDrawerLockMode;
+ /// <summary>
+ /// ProgressBtn
+ /// </summary>
+ Button ProgressBtn;
+ /// <summary>
+ /// ProgressBtnY
+ /// </summary>
+ int ProgressBtnY;
+
#endregion
#region 鈼� 鎺ュ彛__________________________
@@ -126,10 +135,10 @@
}
if (deviceUI.CommonDevice.Type == DeviceType.DimmableLight)
{
- if ((common as DimmableLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
dimmableLight = deviceUI.CommonDevice as DimmableLight;
- dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
{
@@ -142,20 +151,22 @@
{
levelSeekBar.IsClickable = true;
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
+ //levelSeekBar.Progress = 100;
}
else
{
levelSeekBar.IsClickable = false;
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
+ //levelSeekBar.Progress = 0;
}
//change color
dimmableLight.LastDateTime = DateTime.Now;
}
//浜害
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8)
+ if (common.DeviceStatusReport.CluterID == 8)
{
dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
@@ -375,7 +386,7 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+ Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1)
};
itemView.AddChidren(StatuBtn);
@@ -385,14 +396,14 @@
Width = Application.GetRealWidth(271),
Height = Application.GetRealHeight(533),
Gravity = Gravity.CenterHorizontal,
- WavePadding = 2,
+ WavePadding = Application.GetRealWidth(8),
MaxValue=100,
Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100),
WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor
};
itemView.AddChidren(levelSeekBar);
- if (dimmableLight.OnOffStatus==1)
+ if (dimmableLight.OnOffStatus == 1)
{
levelSeekBar.IsClickable = true;
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor;
@@ -403,10 +414,29 @@
levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
}
- levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
+ levelSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
+ {
+ OnProgressButtonMove(levelSeekBar.Progress);
+ ProgressBtn.Visible = true;
+ };
+
+ levelSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+ {
+ ProgressBtn.Visible = false;
+ };
+
+ levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
{
- dimmableLight.SetLevel((int)(levelSeekBar.Progress*MaxLevel/100.0));
- };
+
+ OnProgressButtonMove(e2);
+
+ //鍒ゆ柇鏄惁300ms灞忚斀
+ if (levelSeekBar.IsProgressChangeDelay()) return;
+
+ dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
+ };
+
+ InitProgressBtn(itemView);
switchBtn = new Button()
{
@@ -460,6 +490,33 @@
itemView.AddChidren(roomName);
}
+ /// <summary>
+ /// OnProgressButtonMove
+ /// </summary>
+ private void OnProgressButtonMove(int mProgress)
+ {
+ ProgressBtn.Y = ProgressBtnY + levelSeekBar.NowProgressY;
+ ProgressBtn.Text = mProgress + "%";
+ }
+
+ /// <summary>
+ /// 娣诲姞杩涘害鎸夐挳
+ /// </summary>
+ private void InitProgressBtn(FrameLayout layout)
+ {
+ ProgressBtnY = levelSeekBar.Y - Application.GetMinReal(154);
+ ProgressBtn = new Button()
+ {
+ Y = ProgressBtnY,
+ Width = Application.GetMinReal(135),
+ Height = Application.GetMinReal(104),
+ UnSelectedImagePath = "Item/ProgressBubbles.png",
+ Visible = false,
+ Gravity = Gravity.CenterHorizontal
+ };
+ layout.AddChidren(ProgressBtn);
+ }
+
#endregion
#region 鈼� 缁戝畾鎸夐挳_______________________
--
Gitblit v1.8.0