From dfcb2a1844fd55b57bae23e290b30ec6380e8508 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期五, 26 八月 2022 15:04:22 +0800 Subject: [PATCH] 更新全视通dll --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs | 495 ++++++++++++++++++++++++++----------------------------- 1 files changed, 234 insertions(+), 261 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs old mode 100755 new mode 100644 index 2ed4d25..33be4e8 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs @@ -1,261 +1,234 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// 鍋氭垚涓�涓噷闈㈠彧瑁匜rameLayout鐨勫垪琛ㄥ瀷鎺т欢,鏈夊埛鏂板姛鑳�(鏈夋甯�,瀹冧笉浼氳皟鏁撮珮搴�) - /// </summary> - public class VerticalFrameRefreshControl : VerticalRefreshLayout - { - #region 鈻� 鍙橀噺澹版槑___________________________ - - /// <summary> - /// 琛屼箣闂寸殑闂磋窛 - /// </summary> - public int rowSpace = 0; - /// <summary> - /// 妗屽竷鎺т欢 - /// </summary> - private FrameLayout m_frameTable = null; - /// <summary> - /// 妗屽竷鎺т欢 - /// </summary> - public FrameLayout frameTable - { - get - { - if (m_frameTable == null) { this.InitFrameTable(); } - return m_frameTable; - } - } - - /// <summary> - /// 涓�涓复鏃剁殑涓滆タ - /// </summary> - private FrameLayout frameBackTemp = null; - - #endregion - - #region 鈻� 鍒濆鍖朹____________________________ - - /// <summary> - /// 鍋氭垚涓�涓垪琛ㄥ瀷鐨凢rameLayout,鏈夊埛鏂板姛鑳�(瀹冧笉浼氳皟鏁撮珮搴�) - /// </summary> - /// <param name="i_rowSpace">琛屼箣闂寸殑闂磋窛(杩欎釜鍊兼槸涓庤鎺т欢缁戝畾涓�璧蜂娇鐢ㄧ殑)</param> - public VerticalFrameRefreshControl(int i_rowSpace = 0) - { - rowSpace = Application.GetRealHeight(i_rowSpace); - this.VerticalScrollBarEnabled = false; -#if iOS - //鑷姩鍋忕Щ鍙栨秷 - if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) - { - (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; - } -#endif - } - - /// <summary> - /// 鍒濆鍖栨甯冩帶浠� - /// </summary> - private void InitFrameTable() - { - if (this.m_frameTable != null && this.m_frameTable.Parent != null) - { - return; - } - this.m_frameTable = new FrameLayout(); - this.m_frameTable.Width = this.Width; - this.m_frameTable.Height = this.Height; - this.AddChidren(this.m_frameTable); - } - - #endregion - - #region 鈻� 娣诲姞瀛愭帶浠禵________________________ - - /// <summary> - /// 娣诲姞Frame瀛愭帶浠�(姝ゆ柟娉曟槸鏀瑰彉Y杞�) - /// </summary> - /// <param name="view"></param> - public void AddChidrenFrame(FrameLayout frame) - { - //鍒濆鍖栨甯冩帶浠� - this.InitFrameTable(); - - int value = this.GetLocationMostLastViewBottom(this.m_frameTable); - if (value != -1) - { - frame.Y = value + rowSpace; - } - this.m_frameTable.AddChidren(frame); - //璋冩暣妗屽竷楂樺害 - if (this.m_frameTable.Height < frame.Bottom) - { - this.m_frameTable.Height = frame.Bottom; - } - } - - /// <summary> - /// 娣诲姞Frame瀛愭帶浠�(姝ゆ柟娉曟槸鏀瑰彉楂樺害) - /// </summary> - /// <param name="view"></param> - public void AddChidrenFrame2(FrameLayout frame) - { - //鍒濆鍖栨甯冩帶浠� - this.InitFrameTable(); - - //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 - int value = this.GetLocationMostLastViewBottom(this.m_frameTable); - if (value != -1) - { - frame.Y = value; - } - this.m_frameTable.AddChidren(frame); - if (rowSpace > 0) - { - frame.Height += rowSpace; - } - //璋冩暣妗屽竷楂樺害 - if (this.m_frameTable.Height < frame.Bottom) - { - this.m_frameTable.Height = frame.Bottom; - } - } - - /// <summary> - /// 娣诲姞Frame瀛愭帶浠�(姝ゆ柟娉曟槸鏀瑰彉楂樺害) - /// </summary> - /// <param name="row"></param> - public void AddChidrenRow(RowLayout row) - { - //鍒濆鍖栨甯冩帶浠� - this.InitFrameTable(); - - //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 - int value = this.GetLocationMostLastViewBottom(this.m_frameTable); - if (value != -1) - { - row.Y = value; - } - this.m_frameTable.AddChidren(row); - if (rowSpace > 0) - { - row.Height += rowSpace; - } - //璋冩暣妗屽竷楂樺害 - if (this.m_frameTable.Height < row.Bottom) - { - this.m_frameTable.Height = row.Bottom; - } - } - - #endregion - - #region 鈻� 涓�鑸柟娉昣__________________________ - - /// <summary> - /// 璋冩暣瀛怓rameLayout鐨勯珮搴� - /// </summary> - /// <param name="frame"></param> - /// <param name="buttomSpace">搴曢儴绌虹櫧闂磋窛(鐪熷疄鍊�)</param> - public void AdjustChidrenFrameHeight(FrameLayout frame, int buttomSpace) - { - //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 - int value = this.GetLocationMostLastViewBottom(frame); - if (value != -1) - { - //璋冩暣妗屽竷楂樺害 - frame.Height = value + buttomSpace; - } - } - - /// <summary> - /// 璋冩暣妗屽竷楂樺害 - /// </summary> - /// <param name="buttomSpace">搴曢儴绌虹櫧闂磋窛(鐪熷疄鍊�)</param> - public void AdjustTableHeight(int buttomSpace = 0) - { - //2020.05.25杩藉姞 - if (this.frameBackTemp != null && this.frameBackTemp.Parent != null) - { - this.frameBackTemp.RemoveFromParent(); - } - - //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 - int value = this.GetLocationMostLastViewBottom(this.m_frameTable); - if (value != -1) - { - //璋冩暣妗屽竷楂樺害 - this.m_frameTable.Height = value + buttomSpace; - } - else - { - //杩樺師涓哄師鏉ョ殑楂樺害 - this.RecoverTableHeight(); - } - } - - /// <summary> - /// 閽堝搴曢儴鐐瑰嚮鎸夐挳,璋冩暣鎺т欢鐪熷疄楂樺害 - /// </summary> - /// <param name="correctionsValue">Y杞磋ˉ姝e��(鐪熷疄鍊�,鍒楄〃鎺т欢涓嶅湪bodyFramelayout鐨勬椂鍊欎娇鐢�)</param> - public void AdjustRealHeightByBottomButton(int correctionsValue = 0) - { - //璋冩暣妗屽竷楂樺害 2020.05.25杩藉姞 - this.AdjustTableHeight(); - - var btnTemp = new BottomClickButton(); - if (btnTemp.Yaxis >= this.m_frameTable.Height + correctionsValue) - { - //娌℃湁瓒呰繃 - return; - } - //娣诲姞涓存椂鎺т欢,鐩磋嚦鍙互婊戝姩瓒呰繃搴曢儴鎸夐挳 - int oldRowSpace = this.rowSpace; - this.rowSpace = 0; - - this.frameBackTemp = new FrameLayout(); - frameBackTemp.Height = ControlCommonResourse.BodyFrameHeight - btnTemp.Yaxis + Application.GetRealHeight(23); - this.AddChidrenFrame(frameBackTemp); - - this.rowSpace = oldRowSpace; - } - - /// <summary> - /// 杩樺師妗屽竷楂樺害 - /// </summary> - public void RecoverTableHeight() - { - if (this.m_frameTable != null) - { - m_frameTable.Height = this.Height; - } - } - - /// <summary> - /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 - /// </summary> - /// <returns></returns> - private int GetLocationMostLastViewBottom(FrameLayout frame) - { - int bottomHeight = -1; - - if (frame == null) { return bottomHeight; } - - for (int i = 0; i < frame.ChildrenCount; i++) - { - var child = frame.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> + /// 鍋氭垚涓�涓噷闈㈠彧瑁匜rameLayout鐨勫垪琛ㄥ瀷鎺т欢,鏈夊埛鏂板姛鑳�(鏈夋甯�,瀹冧笉浼氳皟鏁撮珮搴�) + /// </summary> + public class VerticalFrameRefreshControl : VerticalRefreshLayout + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 琛屼箣闂寸殑闂磋窛 + /// </summary> + public int rowSpace = 0; + /// <summary> + /// 妗屽竷鎺т欢 + /// </summary> + private NormalFrameLayout m_frameTable = null; + /// <summary> + /// 妗屽竷鎺т欢 + /// </summary> + public NormalFrameLayout frameTable + { + get + { + if (m_frameTable == null) { this.InitFrameTable(); } + return m_frameTable; + } + } + + /// <summary> + /// 涓�涓复鏃剁殑涓滆タ + /// </summary> + private FrameLayout frameBackTemp = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍋氭垚涓�涓垪琛ㄥ瀷鐨凢rameLayout,鏈夊埛鏂板姛鑳�(瀹冧笉浼氳皟鏁撮珮搴�) + /// </summary> + /// <param name="i_rowSpace">琛屼箣闂寸殑闂磋窛(杩欎釜鍊兼槸涓庤鎺т欢缁戝畾涓�璧蜂娇鐢ㄧ殑)</param> + public VerticalFrameRefreshControl(int i_rowSpace = 0) + { + rowSpace = Application.GetRealHeight(i_rowSpace); + this.VerticalScrollBarEnabled = false; +#if iOS + //鑷姩鍋忕Щ鍙栨秷 + if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) + { + (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; + } +#endif + } + + /// <summary> + /// 鍒濆鍖栨甯冩帶浠� + /// </summary> + private void InitFrameTable() + { + if (this.m_frameTable != null && this.m_frameTable.Parent != null) + { + return; + } + this.m_frameTable = new NormalFrameLayout(); + this.m_frameTable.Width = this.Width; + this.m_frameTable.Height = this.Height; + base.AddChidren(this.m_frameTable); + } + + #endregion + + #region 鈻� 娣诲姞瀛愭帶浠禵________________________ + + /// <summary> + /// 娣诲姞瀛愭帶浠�(娉ㄦ剰,瀹冩槸寰�涓嬪姞鎺т欢,姝ゆ柟娉曟槸鍙敼鍙榊杞�) + /// </summary> + /// <param name="view"></param> + public override void AddChidren(View view) + { + //鍒濆鍖栨甯冩帶浠� + this.InitFrameTable(); + + int value = this.GetLocationMostLastViewBottom(this.frameTable); + if (value != -1) + { + view.Y = value + rowSpace; + } + this.frameTable.AddChidren(view); + //璋冩暣妗屽竷楂樺害 + if (this.frameTable.Height < view.Bottom) + { + this.frameTable.Height = view.Bottom; + } + } + + /// <summary> + /// 娣诲姞瀛愭帶浠�(娉ㄦ剰,瀹冩槸寰�涓嬪姞鎺т欢,姝ゆ柟娉曟槸鏀瑰彉楂樺害) + /// </summary> + /// <param name="view"></param> + public void AddChidren2(View view) + { + //鍒濆鍖栨甯冩帶浠� + this.InitFrameTable(); + + //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 + int value = this.GetLocationMostLastViewBottom(this.frameTable); + if (value != -1) + { + view.Y = value; + } + this.frameTable.AddChidren(view); + if (rowSpace > 0) + { + view.Height += rowSpace; + } + //璋冩暣妗屽竷楂樺害 + if (this.frameTable.Height < view.Bottom) + { + this.frameTable.Height = view.Bottom; + } + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 璋冩暣瀛怓rameLayout鐨勯珮搴� + /// </summary> + /// <param name="frame"></param> + /// <param name="buttomSpace">搴曢儴绌虹櫧闂磋窛(鐪熷疄鍊�)</param> + public void AdjustChidrenFrameHeight(FrameLayout frame, int buttomSpace) + { + //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 + int value = this.GetLocationMostLastViewBottom(frame); + if (value != -1) + { + //璋冩暣妗屽竷楂樺害 + frame.Height = value + buttomSpace; + } + } + + /// <summary> + /// 璋冩暣妗屽竷楂樺害 + /// </summary> + /// <param name="buttomSpace">搴曢儴绌虹櫧闂磋窛(鐪熷疄鍊�)</param> + public void AdjustTableHeight(int buttomSpace = 0) + { + //2020.05.25杩藉姞 + if (this.frameBackTemp != null && this.frameBackTemp.Parent != null) + { + this.frameBackTemp.RemoveFromParent(); + } + + //鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 + int value = this.GetLocationMostLastViewBottom(this.frameTable); + if (value != -1) + { + //璋冩暣妗屽竷楂樺害 + this.frameTable.Height = value + buttomSpace; + } + else + { + //杩樺師涓哄師鏉ョ殑楂樺害 + this.RecoverTableHeight(); + } + } + + /// <summary> + /// 閽堝搴曢儴鐐瑰嚮鎸夐挳,璋冩暣鎺т欢鐪熷疄楂樺害 + /// </summary> + /// <param name="correctionsValue">Y杞磋ˉ姝e��(鐪熷疄鍊�,鍒楄〃鎺т欢涓嶅湪bodyFramelayout鐨勬椂鍊欎娇鐢�)</param> + public void AdjustRealHeightByBottomButton(int correctionsValue = 0) + { + //璋冩暣妗屽竷楂樺害 2020.05.25杩藉姞 + this.AdjustTableHeight(); + + var btnTemp = new BottomClickButton(); + if (btnTemp.Yaxis >= this.frameTable.Height + correctionsValue) + { + //娌℃湁瓒呰繃 + return; + } + //娣诲姞涓存椂鎺т欢,鐩磋嚦鍙互婊戝姩瓒呰繃搴曢儴鎸夐挳 + int oldRowSpace = this.rowSpace; + this.rowSpace = 0; + + this.frameBackTemp = new FrameLayout(); + frameBackTemp.Height = ControlCommonResourse.BodyFrameHeight - btnTemp.Yaxis + Application.GetRealHeight(23); + this.AddChidren(frameBackTemp); + + this.rowSpace = oldRowSpace; + } + + /// <summary> + /// 杩樺師妗屽竷楂樺害 + /// </summary> + public void RecoverTableHeight() + { + if (this.m_frameTable != null) + { + m_frameTable.Height = this.Height; + } + } + + /// <summary> + /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 + /// </summary> + /// <returns></returns> + private int GetLocationMostLastViewBottom(FrameLayout frame) + { + int bottomHeight = -1; + + if (frame == null) { return bottomHeight; } + + for (int i = 0; i < frame.ChildrenCount; i++) + { + var child = frame.GetChildren(i); + if (child.Bottom > bottomHeight) + { + bottomHeight = child.Bottom; + } + } + return bottomHeight; + } + + #endregion + } +} -- Gitblit v1.8.0