From 404cdc88627f942df7944af04ee05b9d527752d6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 30 九月 2019 13:22:40 +0800
Subject: [PATCH] 合并了徐梅的按键面板绑定
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceHistoryFirmwareVersionForm.cs | 117 ++++++++++++++++++++++++++++------------------------------
1 files changed, 56 insertions(+), 61 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceHistoryFirmwareVersionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceHistoryFirmwareVersionForm.cs
index a7619d7..8ec6bff 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceHistoryFirmwareVersionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceHistoryFirmwareVersionForm.cs
@@ -8,75 +8,80 @@
/// <summary>
/// 璁惧鐨勫巻鍙茬増鏈�
/// </summary>
- public class DeviceHistoryFirmwareVersionForm : UserCenterCommonForm
+ public class DeviceHistoryFirmwareVersionForm : EditorCommonForm
{
- /// <summary>
- /// 鍗囩骇鐨勮澶�
- /// </summary>
+ /// <summary>
+ /// 鍗囩骇鐨勮澶�
+ /// </summary>
private List<CommonDevice> listUpdateDevice = null;
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalScrolViewLayout listView = null;
+ private VerticalListControl listView = null;
/// <summary>
- /// 鐣岄潰鍏抽棴鐨凙ction
+ /// 鍥轰欢閫夋嫨鐨勪簨浠�
/// </summary>
- public Action<FirmwareVersionInfo> FormCloseAction = null;
+ public Action<FirmwareVersionInfo> SelectFirmwareInfoEvent = null;
/// <summary>
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
- /// <param name="i_listdevice">璁惧</param>
- public void ShowForm(List<CommonDevice> i_listdevice)
- {
- this.listUpdateDevice = i_listdevice;
-
- //璁剧疆鏍囬淇℃伅
- base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uHistoryVersion));
-
- //鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
- }
-
- /// <summary>
- /// 鍒濆鍖栦腑閮ㄦ帶浠�
- /// </summary>
- private void InitMiddleFrame()
+ /// <param name="deviceMac">璁惧Mac鍦板潃</param>
+ public void ShowForm(string deviceMac)
{
- listView = new VerticalScrolViewLayout();
+ this.listUpdateDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
+
+ //璁剧疆鏍囬淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uHistoryVersion));
+
+ //鍒濆鍖栦腑閮ㄦ帶浠�
+ this.InitMiddleFrame();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栦腑閮ㄦ帶浠�
+ /// </summary>
+ private void InitMiddleFrame()
+ {
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
+
+ listView = new VerticalListControl(12);
listView.Height = bodyFrameLayout.Height;
+ listView.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(listView);
- //鎷ユ湁200绔彛杩欎釜涓滆タ鐨勬椂鍊欙紝鎵嶄細鏄剧ず
- var oTADevice = Common.LocalDevice.Current.GetOTADevice(listUpdateDevice[0].DeviceAddr);
+ //鎷ユ湁200绔彛杩欎釜涓滆タ鐨勬椂鍊欙紝鎵嶄細鏄剧ず
+ var oTADevice = Common.LocalDevice.Current.GetOTADevice(listUpdateDevice[0].DeviceAddr);
if (oTADevice == null || oTADevice.ImgVersion == -1)
{
return;
}
//鑾峰彇鍘嗗彶鐗堟湰
- var listData = FirmwareUpdateLogic.GetFirmwareVersionListInfo(FirmwareLevelType.ZigbeeDevice,
+ var listData = HdlFirmwareUpdateLogic.GetFirmwareVersionListInfo(FirmwareLevelType.ZigbeeDevice,
oTADevice.HwVersion.ToString(),
oTADevice.ImgTypeId.ToString());
- var btnTemp = new ButtonCommon();
- Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnTemp, listUpdateDevice);
+ string unSelectPic = string.Empty;
+ string selectPic = string.Empty;
+ Common.LocalDevice.Current.GetDeviceBeloneIcon(listUpdateDevice, ref unSelectPic, ref selectPic);
new System.Threading.Thread(() =>
{
string ImagType = oTADevice.ImgTypeId.ToString();
- foreach (var data in listData)
+ Application.RunOnMainThread(() =>
{
- if (data.ImagType == ImagType && oTADevice.ImgVersion == data.FirmwareVersion)
+ foreach (var data in listData)
{
- //鍚屼竴涓笢瑗匡紝涓嶆樉绀哄嚭鏉�
- continue;
+ if (data.ImagType == ImagType && oTADevice.ImgVersion == data.FirmwareVersion)
+ {
+ //鍚屼竴涓笢瑗匡紝涓嶆樉绀哄嚭鏉�
+ continue;
+ }
+ this.AddRowlayout(data, unSelectPic, selectPic);
}
- Application.RunOnMainThread(() =>
- {
- this.AddRowlayout(data, btnTemp.UnSelectedImagePath, btnTemp.SelectedImagePath);
- });
- }
+ });
})
{ IsBackground = true }.Start();
}
@@ -87,31 +92,23 @@
/// <param name="info"></param>
/// <param name="unSelPath"></param>
/// <param name="selPath"></param>
- private void AddRowlayout(FirmwareVersionInfo info, string unSelPath,string selPath)
+ private void AddRowlayout(FirmwareVersionInfo info, string unSelPath, string selPath)
{
- var rowlayout = new StatuRowLayout(listView);
-
+ var rowlayout = new FrameRowControl(listView.rowSpace / 2);
+ listView.AddChidren(rowlayout);
//鍥炬爣
- var btnIcon = new RowLeftIconView();
+ var btnIcon = rowlayout.AddLeftIcon();
btnIcon.UnSelectedImagePath = unSelPath;
- btnIcon.SelectedImagePath = selPath;
- rowlayout.AddChidren(btnIcon);
-
//鎸囧畾鐨勮澶�
- var btnDevice = new RowTopBlackView();
- btnDevice.BackgroundColor = UserCenterColor.Current.Transparent;
- btnDevice.Text = info.ShowName;
- rowlayout.AddChidren(btnDevice);
-
- //鍥轰欢淇℃伅
- var btnVersion = new RowBottomBlackView();
- btnVersion.Text = Common.LocalDevice.Current.AppendVersion(info.FirmwareVersion);
- rowlayout.AddChidren(btnVersion);
-
+ rowlayout.AddLeftCaption(info.ShowName, 800);
//鍚戝彸鐨勫浘鏍�
- rowlayout.AddRightIconControl();
+ rowlayout.AddRightArrow();
+ //鍥轰欢淇℃伅
+ rowlayout.AddMostRightView(Common.LocalDevice.Current.AppendVersion(info.FirmwareVersion), 300);
+ //搴曠嚎
+ rowlayout.AddBottomLine();
- rowlayout.MouseUpEvent += (sender, e) =>
+ rowlayout.ButtonClickEvent += (sender, e) =>
{
string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.listUpdateDevice[0]);
if (FirmwareUpdateResourse.dicDeviceUpdateList.ContainsKey(mainKeys) == true)
@@ -119,10 +116,8 @@
this.CloseForm();
return;
}
- if (FormCloseAction != null)
- {
- FormCloseAction(info);
- }
+ SelectFirmwareInfoEvent?.Invoke(info);
+ SelectFirmwareInfoEvent = null;
this.CloseForm();
};
}
--
Gitblit v1.8.0