deliverable 3 ui, methods to be filled in
This commit is contained in:
		
							parent
							
								
									16e39ff120
								
							
						
					
					
						commit
						32f1031782
					
				
					 18 changed files with 1153 additions and 26 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								OlympusServices/.idea/caches/build_file_checksums.ser
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								OlympusServices/.idea/caches/build_file_checksums.ser
									
										
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -30,22 +30,45 @@
 | 
			
		|||
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".SignUp"
 | 
			
		||||
            android:label="Sign Up"
 | 
			
		||||
            android:screenOrientation="portrait" />
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".LogIn"
 | 
			
		||||
            android:label="Log In"
 | 
			
		||||
            android:screenOrientation="portrait" />
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".Welcome"
 | 
			
		||||
            android:label="Welcome"
 | 
			
		||||
            android:screenOrientation="portrait" />
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".AdminWelcome"
 | 
			
		||||
            android:label="Welcome"
 | 
			
		||||
            android:screenOrientation="portrait" />
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".UsersList"
 | 
			
		||||
            android:label="List of Users"/>
 | 
			
		||||
            android:label="List of Users"
 | 
			
		||||
            android:screenOrientation="portrait"/>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".ServicesList"
 | 
			
		||||
            android:label="List of Services"></activity>
 | 
			
		||||
            android:name=".AdminServicesList"
 | 
			
		||||
            android:label="List of Services"
 | 
			
		||||
            android:screenOrientation="portrait"/>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".ServiceProviderWelcome"
 | 
			
		||||
            android:label="Welcome"
 | 
			
		||||
            android:screenOrientation="portrait"/>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".EditProfile"
 | 
			
		||||
            android:label="Edit Profile"
 | 
			
		||||
            android:screenOrientation="portrait"/>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".ServiceProviderServicesList"
 | 
			
		||||
            android:label="List of Services"
 | 
			
		||||
            android:screenOrientation="portrait"/>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".ServiceProviderAvailabilities"
 | 
			
		||||
            android:label="Availabilities"
 | 
			
		||||
            android:screenOrientation="portrait">
 | 
			
		||||
        </activity>
 | 
			
		||||
    </application>
 | 
			
		||||
 | 
			
		||||
</manifest>
 | 
			
		||||
| 
						 | 
				
			
			@ -10,9 +10,6 @@ import android.support.v7.widget.RecyclerView;
 | 
			
		|||
import android.view.LayoutInflater;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.view.ViewGroup;
 | 
			
		||||
import android.widget.AdapterView;
 | 
			
		||||
import android.widget.ArrayAdapter;
 | 
			
		||||
import android.widget.GridView;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +21,7 @@ import java.util.List;
 | 
			
		|||
 * which the admin can view and manipulate.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class ServicesList extends AppCompatActivity implements NewServiceDialogFragment.NoticeDialogListener, EditServiceDialogFragment.NoticeDialogListener{
 | 
			
		||||
public class AdminServicesList extends AppCompatActivity implements NewServiceDialogFragment.NoticeDialogListener, EditServiceDialogFragment.NoticeDialogListener{
 | 
			
		||||
 | 
			
		||||
    //field for RecyclerView
 | 
			
		||||
    private RecyclerView mRecyclerView;
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +39,7 @@ public class ServicesList extends AppCompatActivity implements NewServiceDialogF
 | 
			
		|||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_services_list);
 | 
			
		||||
        setContentView(R.layout.activity_admin_services_list);
 | 
			
		||||
        DBHelper dbHelper = new DBHelper(this);
 | 
			
		||||
        List<String[]> serviceslist = dbHelper.getAllServices();
 | 
			
		||||
        Service[] services = new Service[(serviceslist.size())];
 | 
			
		||||
| 
						 | 
				
			
			@ -70,7 +70,7 @@ public class AdminWelcome extends AppCompatActivity {
 | 
			
		|||
     * @param view
 | 
			
		||||
     */
 | 
			
		||||
    public void goToServices(View view){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(), ServicesList.class);
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(), AdminServicesList.class);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,64 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.app.AlertDialog;
 | 
			
		||||
import android.app.Dialog;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.content.DialogInterface;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.support.v4.app.DialogFragment;
 | 
			
		||||
import android.view.LayoutInflater;
 | 
			
		||||
import android.widget.EditText;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
public class DeleteServiceDialogFragment extends DialogFragment{
 | 
			
		||||
    public interface NoticeDialogListener {
 | 
			
		||||
        public void onDialogDelete(DialogFragment dialog);
 | 
			
		||||
        public void onDialogNevermind(DialogFragment dialog);
 | 
			
		||||
    }
 | 
			
		||||
    DeleteServiceDialogFragment.NoticeDialogListener mListener;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onAttach(Context context) {
 | 
			
		||||
        super.onAttach(context);
 | 
			
		||||
        // Verify that the host activity implements the callback interface
 | 
			
		||||
        try {
 | 
			
		||||
            // Instantiate the NoticeDialogListener so we can send events to the host
 | 
			
		||||
            mListener = (DeleteServiceDialogFragment.NoticeDialogListener) context;
 | 
			
		||||
        } catch (ClassCastException e) {
 | 
			
		||||
            // The activity doesn't implement the interface, throw exception
 | 
			
		||||
            throw new ClassCastException(this.toString()
 | 
			
		||||
                    + " must implement NoticeDialogListener");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    @Override
 | 
			
		||||
    public Dialog onCreateDialog(Bundle savedInstanceState) {
 | 
			
		||||
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
 | 
			
		||||
        // Get the layout inflater
 | 
			
		||||
        LayoutInflater inflater = getActivity().getLayoutInflater();
 | 
			
		||||
 | 
			
		||||
        // Inflate and set the layout for the dialog
 | 
			
		||||
        // Pass null as the parent view because its going in the dialog layout
 | 
			
		||||
        builder.setView(inflater.inflate(R.layout.dialog_service_delete, null))
 | 
			
		||||
                // Add action buttons
 | 
			
		||||
                .setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() {
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void onClick(DialogInterface dialog, int id) {
 | 
			
		||||
                        Bundle args = new Bundle();
 | 
			
		||||
                        args.putString("name", (String)getArguments().get("name"));
 | 
			
		||||
                        DeleteServiceDialogFragment.this.setArguments(args);
 | 
			
		||||
                        mListener.onDialogDelete(DeleteServiceDialogFragment.this);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    }
 | 
			
		||||
                })
 | 
			
		||||
                .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
 | 
			
		||||
                    public void onClick(DialogInterface dialog, int id) {
 | 
			
		||||
                        Bundle args = new Bundle();
 | 
			
		||||
                        args.putString("name", (String)getArguments().get("name"));
 | 
			
		||||
                        mListener.onDialogNevermind(DeleteServiceDialogFragment.this);
 | 
			
		||||
                    }
 | 
			
		||||
                })
 | 
			
		||||
                .setTitle((String)getArguments().get("name"));
 | 
			
		||||
        return builder.create();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,54 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.support.v7.app.AppCompatActivity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
public class EditProfile extends AppCompatActivity {
 | 
			
		||||
    String username;
 | 
			
		||||
    DBHelper dbHelper;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_edit_profile);
 | 
			
		||||
        Bundle bundle = getIntent().getExtras();
 | 
			
		||||
        username = bundle.getString("username");
 | 
			
		||||
        dbHelper = new DBHelper(this);
 | 
			
		||||
        UserType user;
 | 
			
		||||
        user = dbHelper.findUserByUsername(username);
 | 
			
		||||
        TextView firstname = findViewById(R.id.FirstNameInput);
 | 
			
		||||
        TextView lastname = findViewById(R.id.LastNameInput);
 | 
			
		||||
        TextView password = findViewById(R.id.PasswordInput);
 | 
			
		||||
        firstname.setText(user.getFirstname());
 | 
			
		||||
        lastname.setText(user.getLastname());
 | 
			
		||||
        password.setText(user.getPassword());
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Override so that previous screen refreshes when pressing the
 | 
			
		||||
     * back button on this activity of the app.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onBackPressed(){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(),ServiceProviderWelcome.class);
 | 
			
		||||
        intent.putExtra("username", username);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
    public void Save(View view){
 | 
			
		||||
        TextView firstname = findViewById(R.id.FirstNameInput);
 | 
			
		||||
        TextView lastname = findViewById(R.id.LastNameInput);
 | 
			
		||||
        TextView password = findViewById(R.id.PasswordInput);
 | 
			
		||||
        dbHelper.updateUserInfo(username, password.getText().toString(), firstname.getText().toString(), lastname.getText().toString());
 | 
			
		||||
        Toast.makeText(this, "Profile has been updated", Toast.LENGTH_LONG).show();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -50,6 +50,12 @@ public class LogIn extends AppCompatActivity {
 | 
			
		|||
                        startActivity(intent);
 | 
			
		||||
                        finish();
 | 
			
		||||
                    }
 | 
			
		||||
                    else if(user.getRole()=="ServiceProvider"){
 | 
			
		||||
                        Intent intent = new Intent(getApplicationContext(),ServiceProviderWelcome.class);
 | 
			
		||||
                        intent.putExtra("username", username);
 | 
			
		||||
                        startActivity(intent);
 | 
			
		||||
                        finish();
 | 
			
		||||
                    }
 | 
			
		||||
                    else {
 | 
			
		||||
                        Intent intent = new Intent(getApplicationContext(),Welcome.class);
 | 
			
		||||
                        intent.putExtra("username", username);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,65 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.app.TimePickerDialog;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.support.v7.app.AppCompatActivity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.widget.Button;
 | 
			
		||||
import android.widget.TimePicker;
 | 
			
		||||
 | 
			
		||||
import java.util.Calendar;
 | 
			
		||||
 | 
			
		||||
public class ServiceProviderAvailabilities extends AppCompatActivity {
 | 
			
		||||
    private String username;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_service_provider_availabilities);
 | 
			
		||||
        Bundle bundle = getIntent().getExtras();
 | 
			
		||||
        username = bundle.getString("username");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public void onClick(View v) {
 | 
			
		||||
            // Get Current Time
 | 
			
		||||
            final Calendar c = Calendar.getInstance();
 | 
			
		||||
            int hour = c.get(Calendar.HOUR_OF_DAY);
 | 
			
		||||
            int minute = c.get(Calendar.MINUTE);
 | 
			
		||||
 | 
			
		||||
            final Button button = (Button)v;
 | 
			
		||||
 | 
			
		||||
            // Launch Time Picker Dialog
 | 
			
		||||
            TimePickerDialog timePickerDialog = new TimePickerDialog(this,
 | 
			
		||||
                    new TimePickerDialog.OnTimeSetListener() {
 | 
			
		||||
 | 
			
		||||
                        @Override
 | 
			
		||||
                        public void onTimeSet(TimePicker view, int hourOfDay,
 | 
			
		||||
                                              int minute) {
 | 
			
		||||
                            button.setText(hourOfDay + ":" + minute);
 | 
			
		||||
 | 
			
		||||
                            //set availibility for service provider and check start time is less than finish
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                    }, hour, minute, false);
 | 
			
		||||
            timePickerDialog.show();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void onRemove(View view){
 | 
			
		||||
        //set time to Start/End, set availibility for start and end to null
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Override so that previous screen refreshes when pressing the
 | 
			
		||||
     * back button on this activity of the app.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onBackPressed(){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(),ServiceProviderWelcome.class);
 | 
			
		||||
        intent.putExtra("username", username);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,234 @@
 | 
			
		|||
package com.uottawa.olympus.olympusservices;
 | 
			
		||||
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.support.annotation.NonNull;
 | 
			
		||||
import android.support.design.widget.Snackbar;
 | 
			
		||||
import android.support.v4.app.DialogFragment;
 | 
			
		||||
import android.support.v7.app.AppCompatActivity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.support.v7.widget.LinearLayoutManager;
 | 
			
		||||
import android.support.v7.widget.RecyclerView;
 | 
			
		||||
import android.view.LayoutInflater;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.view.ViewGroup;
 | 
			
		||||
import android.widget.ArrayAdapter;
 | 
			
		||||
import android.widget.ListAdapter;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
import com.jaredrummler.materialspinner.MaterialSpinner;
 | 
			
		||||
 | 
			
		||||
import java.util.Iterator;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates the view and dialog listener for List of services
 | 
			
		||||
 * which the admin can view and manipulate.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class ServiceProviderServicesList extends AppCompatActivity implements DeleteServiceDialogFragment.NoticeDialogListener{
 | 
			
		||||
 | 
			
		||||
    //field for RecyclerView
 | 
			
		||||
    private RecyclerView mRecyclerView;
 | 
			
		||||
    //field for adapter of Recycler view
 | 
			
		||||
    private RecyclerView.Adapter mAdapter;
 | 
			
		||||
    //field for layout manager of Recyler view.
 | 
			
		||||
    private RecyclerView.LayoutManager mLayoutManager;
 | 
			
		||||
 | 
			
		||||
    private String username;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * On creation loads up the xml, and generates the services list,
 | 
			
		||||
     * and fillsout the recylerView fields.
 | 
			
		||||
     *
 | 
			
		||||
     * @param savedInstanceState Bundle to transfer information.
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_service_provider_services_list);
 | 
			
		||||
 | 
			
		||||
        Bundle bundle = getIntent().getExtras();
 | 
			
		||||
        username = bundle.getString("username");
 | 
			
		||||
        DBHelper dbHelper = new DBHelper(this);
 | 
			
		||||
 | 
			
		||||
        //grid
 | 
			
		||||
        List<String[]> serviceslist2 = dbHelper.getAllServices();
 | 
			
		||||
        Service[] services2 = new Service[(serviceslist2.size())];
 | 
			
		||||
        Iterator iter2 = serviceslist2.iterator();
 | 
			
		||||
        for (int i=0; i<serviceslist2.size();i++){
 | 
			
		||||
            String[] current = (String[])iter2.next();
 | 
			
		||||
            services2[i] = new Service(current[0], Double.parseDouble(current[1]));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        mRecyclerView = (RecyclerView) findViewById(R.id.Services);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        mLayoutManager = new LinearLayoutManager(this);
 | 
			
		||||
        mRecyclerView.setLayoutManager(mLayoutManager);
 | 
			
		||||
 | 
			
		||||
        mAdapter = new MyAdapter(services2, this);
 | 
			
		||||
        mRecyclerView.setAdapter(mAdapter);
 | 
			
		||||
 | 
			
		||||
        //spinner
 | 
			
		||||
        MaterialSpinner spinner = findViewById(R.id.ServicesInput);
 | 
			
		||||
 | 
			
		||||
        List<String[]> serviceslist = dbHelper.getAllServices();
 | 
			
		||||
        String[] services = new String[(serviceslist.size())];
 | 
			
		||||
        Iterator iter = serviceslist.iterator();
 | 
			
		||||
        for (int i=0; i<serviceslist.size();i++){
 | 
			
		||||
            String[] current = (String[])iter.next();
 | 
			
		||||
            services[i] = current[0];
 | 
			
		||||
        }
 | 
			
		||||
        ArrayAdapter<String> servicesadapter = new ArrayAdapter<String>
 | 
			
		||||
                (this, android.R.layout.simple_spinner_item, services);
 | 
			
		||||
 | 
			
		||||
        servicesadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
 | 
			
		||||
 | 
			
		||||
        spinner.setAdapter(servicesadapter);
 | 
			
		||||
 | 
			
		||||
        spinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() {
 | 
			
		||||
 | 
			
		||||
            @Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
 | 
			
		||||
                Snackbar.make(view, "Clicked " + item, Snackbar.LENGTH_LONG).show();
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Override so that previous screen refreshes when pressing the
 | 
			
		||||
     * back button on this activity of the app.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onBackPressed(){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(),ServiceProviderWelcome.class);
 | 
			
		||||
        intent.putExtra("username", username);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Deletes services from the list.
 | 
			
		||||
     *
 | 
			
		||||
     * @param view View object contains the generated list and buttons
 | 
			
		||||
     */
 | 
			
		||||
    public void deleteService(View view, String name) {
 | 
			
		||||
        DialogFragment newFragment = new DeleteServiceDialogFragment();
 | 
			
		||||
        newFragment.show(getSupportFragmentManager(), "addService");
 | 
			
		||||
        Bundle args = new Bundle();
 | 
			
		||||
        args.putString("name", name);
 | 
			
		||||
        newFragment.setArguments(args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Adds service to the list.
 | 
			
		||||
     *
 | 
			
		||||
     * @param view View object contains the generated list and buttons
 | 
			
		||||
     */
 | 
			
		||||
    public void addService(View view, String name) {
 | 
			
		||||
        MaterialSpinner spinner = findViewById(R.id.RoleInput);
 | 
			
		||||
        String servicename = spinner.getText().toString();
 | 
			
		||||
        //add service to service provider if doesn't already exist
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Uses Dialog to delete a service from the serviceList.
 | 
			
		||||
     *
 | 
			
		||||
     * @param dialog DialogFragment that contains the delete service button.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onDialogDelete(DialogFragment dialog) {
 | 
			
		||||
        DBHelper dbHelper = new DBHelper(this);
 | 
			
		||||
        String name = (String)dialog.getArguments().get("name");
 | 
			
		||||
        //remove service from service provider
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        dialog.dismiss();
 | 
			
		||||
        this.recreate();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Does nothing
 | 
			
		||||
     *
 | 
			
		||||
     * @param dialog DialogFragment that contains the cancel button.
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onDialogNevermind(DialogFragment dialog) {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ServicesHolder> {
 | 
			
		||||
 | 
			
		||||
        private Service[] services;
 | 
			
		||||
        private Context context;
 | 
			
		||||
 | 
			
		||||
        // Provide a reference to the views for each data item
 | 
			
		||||
        // Complex data items may need more than one view per item, and
 | 
			
		||||
        // you provide access to all the views for a data item in a view holder
 | 
			
		||||
 | 
			
		||||
        // Provide a suitable constructor (depends on the kind of dataset)
 | 
			
		||||
        public MyAdapter(Service[] services, Context context) {
 | 
			
		||||
            this.services = services;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Create new views (invoked by the layout manager)
 | 
			
		||||
        @NonNull
 | 
			
		||||
        @Override
 | 
			
		||||
        public ServicesHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
 | 
			
		||||
            View v = LayoutInflater.from(parent.getContext())
 | 
			
		||||
                    .inflate(R.layout.list_item, parent, false);
 | 
			
		||||
            ServicesHolder vh = new ServicesHolder(v);
 | 
			
		||||
            return vh;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Replace the contents of a view (invoked by the layout manager)
 | 
			
		||||
        @Override
 | 
			
		||||
        public void onBindViewHolder(ServicesHolder holder, int position) {
 | 
			
		||||
            Service service = services[position];
 | 
			
		||||
            holder.name.setText(service.getName());
 | 
			
		||||
            holder.rate.setText(String.format("$%,.2f", service.getRate()));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Return the size of your dataset (invoked by the layout manager)
 | 
			
		||||
        @Override
 | 
			
		||||
        public int getItemCount() {
 | 
			
		||||
            return services.length;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        class ServicesHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
 | 
			
		||||
 | 
			
		||||
            TextView name;
 | 
			
		||||
            TextView rate;
 | 
			
		||||
 | 
			
		||||
            public ServicesHolder(View row){
 | 
			
		||||
                super(row);
 | 
			
		||||
                name = row.findViewById(R.id.Name);
 | 
			
		||||
                rate = row.findViewById(R.id.Rate);
 | 
			
		||||
                row.setOnClickListener(this);
 | 
			
		||||
            }
 | 
			
		||||
            @Override
 | 
			
		||||
            public void onClick(View view) {
 | 
			
		||||
                TextView nameview = (TextView)view.findViewById(R.id.Name);
 | 
			
		||||
                String name = nameview.getText().toString();
 | 
			
		||||
                deleteService(view, name);
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2,12 +2,83 @@ package com.uottawa.olympus.olympusservices;
 | 
			
		|||
 | 
			
		||||
import android.support.v7.app.AppCompatActivity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Welcome class creates the welcome screen for the HomeOwners and ServiceProviders
 | 
			
		||||
 * as a temporary screen until full functionality of those two a classes are
 | 
			
		||||
 * implemented.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class ServiceProviderWelcome extends AppCompatActivity {
 | 
			
		||||
    String username;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * On creation of this object the app will display the xml file for
 | 
			
		||||
     * the welcome page which gets the role and username of the UserType
 | 
			
		||||
     * object and welcomes the user with a message.
 | 
			
		||||
     *
 | 
			
		||||
     * @param savedInstanceState Bundle to transfer data
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_service_provider_welcome);
 | 
			
		||||
        Bundle bundle = getIntent().getExtras();
 | 
			
		||||
        username = bundle.getString("username");
 | 
			
		||||
        DBHelper dbHelper = new DBHelper(this);
 | 
			
		||||
        UserType user;
 | 
			
		||||
        user = dbHelper.findUserByUsername(username);
 | 
			
		||||
        TextView welcome = findViewById(R.id.Welcome);
 | 
			
		||||
        welcome.setText("Welcome "+user.getFirstname()+ " you are logged in as a Service Provider");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Override so that nothing occurs when pressing the
 | 
			
		||||
     * back button on this activity of the app.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onBackPressed(){
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Logs out the user and returns them back to
 | 
			
		||||
     * main activity. End all current user activity
 | 
			
		||||
     * for security purposes.
 | 
			
		||||
     *
 | 
			
		||||
     * @param view View object of current activity.
 | 
			
		||||
     */
 | 
			
		||||
    public void LogOut(View view){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(), Main.class);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void EditProfile(View view){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(),EditProfile.class);
 | 
			
		||||
        intent.putExtra("username", username);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void EditServices(View view){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(),ServiceProviderServicesList.class);
 | 
			
		||||
        intent.putExtra("username", username);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
    public void EditAvailabilities(View view){
 | 
			
		||||
        Intent intent = new Intent(getApplicationContext(),ServiceProviderAvailabilities.class);
 | 
			
		||||
        intent.putExtra("username", username);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
        finish();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,7 @@
 | 
			
		|||
    android:paddingRight="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingTop="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".ServicesList">
 | 
			
		||||
    tools:context=".AdminServicesList">
 | 
			
		||||
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,92 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    android:gravity="center_horizontal"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:paddingBottom="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:paddingLeft="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingRight="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingTop="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".EditProfile">
 | 
			
		||||
    <ScrollView
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent">
 | 
			
		||||
        <LinearLayout
 | 
			
		||||
            android:orientation="vertical"
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Title"
 | 
			
		||||
                android:layout_width="300dp"
 | 
			
		||||
                android:layout_height="80dp"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:gravity="center"
 | 
			
		||||
                android:text="Edit Profile"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="30sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                app:fontFamily="@font/julius_sans_one" />
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            //component used from https://github.com/rengwuxian/MaterialEditText
 | 
			
		||||
 | 
			
		||||
            <com.rengwuxian.materialedittext.MaterialEditText
 | 
			
		||||
                android:id="@+id/FirstNameInput"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="80dp"
 | 
			
		||||
                android:layout_marginTop="30dp"
 | 
			
		||||
                android:background="@drawable/customborder"
 | 
			
		||||
                android:hint="First Name"
 | 
			
		||||
                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
 | 
			
		||||
                android:id="@+id/LastNameInput"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="80dp"
 | 
			
		||||
                android:background="@drawable/customborder"
 | 
			
		||||
                android:hint="Last Name"
 | 
			
		||||
                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
 | 
			
		||||
                android:id="@+id/PasswordInput"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="80dp"
 | 
			
		||||
                android:background="@drawable/customborder"
 | 
			
		||||
                android:hint="Password"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                app:met_baseColor="@android:color/white"
 | 
			
		||||
                app:met_floatingLabel="highlight"
 | 
			
		||||
                app:met_primaryColor="@color/colorWhite"
 | 
			
		||||
                app:met_singleLineEllipsis="true"
 | 
			
		||||
                android:inputType="textPassword"
 | 
			
		||||
                android:textCursorDrawable="@color/colorWhite"/>
 | 
			
		||||
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/SignUp"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Save"
 | 
			
		||||
                android:onClick="Save"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </LinearLayout>
 | 
			
		||||
    </ScrollView>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
| 
						 | 
				
			
			@ -16,8 +16,9 @@
 | 
			
		|||
    <TextView
 | 
			
		||||
        android:id="@+id/Title"
 | 
			
		||||
        android:layout_width="300dp"
 | 
			
		||||
        android:layout_height="50dp"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_marginBottom="20dp"
 | 
			
		||||
        android:paddingTop="20dp"
 | 
			
		||||
        android:gravity="center"
 | 
			
		||||
        android:text="@string/login"
 | 
			
		||||
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,350 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    android:gravity="center_horizontal"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:paddingBottom="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:paddingLeft="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingRight="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingTop="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".ServiceProviderAvailabilities">
 | 
			
		||||
    <TableLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent">
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Day"
 | 
			
		||||
                android:layout_width="100dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Day"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Start"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:paddingLeft="20dp"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/End"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:paddingLeft="20dp"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Monday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Monday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/MondayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/MondayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteMon"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Tuesday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Tuesday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/TuesdayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/TuesdayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteTuesday"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Wednesday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Wednesday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/WednesdayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/WednesdayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteWednesday"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Thursday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Thursday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/ThursdayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/ThursdayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteThursday"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Friday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Friday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/FridayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/FridayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteFriday"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Saturday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Saturday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/SaturdayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/SaturdayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteSaturday"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_marginTop="10dp">
 | 
			
		||||
 | 
			
		||||
            <TextView
 | 
			
		||||
                android:id="@+id/Sunday"
 | 
			
		||||
                android:layout_width="105dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginBottom="10dp"
 | 
			
		||||
                android:text="Sunday"
 | 
			
		||||
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
                android:textColor="@android:color/white"
 | 
			
		||||
                android:textSize="15sp"
 | 
			
		||||
                android:layout_marginTop="10dp"
 | 
			
		||||
                android:layout_gravity="center_vertical"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/SundayStart"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Start"
 | 
			
		||||
                android:theme="@style/AppTheme.Button"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:layout_marginRight="10dp"/>
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/SundayEnd"
 | 
			
		||||
                android:layout_width="80dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="End"
 | 
			
		||||
                android:layout_marginRight="10dp"
 | 
			
		||||
                android:onClick="onClick"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/DeleteSunday"
 | 
			
		||||
                android:layout_width="50dp"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="X"
 | 
			
		||||
                android:onClick="onRemove"
 | 
			
		||||
                android:theme="@style/AppTheme.Button" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
    </TableLayout>
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,98 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    android:gravity="center_horizontal"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:paddingBottom="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:paddingLeft="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingRight="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingTop="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".ServiceProviderServicesList">
 | 
			
		||||
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:orientation="horizontal"
 | 
			
		||||
        android:paddingBottom="10dp">
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
            android:id="@+id/Title1"
 | 
			
		||||
            android:layout_width="300dp"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:paddingLeft="10dp"
 | 
			
		||||
            android:layout_marginBottom="5dp"
 | 
			
		||||
            android:layout_marginTop="10dp"
 | 
			
		||||
            android:layout_weight="1"
 | 
			
		||||
            android:text="Name"
 | 
			
		||||
            android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
            android:textColor="@android:color/white"
 | 
			
		||||
            android:textSize="15sp" />
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
            android:id="@+id/Title2"
 | 
			
		||||
            android:layout_width="300dp"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:layout_marginBottom="5dp"
 | 
			
		||||
            android:layout_marginTop="10dp"
 | 
			
		||||
            android:layout_weight="1"
 | 
			
		||||
            android:text="Hourly Rate"
 | 
			
		||||
            android:gravity="end"
 | 
			
		||||
            android:paddingRight="10dp"
 | 
			
		||||
            android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
            android:textColor="@android:color/white"
 | 
			
		||||
            android:textSize="15sp" />
 | 
			
		||||
    </LinearLayout>
 | 
			
		||||
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
        <android.support.v7.widget.RecyclerView
 | 
			
		||||
            android:id="@+id/Services"
 | 
			
		||||
            android:scrollbars="vertical"
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="300dp"/>
 | 
			
		||||
 | 
			
		||||
    </LinearLayout>
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/Title3"
 | 
			
		||||
        android:layout_width="300dp"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_marginBottom="5dp"
 | 
			
		||||
        android:layout_marginTop="10dp"
 | 
			
		||||
        android:gravity="center"
 | 
			
		||||
        android:text="Click on service to remove"
 | 
			
		||||
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
        android:textColor="@android:color/white"
 | 
			
		||||
        android:textSize="15sp" />
 | 
			
		||||
    // component used from https://github.com/jaredrummler/MaterialSpinner
 | 
			
		||||
 | 
			
		||||
    <LinearLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:orientation="horizontal"
 | 
			
		||||
        android:layout_marginTop="20dp">
 | 
			
		||||
 | 
			
		||||
        <com.jaredrummler.materialspinner.MaterialSpinner
 | 
			
		||||
            android:id="@+id/ServicesInput"
 | 
			
		||||
            android:layout_width="250dp"
 | 
			
		||||
            android:layout_height="45dp"
 | 
			
		||||
            android:layout_weight="1"
 | 
			
		||||
            android:layout_marginTop="5dp"/>
 | 
			
		||||
 | 
			
		||||
        <Button
 | 
			
		||||
            android:id="@+id/newService"
 | 
			
		||||
            android:layout_width="wrap_content"
 | 
			
		||||
            android:layout_height="55dp"
 | 
			
		||||
            android:layout_weight="1"
 | 
			
		||||
            android:onClick="addService"
 | 
			
		||||
            android:text="Add"
 | 
			
		||||
            android:textSize="10sp"
 | 
			
		||||
            android:theme="@style/AppTheme.Button"/>
 | 
			
		||||
    </LinearLayout>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,9 +1,69 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    android:gravity="center_horizontal"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:paddingBottom="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:paddingLeft="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingRight="@dimen/activity_horizontal_margin"
 | 
			
		||||
    android:paddingTop="@dimen/activity_vertical_margin"
 | 
			
		||||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".ServiceProviderWelcome">
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/Welcome"
 | 
			
		||||
        android:layout_width="300dp"
 | 
			
		||||
        android:layout_height="80dp"
 | 
			
		||||
        android:layout_marginBottom="10dp"
 | 
			
		||||
        android:gravity="center"
 | 
			
		||||
        android:text="Welcome"
 | 
			
		||||
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
        android:textColor="@android:color/white"
 | 
			
		||||
        android:textSize="20sp"
 | 
			
		||||
        android:layout_marginTop="10dp"
 | 
			
		||||
        app:fontFamily="@font/julius_sans_one" />
 | 
			
		||||
 | 
			
		||||
</android.support.constraint.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/Profile"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="60dp"
 | 
			
		||||
        android:layout_marginTop="10dp"
 | 
			
		||||
        android:onClick="EditProfile"
 | 
			
		||||
        android:text="Profile"
 | 
			
		||||
        android:theme="@style/AppTheme.Button" />
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/Services"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="60dp"
 | 
			
		||||
        android:layout_marginTop="15dp"
 | 
			
		||||
        android:onClick="EditServices"
 | 
			
		||||
        android:text="Services"
 | 
			
		||||
        android:theme="@style/AppTheme.Button" />
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/Availabilities"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="60dp"
 | 
			
		||||
        android:layout_marginTop="15dp"
 | 
			
		||||
        android:text="Availabilities"
 | 
			
		||||
        android:onClick="EditAvailabilities"
 | 
			
		||||
        android:theme="@style/AppTheme.Button" />
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/Bookings"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="60dp"
 | 
			
		||||
        android:layout_marginTop="20dp"
 | 
			
		||||
        android:text="Bookings"
 | 
			
		||||
        android:theme="@style/AppTheme.Button" />
 | 
			
		||||
    <Button
 | 
			
		||||
        android:id="@+id/LogOut"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="60dp"
 | 
			
		||||
        android:layout_marginTop="15dp"
 | 
			
		||||
        android:onClick="LogOut"
 | 
			
		||||
        android:text="Logout"
 | 
			
		||||
        android:theme="@style/AppTheme.Button" />
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
| 
						 | 
				
			
			@ -13,24 +13,13 @@
 | 
			
		|||
    android:background="@drawable/background"
 | 
			
		||||
    tools:context=".SignUp">
 | 
			
		||||
    <ScrollView
 | 
			
		||||
        android:layout_width="wrap_content"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="wrap_content">
 | 
			
		||||
        <LinearLayout
 | 
			
		||||
            android:orientation="vertical"
 | 
			
		||||
            android:layout_width="wrap_content"
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/Title"
 | 
			
		||||
        android:layout_width="300dp"
 | 
			
		||||
        android:layout_height="20dp"
 | 
			
		||||
        android:layout_marginBottom="10dp"
 | 
			
		||||
        android:gravity="center"
 | 
			
		||||
        android:text="@string/signup"
 | 
			
		||||
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
        android:textColor="@android:color/white"
 | 
			
		||||
        android:textSize="15sp"
 | 
			
		||||
        app:fontFamily="@font/julius_sans_one" />
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/textView"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,23 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    android:orientation="vertical"
 | 
			
		||||
    android:layout_width="wrap_content"
 | 
			
		||||
    android:layout_height="wrap_content">
 | 
			
		||||
 | 
			
		||||
    <TextView
 | 
			
		||||
        android:id="@+id/Title1"
 | 
			
		||||
        android:layout_width="300dp"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:layout_marginTop="20dp"
 | 
			
		||||
        android:layout_weight="1"
 | 
			
		||||
        android:text="Are you sure you want to delete this service?"
 | 
			
		||||
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
 | 
			
		||||
        android:textColor="@android:color/black"
 | 
			
		||||
        android:textSize="15sp"
 | 
			
		||||
        android:layout_marginLeft="20dp"
 | 
			
		||||
        android:layout_marginRight="20dp"
 | 
			
		||||
        android:textAlignment="center"/>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue