diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/EditProfile.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/EditProfile.java index 24400a2..57ebfe9 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/EditProfile.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/EditProfile.java @@ -12,6 +12,10 @@ public class EditProfile extends AppCompatActivity { String username; DBHelper dbHelper; + /** + * Prepoplates the fields with user information when the activity is created + * @param savedInstanceState + */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -56,6 +60,11 @@ public class EditProfile extends AppCompatActivity { startActivity(intent); finish(); } + + /** + * Saves updated user information to the database + * @param view + */ public void Save(View view){ TextView firstname = findViewById(R.id.FirstNameInput); TextView lastname = findViewById(R.id.LastNameInput); @@ -66,6 +75,7 @@ public class EditProfile extends AppCompatActivity { TextView description = findViewById(R.id.DescriptionInput); CheckBox licensed = findViewById(R.id.LicensedInput); + //Checks for the fields if(password.getText().toString().length()>=5 && firstname.getText().toString().length()>0 && lastname.getText().toString().length()>0 && companyname.getText().toString().length()>0 && address.getText().toString().length()>0 && phonenumber.getText().toString().length()>0 diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderServicesList.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderServicesList.java index d8b57ac..21b47d3 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderServicesList.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderServicesList.java @@ -39,7 +39,7 @@ public class ServiceProviderServicesList extends AppCompatActivity implements De /** * On creation loads up the xml, and generates the services list, - * and fillsout the recylerView fields. + * and fills out the recylerView fields. * * @param savedInstanceState Bundle to transfer information. */ @@ -207,6 +207,7 @@ public class ServiceProviderServicesList extends AppCompatActivity implements De return services.length; } + //nested class for the items in the recycler view class ServicesHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ TextView name; @@ -218,6 +219,11 @@ public class ServiceProviderServicesList extends AppCompatActivity implements De rate = row.findViewById(R.id.Rate); row.setOnClickListener(this); } + + /** + * Onclick function for the items in the recycler view + * @param view + */ @Override public void onClick(View view) { TextView nameview = (TextView)view.findViewById(R.id.Name);