From 34b65350abbb8b740b9c3bc0b43254cbbe23fcb5 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 19 五月 2020 09:31:44 +0800
Subject: [PATCH] 合并代码,更改面板目标信息
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 159 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
new file mode 100755
index 0000000..62f0a2b
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs
@@ -0,0 +1,159 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 淇℃伅缂栬緫鎺т欢(涓嶅缓璁埆浜轰娇鐢�)
+ /// </summary>
+ public class InformationEditorControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙
+ /// </summary>
+ private FrameLayout detailBackFrame = null;
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private FrameListControl listview = null;
+ /// <summary>
+ /// 鏈�灏忛珮搴�
+ /// </summary>
+ private int minHeight = -1;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�(杩斿洖鐨勬槸淇℃伅瀹瑰櫒鎺т欢)
+ /// </summary>
+ /// <param name="bodyFrameLayout">鐖舵帶浠�</param>
+ /// <param name="title">鏍囬鏂囨湰</param>
+ /// <param name="Height">钃濇箹UI閲岄潰瀹冪殑楂樺害</param>
+ /// <returns>淇℃伅瀹瑰櫒鎺т欢</returns>
+ public FrameListControl InitControl(FrameLayout bodyFrameLayout, string title, int Height)
+ {
+ //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙
+ this.detailBackFrame = new FrameLayout();
+ detailBackFrame.Height = Application.GetRealHeight(Height);
+ detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
+ detailBackFrame.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+ detailBackFrame.Gravity = Gravity.BottomCenter;
+ bodyFrameLayout.AddChidren(detailBackFrame);
+ this.minHeight = detailBackFrame.Height;
+
+ //淇℃伅缂栬緫
+ var btnTile = new NormalViewControl(800, 60, true);
+ btnTile.X = ControlCommonResourse.XXLeft;
+ btnTile.Y = Application.GetRealHeight(81);
+ btnTile.TextSize = 15;
+ btnTile.TextColor = UserCenterColor.Current.TextColor2;
+ btnTile.Text = title;
+ detailBackFrame.AddChidren(btnTile);
+
+ //鍒楄〃鎺т欢
+ this.listview = new FrameListControl(12);
+ listview.Y = btnTile.Bottom + Application.GetRealHeight(17);
+ listview.Height = Application.GetRealHeight(Height) - btnTile.Bottom - Application.GetRealHeight(17);
+ detailBackFrame.AddChidren(listview);
+
+ return listview;
+ }
+
+ /// <summary>
+ /// 瀹屾垚鍒濆鍖�
+ /// </summary>
+ /// <param name="HadBottomButton">杩欎釜鎺т欢鎵�鍦ㄧ殑鐣岄潰,搴曢儴鏈夋病鏈変繚瀛樻寜閽�</param>
+ /// <param name="mandatoryAdjustment">寮哄埗璋冩暣楂樺害</param>
+ public void FinishInitControl(bool HadBottomButton = true, bool mandatoryAdjustment = false)
+ {
+ if (HadBottomButton == true)
+ {
+ var btnFinish = new BottomClickButton();
+ //璁╁畠鍒敼鍙樺潗鏍�
+ int tempSpace = listview.rowSpace;
+ listview.rowSpace = 0;
+ //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩
+ var frameTemp = new FrameLayout();
+ frameTemp.Height = ControlCommonResourse.BodyFrameHeight - btnFinish.Yaxis + Application.GetRealHeight(23);
+ listview.AddChidren(frameTemp);
+
+ listview.rowSpace = tempSpace;
+ }
+
+ //璋冩暣瀹瑰櫒楂樺害澶у皬
+ int value = this.GetLocationMostLastViewBottom();
+ if (mandatoryAdjustment == false)
+ {
+ if (value + Application.GetRealHeight(23) < listview.Height)
+ {
+ //涓嶉渶瑕佽皟鏁�
+ return;
+ }
+ }
+ //璋冩暣澶у皬
+ listview.Height = value + Application.GetRealHeight(23);
+
+ int backHeigth = listview.Bottom;
+ if (minHeight > backHeigth)
+ {
+ //瀹冩湁涓渶灏忛珮搴�
+ backHeigth = minHeight;
+ }
+ this.detailBackFrame.Height = backHeigth;
+
+ //鑾峰彇listview鎵�鍦ㄧ殑鍏ㄥ眬瀹瑰櫒鎺т欢
+ var contrFather = GetVerticalFrameControl(listview);
+ //璋冩暣妗屽竷澶у皬
+ contrFather?.AdjustTableHeight();
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鑾峰彇listview鎵�鍦ㄧ殑鍏ㄥ眬瀹瑰櫒鎺т欢
+ /// </summary>
+ /// <param name="listview"></param>
+ /// <returns></returns>
+ private VerticalFrameControl GetVerticalFrameControl(FrameListControl listview)
+ {
+ var myContr = listview.Parent;
+ while (myContr != null)
+ {
+ if (myContr is VerticalFrameControl)
+ {
+ return (VerticalFrameControl)myContr;
+ }
+ myContr = myContr.Parent;
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
+ /// </summary>
+ /// <returns></returns>
+ private int GetLocationMostLastViewBottom()
+ {
+ int bottomHeight = -1;
+
+ for (int i = 0; i < this.listview.ChildrenCount; i++)
+ {
+ var child = this.listview.GetChildren(i);
+ if (child.Bottom > bottomHeight)
+ {
+ bottomHeight = child.Bottom;
+ }
+ }
+ return bottomHeight;
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0