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/Form/BottomItemSelectForm.cs | 334 +++++++++++++++++++++++++++++++------------------------
1 files changed, 190 insertions(+), 144 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs
old mode 100755
new mode 100644
index 6665467..038c173
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs
@@ -1,39 +1,49 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Shared.Phone.UserCenter
-{
- /// <summary>
- /// 搴曢儴寮圭獥椤圭洰閫夋嫨鐣岄潰(鍒楄〃鏁板敖鍙兘鍒紕閭d箞澶�)
- /// </summary>
- public class BottomItemSelectForm : DialogCommonForm
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 瀹屾垚閫夋嫨鐨勪簨浠�(鍙傛暟涓洪�夋嫨鐨勬槸鍒楄〃鐨勭鍑犺,浠�0寮�濮�)
- /// </summary>
- public Action<int> FinishSelectEvent = null;
- /// <summary>
- /// 鍓嶅洖閫夋嫨鐨勬帶浠�
- /// </summary>
- private NormalSelectControl oldSelectContr = null;
-
- #endregion
-
- #region 鈻� 鍒濆鍖朹____________________________
-
- /// <summary>
- /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
- /// </summary>
- /// <param name="i_topText">澶撮儴鏍囬</param>
- /// <param name="i_listText">闇�瑕佹樉绀虹殑鍒楄〃淇℃伅(鍒楄〃鏁板敖鍙兘鍒紕閭d箞澶�)</param>
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 搴曢儴寮圭獥椤圭洰閫夋嫨鐣岄潰
+ /// </summary>
+ public class BottomItemSelectForm : DialogCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// <para>瀹屾垚閫夋嫨鐨勪簨浠�(鍙傛暟涓洪�夋嫨鐨勬槸鍒楄〃鐨勭鍑犺,浠�0寮�濮�)</para>
+ /// <para>褰揅ancelCallEvent=true鏃�,鐐瑰嚮纭鎸夐挳鏃�,鍙傛暟涓�:-1</para>
+ /// </summary>
+ public Action<int> FinishSelectEvent = null;
+ /// <summary>
+ /// 鍓嶅洖閫夋嫨鐨勬帶浠�
+ /// </summary>
+ private NormalSelectControl oldSelectContr = null;
+ /// <summary>
+ /// 閫夋嫨鍙栨秷(涓嶆槸宸︿笅瑙�),骞朵笖鎸変笅纭畾閿椂,鏄惁璋冪敤鍥炶皟鍑芥暟(璋冪敤鏃朵紶閫掔殑鍙傛暟鏄� -1,榛樿涓嶅洖璋�)
+ /// </summary>
+ public bool CancelCallEvent = false;
+ /// <summary>
+ /// 閫夋嫨鐨勮鑳藉惁鍙栨秷(榛樿鍙互鍙栨秷)
+ /// </summary>
+ public bool SelectRowCanCancel = true;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_topText">澶撮儴鏍囬</param>
+ /// <param name="i_listText">闇�瑕佹樉绀虹殑鍒楄〃淇℃伅</param>
+ /// <param name="i_listBottomText">闇�瑕佹樉绀虹殑鍒楄〃淇℃伅(搴曢儴),濡傛灉鍙槸鍗曡鏄剧ず,鍒欐鍊艰缃负null(濡傛灉涓嶄负null,浣嗘槸绱㈠紩鎵�鎸囧悜鐨勫�间负null,鍒欒琛屽己鍒跺崟琛屾樉绀�)</param>
/// <param name="i_selectNo">璁剧疆鍝釜鏂囨湰涓洪粯璁ら�夋嫨(涓嶈缃~-1)</param>
- public void ShowForm(string i_topText, List<string> i_listText, int i_selectNo)
+ public void ShowForm(string i_topText, List<string> i_listText, List<string> i_listBottomText, int i_selectNo)
{
//鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame(i_topText, i_listText, i_selectNo);
+ this.InitMiddleFrame(i_topText, i_listText, i_listBottomText, i_selectNo);
}
/// <summary>
@@ -41,130 +51,166 @@
/// </summary>
/// <param name="i_topText">澶撮儴鏍囬</param>
/// <param name="i_listText">闇�瑕佹樉绀虹殑鍒楄〃淇℃伅</param>
+ /// <param name="i_listBottomtext">闇�瑕佹樉绀虹殑鍒楄〃淇℃伅(搴曢儴)</param>
/// <param name="i_selectNo">榛樿閫夋嫨</param>
- private void InitMiddleFrame(string i_topText, List<string> i_listText, int i_selectNo)
- {
- //寮у害鐨勫渾鐨勪竴鍗婄殑楂樺害(鍥哄畾)
- int halfRoundHeigth = Application.GetRealHeight(116) / 2;
- //澶撮儴楂樺害
- int topHeight = Application.GetRealHeight(195);
- //搴曢儴楂樺害
- int bottomHeight = Application.GetRealHeight(57);
- //鏄庣粏楂樺害
- int detailHeight = (ControlCommonResourse.ListViewRowHeight + Application.GetRealHeight(12)) * i_listText.Count;
-
- //鎼炰竴涓�忔槑鐨勬
- var frameTransparent = new FrameLayout();
- frameTransparent.Y = bodyFrameLayout.Height - topHeight - bottomHeight - detailHeight;
- frameTransparent.Height = topHeight + bottomHeight + detailHeight + halfRoundHeigth * 2;//楂樺害灏辨槸瑕佸畠瓒呰繃锛岄殢渚挎悶鐨�
- frameTransparent.BackgroundColor = UserCenterColor.Current.Transparent;
- bodyFrameLayout.AddChidren(frameTransparent);
-
- //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙(瀹冧笌瀹為檯楂樺害灏忎簡鍗婁釜寮у害鐨勫渾)
- var detailBackFrame = new FrameLayout();
- detailBackFrame.Y = halfRoundHeigth;
- detailBackFrame.Height = frameTransparent.Height;
- detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
- frameTransparent.AddChidren(detailBackFrame);
-
- //寮у害鐨勫渾
- var rowRound = new FrameLayout();
- rowRound.Width = bodyFrameLayout.Width;
- rowRound.Height = halfRoundHeigth * 2;
- rowRound.BackgroundColor = UserCenterColor.Current.White;
- rowRound.Radius = (uint)halfRoundHeigth;
- frameTransparent.AddChidren(rowRound);
+ private void InitMiddleFrame(string i_topText, List<string> i_listText, List<string> i_listBottomtext, int i_selectNo)
+ {
+ //涓嶈兘澶熸粦鍔ㄧ殑涓滆タ
+ FrameListControl listDetailView1 = null;
+ //鑳藉婊戝姩鐨勪笢瑗�
+ VerticalListControl listDetailView2 = null;
- //澶撮儴淇℃伅
- var btnTitle = new NormalViewControl(detailBackFrame.Width, Application.GetRealHeight(63), false);
- btnTitle.Y = Application.GetRealHeight(35);
+ //鈽呪槄浠庝笅寰�涓婃坊鍔犳帶浠垛槄鈽�
+
+ //鏄庣粏楂樺害(鍒濆鏈�澶氬彧鏄剧ず9琛�)
+ int detailHeight = ControlCommonResourse.ListViewRowHeight + Application.GetRealHeight(12);
+ if (i_listText.Count > 9)
+ {
+ //63:涓婇儴闂磋窛 58:涓嬮儴闂磋窛
+ detailHeight = detailHeight * 9 + Application.GetRealHeight(63 + 58);
+ listDetailView2 = new VerticalListControl(12);
+ listDetailView2.Height = detailHeight;
+ listDetailView2.Gravity = Gravity.BottomCenter;
+ listDetailView2.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listDetailView2);
+ }
+ else
+ {
+ //63:涓婇儴闂磋窛 58:涓嬮儴闂磋窛
+ detailHeight = detailHeight * i_listText.Count + Application.GetRealHeight(63 + 58);
+ listDetailView1 = new FrameListControl(12);
+ listDetailView1.Height = detailHeight;
+ listDetailView1.Gravity = Gravity.BottomCenter;
+ listDetailView1.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listDetailView1);
+ }
+ //绾�
+ int lineYY = listDetailView1 != null ? listDetailView1.Y : listDetailView2.Y;
+ var btnLine = new NormalViewControl(bodyFrameLayout.Width, ControlCommonResourse.BottomLineHeight, false);
+ btnLine.Y = lineYY - ControlCommonResourse.BottomLineHeight;
+ btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+ bodyFrameLayout.AddChidren(btnLine);
+
+ //澶撮儴鐧借壊鑳屾櫙
+ var topBackFame = new FrameLayout();
+ topBackFame.Y = btnLine.Y - Application.GetRealHeight(138);
+ topBackFame.BackgroundColor = UserCenterColor.Current.White;
+ topBackFame.Height = Application.GetRealHeight(138);
+ topBackFame.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+ bodyFrameLayout.AddChidren(topBackFame);
+
+ //澶撮儴淇℃伅
+ var btnTitle = new NormalViewControl(topBackFame.Width, Application.GetRealHeight(65), false);
+ btnTitle.Y = Application.GetRealHeight(34);
btnTitle.Text = i_topText;
btnTitle.TextColor = UserCenterColor.Current.TextColor4;
btnTitle.TextSize = 16;
btnTitle.TextAlignment = TextAlignment.Center;
- rowRound.AddChidren(btnTitle);
+ topBackFame.AddChidren(btnTitle);
//鍙栨秷
- var btnCancel = new NormalViewControl(200, 58, true);
+ var btnCancel = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, false);
btnCancel.X = Application.GetRealWidth(81);
- btnCancel.Y = Application.GetRealHeight(40);
btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1;
btnCancel.TextID = R.MyInternationalizationString.uCancel;
- rowRound.AddChidren(btnCancel);
- btnCancel.ButtonClickEvent += (sender, e) =>
- {
- this.CloseForm();
- };
-
- //瀹屾垚
- var btnFinish = new NormalViewControl(200, 58, true);
- btnFinish.X = Application.GetRealWidth(800);
- btnFinish.Y = Application.GetRealHeight(40);
+ topBackFame.AddChidren(btnCancel);
+ btnCancel.ButtonClickEvent += (sender, e) =>
+ {
+ this.CloseForm();
+ };
+
+ //瀹屾垚
+ var btnFinish = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, false);
+ btnFinish.X = topBackFame.Width - btnCancel.X - Application.GetRealWidth(200);
btnFinish.TextAlignment = TextAlignment.CenterRight;
btnFinish.TextColor = 0xfffb744a;
btnFinish.TextID = R.MyInternationalizationString.uFinish;
- rowRound.AddChidren(btnFinish);
- btnFinish.ButtonClickEvent += (sender, e) =>
- {
- if (FinishSelectEvent != null && oldSelectContr != null)
- {
- //鍥炶皟鍑芥暟
- FinishSelectEvent.Invoke(Convert.ToInt32(oldSelectContr.MainKeys));
- }
- this.CloseForm();
- };
-
- //绾�
- var btnLine = new NormalViewControl(detailBackFrame.Width, ControlCommonResourse.BottomLineHeight, false);
- btnLine.Y = Application.GetRealHeight(138) - ControlCommonResourse.BottomLineHeight - halfRoundHeigth;
- btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
- detailBackFrame.AddChidren(btnLine);
+ topBackFame.AddChidren(btnFinish);
+ btnFinish.ButtonClickEvent += (sender, e) =>
+ {
+ if (FinishSelectEvent != null && oldSelectContr != null)
+ {
+ //鍥炶皟鍑芥暟
+ FinishSelectEvent.Invoke(Convert.ToInt32(oldSelectContr.MainKeys));
+ }
+ else if (FinishSelectEvent != null && this.CancelCallEvent == true)
+ {
+ //鍥炶皟鍑芥暟
+ FinishSelectEvent.Invoke(-1);
+ }
+ this.CloseForm();
+ };
- //鍒楄〃鎺т欢
- var listView = new FrameListControl(12);
- listView.Height = detailHeight + bottomHeight;
- listView.Y = topHeight - halfRoundHeigth;
- detailBackFrame.AddChidren(listView);
- for (int i = 0; i < i_listText.Count; i++)
- {
- var btnRow = new NormalSelectControl(i_listText[i], listView.rowSpace / 2);
- btnRow.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft;//鍚戝彸鍋忕Щ
- btnRow.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(81);//鍚戝乏鍋忕Щ
- listView.AddChidren(btnRow);
- btnRow.InitControl();
- btnRow.MainKeys = i.ToString();
- btnRow.ButtonClickEvent += (sender, e) =>
- {
- //鍙栨秷閫夋嫨
- if (btnRow.IsSelected == true)
- {
- btnRow.IsSelected = false;
- oldSelectContr = null;
- return;
- }
- if (oldSelectContr != null)
- {
- oldSelectContr.IsSelected = false;
- }
- btnRow.IsSelected = true;
- oldSelectContr = btnRow;
- };
- //榛樿閫夋嫨
- if (i == i_selectNo)
- {
- btnRow.IsSelected = true;
- oldSelectContr = btnRow;
- }
- if (i != i_listText.Count - 1)
- {
- //搴曠嚎
- btnRow.AddBottomLine();
- }
+ //娣诲姞涓�涓櫧鑹茬殑闂磋窛
+ var frameSpace = new FrameLayout();
+ frameSpace.Height = Application.GetRealHeight(63);
+ listDetailView1?.AddChidren(frameSpace);
+ listDetailView2?.AddChidren(frameSpace);
+
+ //鏄庣粏鍒楄〃鎺т欢
+ int rowSpace = listDetailView1 != null ? listDetailView1.rowSpace : listDetailView2.rowSpace;
+ for (int i = 0; i < i_listText.Count; i++)
+ {
+ NormalSelectControl btnRow = null;
+ if (i_listBottomtext == null || i_listBottomtext[i] == null)
+ {
+ //鍙樉绀轰竴琛�
+ btnRow = new NormalSelectControl(i_listText[i], rowSpace / 2);
+ }
+ else
+ {
+ //鏄剧ず涓婁笅涓よ
+ btnRow = new NormalSelectControl(i_listText[i], i_listBottomtext[i], rowSpace / 2);
+ }
+ btnRow.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft;//鍚戝彸鍋忕Щ
+ btnRow.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(81);//鍚戝乏鍋忕Щ
+ listDetailView1?.AddChidren(btnRow);
+ listDetailView2?.AddChidren(btnRow);
+
+ btnRow.InitControl();
+ btnRow.MainKeys = i.ToString();
+ btnRow.ButtonClickEvent += (sender, e) =>
+ {
+ //鍙栨秷閫夋嫨
+ if (btnRow.IsSelected == true)
+ {
+ //鍏佽鍙栨秷鐨勬椂鍊�,鎵嶈兘鍙栨秷
+ if (this.SelectRowCanCancel == true)
+ {
+ btnRow.IsSelected = false;
+ oldSelectContr = null;
+ }
+ return;
+ }
+ if (oldSelectContr != null)
+ {
+ oldSelectContr.IsSelected = false;
+ }
+ btnRow.IsSelected = true;
+ oldSelectContr = btnRow;
+ };
+ //榛樿閫夋嫨
+ if (i == i_selectNo)
+ {
+ btnRow.IsSelected = true;
+ oldSelectContr = btnRow;
+ }
+ if (i != i_listText.Count - 1)
+ {
+ //搴曠嚎
+ btnRow.AddBottomLine();
+ }
}
- //鍔ㄧ敾鏁堟灉
- frameTransparent.Animate = Animate.DownToUp;
- }
-
- #endregion
- }
-}
+
+ //濡傛灉鏄粦鍔ㄦ帶浠�,鍒欐坊鍔犲簳閮ㄩ棿璺�
+ if (listDetailView2 != null)
+ {
+ var frameSpace2 = new FrameLayout();
+ frameSpace2.Height = Application.GetRealHeight(58);
+ listDetailView2?.AddChidren(frameSpace2);
+ }
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0