private void init(IAttributeSet attrs) { if (attrs != null) { TypedArray a = Context.ObtainStyledAttributes(attrs, Resource.Styleable.CustomFontTextView); String fontName = a.GetString(Resource.Styleable.CustomFontTextView_fontName); if (fontName != null) { this.Typeface = CustomFontsCache.GetTypeface(fontName); } a.Recycle(); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var v = inflater.Inflate(Resource.Layout.remainder_password_fragment, container, false); etEmail = v.FindViewById <EditText> (Resource.Id.etEmail); spCountry = v.FindViewById <Spinner> (Resource.Id.spCountry); btnSubmit = v.FindViewById <Button> (Resource.Id.btnSubmit); btnSubmit.Typeface = CustomFontsCache.GetTypeface("Roboto-Medium.ttf"); etEmail.TextChanged += delegate { email = etEmail.Text; }; etEmail.SetOnEditorActionListener(new EditorActionListener(this)); var countryAdapter = new ArrayAdapter <string> (Activity, Resource.Layout.loginpage_spinner_item, DataCache.INSTATNCE.ServiceCountryList); countryAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spCountry.ItemSelected += delegate(object sender, AdapterView.ItemSelectedEventArgs e) { selectCountryIndex = e.Position; }; spCountry.Adapter = countryAdapter; selectCountryIndex = Arguments == null ? 0 : Arguments.GetInt(SELECTED_COUNTRY_INDEX); if (selectCountryIndex > 0) { spCountry.SetSelection(selectCountryIndex); } btnSubmit.Click += delegate { // Call Business Api processReminderPassword(); }; etEmail.RequestFocus(); return(v); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var countryAdapter = new ArrayAdapter <string>( Activity, Resource.Layout.loginpage_spinner_item, DataCache.INSTATNCE.ServiceCountryList); countryAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); var v = inflater.Inflate(Resource.Layout.login_fragment, container, false); etEmail = v.FindViewById <EditText>(Resource.Id.etEmail); etPassword = v.FindViewById <EditText>(Resource.Id.etPassword); spCountry = v.FindViewById <Spinner>(Resource.Id.spCountry); tvForgetPassword = v.FindViewById <TextView>(Resource.Id.tvForgetPassword); btnLogin = v.FindViewById <Button>(Resource.Id.btnLogin); tvLoginWaringMessage = v.FindViewById <TextView>(Resource.Id.tvLoginWaringMessage); /* * Application.SynchronizationContext.Post(_ =>{ * Task.Run(delegate{ * Thread.Sleep(100); * }); * etEmail.RequestFocus(); * InputMethodManager imm = (InputMethodManager)Activity.GetSystemService(Context.InputMethodService); * imm.ShowSoftInput(etEmail, ShowFlags.Implicit); * }, null); */ btnLogin.Typeface = CustomFontsCache.GetTypeface("Roboto-Medium.ttf"); etEmail.TextChanged += delegate { email = etEmail.Text; }; etPassword.TextChanged += delegate { password = etPassword.Text; }; etPassword.SetOnEditorActionListener(new EditorActionListener(this)); selectCountryIndex = 0; spCountry.ItemSelected += delegate(object sender, AdapterView.ItemSelectedEventArgs e) { selectCountryIndex = e.Position; }; spCountry.Adapter = countryAdapter; spCountry.Visibility = ViewStates.Invisible; //var lastLoginUser = LoginUtil.Instance.GetLastUserLoginInfo(); //if(lastLoginUser != null) //{ // int lastUserLoginCountryIndex = -1; // for(int i = 0; i < ConfigurationService.GetAllCountryMap().Count; ++i) // { // if(ConfigurationService.GetAllCountryMap()[i].CountryCode == lastLoginUser.Country.CountryCode) // { // lastUserLoginCountryIndex = i; // break; // } // } // if(lastUserLoginCountryIndex >= 0) // { // spCountry.SetSelection(lastUserLoginCountryIndex); // } //} tvForgetPassword.Click += delegate { var loginActivity = Activity as ILoginActivity; if (loginActivity == null) { return; } loginActivity.LoginFragment_ReminderPassowrd(selectCountryIndex); }; btnLogin.Click += delegate { BtnLogin_Click(); }; return(v); }