From b74c052b43d7c4a830386940a036eb7c2ec9abc2 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 14 一月 2020 13:37:26 +0800
Subject: [PATCH] 2020-1-14-01
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs | 129 ++++++++++++++++++++++---------------------
1 files changed, 66 insertions(+), 63 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs
index 71cf137..c168dc1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFirmwareUpdateForm.cs
@@ -30,50 +30,50 @@
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
/// <param name="device">ota璁惧瀵硅薄</param>
- /// <param name="deviceFirmware">鍥轰欢鍗囩骇淇℃伅</param>
- public void ShowForm(OTADevice device, FirmwareVersionInfo deviceFirmware)
- {
- this.deviceMac = device.DeviceAddr;
- //鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame(device, deviceFirmware);
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄤ俊鎭�
- /// </summary>
- /// <param name="device">ota璁惧瀵硅薄</param>
- /// <param name="deviceFirmware">鍥轰欢鍗囩骇淇℃伅</param>
- private void InitMiddleFrame(OTADevice device, FirmwareVersionInfo deviceFirmware)
+ /// <param name="deviceFirmware">鍥轰欢鍗囩骇淇℃伅</param>
+ public void ShowForm(OTADevice device, FirmwareVersionInfo deviceFirmware)
{
- 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 = "鍗囩骇涓�";
+ this.deviceMac = device.DeviceAddr;
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ this.InitMiddleFrame(device, deviceFirmware);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ /// </summary>
+ /// <param name="device">ota璁惧瀵硅薄</param>
+ /// <param name="deviceFirmware">鍥轰欢鍗囩骇淇℃伅</param>
+ private void InitMiddleFrame(OTADevice device, FirmwareVersionInfo deviceFirmware)
+ {
+ 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 = "鍗囩骇涓�";
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;
+ frameBack.AddChidren(btnProRow);
+ var btnProgressBar = new FrameLayout();
+ btnProgressBar.Width = 0;
+ btnProgressBar.Height = btnProRow.Height;
btnProgressBar.Radius = btnProRow.Radius;
btnProgressBar.BackgroundColor = 0xfffb744a;
btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
@@ -121,30 +121,33 @@
//鏇存柊鐘舵�佸彉鍖栫殑浜嬩欢
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)
+ {
+ //鍗囩骇瀹屾垚
+ this.ShowMassage(ShowMsgType.Tip, msg);
+ //璋冪敤鍥炶皟鍑芥暟
+ this.FinishUpdateEvent?.Invoke();
+ this.CloseForm();
+ }
+ else if (div == 2)
+ {
+ //涓诲姩缁堟鍗囩骇
+ this.CloseForm();
+ }
+ });
};
//杩涘害鍊兼敼鍙樹簨浠�
updateLogic.ProgressEvent += (value) =>
@@ -180,7 +183,7 @@
/// <summary>
/// 鐢婚潰鍏抽棴
/// </summary>
- public override void CloseForm()
+ public override void CloseFormBefore()
{
//瀹夊崜鍙互鐐瑰嚮绯荤粺鐨勮繑鍥為敭
UserView.HomePage.Instance.ScrollEnabled = true;
@@ -196,7 +199,7 @@
}
this.FinishUpdateEvent = null;
- base.CloseForm();
+ base.CloseFormBefore();
}
#endregion
--
Gitblit v1.8.0