From fab43407e01474cc4f7b1d0f4b5e43ce1a038ce4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 16 三月 2021 16:51:14 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into temp-wxr
---
HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
index d202d33..4874520 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
@@ -482,6 +482,104 @@
dialog.Close();
};
+ var bodyView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(463),
+ Height = Application.GetRealHeight(375),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ div.AddChidren(bodyView);
+
+ var contentView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(16),
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(296),
+ };
+ bodyView.AddChidren(contentView);
+
+ var row = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(60),
+ };
+ contentView.AddChidren(row);
+
+ int index = 0;
+ foreach (var attr in device.attributes)
+ {
+ if (attr.key == FunctionAttributeKey.Mode
+ || attr.key == FunctionAttributeKey.OnOff
+ || attr.key == FunctionAttributeKey.SetTemp
+ || attr.key == FunctionAttributeKey.SetTempStep
+ || attr.key == FunctionAttributeKey.FanSpeed
+ || attr.key == FunctionAttributeKey.FanManual
+ || attr.key == FunctionAttributeKey.FanAuto
+ )
+ {
+ continue;
+ }
+ if (index != 0 && index % 3 == 0)
+ {
+ row = new FrameLayout()
+ {
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(56),
+ };
+ contentView.AddChidren(row);
+ }
+
+ var btn = new Button()
+ {
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetRealWidth(88),
+ Height = Application.GetRealHeight(40),
+ Radius = (uint)Application.GetRealHeight(18),
+ BorderColor = CSS_Color.PromptingColor1,
+ BorderWidth = (uint)Application.GetRealWidth(2),
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.TextFontSize,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ SelectedTextColor = CSS_Color.MainBackgroundColor,
+ SelectedBackgroundColor = CSS_Color.MainColor,
+ };
+ if (attr.value.Count > 0)
+ {
+ btn.Text = attr.value[0];
+ }
+ if (index % 3 == 1)
+ {
+ btn.Gravity = Gravity.Center;
+ }
+ else if (index % 3 == 2)
+ {
+ btn.X = Application.GetRealWidth(208);
+ }
+ row.AddChidren(btn);
+
+ btn.MouseUpEventHandler = (sender, e) =>
+ {
+ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Key, attr.key);
+ Control.Ins.SendWriteCommand(device, d);
+
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(2000);
+ Application.RunOnMainThread(() =>
+ {
+ btn.IsSelected = false;
+ });
+ })
+ { IsBackground = true }.Start();
+ };
+
+
+
+ index++;
+ }
+
+
+
--
Gitblit v1.8.0