Search in sources :

Example 6 with Validator

use of br.com.ilhasoft.support.validation.Validator in project open-event-orga-app by fossasia.

the class ForgotPasswordFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = DataBindingUtil.inflate(inflater, R.layout.forgot_password_fragment, container, false);
    validator = new Validator(binding);
    return binding.getRoot();
}
Also used : Validator(br.com.ilhasoft.support.validation.Validator)

Example 7 with Validator

use of br.com.ilhasoft.support.validation.Validator in project open-event-orga-app by fossasia.

the class LoginFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = DataBindingUtil.inflate(inflater, R.layout.login_fragment, container, false);
    validator = new Validator(binding);
    return binding.getRoot();
}
Also used : Validator(br.com.ilhasoft.support.validation.Validator)

Example 8 with Validator

use of br.com.ilhasoft.support.validation.Validator in project open-event-orga-app by fossasia.

the class SignUpFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    binding = DataBindingUtil.inflate(inflater, R.layout.sign_up_fragment, container, false);
    validator = new Validator(binding);
    return binding.getRoot();
}
Also used : Validator(br.com.ilhasoft.support.validation.Validator) Nullable(android.support.annotation.Nullable)

Example 9 with Validator

use of br.com.ilhasoft.support.validation.Validator in project open-event-orga-app by fossasia.

the class CreateFaqFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.AppTheme);
    LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
    binding = DataBindingUtil.inflate(localInflater, R.layout.faq_create_layout, container, false);
    validator = new Validator(binding.form);
    binding.submit.setOnClickListener(view -> {
        if (validator.validate())
            getPresenter().createFaq();
    });
    return binding.getRoot();
}
Also used : Context(android.content.Context) ContextThemeWrapper(android.view.ContextThemeWrapper) LayoutInflater(android.view.LayoutInflater) Validator(br.com.ilhasoft.support.validation.Validator)

Example 10 with Validator

use of br.com.ilhasoft.support.validation.Validator in project open-event-orga-app by fossasia.

the class UpdateCopyrightFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    binding = DataBindingUtil.inflate(inflater, R.layout.copyright_create_layout, container, false);
    validator = new Validator(binding.form);
    AppCompatActivity activity = ((AppCompatActivity) getActivity());
    activity.setSupportActionBar(binding.toolbar);
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    setHasOptionsMenu(true);
    Bundle bundle = getArguments();
    copyrightId = bundle.getLong(EVENT_ID);
    binding.submit.setOnClickListener(view -> {
        if (validator.validate())
            getPresenter().updateCopyright();
    });
    return binding.getRoot();
}
Also used : Bundle(android.os.Bundle) AppCompatActivity(android.support.v7.app.AppCompatActivity) Validator(br.com.ilhasoft.support.validation.Validator) ActionBar(android.support.v7.app.ActionBar) Nullable(android.support.annotation.Nullable)

Aggregations

Validator (br.com.ilhasoft.support.validation.Validator)10 Nullable (android.support.annotation.Nullable)4 ActionBar (android.support.v7.app.ActionBar)4 AppCompatActivity (android.support.v7.app.AppCompatActivity)4 LayoutInflater (android.view.LayoutInflater)4 Context (android.content.Context)3 ContextThemeWrapper (android.view.ContextThemeWrapper)3 Bundle (android.os.Bundle)2 RESULT_OK (android.app.Activity.RESULT_OK)1 Intent (android.content.Intent)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 PackageManager (android.content.pm.PackageManager)1 DataBindingUtil (android.databinding.DataBindingUtil)1 TextInputLayout (android.support.design.widget.TextInputLayout)1 Editable (android.text.Editable)1 TextUtils (android.text.TextUtils)1 TextWatcher (android.text.TextWatcher)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 ArrayAdapter (android.widget.ArrayAdapter)1