From 1f6f024bddf48dea1c17c54ade1535a10ef7b39b Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 23 三月 2020 17:16:37 +0800 Subject: [PATCH] 2020-03-23-2 --- ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 579 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 315 insertions(+), 264 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs old mode 100755 new mode 100644 index 2166285..c850ea8 --- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs +++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs @@ -2,13 +2,15 @@ using System.Collections.Generic; using Shared.Common; using ZigBee.Device; - +using Shared.Phone.Device.AC; +using System.Text; + namespace Shared.Phone.UserView { /// <summary> /// User page. /// </summary> - public class UserPage : FrameLayout,ZigBee.Common.IStatus + public class UserPage : FrameLayout, ZigBee.Common.IStatus { #region 鈼� 鍙橀噺_______________________ /// <summary> @@ -20,25 +22,25 @@ /// </summary> private static readonly int tabBarEnum_Width = CommonPage.AppRealWidth / 3; /// <summary> - /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�-110 + /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴� /// </summary> - private static readonly int tabBarEnumIMG_Height = 110; + private static readonly int tabBarEnumIMG_Height = 98; /// <summary> - /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�-110 + /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴� /// </summary> - private static readonly int tabBarEnumIMG_Width = 110; + private static readonly int tabBarEnumIMG_Width = 138; /// <summary> - /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊� -5 + /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊� /// </summary> - private static readonly int tabBarEnumIMG_Y = 5; + private static readonly int tabBarEnumIMG_Y = 3; /// <summary> - /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴� -50 + /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴� /// </summary> - private static readonly int tabBarEnumName_Height = 50; + private static readonly int tabBarEnumName_Height = 40; /// <summary> - /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊� 100 + /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊� /// </summary> - private static readonly int tabBarEnumName_Y = tabBarEnumIMG_Height - 10; + private static readonly int tabBarEnumName_Y = 98; #endregion #region 鈼� 鎺ュ彛____________________________ @@ -66,184 +68,233 @@ /// <param name="typeTag">Type tag.</param> public void DeviceInfoChange(CommonDevice common, string typeTag) { + var myDevice = LocalDevice.Current.GetDevice(common.DeviceAddr, common.DeviceEpoint); + if (myDevice == null) + { + return; + } //璁惧涓婃姤鐘舵�佷腑 褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� if (typeTag == "DeviceStatusReport") { try - { - for (int i = 0; i < Room.AllRoomDeviceUIList.Count; i++) + { + if (common.DeviceStatusReport.AttriBute == null || common.DeviceStatusReport.AttriBute.Count == 0) { - var deviceUI = Room.AllRoomDeviceUIList[i]; - if (deviceUI.CommonDevice == null) - { - //璁惧涓虹┖ - continue; - } - if (common.DeviceAddr != deviceUI.CommonDevice.DeviceAddr || common.DeviceEpoint != deviceUI.CommonDevice.DeviceEpoint) - { - //鍒ゆ柇鏄惁涓哄綋鍓嶈澶� - continue; - } - switch (deviceUI.CommonDevice.Type) - { - case DeviceType.OnOffOutput: - //寮�鍏冲姛鑳� - if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 6) - { - var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight; - onOffOutputLight.DeviceStatusReport = (common as ZigBee.Device.ToggleLight).DeviceStatusReport; - //璁板綍銆佹洿鏂扮姸鎬� - if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0) - { - continue; + return; + } + switch (myDevice.Type) + { + case DeviceType.OnOffOutput: + //寮�鍏冲姛鑳� + if (common.DeviceStatusReport.CluterID == 6) + { + var onOffOutputLight = (ToggleLight)myDevice; + onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport; + onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData; + onOffOutputLight.LastDateTime = DateTime.Now; + } + //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� + if (common.DeviceStatusReport.CluterID == 3) + { + myDevice.IsOnline = 1; + myDevice.LastDateTime = DateTime.Now; + } + break; + + case DeviceType.AirSwitch: + //寮�鍏冲姛鑳� + if (common.DeviceStatusReport.CluterID == 6) + { + var airSwitch = (AirSwitch)myDevice; + airSwitch.DeviceStatusReport = common.DeviceStatusReport; + airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData; + airSwitch.LastDateTime = DateTime.Now; + } + //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� + if (common.DeviceStatusReport.CluterID == 3) + { + myDevice.IsOnline = 1; + myDevice.LastDateTime = DateTime.Now; + } + break; + + case DeviceType.WindowCoveringDevice: + if (common.DeviceStatusReport.CluterID == 258) + { + var rollershade = (Rollershade)myDevice; + rollershade.DeviceStatusReport = common.DeviceStatusReport; + var attriButeList = rollershade.DeviceStatusReport.AttriBute; + switch (attriButeList[0].AttributeId) + { + case 0: + rollershade.WcdType = attriButeList[0].AttriButeData; + rollershade.LastDateTime = DateTime.Now; + break; + } + } + if (common.DeviceStatusReport.CluterID == 3) + { + myDevice.IsOnline = 1; + myDevice.LastDateTime = DateTime.Now; + } + break; + + case DeviceType.Thermostat: + //AC鍔熻兘 + if (common.DeviceStatusReport.CluterID == 513) + { + var ac = (AC)myDevice; + ac.DeviceStatusReport = common.DeviceStatusReport; + var attriButeList = ac.DeviceStatusReport.AttriBute; + foreach (var attList in attriButeList) + { + //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝 + var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default; + switch (attList.AttributeId) + { + case 0: + ac.currentLocalTemperature = curTemp; + ac.LastDateTime = DateTime.Now; + break; + case 17: + ac.currentCoolingSetpoint = curTemp; + ac.LastDateTime = DateTime.Now; + break; + case 18: + ac.currentHeatingSetpoint = curTemp; + ac.LastDateTime = DateTime.Now; + break; + case 4096: + ac.currentAutoSetpoint = curTemp; + ac.LastDateTime = DateTime.Now; + break; + case 28: + ac.currentSystemMode = attList.AttriButeData; + ac.LastDateTime = DateTime.Now; + break; + case 4097: + ac.CleanStatu = attList.AttriButeData == 42; + break; } - onOffOutputLight.OnOffStatus = onOffOutputLight.DeviceStatusReport.AttriBute[0].AttriButeData; - //璁板綍鍥炲鏃堕棿 - onOffOutputLight.LastDateTime = DateTime.Now; } - //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� - if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 3) + } + + if (common.DeviceStatusReport.CluterID == 514) + { + var ac = (AC)myDevice; + var attriButeList = common.DeviceStatusReport.AttriBute; + ac.DeviceStatusReport = common.DeviceStatusReport; + foreach (var attList in attriButeList) { - var onOffOutputLight = deviceUI.CommonDevice as ToggleLight; - onOffOutputLight.IsOnline = 1; - //璁板綍鍥炲鏃堕棿 - onOffOutputLight.LastDateTime = DateTime.Now; - } - break; - - case DeviceType.AirSwitch: - //寮�鍏冲姛鑳� - if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6) - { - var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch; - airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport; - //璁板綍銆佹洿鏂扮姸鎬� - if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0) - { - return; - } - airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData; - //璁板綍鍥炲鏃堕棿 - airSwitch.LastDateTime = DateTime.Now; - - } - //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� - if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3) - { - var airSwitch = deviceUI.CommonDevice as AirSwitch; - airSwitch.IsOnline = 1; - //璁板綍鍥炲鏃堕棿 - airSwitch.LastDateTime = DateTime.Now; - } - break; - - case DeviceType.WindowCoveringDevice: - if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3) - { - var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade; - rollershade.IsOnline = 1; - //璁板綍鍥炲鏃堕棿 - rollershade.LastDateTime = DateTime.Now; - } - break; - - case DeviceType.Thermostat: - //AC鍔熻兘 - if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513) - { - var ac = deviceUI.CommonDevice as ZigBee.Device.AC; - ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport; - var attriButeList = ac.DeviceStatusReport.AttriBute; - if (attriButeList == null || attriButeList.Count == 0) - { - continue; - } - switch (attriButeList[0].AttributeId) - { + switch (attList.AttributeId) + { case 0: - //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝 - ac.currentLocalTemperature = attriButeList[0].AttriButeData / 100; + ac.currentFanMode = attList.AttriButeData; ac.LastDateTime = DateTime.Now; break; - - case 17: - //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鍐锋俯搴︼紝瀹為檯娓╁害涓衡�淐oolingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆� - ac.currentCoolingSetpoint = attriButeList[0].AttriButeData / 100; + case 4096: + ac.currentFanSwingMode = attList.AttriButeData; ac.LastDateTime = DateTime.Now; break; - - case 18: - //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆� - ac.currentHeatingSetpoint = attriButeList[0].AttriButeData / 100; - ac.LastDateTime = DateTime.Now; - break; - - case 28: - //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡 - //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8 - ac.currentSystemMode = attriButeList[0].AttriButeData; - ac.LastDateTime = DateTime.Now; - break; - } - } - //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� - if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3) - { - var ac = deviceUI.CommonDevice as AC; - ac.IsOnline = 1; - //璁板綍鍥炲鏃堕棿 - ac.LastDateTime = DateTime.Now; + } - } - break; + //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� + if (common.DeviceStatusReport.CluterID == 3) + { + myDevice.IsOnline = 1; + myDevice.LastDateTime = DateTime.Now; + } + break; + + case DeviceType.DimmableLight: + //璋冨厜鐏姛鑳� + //寮�鍏冲姛鑳� + if (common.DeviceStatusReport.CluterID == 6) + { + var dimmableLight = (DimmableLight)myDevice; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; + dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; + dimmableLight.LastDateTime = DateTime.Now; + } + //浜害 + if (common.DeviceStatusReport.CluterID == 8) + { + var dimmableLight = (DimmableLight)myDevice; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; + var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; + switch (attriButeList[0].AttributeId) + { + case 0: + dimmableLight.Level = attriButeList[0].AttriButeData; + dimmableLight.LastDateTime = DateTime.Now; + break; + } + } + //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� + if (common.DeviceStatusReport.CluterID == 3) + { + myDevice.IsOnline = 1; + myDevice.LastDateTime = DateTime.Now; + } + break; - case DeviceType.DimmableLight: - //璋冨厜鐏姛鑳� - //寮�鍏冲姛鑳� - if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 6) + case DeviceType.TemperatureSensor: + //娓╁害 + if (common.DeviceStatusReport.CluterID == 1026) + { + var tempera = (TemperatureSensor)myDevice; + foreach (var data in common.DeviceStatusReport.AttriBute) { - var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; - dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; - //璁板綍銆佹洿鏂扮姸鎬� - if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) + if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) { - return; + if (data.AttriButeData == 0) + { + tempera.Temperatrue = 0; + } + else if (data.AttriButeData > 32767) + { + //璐熸暟(鐗规畩澶勭悊) + string strValue = (data.AttriButeData - 65536).ToString(); + //灏忔暟鐐归渶瑕佷竴浣� + strValue = strValue.Substring(0, strValue.Length - 1); + tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } + else + { + //灏忔暟鐐归渶瑕佷竴浣� + string strValue = data.AttriButeData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + tempera.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } } - dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; - //璁板綍鍥炲鏃堕棿 - dimmableLight.LastDateTime = DateTime.Now; } - //浜害 - if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8) + } + //婀垮害 + if (common.DeviceStatusReport.CluterID == 1029) + { + var tempera = (TemperatureSensor)myDevice; + foreach (var data in common.DeviceStatusReport.AttriBute) { - var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; - dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; - var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; - if (attriButeList == null || attriButeList.Count == 0) + if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) { - continue; - } - switch (attriButeList[0].AttributeId) - { - case 0: - //姝ゅ睘鎬ц〃鏄庡綋鍓嶄寒搴︾▼搴� - dimmableLight.Level = attriButeList[0].AttriButeData; - dimmableLight.LastDateTime = DateTime.Now; - break; + if (data.AttriButeData == 0) + { + tempera.Humidity = 0; + } + else + { + //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟) + string strValue = data.AttriButeData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + tempera.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + tempera.LastDateTime = DateTime.Now; + } } } - //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁� - if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 3) - { - var dimmableLight = deviceUI.CommonDevice as DimmableLight; - dimmableLight.IsOnline = 1; - //璁板綍鍥炲鏃堕棿 - dimmableLight.LastDateTime = DateTime.Now; - } - break; - } + } + break; } } catch (Exception ex) @@ -253,61 +304,25 @@ } //璁惧鍦ㄧ嚎鐘舵�佷笂鎶� else if (typeTag == "OnlineStatusChange") + { + myDevice.IsOnline = common.IsOnline; + //璁板綍鍥炲鏃堕棿 + myDevice.LastDateTime = DateTime.Now; + } + else if (typeTag == "IASInfoReport") { try { - for (int i = 0; i < Room.AllRoomDeviceUIList.Count; i++) + switch (myDevice.Type) { - var deviceUI = Room.AllRoomDeviceUIList[i]; - if (deviceUI.CommonDevice == null) - { - //璁惧涓虹┖鎴栬�呮帶浠朵负绌� - continue; - } - if (common.DeviceAddr != deviceUI.CommonDevice.DeviceAddr || common.DeviceEpoint != deviceUI.CommonDevice.DeviceEpoint) - { - //鍒ゆ柇鏄惁涓哄綋鍓嶈澶� - continue; - } - switch (deviceUI.CommonDevice.Type) - { - case DeviceType.OnOffOutput: - var onOffOutputLight = deviceUI.CommonDevice as ToggleLight; - onOffOutputLight.IsOnline = (common as ToggleLight).IsOnline; - //璁板綍鍥炲鏃堕棿 - onOffOutputLight.LastDateTime = DateTime.Now; - break; - case DeviceType.AirSwitch: - var airSwitch = deviceUI.CommonDevice as AirSwitch; - airSwitch.IsOnline = (common as AirSwitch).IsOnline; - //璁板綍鍥炲鏃堕棿 - airSwitch.LastDateTime = DateTime.Now; - break; - case DeviceType.WindowCoveringDevice: - var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade; - rollershade.IsOnline = (common as Rollershade).IsOnline; - //璁板綍鍥炲鏃堕棿 - rollershade.LastDateTime = DateTime.Now; - break; - case DeviceType.Thermostat: - var ac = deviceUI.CommonDevice as ZigBee.Device.AC; - ac.IsOnline = (common as ZigBee.Device.AC).IsOnline; - //璁板綍鍥炲鏃堕棿 - ac.LastDateTime = DateTime.Now; - break; - case DeviceType.DimmableLight: - var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; - dimmableLight.IsOnline = (common as ZigBee.Device.DimmableLight).IsOnline; - //璁板綍鍥炲鏃堕棿 - dimmableLight.LastDateTime = DateTime.Now; - break; - } + case DeviceType.IASZone: + var iAS = (IASZone)myDevice; + iAS.iASInfo = (common as IASZone).iASInfo; + iAS.LastDateTime = DateTime.Now; + break; } } - catch (Exception ex) - { - System.Console.WriteLine($"userpage鍔熻兘鍒锋柊-Error:{ex.Message}"); - } + catch { } } } /// <summary> @@ -351,6 +366,10 @@ { BackgroundColor = Shared.Common.ZigbeeColor.Current.MainColor; ZbGateway.StatusList.Add(this); + Shared.Application.LocationAction += (lon, lat) => + { + Login.AccountLogic.Instance.ReceiveAppLatAndLon(lon.ToString(), lat.ToString()); + }; } /// <summary> @@ -368,8 +387,18 @@ { Y = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight), Height = Application.GetRealHeight(CommonPage.TabbarHeight), - BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor, + BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBottomColor, }; + + #region 鍒嗗壊绾� + + private Button bottomLine = new Button + { + Height = 1, + BackgroundColor = ZigbeeColor.Current.GXCBottomLineColor + }; + + #endregion #region 搴曢儴-涓婚〉鎸夐挳 /// <summary> @@ -391,7 +420,6 @@ Width = Application.GetMinRealAverage(tabBarEnumIMG_Width), UnSelectedImagePath = "Navigation/Home.png", SelectedImagePath = "Navigation/HomeSelected.png", - IsSelected = true, Gravity = Gravity.CenterHorizontal }; /// <summary> @@ -402,10 +430,10 @@ Y = Application.GetRealHeight(tabBarEnumName_Y), Height = Application.GetRealHeight(tabBarEnumName_Height), TextID = R.MyInternationalizationString.HomePage, - TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor, - SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor, - IsSelected = true, - Gravity = Gravity.CenterHorizontal + TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor, + SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2, + Gravity = Gravity.CenterHorizontal, + TextSize = 10 }; #endregion @@ -415,7 +443,7 @@ /// </summary> public FrameLayout categoryFL = new FrameLayout { - X=Application.GetRealWidth(tabBarEnum_Width), + X = Application.GetRealWidth(tabBarEnum_Width), Width = Application.GetRealWidth(tabBarEnum_Width), Height = Application.GetRealHeight(CommonPage.TabbarHeight) }; @@ -439,10 +467,10 @@ Y = Application.GetRealHeight(tabBarEnumName_Y), Height = Application.GetRealHeight(tabBarEnumName_Height), TextID = R.MyInternationalizationString.Category, - TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor, - SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor, - IsSelected = false, - Gravity = Gravity.CenterHorizontal + TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor, + SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2, + Gravity = Gravity.CenterHorizontal, + TextSize = 10 }; #endregion @@ -452,7 +480,7 @@ /// </summary> public FrameLayout settingFL = new FrameLayout { - X = Application.GetRealWidth(tabBarEnum_Width*2), + X = Application.GetRealWidth(tabBarEnum_Width * 2), Width = Application.GetRealWidth(tabBarEnum_Width), Height = Application.GetRealHeight(CommonPage.TabbarHeight) }; @@ -476,61 +504,84 @@ Y = Application.GetRealHeight(tabBarEnumName_Y), Height = Application.GetRealHeight(tabBarEnumName_Height), TextID = R.MyInternationalizationString.Me, - TextColor = ZigbeeColor.Current.GXCTextBlackColor, - SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor, - IsSelected = false, - Gravity = Gravity.CenterHorizontal + TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor, + SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2, + Gravity = Gravity.CenterHorizontal, + TextSize = 10 }; #endregion - #region 鍒嗗壊绾� - - private FrameLayout bottomLine = new FrameLayout - { - Height = 3, - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - - #endregion EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) => { - Room.GetAllRoomDeviceUIList(); - - Instance.homePageName.IsSelected = false; - Instance.homePageIMG.IsSelected = false; - - Instance.categoryName.IsSelected = false; - Instance.categoryIMG.IsSelected = false; - - Instance.settingName.IsSelected = false; - Instance.settingIMG.IsSelected = false; - - Instance.BodyView.RemoveAll(); if (sender == Instance.homePageIMG || sender == Instance.homePageName) { + + if (Instance.homePageName.IsSelected == true && e != null) + { + //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊 + return; + } + Instance.BodyView.RemoveAll(); //涓婚〉 + CommonPage.Instance.IsDrawerLockMode = false; Instance.homePageName.IsSelected = true; - Instance.homePageIMG.IsSelected = true; - var home = new UserHomeView { }; + Instance.homePageIMG.IsSelected = true; + + Instance.categoryName.IsSelected = false; + Instance.categoryIMG.IsSelected = false; + + Instance.settingName.IsSelected = false; + Instance.settingIMG.IsSelected = false; + + var home = new MainPage.UserHomeView2(); Instance.BodyView.AddChidren(home); - home.Show(); + home.ShowForm(); + } - else if (sender == Instance.categoryIMG || sender==Instance.categoryName) - { + else if (sender == Instance.categoryIMG || sender == Instance.categoryName) + { + if (Instance.categoryName.IsSelected == true && e != null) + { + //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊 + return; + } + + Instance.BodyView.RemoveAll(); //鍒嗙被 + CommonPage.Instance.IsDrawerLockMode = true; Instance.categoryName.IsSelected = true; - Instance.categoryIMG.IsSelected = true; + Instance.categoryIMG.IsSelected = true; + + Instance.homePageName.IsSelected = false; + Instance.homePageIMG.IsSelected = false; + + Instance.settingName.IsSelected = false; + Instance.settingIMG.IsSelected = false; + var category = new Phone.Device.Category.Category { }; Instance.BodyView.AddChidren(category); category.Show(); } - else if (sender == Instance.settingIMG || sender==Instance.settingName) - { - //涓汉涓績 + else if (sender == Instance.settingIMG || sender == Instance.settingName) + { + if (Instance.settingName.IsSelected == true && e != null) + { + return; + } + Instance.BodyView.RemoveAll(); + //涓汉涓績 + CommonPage.Instance.IsDrawerLockMode = true; Instance.settingName.IsSelected = true; - Instance.settingIMG.IsSelected = true; - var form = new UserCenter.User.UserMainForm(); + Instance.settingIMG.IsSelected = true; + + Instance.homePageName.IsSelected = false; + Instance.homePageIMG.IsSelected = false; + + Instance.categoryName.IsSelected = false; + Instance.categoryIMG.IsSelected = false; + + var form = new UserCenter.UserMain.UserMainForm(); Instance.BodyView.AddChidren(form); form.ShowForm(); } @@ -557,6 +608,8 @@ AddChidren(BodyView); AddChidren(BottomMenuView); + BottomMenuView.AddChidren(Instance.bottomLine); + Instance.homePageFL.AddChidren(Instance.homePageIMG); Instance.homePageFL.AddChidren(Instance.homePageName); BottomMenuView.AddChidren(Instance.homePageFL); @@ -568,8 +621,6 @@ Instance.settingFL.AddChidren(Instance.settingIMG); Instance.settingFL.AddChidren(Instance.settingName); BottomMenuView.AddChidren(Instance.settingFL); - - BottomMenuView.AddChidren(Instance.bottomLine); homePageIMG.MouseUpEventHandler += BottomEventHandler; homePageName.MouseUpEventHandler += BottomEventHandler; -- Gitblit v1.8.0