From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28
---
ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs | 103 ++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 84 insertions(+), 19 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
index 1c739ea..fbeff98 100644
--- a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -13,7 +13,7 @@
/// <summary>
/// The action.
/// </summary>
- public Action action;
+ public Action<DeviceUI,Common.Room> action;
/// <summary>
/// 鏀惰棌鎸夐挳
@@ -88,6 +88,10 @@
/// ProgressBtnY
/// </summary>
int ProgressBtnY;
+ /// <summary>
+ /// ProgressBtnX
+ /// </summary>
+ int ProgressBtnX;
#endregion
@@ -242,8 +246,8 @@
{
UserView.HomePage.Instance.ScrollEnabled = true;
ZigBee.Device.ZbGateway.StatusList.Remove(this);
- //action();
- //action = null;
+ action(device,room);
+ action = null;
RemoveUpdateControlDeviceStatuAction();
if (IsDrawerLockMode)
{
@@ -294,8 +298,7 @@
}
}
- var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
- if (de == null)
+ if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false)
{
collectionBtn.IsSelected = false;
}
@@ -381,9 +384,10 @@
Width = Application.GetRealWidth(500),
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
- Text = device.CommonDevice.DeviceEpointName,
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15
+ TextSize = 15,
+ IsBold=true
};
itemView.AddChidren(deviceNameBtn);
@@ -394,7 +398,8 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}"
+ Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}",
+ TextSize = 10
};
itemView.AddChidren(StatuBtn);
@@ -458,7 +463,7 @@
}
SetCurtainType(itemView, (device.CommonDevice as Rollershade).WcdType);
-
+
var roomBG = new Button
{
Y = Application.GetRealHeight(1178 - 50),
@@ -494,7 +499,8 @@
Height = Application.GetRealHeight(50),
Text = room.Name,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor
+ TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ TextSize = 12
};
itemView.AddChidren(roomName);
}
@@ -647,9 +653,9 @@
UserView.HomePage.Instance.AddChidren(detailInfo);
UserView.HomePage.Instance.PageIndex += 1;
detailInfo.Show(device, room);
- detailInfo.action = () =>
+ detailInfo.EditAction += (curDev,curRoom) =>
{
- Show(device, room);
+ Show(curDev, curRoom);
};
}
@@ -705,10 +711,11 @@
curtainRollSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage;
layout.AddChidren(curtainRollSeekBar);
curtainRollSeekBar.IsProgressTextShow = false;
- //curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
- //{
- // (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
- //};
+ curtainRollSeekBar.CurtainPaddingTop = Application.GetRealHeight(110);
+ curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+ {
+ (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+ };
curtainRollSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
{
@@ -727,9 +734,9 @@
OnProgressButtonMove(e2);
//鍒ゆ柇鏄惁300ms灞忚斀
- if (curtainRollSeekBar.IsProgressChangeDelay()) return;
+ //if (curtainRollSeekBar.IsProgressChangeDelay()) return;
- (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+ //(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
};
InitProgressBtn(layout);
@@ -740,6 +747,7 @@
curtainSeekBar.Width = Application.GetRealWidth(570);
curtainSeekBar.Height = Application.GetRealHeight(513);
curtainSeekBar.Gravity = Gravity.CenterHorizontal;
+ curtainSeekBar.IsProgressTextShow = false;
curtainSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage;
layout.AddChidren(curtainSeekBar);
@@ -747,6 +755,29 @@
{
(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainSeekBar.Progress);
};
+
+ curtainSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
+ {
+ OnProgressButtonMoveForCurtain(curtainSeekBar.Progress);
+ ProgressBtn.Visible = true;
+ };
+
+ curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+ {
+ ProgressBtn.Visible = false;
+ };
+
+ curtainSeekBar.OnProgressChangedEvent += (send2, e2) =>
+ {
+
+ OnProgressButtonMoveForCurtain(e2);
+
+ //鍒ゆ柇鏄惁300ms灞忚斀
+ //if (curtainRollSeekBar.IsProgressChangeDelay()) return;
+
+ //(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+ };
+ InitProgressBtnForCurtain(layout);
}
}
@@ -763,7 +794,10 @@
Height = Application.GetMinReal(104),
UnSelectedImagePath = "Item/ProgressBubbles.png",
Visible = false,
- Gravity = Gravity.CenterHorizontal
+ Gravity = Gravity.CenterHorizontal,
+ TextSize=14,
+ IsBold=true,
+ TextColor=ZigbeeColor.Current.GXCTextWhiteColor
};
layout.AddChidren(ProgressBtn);
}
@@ -777,6 +811,37 @@
ProgressBtn.Text = mProgress + "%";
}
+
+ /// <summary>
+ /// 娣诲姞杩涘害鎸夐挳
+ /// </summary>
+ private void InitProgressBtnForCurtain(FrameLayout layout)
+ {
+ ProgressBtnX = curtainSeekBar.X - Application.GetMinReal(20);
+ ProgressBtn = new Button()
+ {
+ X = ProgressBtnX,
+ Y = curtainSeekBar.Y + curtainSeekBar.Height / 2 - Application.GetMinReal(180),
+ Width = Application.GetMinReal(135),
+ Height = Application.GetMinReal(104),
+ UnSelectedImagePath = "Item/ProgressBubbles.png",
+ Visible = false,
+ TextSize = 14,
+ IsBold = true,
+ TextColor = ZigbeeColor.Current.GXCTextWhiteColor
+ };
+ layout.AddChidren(ProgressBtn);
+ }
+
+ /// <summary>
+ /// OnProgressButtonMove
+ /// </summary>
+ private void OnProgressButtonMoveForCurtain(int mProgress)
+ {
+ ProgressBtn.X = ProgressBtnX + curtainSeekBar.NowProgressX- Application.GetMinReal(5);
+ ProgressBtn.Text = mProgress + "%";
+ }
+
#endregion
#region 鈼� 鏀惰棌鍒颁富椤礯______________________
--
Gitblit v1.8.0