use of com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator in project FirebaseUI-Android by firebase.
the class RecoverPasswordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.forgot_password_layout);
mEmailFieldValidator = new EmailFieldValidator((TextInputLayout) findViewById(R.id.email_layout));
mEmailEditText = (EditText) findViewById(R.id.email);
String email = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL);
if (email != null) {
mEmailEditText.setText(email);
}
findViewById(R.id.button_done).setOnClickListener(this);
}
use of com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator in project FirebaseUI-Android by firebase.
the class RegisterEmailFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.register_email_layout, container, false);
mPasswordFieldValidator = new PasswordFieldValidator((TextInputLayout) v.findViewById(R.id.password_layout), getResources().getInteger(R.integer.min_password_length));
mNameValidator = new RequiredFieldValidator((TextInputLayout) v.findViewById(R.id.name_layout));
mEmailFieldValidator = new EmailFieldValidator((TextInputLayout) v.findViewById(R.id.email_layout));
mEmailEditText = (EditText) v.findViewById(R.id.email);
mNameEditText = (EditText) v.findViewById(R.id.name);
mPasswordEditText = (EditText) v.findViewById(R.id.password);
mAgreementText = (TextView) v.findViewById(R.id.create_account_text);
mEmailInput = (TextInputLayout) v.findViewById(R.id.email_layout);
mPasswordInput = (TextInputLayout) v.findViewById(R.id.password_layout);
mEmailEditText.setOnFocusChangeListener(this);
mNameEditText.setOnFocusChangeListener(this);
mPasswordEditText.setOnFocusChangeListener(this);
v.findViewById(R.id.button_create).setOnClickListener(this);
if (savedInstanceState != null) {
return v;
}
// If email is passed in, fill in the field and move down to the name field.
String email = mUser.getEmail();
if (!TextUtils.isEmpty(email)) {
mEmailEditText.setText(email);
}
// If name is passed in, fill in the field and move down to the password field.
String name = mUser.getName();
if (!TextUtils.isEmpty(name)) {
mNameEditText.setText(name);
}
// See http://stackoverflow.com/questions/11082341/android-requestfocus-ineffective#comment51774752_11082523
if (!TextUtils.isEmpty(mNameEditText.getText())) {
safeRequestFocus(mPasswordEditText);
} else if (!TextUtils.isEmpty(mEmailEditText.getText())) {
safeRequestFocus(mNameEditText);
} else {
safeRequestFocus(mEmailEditText);
}
return v;
}
use of com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator in project FirebaseUI-Android by firebase.
the class CheckEmailFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.check_email_layout, container, false);
// Email field and validator
mEmailLayout = (TextInputLayout) v.findViewById(R.id.email_layout);
mEmailEditText = (EditText) v.findViewById(R.id.email);
mEmailFieldValidator = new EmailFieldValidator(mEmailLayout);
mEmailLayout.setOnClickListener(this);
mEmailEditText.setOnClickListener(this);
// "Next" button
v.findViewById(R.id.button_next).setOnClickListener(this);
return v;
}
Aggregations