HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-10-10 2ed75b8b337048e5d75e6d9ec8307633134f02fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
 
namespace Shared.Phone.UserCenter.Safety
{
    /// <summary>
    /// 联系人设置
    /// </summary>
    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>
        /// <param name="listData">已经存在的联系方式</param>
        public void ShowForm(List<Safeguard.PushTargetInfo> listData)
        {
            //this.listPhoneData = listData;
 
            ////计算理论值
            //int maxHeight = Application.GetRealHeight(180) * 7;
            //this.listViewCount = maxHeight / ControlCommonResourse.ListViewRowHeight;
 
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uContactSettion));
 
            //初始化中部信息
            //this.InitMiddleFrame();
        }
 
        ///// <summary>
        ///// 初始化中部信息
        ///// </summary>
        //private void InitMiddleFrame()
        //{
        //    //清空bodyFrame
        //    this.ClearBodyFrame();
 
        //    //胁迫状态下,被通知人的联系方式
        //    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);
 
        //    HdlThreadLogic.Current.Run(() =>
        //    {
        //        Application.RunOnMainThread(() =>
        //        {
        //            //添加联系人的明细行
        //            this.AddPhoneNumList();
        //            //添加【添加联系人】的行
        //            this.AddAddContactPersionRow();
        //        });
        //    });
        //}
 
        ///// <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)
        //    {
        //        //有可能是画面正在初始化的时候
        //        this.addPersonRow.Y = this.listView.Bottom;
        //    }
        //}
    }
}