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;
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue