xm
2019-07-16 b910cb79c9b5bcc204022a3cf9e6950f0a64dfbd
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
using System;
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 行控件的共通类(只针对长的控件)
    /// </summary>
    public class RowViewControlComon : ButtonCommon
    {
        /// <summary>
        /// 设置X轴与宽度
        /// </summary>
        /// <param name="hadPictrue"></param>
        public void SetXPointAndWidth(bool hadPictrue)
        {
            if (hadPictrue == true)
            {
                this.X = Application.GetRealWidth(200);
                this.Width = Application.GetRealWidth(830);
            }
            else
            {
                this.X = ControlCommonResourse.XXLeft;
                this.Width = Application.GetRealWidth(950);
            }
        }
    }
 
    /// <summary>
    /// 行输入控件的共通类(只针对长的控件)
    /// </summary>
    public class RowTextControlComon : EditInputText
    {
        /// <summary>
        /// 设置X轴与宽度
        /// </summary>
        /// <param name="hadPictrue"></param>
        public void SetXPointAndWidth(bool hadPictrue)
        {
            if (hadPictrue == true)
            {
                this.X = Application.GetRealWidth(200);
                this.Width = Application.GetRealWidth(830);
            }
            else
            {
                this.X = ControlCommonResourse.XXLeft;
                this.Width = Application.GetRealWidth(950);
            }
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件,
    /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// 原型是:针对上方是大型黑色字体的
    /// </summary>
    public class RowTopBlackView : RowViewControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件,
        /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// 原型是:针对上方是大型黑色字体的
        /// </summary>
        /// <param name="hadPictrue">左边是否有图片</param>
        public RowTopBlackView(bool hadPictrue = true)
        {
            this.Height = ControlCommonResourse.ListViewRowHalfHeight;
            int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Top);
            this.Y = YY + this.DeviationValue;
            //设置X轴与宽度
            this.SetXPointAndWidth(hadPictrue);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件,
    /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// 原型是:针对上方是小型灰色字体的
    /// </summary>
    public class RowTopGrayView : RowViewControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件,
        /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// 原型是:针对上方是小型灰色字体的
        /// </summary>
        /// <param name="hadPictrue">左边是否有图片</param>
        public RowTopGrayView(bool hadPictrue = true)
        {
            this.Height = ControlCommonResourse.ListViewRowHalfHeight;
            int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Top);
            this.Y = YY + this.DeviationValue;
            this.TextColor = UserCenterColor.Current.TextGrayColor;
            //设置X轴与宽度
            this.SetXPointAndWidth(hadPictrue);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件,
    /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// 原型是:针对下方是大型黑色字体的
    /// </summary>
    public class RowBottomBlackView : RowViewControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件,
        /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// 原型是:针对下方是大型黑色字体的
        /// </summary>
        /// <param name="hadPictrue">左边是否有图片</param>
        public RowBottomBlackView(bool hadPictrue = true)
        {
            this.Height = ControlCommonResourse.ListViewRowHalfHeight;
            int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Bottom);
            this.Y = YY - this.DeviationValue;
            //设置X轴与宽度
            this.SetXPointAndWidth(hadPictrue);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件,
    /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// 原型是:针对下方是小型灰色字体的
    /// </summary>
    public class RowBottomGrayView : RowViewControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件,
        /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// 原型是:针对下方是小型灰色字体的
        /// </summary>
        /// <param name="hadPictrue">左边是否有图片</param>
        public RowBottomGrayView(bool hadPictrue = true)
        {
            this.Height = ControlCommonResourse.ListViewRowHalfHeight;
            int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Bottom);
            this.Y = YY - this.DeviationValue;
            this.TextColor = UserCenterColor.Current.TextGrayColor;
            //设置X轴与宽度
            this.SetXPointAndWidth(hadPictrue);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,只有一个显示信息控件的控件,
    /// 自动设置了宽度和高度,位置上下居中,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// </summary>
    public class RowCenterView : RowViewControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,只有一个显示信息控件的控件,
        /// 自动设置了宽度和高度,位置上下居中,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// </summary>
        /// <param name="hadPictrue">左边是否有图片</param>
        public RowCenterView(bool hadPictrue = true)
        {
            this.Height = ControlCommonResourse.ListViewRowOnlyViewHeight;
            this.Gravity = Gravity.CenterVertical;
            //设置X轴与宽度
            this.SetXPointAndWidth(hadPictrue);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的输入框,
    /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// </summary>
    public class RowBottomEditorText : RowTextControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的输入框,
        /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// </summary>
        public RowBottomEditorText()
        {
            this.Height = ControlCommonResourse.ListViewRowHalfHeight;
            int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Bottom);
            this.Y = YY - this.DeviationValue;
            //设置X轴与宽度
            this.SetXPointAndWidth(false);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面,并且处于中间的输入框,
    /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
    /// </summary>
    public class RowCenterEditorText : RowTextControlComon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面,并且处于中间的输入框,
        /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐
        /// </summary>
        public RowCenterEditorText()
        {
            this.Height = ControlCommonResourse.ListViewRowHalfHeight;
            this.Gravity = Gravity.CenterVertical;
            //设置X轴与宽度
            this.SetXPointAndWidth(false);
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面(左滑或者右滑)的旁路设置按钮
    /// </summary>
    public class RowBypassButton : ButtonCommon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面(左滑或者右滑)的旁路设置按钮
        /// </summary>
        public RowBypassButton()
        {
            this.Height = ControlCommonResourse.ListViewRowHeight;
            this.Width = Application.GetRealWidth(177);
 
            this.TextID = R.MyInternationalizationString.uBypass;
            this.BackgroundColor = UserCenterColor.Current.DeepBlue;
            this.TextColor = UserCenterColor.Current.White;
            this.TextAlignment = TextAlignment.Center;
            //this.UnSelectedImagePath = "Safeguard/Bypass.png";
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面(左滑或者右滑)的删除按钮
    /// </summary>
    public class RowDeleteButton : ButtonCommon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面(左滑或者右滑)的删除按钮
        /// </summary>
        public RowDeleteButton()
        {
            this.Height = ControlCommonResourse.ListViewRowHeight;
            this.Width = Application.GetRealWidth(177);
 
            this.BackgroundColor = UserCenterColor.Current.RowDeleteButtonColor;
            this.TextAlignment = TextAlignment.Center;
            this.TextColor = UserCenterColor.Current.White;
            this.TextID = R.MyInternationalizationString.uDelete;
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面(左滑或者右滑)的解除绑定按钮
    /// </summary>
    public class RowUnBindButton : ButtonCommon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面(左滑或者右滑)的解除绑定按钮
        /// </summary>
        public RowUnBindButton()
        {
            this.Height = ControlCommonResourse.ListViewRowHeight;
            this.Width = Application.GetRealWidth(177);
 
            this.BackgroundColor = UserCenterColor.Current.RowDeleteButtonColor;
            this.TextAlignment = TextAlignment.Center;
            this.TextColor = UserCenterColor.Current.White;
            this.TextID = R.MyInternationalizationString.uUnBinded;
        }
    }
 
    /// <summary>
    /// 做成一个存在于RowLayout里面(左滑或者右滑)的编辑按钮
    /// </summary>
    public class RowEditorButton : ButtonCommon
    {
        /// <summary>
        /// 做成一个存在于RowLayout里面(左滑或者右滑)的编辑按钮
        /// </summary>
        public RowEditorButton()
        {
            this.Height = ControlCommonResourse.ListViewRowHeight;
            this.Width = Application.GetRealWidth(177);
 
            this.BackgroundColor = UserCenterColor.Current.RowEditorButtonColor;
            this.TextAlignment = TextAlignment.Center;
            this.TextColor = UserCenterColor.Current.White;
            this.TextID = R.MyInternationalizationString.uEditor;
        }
    }
 
    /// <summary>
    /// 做成一个位于RowLayout中间的密码输入控件,右边会有个可以显示密码的图标
    /// 在添加此控件到画面后,请调用Init()函数执行内部控件的添加
    /// </summary>
    public class RowPasswordControl : RowLayout
    {
        /// <summary>
        /// 文本框的值
        /// </summary>
        public string Text
        {
            get
            {
                if (txtText == null)
                {
                    return string.Empty;
                }
                return txtText.Text;
            }
            set
            {
                if (txtText == null)
                {
                    return;
                }
                txtText.Text = value;
            }
        }
 
        /// <summary>
        /// 输入框控件
        /// </summary>
        private RowCenterEditorText txtText = null;
 
        /// <summary>
        /// 做成一个位于RowLayout中间的密码输入控件,右边会有个可以显示密码的图标
        /// 在添加此控件到画面后,请调用Init()函数执行内部控件的添加
        /// </summary>
        public RowPasswordControl()
        {
            this.Height = ControlCommonResourse.ListViewRowHeight;
        }
 
        /// <summary>
        /// 初始化内部控件(此控件添加到画面后才调用此方法)
        /// </summary>
        /// <param name="placeholderText">输入框的提示信息,有值时会消失</param>
        public void Init(string placeholderText = null)
        {
            txtText = new RowCenterEditorText();
            txtText.SecureTextEntry = true;
 
            this.AddChidren(txtText);
            if (placeholderText != null)
            {
                txtText.PlaceholderText = placeholderText;
                txtText.PlaceholderTextColor = UserCenterColor.Current.TextTipColor;
            }
 
            var btnView = new MostRightEmptyView();
            btnView.UnSelectedImagePath = "Account/HidenPWD.png";
            btnView.SelectedImagePath = "Account/UnHidenPWD.png";
            this.AddChidren(btnView);
            btnView.MouseDownEventHandler += (sender, e) =>
            {
                btnView.IsSelected = !btnView.IsSelected;
                txtText.SecureTextEntry = !txtText.SecureTextEntry;
            };
        }
    }
 
    /// <summary>
    /// 做成存在于Rowlayout里面,向右图标的控件(初始值:控件上下居中,向右停靠),
    /// 无自身点亮功能,交由StatuRowLayout控件处理。也可以使用于Rowlayout外面
    /// </summary>
    public class RowRightIconView : MostRightEmptyView
    {
        /// <summary>
        /// 做成存在于Rowlayout里面,向右图标的控件(初始值:控件上下居中,向右停靠),
        /// 无自身点亮功能,交由StatuRowLayout控件处理。也可以使用于Rowlayout外面
        /// </summary>
        public RowRightIconView()
        {
            this.UnSelectedImagePath = "Item/Next.png";
            this.SelectedImagePath = "Item/NextSelected.png";
        }
    }
 
    /// <summary>
    /// 做成一个位于Rowlayout里面,最右边的文本显示控件.
    /// 初始值:控件上下居中,文字向右靠齐,标准字体及颜色
    /// </summary>
    public class RowMostRightTextView : ButtonCommon
    {
        /// <summary>
        /// 做成一个位于Rowlayout里面,最右边的文本显示控件.
        /// 初始值:位置上下居中,文字向右靠齐,标准字体及颜色
        /// </summary>
        public RowMostRightTextView()
        {
            this.X = Application.GetRealWidth(700);
            this.Height = ControlCommonResourse.NormalControlHeight;
            this.Width = Application.GetRealWidth(320);
            this.TextAlignment = TextAlignment.CenterRight;
            this.Gravity = Gravity.CenterVertical;
        }
    }
 
    /// <summary>
    /// 做成一个位于Rowlayout里面在左边显示的图标
    /// </summary>
    public class RowLeftIconView : ButtonIconCommon
    {
        /// <summary>
        /// 是否是点号模式
        /// </summary>
        public bool PointMode = false;
        /// <summary>
        /// X轴偏移量,因为点号不是110X110
        /// </summary>
        private int xValue = Application.GetRealWidth((110 - 82) / 2);
 
        /// <summary>
        /// 做成一个位于Rowlayout里面在左边显示的图标
        /// </summary>
        public RowLeftIconView()
        {
            this.InitAvgSize(110, 110, true);
            this.X = ControlCommonResourse.XXLeft;
            this.Gravity = Gravity.CenterVertical;
        }
 
        /// <summary>
        /// 将控件适配为【点号】控件
        /// </summary>
        public void ChangedControlInPointMode()
        {
            this.PointMode = true;
 
            this.InitAvgSize(82, 110, true);
            if (this.Parent == null)
            {
                this.X = ControlCommonResourse.XXLeft + xValue;
            }
            else
            {
                this.X += xValue;
            }
 
            this.UnSelectedImagePath = "Item/Point.png";
            this.SelectedImagePath = "Item/PointSelected.png";
            this.Gravity = Gravity.CenterVertical;
        }
 
        /// <summary>
        /// 将控件还原为原来的大小
        /// </summary>
        public void ChangedControlInNormalMode()
        {
            this.PointMode = false;
 
            this.InitAvgSize(110, 110, true);
            if (this.Parent == null)
            {
                this.X = ControlCommonResourse.XXLeft;
            }
            else
            {
                this.X -= xValue;
            }
            this.Gravity = Gravity.CenterVertical;
        }
    }
 
    /// <summary>
    /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的文本显示控件.
    /// 初始值:控件上下居中,文字向右靠齐,标准字体及颜色
    /// </summary>
    public class RowSecondRightTextView : ButtonCommon
    {
        /// <summary>
        /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的文本显示控件.
        /// 初始值:位置上下居中,文字向右靠齐,标准字体及颜色
        /// </summary>
        public RowSecondRightTextView()
        {
            this.X = Application.GetRealWidth(650);
            this.Height = ControlCommonResourse.NormalControlHeight;
            this.Width = Application.GetRealWidth(270);
            this.TextAlignment = TextAlignment.CenterRight;
            this.Gravity = Gravity.CenterVertical;
        }
    }
 
    /// <summary>
    /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的图片显示控件.
    /// 初始值:控件上下居中,
    /// </summary>
    public class RowSecondRightIconView : ButtonIconCommon
    {
        /// <summary>
        /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的图片显示控件.
        /// 初始值:位置上下居中
        /// </summary>
        /// <param name="size">大小</param>
        /// <param name="real">是否计算真实值</param>
        public RowSecondRightIconView(int size = 110, bool real = true)
        {
            this.InitAvgSize(size, size, real);
            this.X = Application.GetRealWidth(820);
            this.Gravity = Gravity.CenterVertical;
 
            //启用点亮功能
            this.UseClickStatu = true;
        }
    }
 
    /// <summary>
    /// 做成一个位于RowLayout里面,用来显示的【小控件】,
    /// 初始值:不设置X轴,位置上下居中,文字居中,标准字体及颜色,圆化度:4
    /// </summary>
    public class RowLittleViewButton : ButtonCommon
    {
        /// <summary>
        /// 做成一个位于RowLayout里面,用来显示的【小控件】,
        /// 初始值:不设置X轴,位置上下居中,文字居中,标准字体及颜色,圆化度:4
        /// </summary>
        /// <param name="i_Width">宽度</param>
        /// <param name="real">是否计算真实值</param>
        public RowLittleViewButton(int i_Width, bool real = false)
        {
            this.InitSize(i_Width, real);
            this.Gravity = Gravity.CenterVertical;
            this.Radius = 4;
            this.TextAlignment = TextAlignment.Center;
        }
    }
 
    /// <summary>
    /// 做成一个位于RowLayout里面,用来单击的【小控件】,
    /// 初始值:不设置X轴,位置上下居中,文字居中,标准白色字体,蓝色背景,圆化度:半圆
    /// </summary>
    public class RowLittleClickButton : ClickButtonCommon
    {
        /// <summary>
        /// 做成一个位于RowLayout里面,用来单击的【小控件】,
        /// 初始值:不设置X轴,位置上下居中,文字居中,标准白色字体,蓝色背景,圆化度:半圆
        /// </summary>
        /// <param name="i_Width">宽度</param>
        /// <param name="real">是否计算真实值</param>
        public RowLittleClickButton(int i_Width, bool real = false)
        {
            this.InitSize(i_Width, real);
            this.Gravity = Gravity.CenterVertical;
            this.Radius = (uint)ControlCommonResourse.NormalControlHeight / 2;
 
            this.UseClickStatu = true;
        }
    }
 
    /// <summary>
    /// 做成一个位于Rowlayout里面,提示拥有新版本的控件
    /// </summary>
    public class RowNewVersionTipView : ButtonCommon
    {
        /// <summary>
        /// 做成一个位于Rowlayout里面,提示拥有新版本的控件
        /// </summary>
        public RowNewVersionTipView()
        {
            this.X = Application.GetRealWidth(720);
            this.Height = ControlCommonResourse.NormalControlHeight;
            this.Width = Application.GetRealWidth(200);
            this.TextAlignment = TextAlignment.Center;
            this.Gravity = Gravity.CenterVertical;
            this.Radius = (uint)ControlCommonResourse.NormalControlHeight / 2;
            this.BackgroundColor = UserCenterColor.Current.Red;
            this.TextColor = UserCenterColor.Current.White;
            this.TextID = R.MyInternationalizationString.uNEW;
        }
    }
}