use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.
the class OrderedValidateBeforeActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_un_ordered_validate_till_before);
// UI References
mNameEditText = (EditText) findViewById(R.id.nameEditText);
mAddressEditText = (EditText) findViewById(R.id.addressEditText);
mEmailEditText = (EditText) findViewById(R.id.emailEditText);
mPhoneEditText = (EditText) findViewById(R.id.phoneEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
RadioGroup modeRadioGroup = (RadioGroup) findViewById(R.id.modeRadioGroup);
// Validator
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Event listeners
mNameEditText.setOnFocusChangeListener(this);
mAddressEditText.setOnFocusChangeListener(this);
mEmailEditText.setOnFocusChangeListener(this);
mPhoneEditText.setOnFocusChangeListener(this);
modeRadioGroup.setOnCheckedChangeListener(this);
}
use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.
the class OrderedValidateTillActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_un_ordered_validate_till_before);
// UI References
mNameEditText = (EditText) findViewById(R.id.nameEditText);
mAddressEditText = (EditText) findViewById(R.id.addressEditText);
mEmailEditText = (EditText) findViewById(R.id.emailEditText);
mPhoneEditText = (EditText) findViewById(R.id.phoneEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
RadioGroup modeRadioGroup = (RadioGroup) findViewById(R.id.modeRadioGroup);
// Validator
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Event listeners
mNameEditText.setOnFocusChangeListener(this);
mAddressEditText.setOnFocusChangeListener(this);
mEmailEditText.setOnFocusChangeListener(this);
mPhoneEditText.setOnFocusChangeListener(this);
modeRadioGroup.setOnCheckedChangeListener(this);
}
use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.
the class QuickRuleOnlyActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quick_rule_only);
mOneOnlyEditText = (EditText) findViewById(R.id.oneOnlyEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
mSaripaarButton = (Button) findViewById(R.id.saripaarButton);
// Event listeners
mSaripaarButton.setOnClickListener(this);
// Validation
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Add a quick rule
mValidator.put(mOneOnlyEditText, new QuickRule<TextView>() {
@Override
public boolean isValid(TextView textView) {
return "1".equals(textView.getText().toString());
}
@Override
public String getMessage(Context context) {
return "Enter 1, nothing else.";
}
});
}
use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.
the class QuickRuleOrderedActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quick_rule_ordered);
// UI References
mZipCodeEditText = (EditText) findViewById(R.id.zipCodeEditText);
mAirtelNumberEditText = (EditText) findViewById(R.id.airtelNumberEditText);
mEmailEditText = (EditText) findViewById(R.id.emailEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
mUseQuickRuleRadioButton = (RadioButton) findViewById(R.id.useQuickRuleRadioButton);
mSaripaarButton = (Button) findViewById(R.id.saripaarButton);
// Validator
mValidator = new Validator(this);
mValidator.setValidationListener(this);
// Event Listeners
mUseQuickRuleRadioButton.setOnCheckedChangeListener(this);
mSaripaarButton.setOnClickListener(this);
}
use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.
the class ConfirmPasswordNoPasswordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_confirm_password_no_password);
mConfirmPasswordEditText = (EditText) findViewById(R.id.confirmPasswordEditText);
mResultTextView = (TextView) findViewById(R.id.resultTextView);
mSaripaarButton = (Button) findViewById(R.id.saripaarButton);
// Event listeners
mSaripaarButton.setOnClickListener(this);
// Validation
mValidator = new Validator(this);
mValidator.setValidationListener(this);
}
Aggregations