| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | /// <summary> |
| | | /// 连接状态提示 |
| | | /// </summary> |
| | | FrameLayout divLinkStateTip; |
| | | FrameLayout linkStateMsgView; |
| | | /// <summary> |
| | | /// 登录状态提示区域 |
| | | /// </summary> |
| | | FrameLayout tokenInvalidMsgView; |
| | | /// <summary> |
| | | /// 安防状态图标 |
| | | /// </summary> |
| | |
| | | }; |
| | | topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(113),//216), |
| | | Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), |
| | | BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, |
| | | }; |
| | | bodyView.AddChidren(topView); |
| | | #else |
| | | VerticalRefreshLayout refreshLayout = new VerticalRefreshLayout() |
| | | { |
| | | Height = Application.GetRealHeight(113),//216), |
| | | Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), |
| | | BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, |
| | | }; |
| | | bodyView.AddChidren(refreshLayout); |
| | |
| | | }; |
| | | topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(113),//216), |
| | | Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), |
| | | }; |
| | | refreshLayout.AddChidren(topView); |
| | | #endif |
| | | #region topView |
| | | |
| | | |
| | | |
| | | Button btnTop; |
| | | btnTop = new Button() |
| | | topView.AddChidren(new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor2, |
| | | }; |
| | | topView.AddChidren(btnTop); |
| | | }); |
| | | |
| | | topView.AddChidren( |
| | | new Button() {Y = Application.GetRealHeight(113), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | Height = Application.GetRealWidth(24) }); |
| | | |
| | | #region topView |
| | | |
| | | btnResidenceName = new Button() |
| | | { |
| | |
| | | IsBold = true |
| | | }; |
| | | topView.AddChidren(btnResidenceName); |
| | | //登录凭证是否有效 |
| | | CheckTokenValid(); |
| | | |
| | | divLinkStateTip = new FrameLayout() |
| | | #region 网关连接状态 |
| | | linkStateMsgView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(113) - Application.GetRealWidth(24), |
| | | Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | BackgroundColor = 0xFFFF4747, |
| | | Visible = false, |
| | | }; |
| | | topView.AddChidren(divLinkStateTip); |
| | | topView.AddChidren(linkStateMsgView); |
| | | |
| | | Button btnLinkStateIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "Collection/GatewayOnlineTipIcon.png" |
| | | }; |
| | | divLinkStateTip.AddChidren(btnLinkStateIcon); |
| | | linkStateMsgView.AddChidren(btnLinkStateIcon); |
| | | |
| | | var btnLinkStateTip = new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.NetworkAnomaly, |
| | | }; |
| | | divLinkStateTip.AddChidren(btnLinkStateTip); |
| | | linkStateMsgView.AddChidren(btnLinkStateTip); |
| | | |
| | | //更新链接状态icon颜色 |
| | | CheckLinkStatus();//2020-12-22 |
| | | #endregion |
| | | |
| | | environmentalView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(1) + btnResidenceName.Bottom, |
| | | Height = Application.GetRealHeight(32), |
| | | }; |
| | | topView.AddChidren(environmentalView); |
| | | CheckLinkStatus();//2020-12-22 |
| | | |
| | | #region 环境数据 |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | |
| | | |
| | | #region 功能场景切换 |
| | | |
| | | bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 }); |
| | | //bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 }); |
| | | |
| | | loadNavView(); |
| | | |
| | |
| | | #if DEBUG |
| | | btnResidenceName.MouseUpEventHandler = (envent, ee) => |
| | | { |
| | | MainPage.Log("sss"); |
| | | |
| | | #if __ANDROID__ |
| | | //HDLLinphoneKit.Instance.MediaPlayerLooping(true); |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); |
| | | #elif __IOS__ |
| | | |
| | |
| | | //} |
| | | //else |
| | | { |
| | | if (!function.collect) |
| | | if (!function.collect&& function.spk != SPK.InverterJinmao) |
| | | continue; |
| | | } |
| | | if (index % 2 == 0) |
| | |
| | | { |
| | | X = Application.GetRealWidth(11), |
| | | Y = Application.GetRealWidth(10), |
| | | TextID = StringId.Acst, |
| | | Text = function.name, |
| | | //TextID = StringId.Acst, |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | |
| | | }; |
| | | view.AddChidren(btnLogo); |
| | | |
| | | try |
| | | { |
| | | if (function.extend.Contains("jinmao") && function.extend.Contains("true")) |
| | | { |
| | | btnLogo.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | btnLogo.Visible = false; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂logo显示处理异常:{ex.Message}"); |
| | | } |
| | | |
| | | Button btnFunctionViewBg; |
| | | btnFunctionViewBg = new Button() |
| | | { |
| | | Height = Application.GetRealWidth(100), |
| | | Width = Application.GetRealWidth(102), |
| | | UnSelectedImagePath = "FunctionIcon/FunctionBg/AcstFunctionBg.png", |
| | | UnSelectedImagePath = function.spk == SPK.AcstParent ? "FunctionIcon/FunctionBg/AcstFunctionBg.png" : "FunctionIcon/FunctionBg/InverterJinmaoFunctionBg.png", |
| | | }; |
| | | view.AddChidren(btnFunctionViewBg); |
| | | if (function.spk == SPK.AcstParent) |
| | |
| | | } |
| | | else if (function.spk == SPK.InverterJinmao) |
| | | { |
| | | btnName.TextID = StringId.NewEnergy; |
| | | //btnName.TextID = StringId.NewEnergy; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new InverterJinmaoPage(); |