From 63a1e0dd7fcda5948c26490d5d7e4c84d6dbf99f Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 16 三月 2021 17:06:19 +0800
Subject: [PATCH] 4

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/HeigthChangeView.cs |  113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 113 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/HeigthChangeView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/HeigthChangeView.cs
new file mode 100644
index 0000000..73d4108
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/HeigthChangeView.cs
@@ -0,0 +1,113 @@
+锘縰sing System;
+using Shared;
+using System.Collections.Generic;
+namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View
+{
+    public class HeigthChangeView
+    {
+
+
+        /// <summary>
+        /// 鑳屾櫙
+        /// </summary>
+        FrameLayout fLayout = new FrameLayout
+        {
+            BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+        };
+        /// <summary>
+        /// 
+        /// </summary>
+        FrameLayout iconFLyout = new FrameLayout
+        {
+            X = Application.GetRealWidth(205),
+            Y = Application.GetRealHeight(314),
+            Width = Application.GetRealWidth(160),
+            Height = Application.GetRealHeight(21 + 44),
+            //BackgroundImagePath = "LogicIcon/bjicon.png",
+        };
+        /// <summary>
+        /// 
+        /// </summary>
+        FrameLayout textFLyout = new FrameLayout
+        {
+            X = Application.GetRealWidth(8),
+            Y = Application.GetRealHeight(14),
+            Width = Application.GetRealWidth(144),
+            Height = Application.GetRealHeight(44),
+        };
+        /// <summary>
+        /// 
+        /// </summary>
+        VerticalScrolViewLayout vv = new VerticalScrolViewLayout
+        {
+            X = Application.GetRealWidth(8),
+            Y = Application.GetRealHeight(14),
+            Width = Application.GetRealWidth(144),
+            Height = Application.GetRealHeight(44 * 4),
+        };
+        /// <summary>
+        /// View鏂规硶
+        /// </summary>
+        /// <param name="frame"></param>
+        /// <param name="list"></param>
+        /// <param name="action"></param>
+        public void Show(FrameLayout frame, List<Pir> list, Action<Pir> action)
+        {
+
+            frame.AddChidren(fLayout);
+            fLayout.AddChidren(iconFLyout);
+
+            fLayout.MouseUpEventHandler += (sender1, e1) =>
+            {
+                fLayout.RemoveFromParent();
+            };
+            if (list.Count > 4)
+            {
+                iconFLyout.Height = Application.GetRealHeight(21 + 44 * 4);
+                iconFLyout.AddChidren(vv);
+                iconFLyout.BackgroundImagePath = "PirIcon/4.png";
+            }
+            else
+            {
+
+                iconFLyout.AddChidren(textFLyout);
+                iconFLyout.Height = Application.GetRealHeight(21 + 44 * list.Count);
+                textFLyout.Height = Application.GetRealHeight(44 * list.Count);
+                iconFLyout.BackgroundImagePath = $"PirIcon/{list.Count}.png";
+            }
+
+
+            for (int i = 0; i < list.Count; i++)
+            {
+                var pirJson = list[i];
+                View.PirNameView pirNameView = new View.PirNameView();
+                if (list.Count > 4)
+                {
+                    vv.AddChidren(pirNameView.FLayoutView());
+                }
+                else
+                {
+                    pirNameView.frameLayout.Y = Application.GetRealHeight(i * 44);
+                    textFLyout.AddChidren(pirNameView.FLayoutView());
+                }
+                pirNameView.btnName.Text = pirJson.name;
+                pirNameView.btnClick.Tag = pirJson;
+                pirNameView.btnClick.MouseUpEventHandler += (sender2, e2) =>
+                {
+                    var pir = pirNameView.btnClick.Tag as Pir;
+                    action(pir);
+                    fLayout.RemoveFromParent();
+
+                    //deviceNameBtn.Text = pirJson.name;
+                    //Pir.currPir = pirJson;
+
+                };
+                if (list.Count - 1 == i)
+                {
+                    ///鏀瑰彉鏈�鍚庨偅鏉′竴涓嚎鐨勯鑹�,鐣岄潰鏄剧ず鏁堟灉浣滅敤;
+                    pirNameView.btnLine.BackgroundColor = CSS.CSS_Color.view;
+                }
+            }
+        }
+    }
+}

--
Gitblit v1.8.0