From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 22 六月 2022 11:22:18 +0800 Subject: [PATCH] 修改引用路径 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs | 322 ++++++++++++++++++++++++++-------------------------- 1 files changed, 161 insertions(+), 161 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs old mode 100755 new mode 100644 index 76d3099..ef53d2a --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/InformationEditorControl.cs @@ -1,161 +1,161 @@ -锘縰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> - /// <param name="real">鏄惁璁$畻Height鐨勭湡瀹炲��</param> - /// <returns>淇℃伅瀹瑰櫒鎺т欢</returns> - public FrameListControl InitControl(FrameLayout bodyFrameLayout, string title, int Height, bool real = true) - { - if (real == true) { Height = Application.GetRealHeight(Height); } - //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙 - this.detailBackFrame = new FrameLayout(); - detailBackFrame.Height = 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 - } -} +锘縰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> + /// <param name="real">鏄惁璁$畻Height鐨勭湡瀹炲��</param> + /// <returns>淇℃伅瀹瑰櫒鎺т欢</returns> + public FrameListControl InitControl(FrameLayout bodyFrameLayout, string title, int Height, bool real = true) + { + if (real == true) { Height = Application.GetRealHeight(Height); } + //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙 + this.detailBackFrame = new FrameLayout(); + detailBackFrame.Height = 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 = 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