added general description to front end
This commit is contained in:
		
							parent
							
								
									5e781ee225
								
							
						
					
					
						commit
						2742160b60
					
				
					 3 changed files with 26 additions and 0 deletions
				
			
		| 
						 | 
					@ -27,6 +27,7 @@ public class EditProfile extends AppCompatActivity {
 | 
				
			||||||
        TextView companyname = findViewById(R.id.CompanyNameInput);
 | 
					        TextView companyname = findViewById(R.id.CompanyNameInput);
 | 
				
			||||||
        TextView address = findViewById(R.id.AddressInput);
 | 
					        TextView address = findViewById(R.id.AddressInput);
 | 
				
			||||||
        TextView phonenumber = findViewById(R.id.PhoneNumberInput);
 | 
					        TextView phonenumber = findViewById(R.id.PhoneNumberInput);
 | 
				
			||||||
 | 
					        TextView description = findViewById(R.id.DescriptionInput);
 | 
				
			||||||
        CheckBox licensed = findViewById(R.id.LicensedInput);
 | 
					        CheckBox licensed = findViewById(R.id.LicensedInput);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,9 +37,11 @@ public class EditProfile extends AppCompatActivity {
 | 
				
			||||||
        companyname.setText(user.getCompanyname());
 | 
					        companyname.setText(user.getCompanyname());
 | 
				
			||||||
        address.setText(user.getAddress());
 | 
					        address.setText(user.getAddress());
 | 
				
			||||||
        phonenumber.setText(user.getPhonenumber());
 | 
					        phonenumber.setText(user.getPhonenumber());
 | 
				
			||||||
 | 
					        description.setText(user.getDescription());
 | 
				
			||||||
        licensed.setChecked(user.isLicensed());
 | 
					        licensed.setChecked(user.isLicensed());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -60,6 +63,7 @@ public class EditProfile extends AppCompatActivity {
 | 
				
			||||||
        TextView companyname = findViewById(R.id.CompanyNameInput);
 | 
					        TextView companyname = findViewById(R.id.CompanyNameInput);
 | 
				
			||||||
        TextView address = findViewById(R.id.AddressInput);
 | 
					        TextView address = findViewById(R.id.AddressInput);
 | 
				
			||||||
        TextView phonenumber = findViewById(R.id.PhoneNumberInput);
 | 
					        TextView phonenumber = findViewById(R.id.PhoneNumberInput);
 | 
				
			||||||
 | 
					        TextView description = findViewById(R.id.DescriptionInput);
 | 
				
			||||||
        CheckBox licensed = findViewById(R.id.LicensedInput);
 | 
					        CheckBox licensed = findViewById(R.id.LicensedInput);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if(password.getText().toString().length()>=5 && firstname.getText().toString().length()>0
 | 
					        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]*")
 | 
					            && lastname.getText().toString().matches("[a-zA-Z]*")
 | 
				
			||||||
            && companyname.getText().toString().matches("^[a-zA-Z0-9_ ]*$")
 | 
					            && companyname.getText().toString().matches("^[a-zA-Z0-9_ ]*$")
 | 
				
			||||||
            && address.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}$")
 | 
					            && phonenumber.getText().toString().matches("^(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$")
 | 
				
			||||||
            && address.getText().toString().replaceAll("\\s+","").length()>0) {
 | 
					            && address.getText().toString().replaceAll("\\s+","").length()>0) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if(dbHelper.updateUserInfo(username, password.getText().toString(), firstname.getText().toString(), lastname.getText().toString(),
 | 
					            if(dbHelper.updateUserInfo(username, password.getText().toString(), firstname.getText().toString(), lastname.getText().toString(),
 | 
				
			||||||
                address.getText().toString(), phonenumber.getText().toString(), companyname.getText().toString(), licensed.isChecked())){
 | 
					                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();
 | 
					                Toast.makeText(this, "Profile has been updated", Toast.LENGTH_LONG).show();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else{
 | 
					            else{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,6 +29,7 @@ public class ServiceProvider extends UserType {
 | 
				
			||||||
    private String phonenumber;
 | 
					    private String phonenumber;
 | 
				
			||||||
    private String companyname;
 | 
					    private String companyname;
 | 
				
			||||||
    private boolean licensed;
 | 
					    private boolean licensed;
 | 
				
			||||||
 | 
					    private String description;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -139,4 +140,9 @@ public class ServiceProvider extends UserType {
 | 
				
			||||||
    public void setLicensed(boolean licensed) {
 | 
					    public void setLicensed(boolean licensed) {
 | 
				
			||||||
        this.licensed = licensed;
 | 
					        this.licensed = licensed;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public String getDescription() {return description; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void setDescription(String description) { this.description = description; }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -105,6 +105,20 @@
 | 
				
			||||||
                android:buttonTint="@color/colorWhite"
 | 
					                android:buttonTint="@color/colorWhite"
 | 
				
			||||||
                android:layout_marginBottom="15dp"/>
 | 
					                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
 | 
					            //component used from https://github.com/rengwuxian/MaterialEditText
 | 
				
			||||||
            <com.rengwuxian.materialedittext.MaterialEditText
 | 
					            <com.rengwuxian.materialedittext.MaterialEditText
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue