From 3291885285dfd5d4f665c20676307878dc3163bc Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 20 十二月 2019 16:28:53 +0800
Subject: [PATCH] 请合并最新代码(优化设备不支持的功能)
---
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs | 134 ++++++++++++++++++++++----------------------
1 files changed, 66 insertions(+), 68 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
index 4f3dfb9..423d87f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayFirmwareUpdateForm.cs
@@ -48,55 +48,54 @@
/// <param name="i_virtualFirmware">铏氭嫙璁惧鐨勫浐浠朵俊鎭�</param>
/// <param name="i_coordinatorFirmware">鍗忚皟鍣ㄦ柊鐗堟湰鐨勫浐浠朵俊鎭�</param>
/// <param name="i_gatewayFirmware">缃戝叧鏂扮増鏈殑鍥轰欢淇℃伅</param>
- /// <param name="i_listVode">铏氭嫙椹卞姩</param>
- public void ShowForm(ZbGateway i_zbGateway, FirmwareVersionInfo i_virtualFirmware, FirmwareVersionInfo i_coordinatorFirmware,
- FirmwareVersionInfo i_gatewayFirmware, List<ZbGatewayData.DriveCodeObj> i_listVode)
- {
+ /// <param name="i_listVode">铏氭嫙椹卞姩</param>
+ public void ShowForm(ZbGateway i_zbGateway, FirmwareVersionInfo i_virtualFirmware, FirmwareVersionInfo i_coordinatorFirmware,
+ FirmwareVersionInfo i_gatewayFirmware, List<ZbGatewayData.DriveCodeObj> i_listVode)
+ {
this.upDatezbGateway = i_zbGateway;
this.virtualFirmware = i_virtualFirmware;
this.coordinatorFirmware = i_coordinatorFirmware;
this.gatewayFirmware = i_gatewayFirmware;
- this.listVode = i_listVode;
-
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
- /// </summary>
- private void InitMiddleFrame()
+ this.listVode = i_listVode;
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ private void InitMiddleFrame()
{
- var frameBack = new FrameLayout();
- frameBack.Width = Application.GetRealWidth(674);
- frameBack.Height = Application.GetRealHeight(386);
- frameBack.BackgroundColor = UserCenterColor.Current.White;
- frameBack.Gravity = Gravity.CenterHorizontal;
- frameBack.Y = Application.GetRealHeight(683);
- frameBack.Radius = 6;
- bodyFrameLayout.AddChidren(frameBack);
-
- //杩涘害鏄剧ず鏂囨湰
- var btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
- btnText.Y = Application.GetRealHeight(248);
- btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnText.TextAlignment = TextAlignment.Center;
- //btnText.Text = "鍗囩骇涓�";
+ var frameBack = new FrameLayout();
+ frameBack.Width = Application.GetRealWidth(674);
+ frameBack.Height = Application.GetRealHeight(386);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Gravity = Gravity.CenterHorizontal;
+ frameBack.Y = Application.GetRealHeight(683);
+ frameBack.Radius = (uint)Application.GetRealHeight(17);
+ bodyFrameLayout.AddChidren(frameBack);
+
+ //杩涘害鏄剧ず鏂囨湰
+ var btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
+ btnText.Y = Application.GetRealHeight(248);
+ btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnText.TextAlignment = TextAlignment.Center;
+ //btnText.Text = "鍗囩骇涓�";
frameBack.AddChidren(btnText);
//杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(161);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
+ var btnProRow = new FrameLayout();
+ btnProRow.Gravity = Gravity.CenterHorizontal;
+ btnProRow.Y = Application.GetRealHeight(161);
+ btnProRow.Width = Application.GetRealWidth(559);
+ btnProRow.Height = Application.GetRealHeight(29);
btnProRow.BackgroundColor = 0xfff5f5f5;
btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- frameBack.AddChidren(btnProRow);
- var btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.Radius = btnProRow.Radius;
+ frameBack.AddChidren(btnProRow);
+ var btnProgressBar = new FrameLayout();
+ btnProgressBar.Width = 0;
+ btnProgressBar.Height = btnProRow.Height;
btnProgressBar.BackgroundColor = 0xfffb744a;
btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
btnProRow.AddChidren(btnProgressBar);
@@ -111,7 +110,7 @@
var btnProgressPic = new PicViewControl(84, 60);
btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
frameProgress.AddChidren(btnProgressPic);
- var btnProgressView = new NormalViewControl(84, 32, true);
+ var btnProgressView = new NormalViewControl(84, 45, true);
btnProgressView.TextSize = 10;
btnProgressView.TextAlignment = TextAlignment.Center;
btnProgressView.Text = "0%";
@@ -141,30 +140,29 @@
//鏇存柊鐘舵�佸彉鍖栫殑浜嬩欢
updateLogic.UpdateStatuChangedEvent += (div, msg) =>
{
- if (div == -1)
+ HdlThreadLogic.Current.RunMain(() =>
{
- //寮傚父
- this.ShowMassage(ShowMsgType.Tip, msg);
- this.CloseForm();
- }
- else if (div == 0)
- {
- //涓�鑸俊鎭�
- btnText.Text = msg;
- }
- else if (div == 1)
- {
- //鍗囩骇瀹屾垚
- this.ShowMassage(ShowMsgType.Tip, msg);
- //璋冪敤鍥炶皟鍑芥暟
- this.FinishUpdateEvent?.Invoke();
- this.CloseForm();
- }
- else if (div == 2)
- {
- //涓诲姩缁堟鍗囩骇
- this.CloseForm();
- }
+ if (div == -1)
+ {
+ //寮傚父
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ this.CloseForm();
+ }
+ else if (div == 0)
+ {
+ //涓�鑸俊鎭�
+ btnText.Text = msg;
+ }
+ else if (div == 1)
+ {
+ //鍗囩骇瀹屾垚
+ btnText.Text = msg;
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ //璋冪敤鍥炶皟鍑芥暟
+ this.FinishUpdateEvent?.Invoke();
+ this.CloseForm();
+ }
+ });
};
//杩涘害鍊兼敼鍙樹簨浠�
updateLogic.ProgressEvent += (value) =>
@@ -172,12 +170,12 @@
Application.RunOnMainThread(() =>
{
//杩涘害鏉�
- decimal result = value / 100;
- int width = (int)(result * ProRowWidth);
+ int width = (int)(value * ProRowWidth);
btnProgressBar.Width = width;
//鏂囨湰鏄剧ず
- btnProgressView.Text = value + "%";
+ int persent = (int)(value * 100);
+ btnProgressView.Text = persent + "%";
//鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
});
@@ -194,7 +192,7 @@
/// <summary>
/// 鐢婚潰鍏抽棴
/// </summary>
- public override void CloseForm()
+ public override void CloseFormBefore()
{
//瀹夊崜鍙互鐐瑰嚮绯荤粺鐨勮繑鍥為敭
UserView.HomePage.Instance.ScrollEnabled = true;
@@ -211,7 +209,7 @@
}
this.FinishUpdateEvent = null;
- base.CloseForm();
+ base.CloseFormBefore();
}
#endregion
--
Gitblit v1.8.0