From 4f0ab0ad21ce450b7856d50f98322a7899361386 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 22 九月 2020 10:30:01 +0800
Subject: [PATCH] 不要下载这个备份
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs | 143 +++++++++++++++++++++++++++++------------------
1 files changed, 87 insertions(+), 56 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs
index 00c5eb4..1b9a476 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/BottomItemSelectForm.cs
@@ -5,14 +5,15 @@
namespace Shared.Phone.UserCenter
{
/// <summary>
- /// 搴曢儴寮圭獥椤圭洰閫夋嫨鐣岄潰(鍒楄〃鏁板敖鍙兘鍒紕閭d箞澶�)
+ /// 搴曢儴寮圭獥椤圭洰閫夋嫨鐣岄潰
/// </summary>
public class BottomItemSelectForm : DialogCommonForm
{
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
- /// 瀹屾垚閫夋嫨鐨勪簨浠�(鍙傛暟涓洪�夋嫨鐨勬槸鍒楄〃鐨勭鍑犺,浠�0寮�濮�)
+ /// <para>瀹屾垚閫夋嫨鐨勪簨浠�(鍙傛暟涓洪�夋嫨鐨勬槸鍒楄〃鐨勭鍑犺,浠�0寮�濮�)</para>
+ /// <para>褰揅ancelCallEvent=true鏃�,鐐瑰嚮纭鎸夐挳鏃�,鍙傛暟涓�:-1</para>
/// </summary>
public Action<int> FinishSelectEvent = null;
/// <summary>
@@ -24,7 +25,7 @@
/// </summary>
public bool CancelCallEvent = false;
/// <summary>
- /// 閫夋嫨鐨勮鑳藉惁鍙栨秷
+ /// 閫夋嫨鐨勮鑳藉惁鍙栨秷(榛樿鍙互鍙栨秷)
/// </summary>
public bool SelectRowCanCancel = true;
@@ -36,12 +37,13 @@
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
/// <param name="i_topText">澶撮儴鏍囬</param>
- /// <param name="i_listText">闇�瑕佹樉绀虹殑鍒楄〃淇℃伅(鍒楄〃鏁板敖鍙兘鍒紕閭d箞澶�)</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>
@@ -49,69 +51,81 @@
/// </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)
+ private void InitMiddleFrame(string i_topText, List<string> i_listText, List<string> i_listBottomtext, 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;
+ //涓嶈兘澶熸粦鍔ㄧ殑涓滆タ
+ FrameListControl listDetailView1 = null;
+ //鑳藉婊戝姩鐨勪笢瑗�
+ VerticalListControl listDetailView2 = null;
- //鎼炰竴涓�忔槑鐨勬
- 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);
+ //鏄庣粏楂樺害(鍒濆鏈�澶氬彧鏄剧ず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 rowRound = new FrameLayout();
- rowRound.Width = bodyFrameLayout.Width;
- rowRound.Height = halfRoundHeigth * 2;
- rowRound.BackgroundColor = UserCenterColor.Current.White;
- rowRound.Radius = (uint)halfRoundHeigth;
- frameTransparent.AddChidren(rowRound);
+ //澶撮儴鐧借壊鑳屾櫙
+ 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(detailBackFrame.Width, Application.GetRealHeight(63), false);
- btnTitle.Y = Application.GetRealHeight(35);
+ 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, true);
btnCancel.X = Application.GetRealWidth(81);
- btnCancel.Y = Application.GetRealHeight(40);
btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1;
btnCancel.TextID = R.MyInternationalizationString.uCancel;
- rowRound.AddChidren(btnCancel);
+ topBackFame.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);
+ var btnFinish = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, true);
+ btnFinish.X = topBackFame.Width - btnCancel.X - Application.GetRealWidth(200);
btnFinish.TextAlignment = TextAlignment.CenterRight;
btnFinish.TextColor = 0xfffb744a;
btnFinish.TextID = R.MyInternationalizationString.uFinish;
- rowRound.AddChidren(btnFinish);
+ topBackFame.AddChidren(btnFinish);
btnFinish.ButtonClickEvent += (sender, e) =>
{
if (FinishSelectEvent != null && oldSelectContr != null)
@@ -127,23 +141,32 @@
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);
+ //娣诲姞涓�涓櫧鑹茬殑闂磋窛
+ var frameSpace = new FrameLayout();
+ frameSpace.Height = Application.GetRealHeight(63);
+ listDetailView1?.AddChidren(frameSpace);
+ listDetailView2?.AddChidren(frameSpace);
- //鍒楄〃鎺т欢
- var listView = new FrameListControl(12);
- listView.Height = detailHeight + bottomHeight;
- listView.Y = topHeight - halfRoundHeigth;
- detailBackFrame.AddChidren(listView);
+ //鏄庣粏鍒楄〃鎺т欢
+ int rowSpace = listDetailView1 != null ? listDetailView1.rowSpace : listDetailView2.rowSpace;
for (int i = 0; i < i_listText.Count; i++)
{
- var btnRow = new NormalSelectControl(i_listText[i], listView.rowSpace / 2);
+ 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);//鍚戝乏鍋忕Щ
- listView.AddChidren(btnRow);
+ listDetailView1?.AddChidren(btnRow);
+ listDetailView2?.AddChidren(btnRow);
+
btnRow.InitControl();
btnRow.MainKeys = i.ToString();
btnRow.ButtonClickEvent += (sender, e) =>
@@ -178,6 +201,14 @@
btnRow.AddBottomLine();
}
}
+
+ //濡傛灉鏄粦鍔ㄦ帶浠�,鍒欐坊鍔犲簳閮ㄩ棿璺�
+ if (listDetailView2 != null)
+ {
+ var frameSpace2 = new FrameLayout();
+ frameSpace2.Height = Application.GetRealHeight(58);
+ listDetailView2?.AddChidren(frameSpace2);
+ }
}
#endregion
--
Gitblit v1.8.0