Search in sources :

Example 21 with Validator

use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.

the class CustomAnnotationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_annotation);
    // UI References
    mZipCodeEditText = (EditText) findViewById(R.id.zipCodeEditText);
    RadioButton registerAnnotationRadioButton = (RadioButton) findViewById(R.id.registerAnnotationRadioButton);
    mResultTextView = (TextView) findViewById(R.id.resultTextView);
    mSaripaarButton = (Button) findViewById(R.id.saripaarButton);
    // Validator
    mValidator = new Validator(this);
    mValidator.setValidationListener(this);
    // Event listeners
    registerAnnotationRadioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                Validator.registerAnnotation(HometownZipCode.class);
            }
        }
    });
    mSaripaarButton.setOnClickListener(this);
}
Also used : RadioButton(android.widget.RadioButton) Validator(com.mobsandgeeks.saripaar.Validator) CompoundButton(android.widget.CompoundButton) HometownZipCode(com.mobsandgeeks.saripaar.tests.ui.validation.HometownZipCode)

Example 22 with Validator

use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.

the class CustomAnnotationWithAdapterActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_annotation_with_adapter);
    // UI References
    mSeekBar = (SeekBar) findViewById(R.id.seekBar);
    mRegisterAnnotationRadioButton = (RadioButton) findViewById(R.id.registerAnnotationRadioButton);
    mResultTextView = (TextView) findViewById(R.id.resultTextView);
    mSaripaarButton = (Button) findViewById(R.id.saripaarButton);
    // Validation
    mValidator = new Validator(this);
    mValidator.setValidationListener(this);
    // Event listeners
    mRegisterAnnotationRadioButton.setOnCheckedChangeListener(this);
    mSaripaarButton.setOnClickListener(this);
}
Also used : Validator(com.mobsandgeeks.saripaar.Validator)

Example 23 with Validator

use of com.mobsandgeeks.saripaar.Validator in project android-saripaar by ragunathjawahar.

the class CustomMultipleViewDataAdaptersActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_multiple_view_data_adapters);
    // UI References
    mEmailFloatLabeledEditText = (FloatLabeledEditText) findViewById(R.id.emailFloatLabelEditText);
    mMaxFloatLabeledEditText = (FloatLabeledEditText) findViewById(R.id.maxFloatLabelEditText);
    mResultTextView = (TextView) findViewById(R.id.resultTextView);
    RadioButton registerEmailAdapterRadioButton = (RadioButton) findViewById(R.id.registerEmailAdapterRadioButton);
    RadioButton registerMaxAdapterRadioButton = (RadioButton) findViewById(R.id.registerMaxAdapterRadioButton);
    Button saripaarButton = (Button) findViewById(R.id.saripaarButton);
    // Validator
    mValidator = new Validator(this);
    mValidator.setValidationListener(this);
    // Event listeners
    saripaarButton.setOnClickListener(this);
    registerEmailAdapterRadioButton.setOnCheckedChangeListener(this);
    registerMaxAdapterRadioButton.setOnCheckedChangeListener(this);
}
Also used : CompoundButton(android.widget.CompoundButton) RadioButton(android.widget.RadioButton) Button(android.widget.Button) RadioButton(android.widget.RadioButton) Validator(com.mobsandgeeks.saripaar.Validator)

Aggregations

Validator (com.mobsandgeeks.saripaar.Validator)23 RadioGroup (android.widget.RadioGroup)8 Button (android.widget.Button)7 TextView (android.widget.TextView)6 View (android.view.View)4 CompoundButton (android.widget.CompoundButton)4 Context (android.content.Context)3 RadioButton (android.widget.RadioButton)3 Bundle (android.os.Bundle)1 CheckBox (android.widget.CheckBox)1 EditText (android.widget.EditText)1 QuickRule (com.mobsandgeeks.saripaar.QuickRule)1 HometownZipCode (com.mobsandgeeks.saripaar.tests.ui.validation.HometownZipCode)1