From 404cdc88627f942df7944af04ee05b9d527752d6 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 30 九月 2019 13:22:40 +0800 Subject: [PATCH] 合并了徐梅的按键面板绑定 --- ZigbeeApp/Shared/Phone/UserCenter/Safety/CoerceContactSettionForm.cs | 393 ++++++++++++++++++++++++++++--------------------------- 1 files changed, 198 insertions(+), 195 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoerceContactSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoerceContactSettionForm.cs index e49de2e..af92cc9 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoerceContactSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoerceContactSettionForm.cs @@ -8,28 +8,28 @@ /// <summary> /// 鑱旂郴浜鸿缃� /// </summary> - public class CoerceContactSettionForm : UserCenterCommonForm + public class CoerceContactSettionForm : EditorCommonForm { - /// <summary> - /// 鍒楄〃鎺т欢 - /// </summary> - private VerticalScrolViewLayout listView = null; - /// <summary> - /// 鍒楄〃鎺т欢鏈�澶氬彧鑳芥樉绀哄灏戣鎺т欢,濡傛灉瓒呰繃鏃�,楂樺害涓嶅啀鍙樺寲 - /// </summary> - private int listViewCount = 7; - /// <summary> - /// 妗屽竷鎺т欢 - /// </summary> - private FrameLayout frameTableLayout = null; - /// <summary> - /// 銆愭坊鍔犺仈绯讳汉銆戠殑琛� - /// </summary> - private StatuRowLayout addPersonRow = null; - /// <summary> - /// 鐢佃瘽鍒楄〃 - /// </summary> - private List<Safeguard.PushTargetInfo> listPhoneData = null; + ///// <summary> + ///// 鍒楄〃鎺т欢 + ///// </summary> + //private VerticalScrolViewLayout listView = null; + ///// <summary> + ///// 鍒楄〃鎺т欢鏈�澶氬彧鑳芥樉绀哄灏戣鎺т欢,濡傛灉瓒呰繃鏃�,楂樺害涓嶅啀鍙樺寲 + ///// </summary> + //private int listViewCount = 7; + ///// <summary> + ///// 妗屽竷鎺т欢 + ///// </summary> + //private FrameLayout frameTableLayout = null; + ///// <summary> + ///// 銆愭坊鍔犺仈绯讳汉銆戠殑琛� + ///// </summary> + //private StatuRowLayout addPersonRow = null; + ///// <summary> + ///// 鐢佃瘽鍒楄〃 + ///// </summary> + //private List<Safeguard.PushTargetInfo> listPhoneData = null; /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) @@ -37,191 +37,194 @@ /// <param name="listData">宸茬粡瀛樺湪鐨勮仈绯绘柟寮�</param> public void ShowForm(List<Safeguard.PushTargetInfo> listData) { - this.listPhoneData = listData; + //this.listPhoneData = listData; - //璁$畻鐞嗚鍊� - int maxHeight = Application.GetRealHeight(180) * 7; - this.listViewCount = maxHeight / ControlCommonResourse.ListViewRowHeight; + ////璁$畻鐞嗚鍊� + //int maxHeight = Application.GetRealHeight(180) * 7; + //this.listViewCount = maxHeight / ControlCommonResourse.ListViewRowHeight; //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uContactSettion)); //鍒濆鍖栦腑閮ㄤ俊鎭� - this.InitMiddleFrame(); + //this.InitMiddleFrame(); } - /// <summary> - /// 鍒濆鍖栦腑閮ㄤ俊鎭� - /// </summary> - private void InitMiddleFrame() - { - //鑳佽揩鐘舵�佷笅锛岃閫氱煡浜虹殑鑱旂郴鏂瑰紡 - var btnTitle = new TitleViewControl(); - btnTitle.TextColor = UserCenterColor.Current.TextGrayColor; - btnTitle.Y = Application.GetRealHeight(40); - btnTitle.TextID = R.MyInternationalizationString.uContactInCoerceStatu; - bodyFrameLayout.AddChidren(btnTitle); - - this.frameTableLayout = new FrameLayout(); - frameTableLayout.Y = btnTitle.Bottom; - bodyFrameLayout.AddChidren(this.frameTableLayout); - - //璁剧疆涓棿閮ㄥ垎淇℃伅 - this.SetMiddleInfo(); - } - - /// <summary> - /// 璁剧疆涓棿閮ㄥ垎淇℃伅 - /// </summary> - private void SetMiddleInfo() - { - this.listView = new VerticalScrolViewLayout(); - this.listView.Height = 0; - frameTableLayout.AddChidren(this.listView); - - new System.Threading.Thread(() => - { - Application.RunOnMainThread(() => - { - //娣诲姞鑱旂郴浜虹殑鏄庣粏琛� - this.AddPhoneNumList(); - //娣诲姞銆愭坊鍔犺仈绯讳汉銆戠殑琛� - this.AddAddContactPersionRow(); - }); - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// 娣诲姞鑱旂郴浜虹殑鏄庣粏琛� - /// </summary> - private void AddPhoneNumList() - { - int heightCount = listPhoneData.Count; - if (heightCount > listViewCount) - { - heightCount = listViewCount; - } - - foreach (var data in listPhoneData) - { - //娣诲姞鑱旂郴浜鸿 - this.AddPhoneNumRowLayout(data); - } - } - - /// <summary> - /// 娣诲姞鑱旂郴浜鸿 - /// </summary> - /// <param name="data"></param> - public void AddPhoneNumRowLayout(Safeguard.PushTargetInfo data) - { - var row = new RowLayout(); - row.Height = ControlCommonResourse.ListViewRowHeight; - this.listView.AddChidren(row); - - //鍥炬爣 - var btnIcon = new RowLeftIconView(); - btnIcon.UnSelectedImagePath = "Account/ProfilePhotoMember.png"; - row.AddChidren(btnIcon); - - //鐢佃瘽鍙风爜 - var btnPhone = new RowCenterView(); - btnPhone.Text = "+" + data.PushNumber.Replace("-", " "); - row.AddChidren(btnPhone); - - //鍒犻櫎 - var btnDelete = new RowDeleteButton(); - row.AddRightView(btnDelete); - btnDelete.MouseUpEventHandler += (sender, e) => - { - string[] Arry = data.PushNumber.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); - string PNumber = string.Empty; - string areaCode = string.Empty; - if (Arry.Length == 1) - { - PNumber = Arry[0]; - } - else - { - areaCode= Arry[0]; - PNumber = Arry[1]; - } - string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg); - this.ShowConfirmMsg(msg, "DeleteCoercePhoneNumber", areaCode, PNumber, row); - }; - - //鏂版坊鍔犵殑鏃跺�欙紝鑷姩璋冩暣鐣岄潰楂樺害 - this.AutoAdjustListViewHeight(); - } - - - /// <summary> - /// 娣诲姞銆愭坊鍔犺仈绯讳汉銆戠殑琛� - /// </summary> - private void AddAddContactPersionRow() - { - this.addPersonRow = new StatuRowLayout(); - addPersonRow.Y = this.listView.Bottom; - frameTableLayout.AddChidren(addPersonRow); - - //娣诲姞鑱旂郴浜� - var txtAddPer = new RowCenterView(false); - txtAddPer.TextID = R.MyInternationalizationString.uAddContactPersion; ; - addPersonRow.AddChidren(txtAddPer); - - //鍔犲彿鍥炬爣 - var btnAdd = new MostRightEmptyView(); - btnAdd.UnSelectedImagePath = "Item/Add.png"; - btnAdd.SelectedImagePath = "Item/AddSelected.png"; - addPersonRow.AddChidren(btnAdd); - - addPersonRow.MouseUpEvent += (sender, e) => - { - var form = new AddCoerceContactForm(); - this.AddForm(form, this.listPhoneData); - }; - } + ///// <summary> + ///// 鍒濆鍖栦腑閮ㄤ俊鎭� + ///// </summary> + //private void InitMiddleFrame() + //{ + // //娓呯┖bodyFrame + // this.ClearBodyFrame(); - /// <summary> - /// 鍒犻櫎鑱旂郴浜烘柟寮� - /// </summary> - /// <param name="areaCode"></param> - /// <param name="phone"></param> - /// <param name="row"></param> - public async void DeleteCoercePhoneNumber(string areaCode, string phone,RowLayout row) - { - bool result = await Common.LocalSafeguard.Current.DeleteCoercePhoneNumber(areaCode, phone); - if (result == true) - { - Application.RunOnMainThread(() => - { - row.RemoveFromParent(); + // //鑳佽揩鐘舵�佷笅锛岃閫氱煡浜虹殑鑱旂郴鏂瑰紡 + // var btnTitle = new TitleViewControl(); + // btnTitle.TextColor = UserCenterColor.Current.TextGrayColor; + // btnTitle.Y = Application.GetRealHeight(40); + // btnTitle.TextID = R.MyInternationalizationString.uContactInCoerceStatu; + // bodyFrameLayout.AddChidren(btnTitle); - //鑷姩璋冩暣鍒楄〃鎺т欢鐨勯珮搴� - this.AutoAdjustListViewHeight(); + // this.frameTableLayout = new FrameLayout(); + // frameTableLayout.Y = btnTitle.Bottom; + // bodyFrameLayout.AddChidren(this.frameTableLayout); - this.LoadFormMethodByName("CoercePasswordMainForm", "InitMiddleFrame"); - }); - } - } + // //璁剧疆涓棿閮ㄥ垎淇℃伅 + // this.SetMiddleInfo(); + //} - /// <summary> - /// 鑷姩璋冩暣鍒楄〃鎺т欢鐨勯珮搴� - /// </summary> - private void AutoAdjustListViewHeight() - { - if (this.listView.ChildrenCount > this.listViewCount) - { - //涓嶅啀鎵╁ぇ - return; - } - this.listView.Height = this.listView.ChildrenCount * ControlCommonResourse.ListViewRowHeight; - if (this.addPersonRow != null) - { - //鏈夊彲鑳芥槸鐢婚潰姝e湪鍒濆鍖栫殑鏃跺�� - this.addPersonRow.Y = this.listView.Bottom; - } - } + ///// <summary> + ///// 璁剧疆涓棿閮ㄥ垎淇℃伅 + ///// </summary> + //private void SetMiddleInfo() + //{ + // this.listView = new VerticalScrolViewLayout(); + // this.listView.Height = 0; + // frameTableLayout.AddChidren(this.listView); + + // new System.Threading.Thread(() => + // { + // Application.RunOnMainThread(() => + // { + // //娣诲姞鑱旂郴浜虹殑鏄庣粏琛� + // this.AddPhoneNumList(); + // //娣诲姞銆愭坊鍔犺仈绯讳汉銆戠殑琛� + // this.AddAddContactPersionRow(); + // }); + // }) + // { IsBackground = true }.Start(); + //} + + ///// <summary> + ///// 娣诲姞鑱旂郴浜虹殑鏄庣粏琛� + ///// </summary> + //private void AddPhoneNumList() + //{ + // int heightCount = listPhoneData.Count; + // if (heightCount > listViewCount) + // { + // heightCount = listViewCount; + // } + + // foreach (var data in listPhoneData) + // { + // //娣诲姞鑱旂郴浜鸿 + // this.AddPhoneNumRowLayout(data); + // } + //} + + ///// <summary> + ///// 娣诲姞鑱旂郴浜鸿 + ///// </summary> + ///// <param name="data"></param> + //public void AddPhoneNumRowLayout(Safeguard.PushTargetInfo data) + //{ + // var row = new RowLayout(); + // row.Height = ControlCommonResourse.ListViewRowHeight; + // this.listView.AddChidren(row); + + // //鍥炬爣 + // var btnIcon = new RowLeftIconView(); + // btnIcon.UnSelectedImagePath = "Center/ProfilePhotoMember.png"; + // row.AddChidren(btnIcon); + + // //鐢佃瘽鍙风爜 + // var btnPhone = new RowCenterView(); + // btnPhone.Text = "+" + data.PushNumber.Replace("-", " "); + // row.AddChidren(btnPhone); + + // //鍒犻櫎 + // var btnDelete = new RowDeleteButton(); + // row.AddRightView(btnDelete); + // btnDelete.MouseUpEventHandler += (sender, e) => + // { + // string[] Arry = data.PushNumber.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); + // string PNumber = string.Empty; + // string areaCode = string.Empty; + // if (Arry.Length == 1) + // { + // PNumber = Arry[0]; + // } + // else + // { + // areaCode= Arry[0]; + // PNumber = Arry[1]; + // } + // string msg = Language.StringByID(R.MyInternationalizationString.uShowDoDeleteMsg); + // this.ShowConfirmMsg(msg, "DeleteCoercePhoneNumber", areaCode, PNumber, row); + // }; + + // //鏂版坊鍔犵殑鏃跺�欙紝鑷姩璋冩暣鐣岄潰楂樺害 + // this.AutoAdjustListViewHeight(); + //} + + + ///// <summary> + ///// 娣诲姞銆愭坊鍔犺仈绯讳汉銆戠殑琛� + ///// </summary> + //private void AddAddContactPersionRow() + //{ + // this.addPersonRow = new StatuRowLayout(); + // addPersonRow.Y = this.listView.Bottom; + // frameTableLayout.AddChidren(addPersonRow); + + // //娣诲姞鑱旂郴浜� + // var txtAddPer = new RowCenterView(false); + // txtAddPer.TextID = R.MyInternationalizationString.uAddContactPersion; ; + // addPersonRow.AddChidren(txtAddPer); + + // //鍔犲彿鍥炬爣 + // var btnAdd = new MostRightEmptyView(); + // btnAdd.UnSelectedImagePath = "Item/Add.png"; + // btnAdd.SelectedImagePath = "Item/AddSelected.png"; + // addPersonRow.AddChidren(btnAdd); + + // addPersonRow.MouseUpEvent += (sender, e) => + // { + // var form = new AddCoerceContactForm(); + // form.AddForm(this.listPhoneData); + // }; + //} + + ///// <summary> + ///// 鍒犻櫎鑱旂郴浜烘柟寮� + ///// </summary> + ///// <param name="areaCode"></param> + ///// <param name="phone"></param> + ///// <param name="row"></param> + //public async void DeleteCoercePhoneNumber(string areaCode, string phone, RowLayout row) + //{ + // bool result = await Common.LocalSafeguard.Current.DeleteCoercePhoneNumber(areaCode, phone); + // if (result == true) + // { + // Application.RunOnMainThread(() => + // { + // row?.RemoveFromParent(); + + // //鑷姩璋冩暣鍒楄〃鎺т欢鐨勯珮搴� + // this.AutoAdjustListViewHeight(); + + // this.LoadFormMethodByName("CoercePasswordMainForm", "InitMiddleFrame"); + // }); + // } + //} + + ///// <summary> + ///// 鑷姩璋冩暣鍒楄〃鎺т欢鐨勯珮搴� + ///// </summary> + //private void AutoAdjustListViewHeight() + //{ + // if (this.listView == null || this.listView.ChildrenCount > this.listViewCount) + // { + // //涓嶅啀鎵╁ぇ + // return; + // } + // this.listView.Height = this.listView.ChildrenCount * ControlCommonResourse.ListViewRowHeight; + // if (this.addPersonRow != null) + // { + // //鏈夊彲鑳芥槸鐢婚潰姝e湪鍒濆鍖栫殑鏃跺�� + // this.addPersonRow.Y = this.listView.Bottom; + // } + //} } } -- Gitblit v1.8.0