made it pretty

This commit is contained in:
IvanaE 2018-10-30 11:16:56 -04:00
parent f0b25cb4da
commit f5bc54316a

View file

@ -15,7 +15,7 @@ public class SignUp extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up); setContentView(R.layout.activity_sign_up);
MaterialSpinner spinner = findViewById(R.id.RoleInput); MaterialSpinner spinner = findViewById(R.id.RoleInput);
spinner.setItems("HomeOwner", "Service Provider"); spinner.setItems("Home Owner", "Service Provider");
spinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() { spinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() {
@Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) { @Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
@ -36,7 +36,7 @@ public class SignUp extends AppCompatActivity {
if(username.length()>=5 && password.length()>5 && firstname.length()>0 && lastname.length()>0 && username.matches("[a-zA-Z0-9]*") && password.matches("[a-zA-Z0-9]*") if(username.length()>=5 && password.length()>5 && firstname.length()>0 && lastname.length()>0 && username.matches("[a-zA-Z0-9]*") && password.matches("[a-zA-Z0-9]*")
&& firstname.matches("[a-zA-Z]*") && lastname.matches("[a-zA-Z]*")){ && firstname.matches("[a-zA-Z]*") && lastname.matches("[a-zA-Z]*")){
switch(spinner.getText().toString()){ switch(spinner.getText().toString()){
case "HomeOwner": case "Home Owner":
newUser = new HomeOwner(username,password,firstname,lastname); newUser = new HomeOwner(username,password,firstname,lastname);
break; break;
case "Service Provider": case "Service Provider":