From 74a9ba8e9a2df9c39f9c2eb212a5ac889a055cd4 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 03 十二月 2019 10:47:51 +0800
Subject: [PATCH] 优化UI细节(请合并最新代码)
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 204 +++++++++++++++++++++++++-------------------------
1 files changed, 102 insertions(+), 102 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index 0dd4842..1368cc6 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -1,19 +1,19 @@
-锘縰sing System;
-using System.Collections.Generic;
-using ZigBee.Device;
-
-namespace Shared.Phone.UserCenter.Device
-{
- /// <summary>
- /// 缃戝叧鎴愬姛娣诲姞璁惧鐨勬樉绀虹敾闈�
- /// </summary>
- public class DeviceAddSuccessForm : EditorCommonForm
+锘縰sing System;
+using System.Collections.Generic;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.Device
+{
+ /// <summary>
+ /// 缃戝叧鎴愬姛娣诲姞璁惧鐨勬樉绀虹敾闈�
+ /// </summary>
+ public class DeviceAddSuccessForm : EditorCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
- /// <summary>
- /// 鏂颁笂鎶ョ殑璁惧
- /// </summary>
+ /// <summary>
+ /// 鏂颁笂鎶ョ殑璁惧
+ /// </summary>
private List<CommonDevice> listNewDevice = null;
/// <summary>
/// 鍒楄〃鎺т欢
@@ -24,57 +24,57 @@
/// </summary>
private string saveDefultName = string.Empty;
- #endregion
+ #endregion
- #region 鈻� 鍒濆鍖朹____________________________
+ #region 鈻� 鍒濆鍖朹____________________________
- /// <summary>
- /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
- /// </summary>
- /// <param name="deviceMac">璁惧Mac鍦板潃</param>
- public void ShowForm(string deviceMac)
- {
- this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
-
- //璁剧疆鏍囬淇℃伅
- base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
-
- //鍒濆鍖栦腑閮ㄦ帶浠�
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="deviceMac">璁惧Mac鍦板潃</param>
+ public void ShowForm(string deviceMac)
+ {
+ this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
this.InitMiddleFrame();
//璁剧疆鍏ㄩ儴鍥炶矾鐨勯粯璁ゅ悕瀛�
this.SetAllEpointName();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄦ帶浠�
- /// </summary>
- private void InitMiddleFrame()
- {
- //娓呯┖bodyFrame
- this.ClearBodyFrame();
-
- //鍒濆鍖栨甯�
- this.InitFrameTable();
-
- //璁惧鍥剧墖
- var btnpictrue = new PicViewControl(855, 570);
- btnpictrue.Gravity = Gravity.CenterHorizontal;
- btnpictrue.Y = Application.GetRealHeight(58);
- Common.LocalDevice.Current.SetRealDeviceIconToControl(btnpictrue, listNewDevice);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ //鍒濆鍖栨甯�
+ this.InitFrameTable();
+
+ //璁惧鍥剧墖
+ var btnpictrue = new PicViewControl(855, 570);
+ btnpictrue.Gravity = Gravity.CenterHorizontal;
+ btnpictrue.Y = Application.GetRealHeight(58);
+ Common.LocalDevice.Current.SetRealDeviceIconToControl(btnpictrue, listNewDevice);
bodyFrameLayout.AddChidren(btnpictrue);
string nameValue = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
this.saveDefultName = nameValue;
//璁惧澶囨敞
- string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
- string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
- var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
- listview.AddChidren(btnNote);
- btnNote.InitControl();
- //鍒掔嚎
- btnNote.AddBottomLine();
+ string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
+ string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
+ var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
+ listview.AddChidren(btnNote);
+ btnNote.InitControl();
+ //鍒掔嚎
+ btnNote.AddBottomLine();
btnNote.txtInput.FinishInputEvent += () =>
{
if (btnNote.Text.Trim() == string.Empty)
@@ -84,16 +84,16 @@
}
//淇敼鍚嶅瓧
this.DeviceReName(btnNote.Text.Trim());
- };
-
- //璁惧绫诲瀷
- caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
- deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice);
+ };
+
+ //璁惧绫诲瀷
+ caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
+ deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice);
var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2);
btnType.UseClickStatu = false;
- listview.AddChidren(btnType);
+ listview.AddChidren(btnType);
btnType.InitControl();
- //鍒掔嚎
+ //鍒掔嚎
btnType.AddBottomLine();
//鎵�灞炲尯鍩�
@@ -145,7 +145,7 @@
btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
btnLine.Gravity = Gravity.CenterHorizontal;
btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8);
- bodyFrameLayout.AddChidren(btnLine);
+ bodyFrameLayout.AddChidren(btnLine);
}
/// <summary>
@@ -156,16 +156,16 @@
//寮у害鐨勫渾鐨勪竴鍗婄殑楂樺害(鍥哄畾)
int halfRoundHeigth = Application.GetRealHeight(116) / 2;
//寮у害鐨勫渾
- var btnRound = new NormalViewControl(bodyFrameLayout.Width, halfRoundHeigth * 2, false);
- btnRound.Y = Application.GetRealHeight(708);
- btnRound.BackgroundColor = UserCenterColor.Current.White;
- btnRound.Radius = (uint)halfRoundHeigth;
- bodyFrameLayout.AddChidren(btnRound);
- //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙(瑕嗙洊寮у害鐨勫渾鐨勫崐杈�)
- var detailBackFrame = new FrameLayout();
- detailBackFrame.Y = btnRound.Bottom - btnRound.Height / 2;
+ var btnRound = new NormalViewControl(bodyFrameLayout.Width, halfRoundHeigth * 2, false);
+ btnRound.Y = Application.GetRealHeight(708);
+ btnRound.BackgroundColor = UserCenterColor.Current.White;
+ btnRound.Radius = (uint)halfRoundHeigth;
+ bodyFrameLayout.AddChidren(btnRound);
+ //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙(瑕嗙洊寮у害鐨勫渾鐨勫崐杈�)
+ var detailBackFrame = new FrameLayout();
+ detailBackFrame.Y = btnRound.Bottom - btnRound.Height / 2;
detailBackFrame.Height = Application.GetRealHeight(1200);//楂樺害灏辨槸瑕佸畠瓒呰繃
- detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
+ detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(detailBackFrame);
//璁惧缂栬緫
@@ -182,39 +182,39 @@
detailBackFrame.AddChidren(listview);
//瀹屾垚
- var btnFinish = new BottomClickButton();
- btnFinish.Y = Application.GetRealHeight(736);
- btnFinish.TextID = R.MyInternationalizationString.uFinish;
- detailBackFrame.AddChidren(btnFinish);
- btnFinish.MouseUpEventHandler += (sender, e) =>
- {
- //鍏抽棴鑷韩
- this.CloseForm();
+ var btnFinish = new BottomClickButton();
+ btnFinish.Y = Application.GetRealHeight(736);
+ btnFinish.TextID = R.MyInternationalizationString.uFinish;
+ detailBackFrame.AddChidren(btnFinish);
+ btnFinish.MouseUpEventHandler += (sender, e) =>
+ {
+ //鍏抽棴鑷韩
+ this.CloseForm();
};
}
- #endregion
-
+ #endregion
+
#region 鈻� 淇敼鍚嶅瓧___________________________
- /// <summary>
- /// 璁惧閲嶅懡鍚嶇劧鍚庢墦寮�鏂扮殑鐢婚潰
- /// </summary>
- /// <param name="i_deviceName">deviceName.</param>
- /// <param name="mode">鏄惁鏄剧ず閿欒</param>
- private async void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES)
- {
- //淇敼MAC鍚�
- string deviceName = i_deviceName.Trim();
- var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode);
- if (result == false)
+ /// <summary>
+ /// 璁惧閲嶅懡鍚嶇劧鍚庢墦寮�鏂扮殑鐢婚潰
+ /// </summary>
+ /// <param name="i_deviceName">deviceName.</param>
+ /// <param name="mode">鏄惁鏄剧ず閿欒</param>
+ private async void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES)
+ {
+ //淇敼MAC鍚�
+ string deviceName = i_deviceName.Trim();
+ var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode);
+ if (result == false)
{
return;
- }
- //鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼
- this.saveDefultName = string.Empty;
-
- //濡傛灉瀹冪殑鍥炶矾鍙湁涓�涓殑璇濓紝鍒欏湪璁惧涓婃姤鐨勬椂鍊欙紝淇敼MAC鍚嶅瓧涔嬪悗锛岃繛鍚岀鐐瑰悕瀛椾篃涓�璧蜂慨鏀�
+ }
+ //鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼
+ this.saveDefultName = string.Empty;
+
+ //濡傛灉瀹冪殑鍥炶矾鍙湁涓�涓殑璇濓紝鍒欏湪璁惧涓婃姤鐨勬椂鍊欙紝淇敼MAC鍚嶅瓧涔嬪悗锛岃繛鍚岀鐐瑰悕瀛椾篃涓�璧蜂慨鏀�
if (this.listNewDevice.Count == 1)
{
//淇敼绔偣鍚嶅瓧
@@ -223,7 +223,7 @@
{
return;
}
- }
+ }
}
/// <summary>
@@ -251,14 +251,14 @@
}
}
- #endregion
+ #endregion
#region 鈻� 鐢婚潰鍏抽棴___________________________
/// <summary>
/// 鐢婚潰鍏抽棴
/// </summary>
- public override void CloseForm()
+ public override void CloseFormBefore()
{
if (this.saveDefultName != string.Empty)
{
@@ -267,9 +267,9 @@
}
//娣诲姞璁惧鍒板垪琛�
this.LoadFormMethodByName("DeviceListMainForm", "AddDeviceToFormTable", listNewDevice[0].DeviceAddr);
-
- base.CloseForm();
+
+ base.CloseFormBefore();
}
#endregion
- }
-}
+ }
+}
--
Gitblit v1.8.0