From 627093aca723d4bfb971b97c828e8b3a22dbda78 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 17 七月 2020 17:26:19 +0800
Subject: [PATCH] 2020-07-17-1
---
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs | 77 +++++++++++++++++++++++++++-----------
1 files changed, 55 insertions(+), 22 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
index ce7a88e..b509b41 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayProductInfoForm.cs
@@ -44,18 +44,48 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
bool gateWayExist = HdlGatewayLogic.Current.IsGatewayExist(zbGateway);
+ var framePic = new FrameLayout();
+ framePic.Width = Application.GetRealWidth(855);
+ framePic.Height = Application.GetRealHeight(570);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.Y = Application.GetRealHeight(58);
+ listBackControl.frameTable.AddChidren(framePic);
+
+ var linuxImageType = this.zbGateway.LinuxImageType.ToString();
+ var imageFile = "Gateway/RealGateway" + linuxImageType + ".png";
+ imageFile = IO.FileUtils.GetImageFilePath(imageFile);
+ if (imageFile == string.Empty)
+ {
+ //濡傛灉娌℃湁鎸囧畾鐨勭綉鍏崇殑鐪熷疄鍥剧墖鐨勮瘽,鍒欑敤鍏遍�氬浘鐗�
+ imageFile = IO.FileUtils.GetImageFilePath("Gateway/RealGateway.png");
+ }
+#if Android
+ //璁惧鍥剧墖
+ var bim = Android.Graphics.BitmapFactory.DecodeFile(imageFile);
+ var btnpictrue = new PicViewControl(bim.Width, bim.Height);
+#endif
+#if iOS
+ //璁惧鍥剧墖
+ var bim = UIKit.UIImage.FromFile(imageFile);
+ var btnpictrue = new PicViewControl((int)bim.Size.Width, (int)bim.Size.Height);
+#endif
+ bim.Dispose();
+ bim = null;
+
//鍥剧墖
- var btnImage = new PicViewControl(855, 570, true);
- btnImage.Y = Application.GetRealHeight(58);
- btnImage.Gravity = Gravity.CenterHorizontal;
- HdlGatewayLogic.Current.SetRealGatewayPictrue(btnImage, zbGateway);
- bodyFrameLayout.AddChidren(btnImage);
+ btnpictrue.Gravity = Gravity.Center;
+ btnpictrue.UnSelectedImagePath = imageFile;
+ framePic.AddChidren(btnpictrue);
//鍒濆鍖栨甯�
var tableContr = new InformationEditorControl();
- var listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ var listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//璁惧澶囨敞(濡傛灉杩欎釜缃戝叧娌℃湁缁戝畾鐨勮瘽,鍙厑璁告煡鐪�,涓嶈兘鏇存敼)
string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
@@ -92,32 +122,34 @@
btnNote.AddBottomLine();
}
- //璁惧绫诲瀷
+ //璁惧绫诲瀷 (鍥哄畾鏅鸿兘缃戝叧)
caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
- var btnType = new FrameCaptionViewControl(caption, string.Empty, listview.rowSpace / 2);
+ var btnType = new FrameCaptionViewControl(caption, Language.StringByID(60004), listview.rowSpace / 2);
btnType.UseClickStatu = false;
listview.AddChidren(btnType);
btnType.InitControl();
//鍒掔嚎
btnType.AddBottomLine();
- HdlGatewayLogic.Current.SetGatewayImageText(btnType.txtView, zbGateway);
- //鎵�灞炲尯鍩�
- caption = Language.StringByID(R.MyInternationalizationString.uBelongArea);
- var btnBeloneArea = new FrameCaptionViewControl(caption, Common.Config.Instance.Home.Name, listview.rowSpace / 2);
- btnBeloneArea.UseClickStatu = false;
- listview.AddChidren(btnBeloneArea);
- btnBeloneArea.InitControl();
- //鍒掔嚎
- btnBeloneArea.AddBottomLine();
+ //瀹夎浣嶇疆
+ var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
+ listview.AddChidren(rowBeloneArea);
+ rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uInstallationLocation), this.zbGateway);
+ //搴曠嚎
+ rowBeloneArea.AddBottomLine();
+ rowBeloneArea.SelectRoomEvent += (roomKeys) =>
+ {
+ //鍙樻洿缃戝叧鎴块棿
+ HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway, roomKeys);
+ };
//瀹屾垚鍒濆鍖栨甯�
- tableContr.FinishInitControl(bodyFrameLayout, listview);
+ tableContr.FinishInitControl();
if (gateWayExist == true)
{
//鏇村閰嶇疆
- var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(49), false);
+ var btnHelp = new NormalViewControl(listBackControl.frameTable.Width, Application.GetRealHeight(49), false);
btnHelp.Y = Application.GetRealHeight(1388);
btnHelp.TextSize = 12;
btnHelp.TextAlignment = TextAlignment.Center;
@@ -128,14 +160,14 @@
var form = new GatewayManage.GatewayInfoEditorForm();
this.AddFromAndRemoveNowForm(form, zbGateway);
};
- bodyFrameLayout.AddChidren(btnHelp);
+ listBackControl.frameTable.AddChidren(btnHelp);
//搴曠嚎
- int lineWidth = btnHelp.GetRealWidthByText(12);
+ int lineWidth = btnHelp.GetRealWidthByText();
var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
btnLine.Gravity = Gravity.CenterHorizontal;
btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8);
- bodyFrameLayout.AddChidren(btnLine);
+ listBackControl.frameTable.AddChidren(btnLine);
}
//瀹屾垚鎸夐挳
@@ -148,6 +180,7 @@
{
//濡傛灉杩欎釜缃戝叧杩樻病鏈夌粦瀹�,鍒欑洿鎺ュ叧闂晫闈�
this.CloseForm();
+ return;
}
//瀹屾垚鎸夐挳鎸変笅
this.FinishButtonClick(btnGateName.Text);
--
Gitblit v1.8.0