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;
|
}
|
}
|
}
|