Added UML and Test file fixes, added string description to the DBHelper and SignUp. Further fixes needed
This commit is contained in:
commit
66d33d4cc4
3 changed files with 27 additions and 0 deletions
|
@ -27,6 +27,7 @@ public class EditProfile extends AppCompatActivity {
|
|||
TextView companyname = findViewById(R.id.CompanyNameInput);
|
||||
TextView address = findViewById(R.id.AddressInput);
|
||||
TextView phonenumber = findViewById(R.id.PhoneNumberInput);
|
||||
TextView description = findViewById(R.id.DescriptionInput);
|
||||
CheckBox licensed = findViewById(R.id.LicensedInput);
|
||||
|
||||
|
||||
|
@ -36,9 +37,11 @@ public class EditProfile extends AppCompatActivity {
|
|||
companyname.setText(user.getCompanyname());
|
||||
address.setText(user.getAddress());
|
||||
phonenumber.setText(user.getPhonenumber());
|
||||
description.setText(user.getDescription());
|
||||
licensed.setChecked(user.isLicensed());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,6 +63,7 @@ public class EditProfile extends AppCompatActivity {
|
|||
TextView companyname = findViewById(R.id.CompanyNameInput);
|
||||
TextView address = findViewById(R.id.AddressInput);
|
||||
TextView phonenumber = findViewById(R.id.PhoneNumberInput);
|
||||
TextView description = findViewById(R.id.DescriptionInput);
|
||||
CheckBox licensed = findViewById(R.id.LicensedInput);
|
||||
|
||||
if(password.getText().toString().length()>=5 && firstname.getText().toString().length()>0
|
||||
|
@ -70,11 +74,13 @@ public class EditProfile extends AppCompatActivity {
|
|||
&& lastname.getText().toString().matches("[a-zA-Z]*")
|
||||
&& companyname.getText().toString().matches("^[a-zA-Z0-9_ ]*$")
|
||||
&& address.getText().toString().matches("^[a-zA-Z0-9_ ]*$")
|
||||
&& description.getText().toString().matches("^[a-zA-Z0-9_ ]*$")
|
||||
&& phonenumber.getText().toString().matches("^(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$")
|
||||
&& address.getText().toString().replaceAll("\\s+","").length()>0) {
|
||||
|
||||
if(dbHelper.updateUserInfo(username, password.getText().toString(), firstname.getText().toString(), lastname.getText().toString(),
|
||||
address.getText().toString(), phonenumber.getText().toString(), companyname.getText().toString(), licensed.isChecked())){
|
||||
//add comment method here
|
||||
Toast.makeText(this, "Profile has been updated", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -142,6 +142,7 @@ public class ServiceProvider extends UserType {
|
|||
this.licensed = licensed;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
@ -149,4 +150,10 @@ public class ServiceProvider extends UserType {
|
|||
public void setDescription(String phonenumber) {
|
||||
this.description = description;
|
||||
}
|
||||
=======
|
||||
|
||||
public String getDescription() {return description; }
|
||||
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
>>>>>>> 587e99040b46bc068178844c11165b0730c21628
|
||||
}
|
|
@ -105,6 +105,20 @@
|
|||
android:buttonTint="@color/colorWhite"
|
||||
android:layout_marginBottom="15dp"/>
|
||||
|
||||
//component used from https://github.com/rengwuxian/MaterialEditText
|
||||
<com.rengwuxian.materialedittext.MaterialEditText
|
||||
android:id="@+id/DescriptionInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/customborder"
|
||||
android:hint="General Description"
|
||||
android:textSize="15sp"
|
||||
app:met_baseColor="@android:color/white"
|
||||
app:met_floatingLabel="highlight"
|
||||
app:met_primaryColor="@color/colorWhite"
|
||||
app:met_singleLineEllipsis="true"
|
||||
android:textCursorDrawable="@color/colorWhite"/>
|
||||
|
||||
|
||||
//component used from https://github.com/rengwuxian/MaterialEditText
|
||||
<com.rengwuxian.materialedittext.MaterialEditText
|
||||
|
|
Loading…
Reference in a new issue