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 |  152 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 99 insertions(+), 53 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
index c4da2d5..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()
         {
@@ -143,7 +149,7 @@
             var contentView = new VerticalScrolViewLayout()
             {
                 Y = Application.GetRealHeight(74),
-                Height = Application.GetRealHeight(Application.DesignHeight - 74),
+                Height = Application.GetRealHeight(Application.DesignHeight)- Application.GetRealHeight(74),
             };
             bodyView.AddChidren(contentView);
 
@@ -202,6 +208,7 @@
                 TextColor = CSS_Color.MainBackgroundColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton);
 
@@ -215,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,
@@ -234,7 +241,6 @@
                 TextColor = CSS_Color.MainBackgroundColor,
                 TextSize = 12,
                 TextAlignment = TextAlignment.CenterLeft,
-                //IsBold = true,
             };
             electricityGenerationView.AddChidren(pvGenerate_TotalValuesButton);
 
@@ -278,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,
@@ -295,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),
@@ -304,10 +310,11 @@
                 TextSize = 18,
                 TextAlignment = TextAlignment.TopRight,
                 IsBold = true,
+                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;
@@ -409,6 +416,7 @@
                 Y = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(151),
                 Height = Application.GetRealWidth(151),
+                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgRunBg.png"
             };
             pvEleGenerationInfoView.AddChidren(powerGenerationView);
 
@@ -463,6 +471,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 24,
                 IsBold = true,
+                FontName = fontName,
             };
             powerGenerationView.AddChidren(pvPower_ValuesButton);
 
@@ -492,6 +501,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton);
 
@@ -521,6 +531,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton);
 
@@ -550,6 +561,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             pvEleGenerationInfoView.AddChidren(pvGeneration_YearValuesButton);
 
@@ -586,17 +598,21 @@
                             Application.RunOnMainThread(() =>
                             {
                                 pvGeneration_YearValuesButton.Text = totalValues.ToString();
-                                while (true)
+                                if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth())
                                 {
-                                    if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth())
-                                    {
-                                        pvGeneration_YearValuesButton.TextSize--;
-                                    }
-                                    else
-                                    {
-                                        break;
-                                    }
+                                    pvGeneration_YearValuesButton.TextSize = 12;
                                 }
+                                //while (true)
+                                //{
+                                //    if (pvGeneration_YearValuesButton.Width < pvGeneration_YearValuesButton.GetTextWidth())
+                                //    {
+                                //        pvGeneration_YearValuesButton.TextSize=12;
+                                //    }
+                                //    else
+                                //    {
+                                //        break;
+                                //    }
+                                //}
                             });
                         }
                     }
@@ -636,6 +652,7 @@
                 Y = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(151),
                 Height = Application.GetRealWidth(151),
+                BackgroundImagePath = "FunctionIcon/Acst/Inverter/PvBgDischargeBg.png"
             };
             electricityUsageStatusView.AddChidren(powerUsageView);
 
@@ -686,6 +703,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 24,
                 IsBold = true,
+                FontName = fontName,
             };
             powerUsageView.AddChidren(loadElec_ValuesButton);
 
@@ -714,6 +732,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton);
 
@@ -741,6 +760,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton);
 
@@ -769,6 +789,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = 18,
                 IsBold = true,
+                FontName = fontName,
             };
             electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton);
 
@@ -807,17 +828,25 @@
                             Application.RunOnMainThread(() =>
                             {
                                 powerUsage_YearValuesButton.Text = totalValues.ToString();
-                                while (true)
+                                if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
                                 {
-                                    if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
-                                    {
-                                        powerUsage_YearValuesButton.TextSize--;
-                                    }
-                                    else
-                                    {
-                                        break;
-                                    }
+                                    powerUsage_YearValuesButton.TextSize = 12;
                                 }
+                                //while (true)
+                                //{
+                                //    if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth())
+                                //    {
+                                //        powerUsage_YearValuesButton.TextSize-=1;
+                                //        if (powerUsage_YearValuesButton.TextSize <= 10)
+                                //        {
+                                //            break;
+                                //        }
+                                //    }
+                                //    else
+                                //    {
+                                //        break;
+                                //    }
+                                //}
                             });
                         }
                     }
@@ -953,6 +982,7 @@
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = 24,
                     IsBold = true,
+                FontName = fontName,
                 };
                 esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton);
 
@@ -987,6 +1017,7 @@
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = 24,
                     IsBold = true,
+                FontName = fontName,
                 };
                 esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton);
 
@@ -1031,7 +1062,7 @@
             {
                 Gravity = Gravity.CenterHorizontal,
                 Width = Application.GetRealWidth(343),
-                Height = Application.GetRealHeight(142),
+                Height = Application.GetRealWidth(142),//142
                 ScrollEnabled = false,
             };
             contentView.AddChidren(socialContributionView);
@@ -1055,36 +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 = 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()
             {
@@ -1124,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()),
@@ -1135,25 +1178,23 @@
                 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 - 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()
             {
@@ -1193,36 +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 = 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()
             {
@@ -1335,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