From 47f179be722a61c95cc03c8f90e1aa91c12d1124 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期三, 23 十月 2024 18:49:23 +0800 Subject: [PATCH] UI走查,安卓 --- HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs | 120 +++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 71 insertions(+), 49 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs index c3d9e0b..539b572 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs @@ -120,6 +120,12 @@ /// </summary> Button socialContribution_Info3_ValuesButton; +#if __ANDROID__ + private string fontName = "BEBAS.ttf"; +#else + private string fontName = "BEBAS"; +#endif + public InverterJinmaoPage() { @@ -202,7 +208,7 @@ TextColor = CSS_Color.MainBackgroundColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton); @@ -216,7 +222,7 @@ #endif pvGenerate_todayUintButton = new Button() { - Y = Application.GetRealWidth(43), + Y = Application.GetRealWidth(44), Height = Application.GetRealWidth(17), Text = "kwh", TextColor = CSS_Color.MainBackgroundColor, @@ -235,7 +241,6 @@ TextColor = CSS_Color.MainBackgroundColor, TextSize = 12, TextAlignment = TextAlignment.CenterLeft, - //IsBold = true, }; electricityGenerationView.AddChidren(pvGenerate_TotalValuesButton); @@ -279,7 +284,7 @@ loadEle_TodayUintButton = new Button() { - Y = Application.GetRealWidth(43), + Y = Application.GetRealWidth(45), Height = Application.GetRealWidth(17), Text = "kwh", TextColor = CSS_Color.MainBackgroundColor, @@ -296,7 +301,7 @@ pvLoad_TodayValuesButton = new Button() { - X = Application.GetRealWidth(81 - 12) - loadEle_TodayUintButton.Width, + X = Application.GetRealWidth(81 - 8) - loadEle_TodayUintButton.Width, Y = Application.GetRealWidth(34), Height = Application.GetRealWidth(53), Width = Application.GetRealWidth(100), @@ -305,11 +310,11 @@ TextSize = 18, TextAlignment = TextAlignment.TopRight, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; #if __IOS__ pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34); - pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 12) - loadEle_TodayUintButton.Width; + pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 8) - loadEle_TodayUintButton.Width; #else pvLoad_TodayValuesButton.Y = Application.GetRealWidth(37); pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 16) - loadEle_TodayUintButton.Width; @@ -411,6 +416,7 @@ Y = Application.GetRealWidth(20), Width = Application.GetRealWidth(151), Height = Application.GetRealWidth(151), + BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgRunBg.png" }; pvEleGenerationInfoView.AddChidren(powerGenerationView); @@ -465,7 +471,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 24, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; powerGenerationView.AddChidren(pvPower_ValuesButton); @@ -495,7 +501,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton); @@ -525,7 +531,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton); @@ -555,7 +561,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; pvEleGenerationInfoView.AddChidren(pvGeneration_YearValuesButton); @@ -646,6 +652,7 @@ Y = Application.GetRealWidth(20), Width = Application.GetRealWidth(151), Height = Application.GetRealWidth(151), + BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgDischargeBg.png" }; electricityUsageStatusView.AddChidren(powerUsageView); @@ -696,7 +703,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 24, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; powerUsageView.AddChidren(loadElec_ValuesButton); @@ -725,7 +732,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton); @@ -753,7 +760,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton); @@ -782,7 +789,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 18, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton); @@ -821,7 +828,10 @@ Application.RunOnMainThread(() => { powerUsage_YearValuesButton.Text = totalValues.ToString(); - powerUsage_YearValuesButton.TextSize=12; + if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth()) + { + powerUsage_YearValuesButton.TextSize = 12; + } //while (true) //{ // if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth()) @@ -972,7 +982,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 24, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton); @@ -1007,7 +1017,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 24, IsBold = true, - FontName = "BEBAS", + FontName = fontName, }; esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton); @@ -1076,37 +1086,41 @@ }; 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(InverterJinmao_AttrEnum.coal.ToString()), TextSize = 18, TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.BottomLeft, IsBold = true, - FontName = "BEBAS", + 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 - Application.GetRealWidth(4), - 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, + TextColor = CSS_Color.FirstLevelTitleColor, }; -#if __IOS__ - socialContribution_Info1_UintButton.Y = Application.GetRealWidth(66); -#endif - socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton); + socialContribution_Info1_ValuesView.AddChidren(socialContribution_Info1_UintButton); var socialContribution_Info1_TipButton = new Button() { @@ -1146,10 +1160,17 @@ }; 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), Text = function.GetAttrState(InverterJinmao_AttrEnum.co2.ToString()), @@ -1157,26 +1178,23 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.BottomLeft, IsBold = true, - FontName = "BEBAS", + 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 - Application.GetRealWidth(4), - 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() { @@ -1216,37 +1234,41 @@ }; 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(InverterJinmao_AttrEnum.trees.ToString()), TextSize = 18, TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.BottomLeft, IsBold = true, - FontName = "BEBAS", + 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 - Application.GetRealWidth(4), - 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() { @@ -1359,7 +1381,7 @@ #if __IOS__ pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34); - pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 12) - loadEle_TodayUintButton.Width; + pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 8) - loadEle_TodayUintButton.Width; #else pvLoad_TodayValuesButton.Y = Application.GetRealWidth(37); pvLoad_TodayValuesButton.X = Application.GetRealWidth(81 - 16) - loadEle_TodayUintButton.Width; -- Gitblit v1.8.0