From bd46c57c77c276014db3192a4e2cc96e23c93202 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 21 二月 2020 13:08:47 +0800 Subject: [PATCH] 先上传个版本吧 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 108 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 92 insertions(+), 16 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs index 15f40b7..06e29ea 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs @@ -26,26 +26,54 @@ /// 鏋勯�犲嚱鏁� /// </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 鈼� 鍙橀噺鐢虫槑__________________________ + #region 鍙橀噺鐢虫槑 + /// <summary> + /// 褰撳墠鎸夐敭 + /// </summary> ZigBee.Device.Panel currentKey; - //鏄剧ず琚粦瀹氳澶囨垨鍦烘櫙鐨剉iew + /// <summary> + /// 鏄剧ず琚粦瀹氳澶囨垨鍦烘櫙鐨剉iew + /// </summary> VerticalScrolViewLayout midVerticalScrolViewLayout; + /// <summary> + /// 鏄剧ず鎴块棿鐨剉iew + /// </summary> HorizontalScrolViewLayout btnHorizontalScrolViewLayout; /// <summary> /// 鎸夐敭閰嶇疆鐨勭洰鏍囧垪琛� /// </summary> - List<CommonDevice> targetList = new List<CommonDevice>();//涓存椂鐩爣鍒楄〃 - List<Room> roomList = new List<Room>();//鏈湴鎴块棿鍒楄〃 + List<CommonDevice> targetList = new List<CommonDevice>(); + /// <summary> + /// 鏈湴鎴块棿鍒楄〃 + /// </summary> + List<Room> roomList = new List<Room>(); + /// <summary> + /// 褰撶粦瀹氳〃鍙樺寲鍚庣殑鍥炶皟 + /// </summary> public Action<List<BindListResponseObj>> action; + /// <summary> + /// 淇濆瓨瀹屾垚鎸夐挳 + /// </summary> Button btnFinifh; + /// <summary> + /// 妤煎眰鏂囨湰 + /// </summary> Button btnFloorText; - Dictionary<string, string> dicFloor;//妤煎眰鍒楄〃 + /// <summary> + /// 妤煎眰鍒楄〃 + /// </summary> + Dictionary<string, string> dicFloor; List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>(); + /// <summary> + /// 缃戝叧涓殑鍦烘櫙鍒楄〃 + /// </summary> + public List<ScenesListInfo> gwCurScenesList = new List<ScenesListInfo>(); #endregion /// <summary> @@ -67,7 +95,6 @@ var btnAddFrameLayout = new FrameLayout { X = Application.GetRealWidth(830), - Width = Application.GetRealWidth(200), }; this.titleFrameLayout.AddChidren(btnAddFrameLayout); @@ -77,7 +104,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); @@ -95,9 +123,20 @@ { SideslipFramelayout(); }; + if (Common.Config.Instance.Home.FloorDics.Count == 0) + { + btnAddFrameLayout.Width = 0; + } + else + { + btnAddFrameLayout.Width = Application.GetRealWidth(200); + } MidFrameLayoutContent(btnFloorText); } + /// <summary> + /// 涓儴甯冨眬 + /// </summary> async void MidFrameLayoutContent(Button btnFloorText) { #region UI @@ -136,6 +175,7 @@ TextID = R.MyInternationalizationString.Save, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, + IsBold = true, TextSize = 16, }; bottomFrameLayout.AddChidren(btnFinifh); @@ -194,7 +234,6 @@ Shared.Common.Room curRoom = roomList[0]; int index = 0; RefreshRoomList(curRoom, ref index); - RefreshSceneList(roomList[index]); if (curRoom.SceneUIList.Count == 0) { @@ -541,7 +580,10 @@ RefreshSceneList(curRoom); } - //鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀� + /// <summary> + /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀� + /// </summary> + /// <param name="curRoom"></param> void RefreshSceneList(Shared.Common.Room curRoom) { midVerticalScrolViewLayout.RemoveAll(); @@ -551,7 +593,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() @@ -567,16 +616,17 @@ Y = Application.GetMinRealAverage(46), Width = Application.GetMinRealAverage(81), Height = Application.GetMinRealAverage(81), - UnSelectedImagePath = scene.IconPath, + UnSelectedImagePath = "Scene/SceneIcon.png",// scene.IconPath, }; rowLayout.AddChidren(devicePic); var btnBindName = new Button() { - Width = Application.GetRealWidth(500 - 120), + Width = Application.GetRealWidth(790), X = devicePic.Right + Application.GetRealWidth(20), TextColor = Shared.Common.ZigbeeColor.Current.TextBlack, TextAlignment = TextAlignment.CenterLeft, + TextSize = 15, }; rowLayout.AddChidren(btnBindName); @@ -703,7 +753,9 @@ } } - // 渚ц竟瀵艰埅鏍� + /// <summary> + /// 妤煎眰閫夋嫨鐨勪晶杈瑰鑸爮 + /// </summary> void SideslipFramelayout() { var dialog = new Dialog @@ -734,8 +786,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, }; @@ -786,6 +839,7 @@ if (currentKey.currentSelectFloorId == floorId) { btnAllMethod.IsSelected = true; + btnAllMethod.IsBold = true; btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; } @@ -813,6 +867,7 @@ oldbuttonText = btnMethodText; btnMethodText.IsSelected = true; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbuttonText.IsBold = true; } //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� @@ -855,7 +910,10 @@ } } - //褰撳墠鎸夐敭鎵�鏈夋樉绀烘埧闂寸殑鎵�鏈夊満鏅鐞� + /// <summary> + /// 褰撳墠鎸夐敭鎵�鏈夋樉绀烘埧闂寸殑鎵�鏈夊満鏅鐞� + /// </summary> + /// <returns></returns> List<SceneUI> GetALlDispalyRoomSceneList() { currentKeyAllRoomSceneList.Clear(); @@ -880,6 +938,24 @@ } return currentKeyAllRoomSceneList; } + /// <summary> + /// 鑾峰彇缃戝叧涓瓨鍦ㄧ殑鏈湴鍦烘櫙鍒楄〃 + /// </summary> + /// <param name="curRoom"></param> + /// <returns></returns> + 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