| | |
| | | /// </summary> |
| | | Button btnPowerControl; |
| | | |
| | | #if __ANDROID__ |
| | | private string fontName = "BEBAS.ttf"; |
| | | #else |
| | | private string fontName = "BEBAS"; |
| | | #endif |
| | | |
| | | public WaterHeaterJinmaoPage(Function deviceFunction) |
| | | { |
| | | bodyView = this; |
| | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = topView.contentView.Height, |
| | | Height = Application.GetRealHeight(Application.DesignHeight - 94 - 5) - topView.contentView.Height, |
| | | Height = Application.GetRealHeight(Application.DesignHeight) - topView.contentView.Height - Application.GetRealWidth(94), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(Application.DesignHeight - 94), |
| | | Height = Application.GetRealHeight(94 + 16), |
| | | Y = Application.GetRealHeight(Application.DesignHeight) - Application.GetRealWidth(94), |
| | | Height = Application.GetRealWidth(94 + 16), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(16), |
| | | BorderColor = 0x00FFFFFF, |
| | |
| | | /// </summary> |
| | | private void initContentView() |
| | | { |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(16) }); |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealWidth(16) }); |
| | | |
| | | #region 热水器状态 |
| | | FrameLayout infoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(181), |
| | | Height = Application.GetRealWidth(181), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.temp.ToString(), "---"), |
| | | FontName = fontName, |
| | | }; |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(6); |
| | | if (btnTempValues.Width > Application.GetRealWidth(80)) |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString(), "---"), |
| | | FontName = fontName, |
| | | }; |
| | | setTemp_ValuesButton.Width = setTemp_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | setTemp_ValuesButton.Gravity = Gravity.CenterHorizontal; |
| | |
| | | }; |
| | | setTempView.AddChidren(setTemp_Temp_MaxValuesTextButton); |
| | | #endregion |
| | | |
| | | |
| | | #region flow 热水流量 |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(142), |
| | | Height = Application.GetRealWidth(130), |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(socialContributionView); |
| | |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_IconButton); |
| | | |
| | | var socialContribution_Info1_ValuesView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealWidth(68), |
| | | Height = Application.GetRealWidth(25), |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesView); |
| | | |
| | | socialContribution_Info1_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | //Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | //Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | FontName = fontName, |
| | | }; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesButton); |
| | | socialContribution_Info1_ValuesView.AddChidren(socialContribution_Info1_ValuesButton); |
| | | |
| | | socialContribution_Info1_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info1_ValuesButton.Right, |
| | | Y = Application.GetRealWidth(68), |
| | | //Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | //Height = Application.GetRealWidth(23), |
| | | Text = "kwh", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton); |
| | | socialContribution_Info1_ValuesView.AddChidren(socialContribution_Info1_UintButton); |
| | | |
| | | var socialContribution_Info1_TipButton = new Button() |
| | | { |
| | |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_IconButton); |
| | | |
| | | var socialContribution_Info2_ValuesView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealWidth(68), |
| | | Height = Application.GetRealWidth(25), |
| | | }; |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesView); |
| | | |
| | | socialContribution_Info2_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | //Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | //Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | FontName = fontName, |
| | | }; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesButton); |
| | | |
| | | socialContribution_Info2_ValuesView.AddChidren(socialContribution_Info2_ValuesButton); |
| | | |
| | | socialContribution_Info2_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info2_ValuesButton.Right, |
| | | Y = Application.GetRealWidth(68), |
| | | //Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | //Height = Application.GetRealWidth(23), |
| | | Text = "吨", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | socialContribution_Info2_ValuesView.AddChidren(socialContribution_Info2_UintButton); |
| | | |
| | | var socialContribution_Info2_TipButton = new Button() |
| | | { |
| | |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_IconButton); |
| | | |
| | | var socialContribution_Info3_ValuesView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealWidth(68), |
| | | Height = Application.GetRealWidth(25), |
| | | }; |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesView); |
| | | |
| | | socialContribution_Info3_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(68), |
| | | //Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(25), |
| | | //Height = Application.GetRealWidth(25), |
| | | Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()), |
| | | TextSize = 18, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | FontName = fontName, |
| | | }; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesButton); |
| | | socialContribution_Info3_ValuesView.AddChidren(socialContribution_Info3_ValuesButton); |
| | | |
| | | socialContribution_Info3_UintButton = new Button() |
| | | { |
| | | X = socialContribution_Info3_ValuesButton.Right, |
| | | Y = Application.GetRealWidth(68), |
| | | //Y = Application.GetRealWidth(68), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(23), |
| | | //Height = Application.GetRealWidth(23), |
| | | Text = "棵", |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | socialContribution_Info3_ValuesView.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealWidth(12) }); |
| | | |
| | | } |
| | | /// <summary> |