From 3dcbd186c42c598c0c08d1cd37034cf2baa09e54 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 30 十二月 2019 15:47:51 +0800 Subject: [PATCH] 合并了代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 37 +++++++++++++++++++++++++++++++++---- 1 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs index 2d29c23..194554c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs @@ -26,9 +26,10 @@ /// 鏋勯�犲嚱鏁� /// </summary> /// <param name="doorLock"></param> - public AddScenePage(ZigBee.Device.Panel key) + public AddScenePage(ZigBee.Device.Panel key, List<ScenesListInfo> gwScenesList) { this.currentKey = key; + gwCurScenesList = gwScenesList; } #region 鈼� 鍙橀噺鐢虫槑__________________________ @@ -46,6 +47,7 @@ Button btnFloorText; Dictionary<string, string> dicFloor;//妤煎眰鍒楄〃 List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>(); + public List<ScenesListInfo> gwCurScenesList = new List<ScenesListInfo>();//缃戝叧涓殑鍦烘櫙鍒楄〃 #endregion /// <summary> @@ -76,7 +78,8 @@ X = Application.GetRealWidth(15), Text = Language.StringByID(R.MyInternationalizationString.FirstFloor), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, - TextSize = 15, + TextSize = 14, + IsBold =true, TextAlignment = TextAlignment.CenterRight, }; btnAddFrameLayout.AddChidren(btnFloorText); @@ -143,6 +146,7 @@ TextID = R.MyInternationalizationString.Save, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + IsBold =true, TextSize = 16, }; bottomFrameLayout.AddChidren(btnFinifh); @@ -558,7 +562,14 @@ } Button oldScene = null; int curIndex = 0; - foreach (var scene in curRoom.SceneUIList) + var currentSceneUIList = GetMatchSceneUIList(curRoom); + if (currentSceneUIList.Count == 0) + { + btnFinifh.Enable = false; + btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; + return; + } + foreach (var scene in currentSceneUIList) { #region 缁戝畾琛║I鏄撅紙鏃犳暟鎹鐞嗭級 var rowLayout = new FrameLayout() @@ -584,6 +595,7 @@ X = devicePic.Right + Application.GetRealWidth(20), TextColor = Shared.Common.ZigbeeColor.Current.TextBlack, TextAlignment = TextAlignment.CenterLeft, + TextSize =15, }; rowLayout.AddChidren(btnBindName); @@ -741,8 +753,9 @@ Height = Application.GetRealHeight(58), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(81), - TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 14, + IsBold = true, TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.SelectFloor, }; @@ -793,6 +806,7 @@ if (currentKey.currentSelectFloorId == floorId) { btnAllMethod.IsSelected = true; + btnAllMethod.IsBold = true; btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; } @@ -820,6 +834,7 @@ oldbuttonText = btnMethodText; btnMethodText.IsSelected = true; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbuttonText.IsBold = true; } //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� @@ -887,6 +902,20 @@ } return currentKeyAllRoomSceneList; } + //鑾峰彇缃戝叧涓瓨鍦ㄧ殑鏈湴鍦烘櫙鍒楄〃 + List<SceneUI> GetMatchSceneUIList(Shared.Common.Room curRoom) + { + var tempSceneUIList = new List<SceneUI>(); + foreach (var scene in curRoom.SceneUIList) + { + var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == scene.Id)); + if (gwSc != null) + { + tempSceneUIList.Add(scene); + } + } + return tempSceneUIList; + } public void DeviceInfoChange(CommonDevice common, string typeTag) { -- Gitblit v1.8.0