using System; using System.Timers; using Shared.Common; using Shared.Phone.Device.CommonForm; using Shared.Phone.UserCenter; namespace Shared.Phone.Login { public class PhoneEmailForm : FrameLayoutBase { /// /// 选择手机 /// public Button SelectedPhone; /// /// 选择邮箱 /// public Button SelectedEmail; /// /// 手机邮箱 /// private FrameLayout PhoneEmailFL; public PhoneEmailForm() { } /// /// Init /// /// public void Init(FrameLayout frameLayout, int y = 559, int width = 876, int height = 127) { PhoneEmailFL = new FrameLayout() { Y = Application.GetRealHeight(y), Width = this.GetPictrueRealSize(905), Height = this.GetPictrueRealSize(170), //BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, //Radius = (uint)Application.GetRealHeight(height / 2), Gravity = Gravity.CenterHorizontal }; frameLayout.AddChidren(PhoneEmailFL); var bg = new Button { Width = this.GetPictrueRealSize(905), Height = this.GetPictrueRealSize(170), UnSelectedImagePath = "Account/PhoneEmail_White.png", Gravity = Gravity.CenterHorizontal }; PhoneEmailFL.AddChidren(bg); SelectedPhone = new Button() { X=Application.GetRealWidth(10), Width = this.GetPictrueRealSize(905 / 2 + 20), Height=this.GetPictrueRealSize(height), SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor, TextID = R.MyInternationalizationString.PhoneNum, TextColor = ZigbeeColor.Current.GXCTextColor, SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, Radius = (uint)Application.GetRealHeight(height / 2), IsSelected = true, IsBold=true, Tag = "Phone", TextSize= CommonFormResouce.TextSize }; PhoneEmailFL.AddChidren(SelectedPhone); SelectedEmail = new Button() { X = this.GetPictrueRealSize(905 / 2 - 20), Width = this.GetPictrueRealSize(905 / 2 + 20), Height = this.GetPictrueRealSize(height), SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor, TextID = R.MyInternationalizationString.Email, TextColor = ZigbeeColor.Current.GXCTextColor, SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, Radius = (uint)Application.GetRealHeight(height / 2), IsSelected = false, Tag = "Email", TextSize = CommonFormResouce.TextSize }; PhoneEmailFL.AddChidren(SelectedEmail); } /// /// SetSelectedColor /// /// public void SetSelectedColor(uint selectedColor) { SelectedPhone.SelectedBackgroundColor = selectedColor; SelectedEmail.SelectedBackgroundColor = selectedColor; SelectedPhone.IsSelected = true; SelectedEmail.IsSelected = false; } } public class PhoneRowForm : FrameLayoutBase { /// /// 手机区号btn /// public Button PhoneZoneBtn; /// /// 账号输入控件 /// public EditText AccountET; /// /// Button_Height /// private int Button_Height = 92; /// /// accountLine /// private Button accountLine; /// /// Init /// /// /// public void Init(FrameLayout frameLayout, FrameLayout parFL, string account, int x, int y) { var accountFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(accountFL); PhoneZoneBtn = new Button() { X = Application.GetRealWidth(29), Width = Application.GetRealWidth(150), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, Text = $"+{CommonPage.PhoneZoneStr}", TextAlignment = TextAlignment.Center, TextSize = CommonFormResouce.TextSize }; accountFL.AddChidren(PhoneZoneBtn); //目前只针对+86 //PhoneZoneBtn.MouseUpEventHandler += (sender, e) => //{ // var form = new AreaCodeSelectForm(); // parFL.AddChidren(form); // form.InitForm(); // form.ShowForm(); // form.FinishSelectEvent += (code) => // { // (sender as Button).Text = "+" + code; // CommonPage.PhoneZoneStr = code; // }; //}; AccountET = new EditText() { X = Application.GetRealWidth(222), Width = Application.GetRealWidth(600), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPhoneNum), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = account, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize }; accountFL.AddChidren(AccountET); accountLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; accountFL.AddChidren(accountLine); AccountET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { accountLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; accountLine.Height = 2; } else { accountLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; accountLine.Height = 1; } } } public class PhoneLoginRowForm : FrameLayoutBase { /// /// 账号输入控件 /// public EditText AccountET; /// /// Button_Height /// private int Button_Height = 92; /// /// accountLine /// private Button accountLine; /// /// Init /// /// /// public void Init(FrameLayout frameLayout, FrameLayout parFL, string account, int x, int y) { this.X = Application.GetRealWidth(x); this.Y = Application.GetRealHeight(y); this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; frameLayout.AddChidren(this); var accountBtn = new Button() { X = Application.GetRealWidth(69), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Account.png" }; this.AddChidren(accountBtn); AccountET = new EditText() { X = Application.GetRealWidth(193), Width = Application.GetRealWidth(600), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPhoneNum), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = account, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize, IsNumberKeyboardType = true }; this.AddChidren(AccountET); accountLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height)-2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; this.AddChidren(accountLine); AccountET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if(focusEvent.Focus) { accountLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; accountLine.Height = 2; } else { accountLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; accountLine.Height = 1; } } } public class EmailRowForm : FrameLayoutBase { /// /// 账号输入控件 /// public EditText AccountET; /// /// Button_Height /// private int Button_Height = 92; /// /// accountLine /// private Button accountLine; /// /// Init /// /// /// public void Init(FrameLayout frameLayout, string account, int x, int y) { var accountFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(accountFL); var accountBtn = new Button() { X = Application.GetRealWidth(29), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Account.png" }; accountFL.AddChidren(accountBtn); AccountET = new EditText() { X = Application.GetRealWidth(222), Width = Application.GetRealWidth(700), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputEmail), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = account, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize }; accountFL.AddChidren(AccountET); accountLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; accountFL.AddChidren(accountLine); AccountET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { accountLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; accountLine.Height = 2; } else { accountLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; accountLine.Height = 1; } } } public class EmailLoginRowForm : FrameLayoutBase { /// /// 账号输入控件 /// public EditText AccountET; /// /// Button_Height /// private int Button_Height = 92; /// /// accountLine /// private Button accountLine; /// /// Init /// /// /// public void Init(FrameLayout frameLayout, string account, int x, int y) { this.X = Application.GetRealWidth(x); this.Y = Application.GetRealHeight(y); this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; frameLayout.AddChidren(this); var accountBtn = new Button() { X = Application.GetRealWidth(69), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Account.png" }; this.AddChidren(accountBtn); AccountET = new EditText() { X = Application.GetRealWidth(193), Width = Application.GetRealWidth(700), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputEmail), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = account, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize }; this.AddChidren(AccountET); accountLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; this.AddChidren(accountLine); AccountET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { accountLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; accountLine.Height = 2; } else { accountLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; accountLine.Height = 1; } } } public class EmailForgotRowForm : FrameLayoutBase { /// /// 账号输入控件 /// public EditText AccountET; /// /// Button_Height /// private int Button_Height = 92; /// /// accountLine /// private Button accountLine; /// /// Init /// /// /// public void Init(FrameLayout frameLayout, string account, int x, int y) { var accountFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(accountFL); AccountET = new EditText() { X = Application.GetRealWidth(CommonFormResouce.Row_X), Width = Application.GetRealWidth(700), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputEmail), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = account, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize }; accountFL.AddChidren(AccountET); accountLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; accountFL.AddChidren(accountLine); AccountET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { accountLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; accountLine.Height = 2; } else { accountLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; accountLine.Height = 1; } } } public class VerificationCodeRowForm : FrameLayoutBase { /// /// Button_Height /// private int Button_Height = 92; /// /// codeBtn /// //public Button CodeBtn; /// /// sendCode /// public Button SendCodeBtn; /// /// VerificationCodeET /// public EditText VerificationCodeET; /// /// pwdLine /// private Button pwdLine; /// /// Init /// /// /// /// public void Init(FrameLayout frameLayout, int x, int y) { var codeFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(codeFL); var codeBtn = new Button() { X = Application.GetRealWidth(29), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Code.png" }; codeFL.AddChidren(codeBtn); VerificationCodeET = new EditText() { X = Application.GetRealWidth(222), Width = Application.GetRealWidth(350), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputVerificationCode), TextAlignment = TextAlignment.CenterLeft, PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, TextSize = CommonFormResouce.PlaceHolderTextSize }; codeFL.AddChidren(VerificationCodeET); var sendCodeLine = new Button() { X = Application.GetRealWidth(611), Width = 1, Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, BackgroundColor = ZigbeeColor.Current.GXCLineColor }; codeFL.AddChidren(sendCodeLine); SendCodeBtn = new Button() { X = sendCodeLine.Right + Application.GetRealWidth(20), Width = Application.GetRealWidth(250), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, TextID = R.MyInternationalizationString.SendVerificationCode, TextColor = ZigbeeColor.Current.GXCTextGrayColor, SelectedTextColor = ZigbeeColor.Current.GXCTextColor, TextAlignment = TextAlignment.Center, TextSize=CommonFormResouce.TextSize, Enable = false, IsSelected = false, IsBold=true }; codeFL.AddChidren(SendCodeBtn); pwdLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; codeFL.AddChidren(pwdLine); VerificationCodeET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; pwdLine.Height = 2; } else { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; pwdLine.Height = 1; } } } public class PwdRowForm : FrameLayoutBase { /// /// PasswrodET /// public EditText PasswrodET; /// /// hidePWD /// private Button hidenPWDbtn; /// /// Button_Height /// private int Button_Height = 92; /// /// pwdLine /// private Button pwdLine; /// /// Init /// /// /// /// /// public void Init(FrameLayout frameLayout ,int x,int y,string password="") { var pwdFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(pwdFL); var passwordBtn = new Button() { X = Application.GetRealWidth(29), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity=Gravity.CenterVertical, UnSelectedImagePath = "Account/Password.png" }; pwdFL.AddChidren(passwordBtn); PasswrodET = new EditText() { X = Application.GetRealWidth(222), Width = Application.GetRealWidth(550), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPWD), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = password, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize, SecureTextEntry = true }; pwdFL.AddChidren(PasswrodET); hidenPWDbtn = new Button() { X = Application.GetRealWidth(775), Width = Application.GetMinReal(Button_Height), Height = Application.GetMinReal(Button_Height), Gravity = Gravity.CenterVertical, SelectedImagePath = "Account/HidePwd.png", UnSelectedImagePath = "Account/UnhidePwd.png", IsSelected=true }; pwdFL.AddChidren(hidenPWDbtn); hidenPWDbtn.MouseUpEventHandler += (sender, e) => { (sender as Button).IsSelected = !(sender as Button).IsSelected; PasswrodET.SecureTextEntry = (sender as Button).IsSelected; }; pwdLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; pwdFL.AddChidren(pwdLine); PasswrodET.FoucsChanged += Text_FoucesChangeEvent; } /// /// SetPlaceholdText /// /// public void SetPlaceholdText(string holdText) { PasswrodET.PlaceholderText = holdText; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; pwdLine.Height = 2; } else { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; pwdLine.Height = 1; } } } public class PwdLoginRowForm : FrameLayoutBase { /// /// PasswrodET /// public EditText PasswrodET; /// /// hidePWD /// private Button hidenPWDbtn; /// /// Button_Height /// private int Button_Height = 92; /// /// pwdLine /// private Button pwdLine; /// /// Init /// /// /// /// /// public void Init(FrameLayout frameLayout, int x, int y, string password = "") { this.X = Application.GetRealWidth(x); this.Y = Application.GetRealHeight(y); this.Width = Application.GetRealWidth(CommonFormResouce.Row_Width); this.Height = Application.GetRealHeight(CommonFormResouce.Row_Height); this.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; frameLayout.AddChidren(this); var passwordBtn = new Button() { X = Application.GetRealWidth(69), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Password.png" }; this.AddChidren(passwordBtn); PasswrodET = new EditText() { X = Application.GetRealWidth(193), Width = Application.GetRealWidth(600), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPWD), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = password, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize, SecureTextEntry = true }; this.AddChidren(PasswrodET); hidenPWDbtn = new Button() { X = Application.GetRealWidth(775), Width = Application.GetMinReal(Button_Height), Height = Application.GetMinReal(Button_Height), Gravity = Gravity.CenterVertical, SelectedImagePath = "Account/HidePwd.png", UnSelectedImagePath = "Account/UnhidePwd.png", IsSelected = true }; this.AddChidren(hidenPWDbtn); hidenPWDbtn.MouseUpEventHandler += (sender, e) => { (sender as Button).IsSelected = !(sender as Button).IsSelected; PasswrodET.SecureTextEntry = (sender as Button).IsSelected; }; pwdLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; this.AddChidren(pwdLine); PasswrodET.FoucsChanged += Text_FoucesChangeEvent; } /// /// SetPlaceholdText /// /// public void SetPlaceholdText(string holdText) { PasswrodET.PlaceholderText = holdText; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; pwdLine.Height = 2; } else { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; pwdLine.Height = 1; } } } public class PwdForForgetRowForm : FrameLayoutBase { /// /// PasswrodET /// public EditText PasswrodET; /// /// hidePWD /// private Button hidenPWDbtn; /// /// Button_Height /// private int Button_Height = 92; /// /// pwdLine /// private Button pwdLine; /// /// Init /// /// /// /// /// public void Init(FrameLayout frameLayout, int x, int y, string password = "") { var pwdFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(pwdFL); PasswrodET = new EditText() { X = Application.GetRealWidth(CommonFormResouce.Row_X), Width = Application.GetRealWidth(700), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputPWD), PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Text = password, TextAlignment = TextAlignment.CenterLeft, TextSize = CommonFormResouce.PlaceHolderTextSize, SecureTextEntry = true }; pwdFL.AddChidren(PasswrodET); hidenPWDbtn = new Button() { X = Application.GetRealWidth(775), Width = Application.GetMinReal(Button_Height), Height = Application.GetMinReal(Button_Height), Gravity = Gravity.CenterVertical, SelectedImagePath = "Account/HidePwd.png", UnSelectedImagePath = "Account/UnhidePwd.png", IsSelected = true }; pwdFL.AddChidren(hidenPWDbtn); hidenPWDbtn.MouseUpEventHandler += (sender, e) => { (sender as Button).IsSelected = !(sender as Button).IsSelected; PasswrodET.SecureTextEntry = (sender as Button).IsSelected; }; pwdLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; pwdFL.AddChidren(pwdLine); PasswrodET.FoucsChanged += Text_FoucesChangeEvent; } /// /// SetPlaceholdText /// /// public void SetPlaceholdText(string holdText) { PasswrodET.PlaceholderText = holdText; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; pwdLine.Height = 2; } else { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; pwdLine.Height = 1; } } } public class CodeForRegisterRowForm : FrameLayoutBase { /// /// Button_Height /// private int Button_Height = 92; /// /// codeBtn /// //public Button CodeBtn; /// /// sendCode /// public NormalViewControl SendCodeBtn; /// /// VerificationCodeET /// public EditText VerificationCodeET; /// /// pwdLine /// private Button pwdLine; /// /// sendCodeBG /// private FrameLayout SendCodeBG; private Timer t; private DateTime dateBegin; public CodeForRegisterRowForm() { t = new Timer(); dateBegin = new DateTime(); } /// /// Init /// /// /// /// public void Init(FrameLayout frameLayout, int x, int y) { var codeFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(codeFL); var codeBtn = new Button() { X = Application.GetRealWidth(29), Width = this.GetPictrueRealSize(Button_Height), Height = this.GetPictrueRealSize(Button_Height), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Account/Code.png" }; codeFL.AddChidren(codeBtn); VerificationCodeET = new EditText() { X = Application.GetRealWidth(222), Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputVerificationCode), TextAlignment = TextAlignment.CenterLeft, PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, TextSize = CommonFormResouce.PlaceHolderTextSize }; codeFL.AddChidren(VerificationCodeET); SendCodeBtn = new NormalViewControl(300, 127, true) { X = Application.GetRealWidth(CommonFormResouce.Row_Width - 300), Gravity = Gravity.CenterVertical, TextID = R.MyInternationalizationString.SendVerificationCode, TextColor = ZigbeeColor.Current.GXCTextWhiteColor, TextAlignment = TextAlignment.Center, BackgroundColor = 0xFFFEBCA9, CanClick = false, Radius=(uint)Application.GetRealHeight(12), IsBold=true, TextSize=CommonFormResouce.TextSize }; codeFL.AddChidren(SendCodeBtn); pwdLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(536), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; codeFL.AddChidren(pwdLine); VerificationCodeET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; pwdLine.Height = 2; } else { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; pwdLine.Height = 1; } } /// /// TimeBegin /// public void TimeBegin() { SendCodeBtn.BackgroundColor = UserCenterColor.Current.White; SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextBlackColor; HdlThreadLogic.Current.RunThread(() => { //后重发 string txtValue = Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain); int timeOut = 60; while (timeOut > 0 && SendCodeBtn.Parent != null) { HdlThreadLogic.Current.RunMain(() => { SendCodeBtn.Text = timeOut + "s" + txtValue; }); timeOut--; System.Threading.Thread.Sleep(1000); } HdlThreadLogic.Current.RunMain(() => { SendCodeBtn.TextID = R.MyInternationalizationString.SendVerificationCode; SendCodeBtn.BackgroundColor = 0xFFFC744B; SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; SendCodeBtn.CanClick = true; }); }); } /// /// RemoveFromParent /// public override void RemoveFromParent() { t.Close(); t.Dispose(); base.RemoveFromParent(); } } public class CodeForForgetRowForm:FrameLayout { /// /// Button_Height /// private int Button_Height = 92; /// /// sendCode /// public Button SendCodeBtn; /// /// VerificationCodeET /// public EditText VerificationCodeET; /// /// pwdLine /// private Button pwdLine; /// /// Timer /// private Timer t; /// /// dateBegin /// private DateTime dateBegin; public CodeForForgetRowForm() { t = new Timer(); dateBegin = new DateTime(); } /// /// Init /// /// /// /// public void Init(FrameLayout frameLayout, int x, int y) { var codeFL = new FrameLayout() { X = Application.GetRealWidth(x), Y = Application.GetRealHeight(y), Width = Application.GetRealWidth(CommonFormResouce.Row_Width), Height = Application.GetRealHeight(CommonFormResouce.Row_Height), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; frameLayout.AddChidren(codeFL); VerificationCodeET = new EditText() { X = Application.GetRealWidth(CommonFormResouce.Row_X), Width = Application.GetRealWidth(536), Height = Application.GetRealHeight(Button_Height), Gravity = Gravity.CenterVertical, PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputVerificationCode), TextAlignment = TextAlignment.CenterLeft, PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, TextColor = ZigbeeColor.Current.GXCTextBlackColor, TextSize = CommonFormResouce.PlaceHolderTextSize }; codeFL.AddChidren(VerificationCodeET); SendCodeBtn = new Button() { X = Application.GetRealWidth(CommonFormResouce.Row_Width - 300), Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(127), Gravity = Gravity.CenterVertical, TextID = R.MyInternationalizationString.SendVerificationCode, TextColor = ZigbeeColor.Current.GXCTextWhiteColor, SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, TextAlignment = TextAlignment.Center, BackgroundColor = ZigbeeColor.Current.GXCButtonDisableColor, SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor, Enable = false, IsSelected = false, Radius = (uint)Application.GetRealHeight(12), IsBold=true, TextSize=CommonFormResouce.TextSize }; codeFL.AddChidren(SendCodeBtn); pwdLine = new Button() { Y = Application.GetRealHeight(CommonFormResouce.Row_Height) - 2, Width = Application.GetRealWidth(536), Height = 1, BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor }; codeFL.AddChidren(pwdLine); VerificationCodeET.FoucsChanged += Text_FoucesChangeEvent; } /// /// 光标改变 /// /// /// private void Text_FoucesChangeEvent(object sender, FocusEventArgs focusEvent) { if (focusEvent.Focus) { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCSelectedLineColor; pwdLine.Height = 2; } else { pwdLine.BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor; pwdLine.Height = 1; } } /// /// TimeOut /// /// /// private void TimeOut(object sender, System.Timers.ElapsedEventArgs e) { var span = DateTime.Now - dateBegin; if (span.TotalSeconds <= 61) { Application.RunOnMainThread(() => { SendCodeBtn.Text = Convert.ToInt16(60 - span.TotalSeconds) + "s" + Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain); SendCodeBtn.Enable = SendCodeBtn.IsSelected = false; SendCodeBtn.BackgroundColor = ZigbeeColor.Current.GXCClearColor; SendCodeBtn.SelectedBackgroundColor = ZigbeeColor.Current.GXCClearColor; SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextBlackColor; }); } else { Application.RunOnMainThread(() => { SendCodeBtn.TextID = R.MyInternationalizationString.SendVerificationCode; SendCodeBtn.BackgroundColor = ZigbeeColor.Current.GXCButtonDisableColor; SendCodeBtn.SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor; SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; SendCodeBtn.Enable = SendCodeBtn.IsSelected = true; t.Stop(); t.Close(); }); } } /// /// TimeBegin /// public void TimeBegin() { t.Interval = 1000; t.AutoReset = true; t.Enabled = true; t.Elapsed += TimeOut; //启动计时器倒计时-60s t.Start(); dateBegin = DateTime.Now; } /// /// RemoveFromParent /// public override void RemoveFromParent() { t.Close(); t.Dispose(); base.RemoveFromParent(); } } }