From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs | 1373 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 1,373 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs b/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs new file mode 100644 index 0000000..9e3a426 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Login/PhoneEmailForm.cs @@ -0,0 +1,1373 @@ +锘縰sing System; +using System.Timers; +using Shared.Common; +using Shared.Phone.Device.CommonForm; +using Shared.Phone.UserCenter; + +namespace Shared.Phone.Login +{ + public class PhoneEmailForm : FrameLayoutBase + { + /// <summary> + /// 閫夋嫨鎵嬫満 + /// </summary> + public Button SelectedPhone; + /// <summary> + /// 閫夋嫨閭 + /// </summary> + public Button SelectedEmail; + /// <summary> + /// 鎵嬫満閭 + /// </summary> + private FrameLayout PhoneEmailFL; + + public PhoneEmailForm() + { + } + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + 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); + } + + /// <summary> + /// SetSelectedColor + /// </summary> + /// <param name="selectedColor"></param> + public void SetSelectedColor(uint selectedColor) + { + SelectedPhone.SelectedBackgroundColor = selectedColor; + SelectedEmail.SelectedBackgroundColor = selectedColor; + SelectedPhone.IsSelected = true; + SelectedEmail.IsSelected = false; + } + } + + public class PhoneRowForm : FrameLayoutBase + { + /// <summary> + /// 鎵嬫満鍖哄彿btn + /// </summary> + public Button PhoneZoneBtn; + /// <summary> + /// 璐﹀彿杈撳叆鎺т欢 + /// </summary> + public EditText AccountET; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// accountLine + /// </summary> + private Button accountLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="account"></param> + 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; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// 璐﹀彿杈撳叆鎺т欢 + /// </summary> + public EditText AccountET; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// accountLine + /// </summary> + private Button accountLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="account"></param> + 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; + + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// 璐﹀彿杈撳叆鎺т欢 + /// </summary> + public EditText AccountET; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// accountLine + /// </summary> + private Button accountLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="account"></param> + 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; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// 璐﹀彿杈撳叆鎺т欢 + /// </summary> + public EditText AccountET; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// accountLine + /// </summary> + private Button accountLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="account"></param> + 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; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// 璐﹀彿杈撳叆鎺т欢 + /// </summary> + public EditText AccountET; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// accountLine + /// </summary> + private Button accountLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="account"></param> + 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; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// codeBtn + /// </summary> + //public Button CodeBtn; + /// <summary> + /// sendCode + /// </summary> + public Button SendCodeBtn; + /// <summary> + /// VerificationCodeET + /// </summary> + public EditText VerificationCodeET; + /// <summary> + /// pwdLine + /// </summary> + private Button pwdLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="x"></param> + /// <param name="y"></param> + 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; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// PasswrodET + /// </summary> + public EditText PasswrodET; + /// <summary> + /// hidePWD + /// </summary> + private Button hidenPWDbtn; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// pwdLine + /// </summary> + private Button pwdLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="password"></param> + /// <param name="x"></param> + /// <param name="y"></param> + 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; + } + /// <summary> + /// SetPlaceholdText + /// </summary> + /// <param name="holdText"></param> + public void SetPlaceholdText(string holdText) + { + PasswrodET.PlaceholderText = holdText; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// PasswrodET + /// </summary> + public EditText PasswrodET; + /// <summary> + /// hidePWD + /// </summary> + private Button hidenPWDbtn; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// pwdLine + /// </summary> + private Button pwdLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="password"></param> + /// <param name="x"></param> + /// <param name="y"></param> + 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; + } + /// <summary> + /// SetPlaceholdText + /// </summary> + /// <param name="holdText"></param> + public void SetPlaceholdText(string holdText) + { + PasswrodET.PlaceholderText = holdText; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// PasswrodET + /// </summary> + public EditText PasswrodET; + /// <summary> + /// hidePWD + /// </summary> + private Button hidenPWDbtn; + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// pwdLine + /// </summary> + private Button pwdLine; + + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="password"></param> + /// <param name="x"></param> + /// <param name="y"></param> + 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; + } + /// <summary> + /// SetPlaceholdText + /// </summary> + /// <param name="holdText"></param> + public void SetPlaceholdText(string holdText) + { + PasswrodET.PlaceholderText = holdText; + } + + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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 + { + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// codeBtn + /// </summary> + //public Button CodeBtn; + /// <summary> + /// sendCode + /// </summary> + public NormalViewControl SendCodeBtn; + /// <summary> + /// VerificationCodeET + /// </summary> + public EditText VerificationCodeET; + /// <summary> + /// pwdLine + /// </summary> + private Button pwdLine; + /// <summary> + /// sendCodeBG + /// </summary> + private FrameLayout SendCodeBG; + private Timer t; + private DateTime dateBegin; + + public CodeForRegisterRowForm() + { + t = new Timer(); + dateBegin = new DateTime(); + } + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="x"></param> + /// <param name="y"></param> + 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; + + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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; + } + } + + /// <summary> + /// TimeBegin + /// </summary> + 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; + }); + }); + } + + /// <summary> + /// RemoveFromParent + /// </summary> + public override void RemoveFromParent() + { + t.Close(); + t.Dispose(); + base.RemoveFromParent(); + } + + } + + public class CodeForForgetRowForm:FrameLayout + { + /// <summary> + /// Button_Height + /// </summary> + private int Button_Height = 92; + /// <summary> + /// sendCode + /// </summary> + public Button SendCodeBtn; + /// <summary> + /// VerificationCodeET + /// </summary> + public EditText VerificationCodeET; + /// <summary> + /// pwdLine + /// </summary> + private Button pwdLine; + /// <summary> + /// Timer + /// </summary> + private Timer t; + /// <summary> + /// dateBegin + /// </summary> + private DateTime dateBegin; + + public CodeForForgetRowForm() + { + t = new Timer(); + dateBegin = new DateTime(); + } + /// <summary> + /// Init + /// </summary> + /// <param name="frameLayout"></param> + /// <param name="x"></param> + /// <param name="y"></param> + 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; + } + + /// <summary> + /// 鍏夋爣鏀瑰彉 + /// </summary> + /// <param name="sender"></param> + /// <param name="focusEvent"></param> + 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; + } + } + + /// <summary> + /// TimeOut + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + 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(); + }); + } + } + + /// <summary> + /// TimeBegin + /// </summary> + public void TimeBegin() + { + t.Interval = 1000; + t.AutoReset = true; + t.Enabled = true; + t.Elapsed += TimeOut; + //鍚姩璁℃椂鍣ㄥ�掕鏃�-60s + t.Start(); + dateBegin = DateTime.Now; + } + + /// <summary> + /// RemoveFromParent + /// </summary> + public override void RemoveFromParent() + { + t.Close(); + t.Dispose(); + base.RemoveFromParent(); + } + } + +} -- Gitblit v1.8.0