added comments to edit profile and services list
This commit is contained in:
parent
18216adfae
commit
1ba91f5cde
2 changed files with 17 additions and 1 deletions
|
@ -12,6 +12,10 @@ public class EditProfile extends AppCompatActivity {
|
||||||
String username;
|
String username;
|
||||||
DBHelper dbHelper;
|
DBHelper dbHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepoplates the fields with user information when the activity is created
|
||||||
|
* @param savedInstanceState
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -56,6 +60,11 @@ public class EditProfile extends AppCompatActivity {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves updated user information to the database
|
||||||
|
* @param view
|
||||||
|
*/
|
||||||
public void Save(View view){
|
public void Save(View view){
|
||||||
TextView firstname = findViewById(R.id.FirstNameInput);
|
TextView firstname = findViewById(R.id.FirstNameInput);
|
||||||
TextView lastname = findViewById(R.id.LastNameInput);
|
TextView lastname = findViewById(R.id.LastNameInput);
|
||||||
|
@ -66,6 +75,7 @@ public class EditProfile extends AppCompatActivity {
|
||||||
TextView description = findViewById(R.id.DescriptionInput);
|
TextView description = findViewById(R.id.DescriptionInput);
|
||||||
CheckBox licensed = findViewById(R.id.LicensedInput);
|
CheckBox licensed = findViewById(R.id.LicensedInput);
|
||||||
|
|
||||||
|
//Checks for the fields
|
||||||
if(password.getText().toString().length()>=5 && firstname.getText().toString().length()>0
|
if(password.getText().toString().length()>=5 && firstname.getText().toString().length()>0
|
||||||
&& lastname.getText().toString().length()>0 && companyname.getText().toString().length()>0
|
&& lastname.getText().toString().length()>0 && companyname.getText().toString().length()>0
|
||||||
&& address.getText().toString().length()>0 && phonenumber.getText().toString().length()>0
|
&& address.getText().toString().length()>0 && phonenumber.getText().toString().length()>0
|
||||||
|
|
|
@ -207,6 +207,7 @@ public class ServiceProviderServicesList extends AppCompatActivity implements De
|
||||||
return services.length;
|
return services.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nested class for the items in the recycler view
|
||||||
class ServicesHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
|
class ServicesHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
|
||||||
|
|
||||||
TextView name;
|
TextView name;
|
||||||
|
@ -218,6 +219,11 @@ public class ServiceProviderServicesList extends AppCompatActivity implements De
|
||||||
rate = row.findViewById(R.id.Rate);
|
rate = row.findViewById(R.id.Rate);
|
||||||
row.setOnClickListener(this);
|
row.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Onclick function for the items in the recycler view
|
||||||
|
* @param view
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
TextView nameview = (TextView)view.findViewById(R.id.Name);
|
TextView nameview = (TextView)view.findViewById(R.id.Name);
|
||||||
|
|
Loading…
Reference in a new issue