From 3272ca5b51e19f7f8a827b0f68400570a547fe60 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 28 四月 2020 15:02:44 +0800 Subject: [PATCH] 2020-04-28-1 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 70 ++++++++++++++++------------------- 1 files changed, 32 insertions(+), 38 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs index f381cb9..514859d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Shared.Common; +using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; @@ -15,7 +16,7 @@ /// <summary> /// 鍒楄〃鎺т欢 /// </summary> - private VerticalListControl listview = null; + private FrameListControl listview = null; /// <summary> /// 褰撳墠閫夋嫨鐨勮澶� /// </summary> @@ -71,12 +72,16 @@ //娓呯┖bodyFrame this.ClearBodyFrame(); + var listBackControl = new VerticalFrameControl(); + listBackControl.Height = bodyFrameLayout.Height; + bodyFrameLayout.AddChidren(listBackControl); + //鍒濆鍖栨甯� this.tableContr = new InformationEditorControl(); - this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028); + this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028); //鍒濆鍖栬澶囧洖璺浘鏍� - this.InitDeviceEpointIcon(); + this.InitDeviceEpointIcon(listBackControl); //淇濆瓨 var btnFinish = new BottomClickButton(); @@ -173,11 +178,9 @@ this.AddBindRow(); //娣诲姞鑳屽厜鐏 this.AddBackLightRow(); - //娣诲姞鎺ヨ繎鎰熷簲琛� - this.AddProximityInductionRow(); //鍒濆鍖栨甯冨畬鎴� - tableContr.FinishInitControl(bodyFrameLayout, this.listview); + tableContr.FinishInitControl(); } #endregion @@ -273,34 +276,25 @@ btnLight.AddRightArrow(); btnLight.ButtonClickEvent += (sender, e) => { - var form = new PanelBackLightSettionForm(); - form.AddForm((Panel)nowSelectDevice); + List<CommonDevice> listNewDevice = new List<CommonDevice> { }; + listNewDevice.Add((Panel)nowSelectDevice); + var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listNewDevice); + //濡傛灉璁惧鏄柟鎮﹀紑鎺ц澶囷紝鑳屽厜鐏〉闇�瑕佹粦鍔ㄤ笖鏈夋帴杩戞劅搴斿姛鑳� + if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo + || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour + || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight) + { + var form = new PanelBackLighWithSensorForm(); + form.AddForm((Panel)nowSelectDevice); + } + else + { + //涓嶅甫鎺ヨ繎鎰熷簲鐨� + var form = new PanelBackLightSettionForm(); + form.AddForm((Panel)nowSelectDevice); + } }; } - } - - #endregion - - #region 鈻� 鎺ヨ繎鎰熷簲___________________________ - - /// <summary> - /// 娣诲姞鎺ヨ繎鎰熷簲琛� - /// </summary> - private void AddProximityInductionRow() - { - //鎺ヨ繎鎰熷簲 - var rowContr = new FrameRowControl(listview.rowSpace / 2); - rowContr.UseClickStatu = false; - listview.AddChidren(rowContr); - rowContr.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uProximityInduction), 600); - //搴曠嚎 - rowContr.AddBottomLine(); - //寮�鍏� - var btnSwitch = rowContr.AddMostRightSwitchIcon(); - btnSwitch.ButtonClickEvent += (sender, e) => - { - btnSwitch.IsSelected = !btnSwitch.IsSelected; - }; } #endregion @@ -310,7 +304,7 @@ /// <summary> /// 鍒濆鍖栬澶囧洖璺浘鏍� /// </summary> - private void InitDeviceEpointIcon() + private void InitDeviceEpointIcon(VerticalFrameControl listBackControl) { bool hadDevice = false; var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr); @@ -348,7 +342,7 @@ frameBorder.Gravity = Gravity.CenterHorizontal; frameBorder.Width = Application.GetMinRealAverage(426); frameBorder.Height = Application.GetMinRealAverage(426); - bodyFrameLayout.AddChidren(frameBorder); + listBackControl.frameTable.AddChidren(frameBorder); var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false); @@ -357,19 +351,19 @@ if (listOffSwitch.Count == 8) { //鍏寜閿潰鏉� - btnPic.UnSelectedImagePath = "Device/PanelFangyueEightButtonTable.png"; + btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueEightButtonTable.png"; this.InitEightButtonPanelIcon(frameBorder, listOffSwitch); } else if (listOffSwitch.Count == 4) { //鍥涙寜閿潰鏉� - btnPic.UnSelectedImagePath = "Device/PanelFangyueFourButtonTable.png"; + btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueFourButtonTable.png"; this.InitFourButtonPanelIcon(frameBorder, listOffSwitch); } else { //浜屾寜閿潰鏉� - btnPic.UnSelectedImagePath = "Device/PanelFangyueTwoButtonTable.png"; + btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueTwoButtonTable.png"; this.InitTwoButtonPanelIcon(frameBorder, listOffSwitch); } } -- Gitblit v1.8.0