本文整理汇总了Java中com.mobsandgeeks.saripaar.Validator类的典型用法代码示例。如果您正苦于以下问题:Java Validator类的具体用法?Java Validator怎么用?Java Validator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Validator类属于com.mobsandgeeks.saripaar包,在下文中一共展示了Validator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login_activity);
ButterKnife.bind(this);
mValidator = new Validator(this);
mValidator.setValidationListener(this);
mOAuth2Service = OAuth2ServiceFactory.createAnonymousService(OAuth2Service.class);
mAccountManager = AccountManager.get(getBaseContext());
mAuthTokenType = getIntent().getStringExtra(AccountManager.KEY_ACCOUNT_TYPE);
if (mAuthTokenType == null) {
mAuthTokenType = AuthConstants.AUTHTOKEN_TYPE;
}
}
示例2: onCreate
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.signup_activity);
ButterKnife.bind(this);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mCallbackManager = CallbackManager.Factory.create();
mUserService = OAuth2ServiceFactory.createAnonymousService(UserService.class);
mValidator = new Validator(this);
mValidator.setValidationListener(this);
UniqueEmailRule uniqueEmailRule = new UniqueEmailRule(mName, mUserService);
mValidator.put(mEmail, uniqueEmailRule);
registerCallback();
}
示例3: onCreate
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
validator = new Validator(this);
validator.setValidationListener(this);
validator.put(selectNodeView, new QuickRule<TextView>() {
@Override
public boolean isValid(TextView view) {
return view.getText().toString().contains(LEFT_BRACKETS);
}
@Override
public String getMessage(Context context) {
return getString(R.string.node_input_error);
}
});
getPresenter().request();
}
示例4: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View searchView = inflater.inflate(R.layout.fragment_settings, container, false);
ButterKnife.bind(this, searchView);
mValidator = new Validator(this);
mValidator.setValidationListener(this);
mSaveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mValidator.validate();
}
});
mLabelStreetAddress.setText(getString(R.string.label_street_address));
mLabelCity.setText(getString(R.string.label_city));
mLabelState.setText(getString(R.string.label_state));
mLabelZip.setText(getString(R.string.label_zip));
return searchView;
}
示例5: CardEditDialog
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
public CardEditDialog(Context context, Card card) {
super(context);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.validator = new com.mobsandgeeks.saripaar.Validator(this);
this.validator.setValidationListener(this);
if (card == null) {
this.card = new Card();
} else {
this.card = card;
}
setContentView(R.layout.dialog_card_edit);
titleText = (TextView) findViewById(R.id.title_text);
displayText = (EditText) findViewById(R.id.display_text);
translateText = (EditText) findViewById(R.id.translate_text);
noteText = (EditText) findViewById(R.id.note_text);
cancelButton = (Button) findViewById(R.id.cancel_button);
saveButton = (Button) findViewById(R.id.save_button);
initViews();
}
示例6: onCreate
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
prefs = new Preferences(this);
if (!prefs.getRegStatus()) {
setContentView(R.layout.activity_home);
ed_username = (EditText) findViewById(R.id.username);
ed_phoneNumber = (EditText) findViewById(R.id.phonenumber);
gender=(Spinner) findViewById(R.id.gender);
btn_login = (Button) findViewById(R.id.btn_reg);
btn_login.setOnClickListener(this);
validator = new Validator(this);
validator.setValidationListener(this);
} else {
Intent in = new Intent(this, MainActivity.class);
startActivity(in);
finish();
}
}
示例7: renderView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
public void renderView() {
setContentView(R.layout.activity_payment);
super.initCommonComponents();
btnPay = (AppCompatButton) findViewById(R.id.btnPay);
//etCardNumber,etName,etMonth,etYear,etCvv
etCardNumber = (EditText) findViewById(R.id.etCardNumber);
etName = (EditText) findViewById(R.id.etName);
etMonth = (EditText) findViewById(R.id.etMonth);
etYear = (EditText) findViewById(R.id.etYear);
etCvv = (EditText) findViewById(R.id.etCvv);
totalShopping = (TextView) findViewById(R.id.totalShopping);
validator = new Validator(this);
validator.setValidationListener(this);
}
示例8: initValidator
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
private Validator initValidator() {
Validator validator = new Validator(this);
validator.setValidationListener(new Validator.ValidationListener() {
@Override
public void onValidationSucceeded() {
view.hideKeyboard();
user.setFirstName(binding.etFirstName.getText().toString());
user.setLastName(binding.etLastName.getText().toString());
user.setAge(Integer.valueOf(binding.etAge.getText().toString()));
presenter.updateUser(user);
}
@Override
public void onValidationFailed(List<ValidationError> errors) {
for (ValidationError error : errors) {
View view1 = error.getView();
String message = error.getCollatedErrorMessage(EditProfileActivity.this);
if (view1 instanceof EditText) {
((EditText) view1).setError(message);
} else {
EditProfileActivity.this.view.showMessage(message);
}
}
}
});
return validator;
}
示例9: initVars
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
protected void initVars() {
setHasOptionsMenu(true);
validator = new Validator(this);
validator.setValidationListener(this);
presenter.doGetProfile();
}
示例10: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_create_admission, container, false);
HomeActivity.navItemIndex = 6;
communicator = new Communicator();
/* Create Validator object to
* call the setValidationListener method of Validator class*/
validator = new Validator(this);
// Call the validation listener method.
validator.setValidationListener(this);
// Instantiate Progress Dialog object
prgDialog = new ProgressDialog(CreateAdmissionFragment.this.getActivity());
// Set Progress Dialog Text
prgDialog.setMessage("Please wait...");
// Set Cancelable as False
prgDialog.setCancelable(false);
// Get a reference to the AutoCompleteTextView in the layout
patientNames = (AutoCompleteTextView) view.findViewById(R.id.autocomplete_patients);
patientNames.setText(id);
admissionDate = (EditText) view.findViewById(R.id.admissionDate);
dischargeDate = (EditText) view.findViewById(R.id. dischargeDate);
healthCentre = (EditText) view.findViewById(R.id.healthCentreET);
notes = (EditText) view.findViewById(R.id.notesET);
submit = (Button) view.findViewById(R.id.admission_submit);
initialiseDialogs();
patientsGet();
addListenerOnButton();
return view;
}
示例11: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
HomeActivity.navItemIndex = 6;
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_update_admission, container, false);
communicator = new Communicator();
/* Create Validator object to
* call the setValidationListener method of Validator class*/
validator = new Validator(this);
// Call the validation listener method.
validator.setValidationListener(this);
// Instantiate Progress Dialog object
prgDialog = new ProgressDialog(UpdateAdmissionFragment.this.getActivity());
// Set Progress Dialog Text
prgDialog.setMessage("Please wait...");
// Set Cancelable as False
prgDialog.setCancelable(false);
// Get a reference to the AutoCompleteTextView in the layout
patientNames = (AutoCompleteTextView) view.findViewById(R.id.autocomplete_patients);
admissionDate = (EditText) view.findViewById(R.id.admissionDate);
dischargeDate = (EditText) view.findViewById(R.id. dischargeDate);
healthCentre = (EditText) view.findViewById(R.id.healthCentreET);
notes = (EditText) view.findViewById(R.id.notesET);
submit = (Button) view.findViewById(R.id.admission_submit);
initialiseDialogs();
patientsGet();
fillTextBoxes();
addListenerOnButton();
return view;
}
示例12: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
HomeActivity.navItemIndex = 4;
View view = inflater.inflate(R.layout.fragment_update_counselling, container, false);
communicator = new Communicator();
// Instantiate Progress Dialog object
prgDialog = new ProgressDialog(UpdateCounsellingFragment.this.getActivity());
// Set Progress Dialog Text
prgDialog.setMessage("Please wait...");
// Set Cancelable as False
prgDialog.setCancelable(false);
// Get a reference to the AutoCompleteTextView in the layout
patientNames = (AutoCompleteTextView) view.findViewById(R.id.autocomplete_patients);
sessionType = (Spinner) view.findViewById(R.id.session_spinner);
notesET = (EditText) view.findViewById(R.id.notesET);
//sessionType = (Spinner) view.findViewById(R.id.session_spinner);
submit = (Button) view.findViewById(R.id.session_submit);
/* Create Validator object to
* call the setValidationListener method of Validator class*/
validator = new Validator(this);
// Call the validation listener method.
validator.setValidationListener(this);
patientNames.setText(counsellingInfo[2]);
notesET.setText(counsellingInfo[1]);
patientsGet();
addItemsOnSessionSpinner();
submitListener();
return view;
}
示例13: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
HomeActivity.navItemIndex = 4;
View view = inflater.inflate(R.layout.fragment_create_counselling, container, false);
communicator = new Communicator();
// Instantiate Progress Dialog object
prgDialog = new ProgressDialog(CreateCounsellingFragment.this.getActivity());
// Set Progress Dialog Text
prgDialog.setMessage("Please wait...");
// Set Cancelable as False
prgDialog.setCancelable(false);
/* Create Validator object to
* call the setValidationListener method of Validator class*/
validator = new Validator(this);
// Call the validation listener method.
validator.setValidationListener(this);
// Get a reference to the AutoCompleteTextView in the layout
patientNames = (AutoCompleteTextView) view.findViewById(R.id.autocomplete_patients);
patientNames.setText(id);
sessionType = (Spinner) view.findViewById(R.id.session_spinner);
notesET = (EditText) view.findViewById(R.id.notesET);
//sessionType = (Spinner) view.findViewById(R.id.session_spinner);
submit = (Button) view.findViewById(R.id.session_submit);
patientsGet();
addItemsOnSessionSpinner();
submitListener();
return view;
}
示例14: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
HomeActivity.navItemIndex = 3;
View view = inflater.inflate(R.layout.fragment_create_appointment, container, false);
communicator = new Communicator();
/* Create Validator object to
* call the setValidationListener method of Validator class*/
validator = new Validator(this);
// Call the validation listener method.
validator.setValidationListener(this);
// Instantiate Progress Dialog object
prgDialog = new ProgressDialog(CreateAppointmentFragment.this.getActivity());
// Set Progress Dialog Text
prgDialog.setMessage("Please wait...");
// Set Cancelable as False
prgDialog.setCancelable(false);
// Get a reference to the AutoCompleteTextView in the layout
patientNames = (AutoCompleteTextView) view.findViewById(R.id.autocomplete_patients);
patientNames.setText(id);
users = (Spinner) view.findViewById(R.id.ownerSpinner);
//patientNames = (AutoCompleteTextView) findViewById(R.id.autocomplete_patients);
//sessionType = (Spinner) findViewById(R.id.session_spinner);
appointmentTypeET = (EditText) view.findViewById(R.id.appointmentTypeET);
dateET = (EditText) view.findViewById(R.id.app_date_ET);
startTimeET = (EditText) view.findViewById(R.id.startTimeET);
endTimeET = (EditText) view.findViewById(R.id.endTimeET);
notesET = (EditText) view.findViewById(R.id.noteET);
//appDatePicker = (DatePicker) view.findViewById(R.id.app_datePicker);
submit = (Button) view.findViewById(R.id.appointment_submit);
patientsGet();
addItemsOnUserSpinner();
initialiseDialogs();
addListenerOnButton();
return view;
}
示例15: onCreateView
import com.mobsandgeeks.saripaar.Validator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
HomeActivity.navItemIndex = 9;
View view = inflater.inflate(R.layout.fragment_create_adverse_event, container, false);
communicator = new Communicator();
/* Create Validator object to
* call the setValidationListener method of Validator class*/
validator = new Validator(this);
// Call the validation listener method.
validator.setValidationListener(this);
// Instantiate Progress Dialog object
prgDialog = new ProgressDialog(CreateAdverseEventFragment.this.getActivity());
// Set Progress Dialog Text
prgDialog.setMessage("Please wait...");
// Set Cancelable as False
prgDialog.setCancelable(false);
// Get a reference to the AutoCompleteTextView in the layout
patientNames = (AutoCompleteTextView) view.findViewById(R.id.autocomplete_patients);
patientNames.setText(id);
eventDate = (EditText) view.findViewById(R.id.eventDateET);
adverseEvent = (Spinner) view.findViewById(R.id.AdverseEventspinner);
notes = (EditText) view.findViewById(R.id.noteET);
submit = (Button) view.findViewById(R.id.adverse_submit);
initialiseDialog();
patientsGet();
addItemsOnSpinner();
addListenerOnButton();
return view;
}