diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 199386e1..2ea54c11 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -107,7 +107,7 @@ 2000; + } else { + isValid = false; + } + + if (!isValid) { + year.setError("Please enter a valid year"); + } else { + year.setError(null); + } + + } + + @Override + public void afterTextChanged(Editable s) { + } + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + }; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -49,7 +86,7 @@ public class UploadFieldsBuilderActivity extends BaseActivity { } //Initialize toolbar - toolbar = findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); toolbar.setTitle("Upload fields builder"); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { @@ -57,12 +94,10 @@ public class UploadFieldsBuilderActivity extends BaseActivity { getSupportActionBar().setDisplayShowHomeEnabled(true); } - createDrawer(); - drawer.setSelection(UPLOAD_ID); - semesterChooserLinear = findViewById(R.id.upload_fields_builder_choose_semester); semesterRadio = findViewById(R.id.upload_fields_builder_semester_radio_group); year = findViewById(R.id.upload_fields_builder_year); + year.addTextChangedListener(customYearWatcher); typeRadio = findViewById(R.id.upload_fields_builder_type_radio_group); typeRadio.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {