From 6817ec660fcf032ed94a4197b145ad1e96c2aeed Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 06 五月 2020 17:40:34 +0800
Subject: [PATCH] 2020-05-06-2
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs | 57 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 32 insertions(+), 25 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
index 4102a31..c399fee 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -80,7 +80,7 @@
//璁剧疆鏍囬淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
- this.gatewayId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway);
+ this.gatewayId = GatewayResourse.NowSelectGatewayId;
HdlGatewayLogic.Current.GetRealGateway(ref this.realGateway, this.gatewayId);
//鍒濆鍖栦腑閮ㄦ帶浠�
@@ -96,11 +96,13 @@
this.ClearBodyFrame();
//鍥剧墖
- var btnPic = new PicViewControl(878, 478);
- btnPic.Y = Application.GetMinRealAverage(251);
- btnPic.Gravity = Gravity.CenterHorizontal;
- btnPic.UnSelectedImagePath = "Instruct/DeviceSearch.png";
- bodyFrameLayout.AddChidren(btnPic);
+ var framePic = new FrameLayout();
+ framePic.Width = this.GetPictrueRealSize(878);
+ framePic.Height = this.GetPictrueRealSize(478);
+ framePic.Y = Application.GetRealHeight(251);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.BackgroundImagePath = "Instruct/DeviceSearch.png";
+ bodyFrameLayout.AddChidren(framePic);
//姝e湪鎼滅储璁惧锛岃绋嶅�欌��
var btnSearch = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(58), false);
@@ -142,13 +144,15 @@
btnProgressView.Text = "0%";
frameProgress.AddChidren(btnProgressView);
- //鍏佽璁惧鍏ョ綉
- this.StartDeviceCanAddToGateway(false);
-
- //娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢
- this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
+ if (this.realGateway != null)
+ {
+ //鍏佽璁惧鍏ョ綉
+ this.StartDeviceCanAddToGateway(false);
+ //娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢
+ this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
+ }
//寮�鍚繛鎺ョ殑鍋囨兂鍔ㄧ敾鏁堟灉绾跨▼
- this.StartConcetionAnimeteThread();
+ this.StartConcetionAnimeteThread(framePic);
}
#endregion
@@ -310,23 +314,23 @@
/// <summary>
/// 寮�鍚繛鎺ョ殑鍋囨兂鍔ㄧ敾鏁堟灉绾跨▼
/// </summary>
- private void StartConcetionAnimeteThread()
+ private void StartConcetionAnimeteThread(FrameLayout framePic)
{
- int iconSize = Application.GetMinRealAverage(23);
+ int iconSize = this.GetPictrueRealSize(23);
var listPoint = new List<int>();
for (int i = 0; i < 9; i++)
{
//X杞�+Index*(鍥炬爣澶у皬+闂磋窛)
- listPoint.Add(Application.GetMinRealAverage(394) + i * (iconSize + Application.GetMinRealAverage(10)));
+ listPoint.Add(this.GetPictrueRealSize(300) + i * (iconSize + this.GetPictrueRealSize(10)));
}
var btnRound = new PicViewControl(iconSize, iconSize, false);
btnRound.Radius = (uint)iconSize / 2;
btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor;
btnRound.X = listPoint[0];
- btnRound.Y = Application.GetMinRealAverage(475);
- bodyFrameLayout.AddChidren(btnRound);
+ btnRound.Y = this.GetPictrueRealSize(225);
+ framePic.AddChidren(btnRound);
HdlThreadLogic.Current.RunThread(() =>
{
@@ -571,15 +575,18 @@
/// </summary>
public override void CloseFormBefore()
{
- //鍋滄鎺ユ敹
- this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
-
- HdlThreadLogic.Current.RunThread(() =>
+ if (this.realGateway != null)
{
- System.Threading.Thread.Sleep(1200);
- //鍏抽棴鍏ョ綉妯″紡
- this.realGateway.AddNewDeviceToGateway(0);
- });
+ //鍋滄鎺ユ敹
+ this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ System.Threading.Thread.Sleep(1200);
+ //鍏抽棴鍏ョ綉妯″紡
+ this.realGateway.AddNewDeviceToGateway(0);
+ });
+ }
base.CloseFormBefore();
}
--
Gitblit v1.8.0