From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs | 183 +++++++++++++++++++++++++++++----------------
1 files changed, 118 insertions(+), 65 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
index e4c70ef..b76866c 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -6,6 +6,7 @@
using HDL_ON.Entity;
using HDL_ON.DriverLayer;
using HDL_ON.UI.Music;
+using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
namespace HDL_ON.UI
{
@@ -40,6 +41,10 @@
/// </summary>
private Button btnCurrDeviceRoom;
/// <summary>
+ /// 鐢甸噺鐖舵帶浠�
+ /// </summary>
+ private FrameLayout cellFrame;
+ /// <summary>
/// 鐢甸噺
/// </summary>
private Button btnCell;
@@ -71,7 +76,7 @@
/// <summary>
/// 琛ㄧず鏉ヨ嚜閭d釜鐣岄潰
/// </summary>
- private UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom Comerom;
+ private CommonMethod.Comerom comerom;
/// <summary>
/// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟
/// </summary>
@@ -83,14 +88,14 @@
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="function">璁惧</param>
- /// <param name="btnDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢</param>
- /// <param name="btnRoomName">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢</param>
- public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom comerom, Action action)
+ /// <param name="btnDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param>
+ /// <param name="btnRoomName">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param>
+ public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action)
{
this.device = function;
this.btnDeviceName = btnDeviceName;
this.btnRoomName = btnRoomName;
- this.Comerom = comerom;
+ this.comerom = comerom;
this.action = action;
}
@@ -103,8 +108,6 @@
this.EventListener();
//璇诲彇鏁版嵁
this.ReadData();
-
-
}
@@ -164,11 +167,7 @@
};
whiteFl.AddChidren(btnCurrDeviceName);
- btnCurrDeviceName.Width = btnCurrDeviceName.GetTextWidth();
- if (btnCurrDeviceName.GetTextWidth() > btnCollectIcon.X)
- {
- btnCurrDeviceName.Width = btnCollectIcon.X;
- }
+
btnCurrDeviceRoom = new Button
{
TextSize = TextSize.Text12,
@@ -181,9 +180,8 @@
TextAlignment = TextAlignment.CenterLeft,
};
whiteFl.AddChidren(btnCurrDeviceRoom);
- btnCurrDeviceRoom.Width = btnCurrDeviceRoom.GetTextWidth();
- var cellFrame = new FrameLayout
+ cellFrame = new FrameLayout
{
X = btnCurrDeviceRoom.Right + Application.GetRealWidth(20),
Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(5),
@@ -191,8 +189,6 @@
Height = Application.GetRealHeight(16),
};
whiteFl.AddChidren(cellFrame);
-
-
cellDiyArcSeekBar = new DiyArcSeekBar
{
@@ -221,7 +217,12 @@
cellFrame.AddChidren(btnCell);
-
+#if __IOS__
+//btnCell.Padding = new Padding(0,0,0,0);
+ btnCell.Width += 5;
+ cellFrame.Width += 5;
+#else
+#endif
//闂ㄩ攣鐘舵��
@@ -235,6 +236,9 @@
SelectedImagePath = "FunctionIcon/DoorLock/UnLocking.png",
};
whiteFl.AddChidren(btnDoorLockIcon);
+
+ this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害
+
int heightY = btnDoorLockIcon.Bottom + Application.GetRealHeight(70);
//瀹炴椂瑙嗛
rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
@@ -264,6 +268,8 @@
pswFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png";
pswFL.GetTextButton().TextID = StringId.linshimima1;
+
+
#endregion
@@ -276,47 +282,39 @@
//杩斿洖
this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
{
- RemoveFromParent();
-
-
+ this.RemoveFromParent();
};
//璁剧疆
this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
{
- //璋冪敤绉�缁曠殑鐣岄潰
- var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
+ CommonMethod.Current.MainThread(() =>
{
+ //璋冪敤绉�缁曠殑鐣岄潰
+ var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
+ {
+ if (this.btnDeviceName == null || this.btnRoomName == null || this.device == null)
+ {
+ return;
+ }
+ ////鍒锋柊鏄剧ず
+ this.btnDeviceName.Text = this.device.name;
+ this.btnRoomName.Text = this.device.GetRoomListName();
+ this.btnCurrDeviceName.Text = this.device.name;
+ this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
+ this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害
+ });
+ infoView.actionDel += () =>
+ {
+ //瑙g粦璁惧鍚�
+ this.RemoveFromParent();
+ this.action?.Invoke();
- if (this.btnDeviceName == null || this.btnRoomName == null)
- {
- return;
- }
- ////鍒锋柊鏄剧ず
- this.btnDeviceName.Text = this.device.name;
- this.btnRoomName.Text = this.device.GetRoomListName();
- this.topView.topNameBtn.Text = this.device.name;
- this.btnCurrDeviceName.Text = this.device.name;
- this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
-
- ////浠庢柊璁$畻瀹藉害
- //this.btnDeviceName.Text = btnDeviceName.Text;
- //this.btnDeviceName.Width = this.btnDeviceName.GetTextWidth();
-
- //this.btnRoomName.Text = btnRoomName.Text;
- //this.btnRoomName.Width = this.btnRoomName.GetTextWidth();
-
- ////鍥炶皟浜嬩欢
- //this.SettionFinishEvent?.Invoke();
- }, () =>
- {
- //瑙g粦璁惧鍚�
- this.RemoveFromParent();
- this.action?.Invoke();
+ };
+ MainPage.BasePageView.AddChidren(infoView);
+ infoView.LoadPage();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
});
- MainPage.BasePageView.AddChidren(infoView);
- infoView.LoadPage();
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
//鏀惰棌
this.btnCollectIcon.MouseUpEventHandler += (sender, e) =>
@@ -327,12 +325,18 @@
//瀹炴椂瑙嗛
this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) =>
{
-
+ CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk, false);
});
//涓存椂瀵嗙爜
- this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
+ this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) =>
+ {
+ CommonMethod.Current.SkipPSWActivity(this.device.deviceId);
+ });
//鍘嗗彶璁板綍
- this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
+ this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) =>
+ {
+ CommonMethod.Current.SkipRecordActivity(this.device.deviceId);
+ });
}
@@ -341,16 +345,14 @@
/// </summary>
private void ReadData()
{
- Loading loading = new Loading();
- this.AddChidren(loading);
- loading.Start();
- new System.Threading.Thread(() =>
+ CommonMethod.Current.Loading.Start();
+ CommonMethod.Current.SunThread(() =>
{
try
{
- var videoDoorLockInfo = UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockState(this.device);
- var cellInfo =UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetCellValue(this.device);
- Application.RunOnMainThread(() =>
+ var videoDoorLockInfo = VideDoorLockSend.Current.GetVideoDoorLockState(this.device);
+ var cellInfo = VideDoorLockSend.Current.GetCellValue(this.device);
+ CommonMethod.Current.MainThread(() =>
{
//this.cellDiyArcSeekBar.Progress = i;
//鏇存柊鐢甸噺鍊�
@@ -363,12 +365,63 @@
{
Application.RunOnMainThread(() =>
{
- loading.Hide();
+ CommonMethod.Current.Loading.Hide();
});
}
- })
- { IsBackground = true }.Start() ;
+ });
}
+
+
+
+ /// <summary>
+ /// 閲嶆柊璁$畻瀹藉害(璁惧鍚嶇О,鎴块棿鎺т欢)
+ /// </summary>
+ private void CalculatedPosition()
+ {
+ this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth();
+ this.btnCurrDeviceName.Width += 10;
+ if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X)
+ {
+ //閲嶆柊璁$畻瀹藉害
+ this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10);
+ }
+ this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth();
+ this.btnCurrDeviceRoom.Width += 10;
+ if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X)
+ {
+ //閲嶆柊璁$畻瀹藉害
+ this.btnCurrDeviceRoom.Width = this.btnCollectIcon.X + Application.GetRealWidth(-20 - 10);
+ }
+ this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20);
+ }
+
+ /// <summary>
+ /// 鏇存柊鐘舵��
+ /// </summary>
+ public void UpdateState(PushMessageType pushMessageType)
+ {
+ CommonMethod.Current.MainThread(() =>
+ {
+ if (pushMessageType == PushMessageType.Alarm)
+ {
+ //闂ㄩ攣鐢垫睜鍊�
+ if (this.btnCell != null)
+ {
+ //videoDoorLockPage.btnCell.Text = "";
+ }
+ }
+ else
+ {
+ if (this.btnDoorLockIcon != null && !this.btnDoorLockIcon.IsSelected)
+ {
+ this.btnDoorLockIcon.IsSelected = false;
+ }
+ }
+
+ });
+
+ }
+
}
/// <summary>
/// 鑷繁寮勪竴涓狥rameLayout
@@ -405,7 +458,7 @@
TextID = StringId.dangqianmenweiguan,
TextSize = TextSize.Text12,
TextColor = MusicColor.TextCancelColor,
- TextAlignment=TextAlignment.Center,
+ TextAlignment = TextAlignment.Center,
Gravity = Gravity.CenterHorizontal,
Name = "btnStateText"
};
@@ -492,6 +545,6 @@
}
-
+
}
--
Gitblit v1.8.0