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/AddDevicePage.cs | 87 +++++++++++++++++++++++++++++++++++++------ 1 files changed, 74 insertions(+), 13 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs index ef62d30..df44068 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs @@ -30,27 +30,68 @@ this.curDeviceBindType = deviceBindType; } - #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>(); + /// <summary> + /// 鎴块棿鍒楄〃 + /// </summary> List<Room> roomList = new List<Room>(); + /// <summary> + /// 娣诲姞璁惧鍚庣殑鍥炶皟 + /// </summary> public Action<List<BindListResponseObj>> actionAddDevicePage; + /// <summary> + /// 褰撳墠璁惧绫诲瀷鍒楄〃 + /// </summary> List<DeviceUI> curTypeDeviceList = new List<DeviceUI> { }; + /// <summary> + /// 褰撳墠璁惧缁戝畾绫诲瀷 + /// </summary> string curDeviceBindType = ""; + /// <summary> + /// 妤煎眰鏂囨湰 + /// </summary> Button btnFloorText; + /// <summary> + /// 妤煎眰琛� + /// </summary> Dictionary<string, string> dicFloor; + /// <summary> + /// 褰撳墠閫夋嫨鐨勬寜閿ā寮� + /// </summary> Button btnChooseKeyMode; - bool IsInitEntry = false;//鏄惁棣栨杩涘叆璇ラ〉 + /// <summary> + /// 鏄惁棣栨杩涘叆璇ラ〉 + /// </summary> + bool IsInitEntry = false; + /// <summary> + /// 褰撳墠鎸夐敭鐨勬墍鏈夋埧闂磋澶囧垪琛� + /// </summary> List<DeviceUI> currentKeyAllRoomDeviceList = new List<DeviceUI>(); + /// <summary> + /// 涓存椂瀛樺偍鐨勭洰鏍囧垪琛� + /// </summary> Dictionary<string, CommonDevice> oldTargetList = new Dictionary<string, CommonDevice> { }; #endregion + /// <summary> + /// 娣诲姞璁惧鏄剧ず + /// </summary> public void Show() { targetList.Clear(); @@ -81,7 +122,6 @@ var btnAddFrameLayout = new FrameLayout { X = Application.GetRealWidth(830), - Width = Application.GetRealWidth(200), }; this.titleFrameLayout.AddChidren(btnAddFrameLayout); @@ -91,7 +131,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); @@ -115,9 +156,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 @@ -162,6 +214,7 @@ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, TextSize = 16, + IsBold = true, }; bottomFrameLayout.AddChidren(btnChooseKeyMode); #endregion @@ -396,7 +449,10 @@ RefreshDeviceList(curRoom); } - //褰撳墠鎸夐敭鎵�鏈夋樉绀烘埧闂寸殑鎵�鏈夎澶囧鐞� + /// <summary> + /// 褰撳墠鎸夐敭鎵�鏈夋樉绀烘埧闂寸殑鎵�鏈夎澶囧鐞� + /// </summary> + /// <returns></returns> List<DeviceUI> GetALlDispalyRoomDeviceList() { currentKeyAllRoomDeviceList.Clear(); @@ -532,6 +588,7 @@ int curIndex = 0; foreach (var device in curTypeDeviceList) { + curIndex++; if (device.CommonDevice != null && device.CommonDevice.IsOnline == 0) { continue; @@ -558,11 +615,12 @@ 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, Tag = device.CommonDevice?.DeviceEpointName, + TextSize = 15, }; rowLayout.AddChidren(btnBindName); @@ -589,7 +647,7 @@ }; rowLayout.AddChidren(line2); - if (curIndex == curRoom.DeviceUIList.Count - 1) + if (curIndex == curTypeDeviceList.Count) { line2.Visible = false; } @@ -634,7 +692,7 @@ btnBindName.MouseUpEventHandler += hander; btnChoose.MouseUpEventHandler += hander; - if (device.CommonDevice?.DeviceEpointName == "") + if (string.IsNullOrEmpty(device.CommonDevice?.DeviceEpointName)) { btnBindName.Text = device.CommonDevice?.DeviceAddr + "_" + device.CommonDevice?.DeviceEpoint; } @@ -651,8 +709,6 @@ btnChoose.Visible = true; } } - - curIndex++; } if (targetList.Count == 0) { @@ -666,7 +722,9 @@ } } - // 渚ц竟瀵艰埅鏍� + /// <summary> + /// 閫夋嫨妤煎眰鐨勪晶杈规爮 + /// </summary> void SideslipFramelayout() { var dialog = new Dialog @@ -697,10 +755,11 @@ 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, TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.SelectFloor, + IsBold = true, }; sidelipFrameLayout.AddChidren(btnSelectFloor); @@ -749,6 +808,7 @@ if (currentKey.currentSelectFloorId == floorId) { btnAllMethod.IsSelected = true; + btnAllMethod.IsBold = true; btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; } @@ -777,6 +837,7 @@ oldbuttonText = btnMethodText; btnMethodText.IsSelected = true; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + oldbuttonText.IsBold = true; } //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� -- Gitblit v1.8.0