diff --git a/Deliverable3.zip b/Deliverable3.zip
new file mode 100644
index 0000000..199d0fd
Binary files /dev/null and b/Deliverable3.zip differ
diff --git a/OlympusServices/app/src/main/AndroidManifest.xml b/OlympusServices/app/src/main/AndroidManifest.xml
index fe68bbe..a42982d 100644
--- a/OlympusServices/app/src/main/AndroidManifest.xml
+++ b/OlympusServices/app/src/main/AndroidManifest.xml
@@ -60,7 +60,7 @@
android:name=".EditProfile"
android:label="Edit Profile"
android:screenOrientation="portrait"
- android:windowSoftInputMode="stateHidden"/>
+ android:windowSoftInputMode="stateHidden" />
-
+ android:screenOrientation="portrait" />
+
+
+
+
+
\ No newline at end of file
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java
new file mode 100644
index 0000000..c3d9de1
--- /dev/null
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java
@@ -0,0 +1,124 @@
+package com.uottawa.olympus.olympusservices;
+
+public class Booking {
+ private int starth;
+ private int startmin;
+ private int endh;
+ private int endmin;
+ private int day;
+ private int month;
+ private int year;
+ private String serviceprovider; //username
+ private String homeowner; //username
+ public enum Status {
+ PENDING, CONFIRMED, CANCELLED
+ }
+ private Status status;
+
+ int rating; //out of 5
+
+ public Booking(int starth, int startmin, int endh, int endmin, int day, int month, int year,
+ String serviceprovider, String homeowner){
+ this.starth = starth;
+ this.startmin = startmin;
+ this.endh = endh;
+ this.endmin = endmin;
+ this.day = day;
+ this.month = month;
+ this.year = year;
+ this.serviceprovider = serviceprovider;
+ this.homeowner = homeowner;
+ this.status = Status.PENDING;
+ }
+
+
+ public int getStarth() {
+ return starth;
+ }
+
+ public void setStarth(int starth) {
+ this.starth = starth;
+ }
+
+ public int getStartmin() {
+ return startmin;
+ }
+
+ public void setStartmin(int startmin) {
+ this.startmin = startmin;
+ }
+
+ public int getEndh() {
+ return endh;
+ }
+
+ public void setEndh(int endh) {
+ this.endh = endh;
+ }
+
+ public int getEndmin() {
+ return endmin;
+ }
+
+ public void setEndmin(int endmin) {
+ this.endmin = endmin;
+ }
+
+ public int getDay() {
+ return day;
+ }
+
+ public void setDay(int day) {
+ this.day = day;
+ }
+
+ public int getMonth() {
+ return month;
+ }
+
+ public void setMonth(int month) {
+ this.month = month;
+ }
+
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+
+ public String getServiceprovider() {
+ return serviceprovider;
+ }
+
+ public void setServiceprovider(String serviceprovider) {
+ this.serviceprovider = serviceprovider;
+ }
+
+ public String getHomeowner() {
+ return homeowner;
+ }
+
+ public void setHomeowner(String homeowner) {
+ this.homeowner = homeowner;
+ }
+
+ public void setStatus(Status status){
+ this.status = status;
+ }
+
+ public Status getStatus(){
+ return this.status;
+ }
+
+ public int getRating() {
+ return rating;
+ }
+
+ public void setRating(int rating) {
+ this.rating = rating;
+ }
+
+
+}
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java
index 6d0e729..e48f01f 100644
--- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/DBHelper.java
@@ -353,7 +353,7 @@ public class DBHelper extends SQLiteOpenHelper {
if (phonenumber != null && !phonenumber.equals(""))values.put(COLUMN_PHONE, phonenumber);
if (companyname != null && !companyname.equals(""))values.put(COLUMN_COMPANY, companyname);
if (licensed != null) values.put(COLUMN_LICENSED, String.valueOf(licensed));
- if (description != null && !description.equals(""))values.put(COLUMN_DESCRIPTION, description);
+ if (description != null )values.put(COLUMN_DESCRIPTION, description);
return writeDB.update(TABLE_LOGIN, values, COLUMN_USERNAME+" = ?",
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/FindServiceProvider.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/FindServiceProvider.java
new file mode 100644
index 0000000..895f2d0
--- /dev/null
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/FindServiceProvider.java
@@ -0,0 +1,315 @@
+package com.uottawa.olympus.olympusservices;
+
+import android.app.DatePickerDialog;
+import android.app.TimePickerDialog;
+import android.content.Context;
+import android.content.Intent;
+import android.support.annotation.NonNull;
+import android.support.design.widget.Snackbar;
+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.Button;
+import android.widget.DatePicker;
+import android.widget.RatingBar;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+
+import com.jaredrummler.materialspinner.MaterialSpinner;
+
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+
+public class FindServiceProvider extends AppCompatActivity {
+ String username;
+ DBHelper dbHelper;
+
+ //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;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_find_service_provider);
+ Bundle bundle = getIntent().getExtras();
+ username = bundle.getString("username");
+
+ MaterialSpinner spinner = findViewById(R.id.RatingInput);
+ spinner.setItems("",1, 2, 3, 4, 5);
+
+ dbHelper = new DBHelper(this);
+ MaterialSpinner spinner2 = findViewById(R.id.ServicesInput);
+
+ List serviceslist = dbHelper.getAllServices();
+ String[] services = new String[(serviceslist.size())];
+ Iterator iter = serviceslist.iterator();
+ for (int i=0; itime[0]){
+ return true;
+ }else{
+ if(time[2]==time[0]&&time[3]>time[1]){
+ return true;
+ }else{
+ return false;
+ }
+ }
+ }
+
+
+ public class MyAdapter extends RecyclerView.Adapter {
+
+ private ServiceProvider[] serviceProviders;
+ 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(ServiceProvider[] serviceProviders, Context context) {
+ this.serviceProviders = serviceProviders;
+ }
+
+ // Create new views (invoked by the layout manager)
+ @NonNull
+ @Override
+ public ProviderHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View v = LayoutInflater.from(parent.getContext())
+ .inflate(R.layout.service_list_item, parent, false);
+ ProviderHolder vh = new ProviderHolder(v);
+ return vh;
+ }
+
+ // Replace the contents of a view (invoked by the layout manager)
+ @Override
+ public void onBindViewHolder(ProviderHolder holder, int position) {
+ ServiceProvider serviceprovider = serviceProviders[position];
+ holder.name.setText(serviceprovider.getFirstname()+" "+serviceprovider.getLastname());
+ holder.rate.setText("5");
+ //serviceprovider.getRating()
+
+
+
+ }
+
+ // Return the size of your dataset (invoked by the layout manager)
+ @Override
+ public int getItemCount() {
+ return serviceProviders.length;
+ }
+
+ class ProviderHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
+
+ TextView name;
+ TextView rate;
+
+ public ProviderHolder(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();
+ makeBooking(name);
+
+ }
+
+
+ }
+
+
+ }
+}
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/HomeOwnerBookings.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/HomeOwnerBookings.java
new file mode 100644
index 0000000..432bc80
--- /dev/null
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/HomeOwnerBookings.java
@@ -0,0 +1,30 @@
+package com.uottawa.olympus.olympusservices;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class HomeOwnerBookings extends AppCompatActivity {
+ String username;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_home_owner_bookings);
+ Bundle bundle = getIntent().getExtras();
+ username = bundle.getString("username");
+ }
+
+ /**
+ * 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(),Welcome.class);
+ intent.putExtra("username", username);
+ startActivity(intent);
+ finish();
+ }
+}
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/MakeBooking.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/MakeBooking.java
new file mode 100644
index 0000000..ba73427
--- /dev/null
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/MakeBooking.java
@@ -0,0 +1,166 @@
+package com.uottawa.olympus.olympusservices;
+
+import android.app.DatePickerDialog;
+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.DatePicker;
+import android.widget.TextView;
+import android.widget.TimePicker;
+
+import java.util.Calendar;
+
+public class MakeBooking extends AppCompatActivity {
+ String homeowner;
+ String serviceprovider;
+ String service;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_make_booking);
+ Bundle bundle = getIntent().getExtras();
+ homeowner = bundle.getString("homeowner");
+ serviceprovider = bundle.getString("serviceprovider");
+ service = bundle.getString("service");
+
+ TextView homeo = findViewById(R.id.HomeOwner);
+ TextView servicep = findViewById(R.id.ServiceProvider);
+ TextView serv = findViewById(R.id.Service);
+
+ homeo.setText("Home Owner: \n"+homeowner);
+ servicep.setText("ServiceProvider: \n"+serviceprovider);
+ serv.setText("Service: \n"+service);
+
+ }
+
+ @Override
+ public void onBackPressed(){
+ Intent intent = new Intent(getApplicationContext(),Welcome.class);
+ intent.putExtra("username", homeowner);
+ startActivity(intent);
+ finish();
+ }
+ public void Cancel(View view){
+ onBackPressed();
+ }
+
+ public void Book(View view){
+ //
+ }
+
+ public void onClickDate(View view){
+
+ final Button button = (Button)view;
+ final Calendar c = Calendar.getInstance();
+
+ DatePickerDialog datePickerDialog = new DatePickerDialog(this,
+ new DatePickerDialog.OnDateSetListener() {
+
+ @Override
+ public void onDateSet(DatePicker view, int year, int month, int day) {
+ Calendar newDate = Calendar.getInstance();
+ newDate.set(year, month, day);
+ String daystring;
+ String monthstring;
+ if((""+day).length()==1){
+ daystring = "0"+day;
+ }
+ else{
+ daystring = day+"";
+ }
+ if((""+month).length()==1){
+ monthstring = "0"+month;
+ }
+ else{
+ monthstring = ""+month;
+ }
+ button.setText(monthstring + " / " + daystring + " / "
+ + year);
+ }
+
+ }, c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));
+ datePickerDialog.show();
+
+ }
+
+
+ public void onClickTime(View view){
+ final Calendar c = Calendar.getInstance();
+ int hour = c.get(Calendar.HOUR_OF_DAY);
+ int minute = c.get(Calendar.MINUTE);
+ final Button button = (Button)view;
+
+ // Launch Time Picker Dialog
+ TimePickerDialog timePickerDialog = new TimePickerDialog(this,
+ new TimePickerDialog.OnTimeSetListener() {
+
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay,
+ int minute) {
+ String time = "";
+
+ button.setText(formatTime(hourOfDay,minute));
+ //set availibility for service provider and check start time is less than finish
+ }
+
+ }, hour, minute, false);
+ timePickerDialog.show();
+
+ }
+
+ private String formatTime(int hours, int minutes){
+ String time = "";
+ if(hours<10){
+ time = time+"0"+hours+":";
+ }else{
+ time = time+hours+":";
+ }
+ if (minutes<10){
+ time = time+"0"+minutes;
+ }
+ else {
+ time = time+minutes;
+ }
+ return time;
+ }
+
+ private int[] parseTime(String startTime, String endTime){
+ int[] times = new int[4];
+ if(startTime.equals("START")){
+ times[0]=0;
+ times[1]=0;
+ }else{
+ times[0] = Integer.parseInt(startTime.substring(0,2));
+ times[1] = Integer.parseInt(startTime.substring(3));
+ }
+ if(endTime.equals("END")){
+ times[2]=0;
+ times[3]=0;
+ }else{
+ times[2] = Integer.parseInt(endTime.substring(0,2));
+ times[3] = Integer.parseInt(endTime.substring(3));
+ }
+ return times;
+ }
+
+ private boolean validateTime(int[] time){
+ if(time[0]==0&&time[1]==0&&time[2]==0&&time[3]==0){
+ return true;
+ }
+ if(time[2]>time[0]){
+ return true;
+ }else{
+ if(time[2]==time[0]&&time[3]>time[1]){
+ return true;
+ }else{
+ return false;
+ }
+ }
+ }
+
+
+}
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java
index 16f190c..35839c8 100644
--- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java
@@ -30,6 +30,7 @@ public class ServiceProvider extends UserType {
private String companyname;
private boolean licensed;
private String description;
+ private int rating;
@@ -53,6 +54,7 @@ public class ServiceProvider extends UserType {
this.companyname = companyname;
this.licensed = licensed;
this.description = "";
+ this.rating = 0;
}
ServiceProvider(String username, String password, String firstname, String lastname, String address,
@@ -162,4 +164,12 @@ public class ServiceProvider extends UserType {
this.description = description;
}
+ public int getRating() {
+ return rating;
+ }
+
+ public void setRating(int rating) {
+ this.rating = rating;
+ }
+
}
\ No newline at end of file
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderBookings.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderBookings.java
new file mode 100644
index 0000000..8d1ccff
--- /dev/null
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderBookings.java
@@ -0,0 +1,30 @@
+package com.uottawa.olympus.olympusservices;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class ServiceProviderBookings extends AppCompatActivity {
+ String username;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_service_provider_bookings);
+ Bundle bundle = getIntent().getExtras();
+ username = bundle.getString("username");
+ }
+
+ /**
+ * 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();
+ }
+}
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..36105c0 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.
*/
@@ -83,15 +83,6 @@ public class ServiceProviderServicesList extends AppCompatActivity implements De
spinner.setItems(services);
-
-
- spinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener() {
-
- @Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
- Snackbar.make(view, "Clicked " + item, Snackbar.LENGTH_LONG).show();
- }
- });
-
}
@@ -207,6 +198,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 +210,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);
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderWelcome.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderWelcome.java
index efa2570..448c1d9 100644
--- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderWelcome.java
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProviderWelcome.java
@@ -32,8 +32,7 @@ public class ServiceProviderWelcome extends AppCompatActivity {
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");
-
+ welcome.setText("Welcome "+user.getFirstname()+ " you are logged in as a Home Owner");
}
@@ -79,6 +78,12 @@ public class ServiceProviderWelcome extends AppCompatActivity {
startActivity(intent);
finish();
}
+ public void SeeBookings(View view){
+ Intent intent = new Intent(getApplicationContext(),ServiceProviderBookings.class);
+ intent.putExtra("username", username);
+ startActivity(intent);
+ finish();
+ }
}
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java
index 1fd1ab0..7eb5913 100644
--- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/SignUpPart2.java
@@ -37,12 +37,12 @@ public class SignUpPart2 extends AppCompatActivity {
if(companyname.length()>0 && address.length()>0 && phonenumber.length()>0
&& companyname.matches("^[a-zA-Z0-9_ ]*$") && address.matches("^[a-zA-Z0-9_ ]*$")
&& phonenumber.matches("^(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$")
+ && description.matches("^[a-zA-Z0-9_ ]*$")
&& companyname.replaceAll("\\s+","").length()>0
&& address.replaceAll("\\s+","").length()>0) {
ServiceProvider serviceProvider = new ServiceProvider(username, password, firstname, lastname,
- address, phonenumber, companyname, licensed);
- serviceProvider.setDescription(description);
+ address, phonenumber, companyname, licensed, description);
if(dbHelper.addUser(serviceProvider)){
startActivity(intent);
finish();
diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Welcome.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Welcome.java
index 24ac48c..a054142 100644
--- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Welcome.java
+++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Welcome.java
@@ -13,6 +13,7 @@ import android.content.Intent;
*
*/
public class Welcome extends AppCompatActivity {
+ String username;
/**
* On creation of this object the app will display the xml file for
@@ -26,14 +27,13 @@ public class Welcome extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
Bundle bundle = getIntent().getExtras();
- String username = bundle.getString("username");
+ username = bundle.getString("username");
DBHelper dbHelper = new DBHelper(this);
UserType user;
user = dbHelper.findUserByUsername(username);
- TextView role = findViewById(R.id.Role);
- TextView name = findViewById(R.id.name);
- role.setText(user.getRole());
- name.setText(user.getFirstname());
+ TextView welcome = findViewById(R.id.Welcome);
+ welcome.setText("Welcome "+user.getFirstname()+ " you are logged in as a Service Provider");
+
}
@@ -60,5 +60,19 @@ public class Welcome extends AppCompatActivity {
finish();
}
+ public void SeeBookings(View view){
+ Intent intent = new Intent(getApplicationContext(),HomeOwnerBookings.class);
+ intent.putExtra("username", username);
+ startActivity(intent);
+ finish();
+ }
+
+ public void FindServiceProvider(View view){
+ Intent intent = new Intent(getApplicationContext(),FindServiceProvider.class);
+ intent.putExtra("username", username);
+ startActivity(intent);
+ finish();
+ }
+
}
diff --git a/OlympusServices/app/src/main/res/layout/activity_admin_welcome.xml b/OlympusServices/app/src/main/res/layout/activity_admin_welcome.xml
index fb775e0..7b91c0e 100644
--- a/OlympusServices/app/src/main/res/layout/activity_admin_welcome.xml
+++ b/OlympusServices/app/src/main/res/layout/activity_admin_welcome.xml
@@ -11,7 +11,7 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/background"
- tools:context=".Welcome">
+ tools:context=".AdminWelcome">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OlympusServices/app/src/main/res/layout/activity_home_owner_bookings.xml b/OlympusServices/app/src/main/res/layout/activity_home_owner_bookings.xml
new file mode 100644
index 0000000..dd7754a
--- /dev/null
+++ b/OlympusServices/app/src/main/res/layout/activity_home_owner_bookings.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/OlympusServices/app/src/main/res/layout/activity_make_booking.xml b/OlympusServices/app/src/main/res/layout/activity_make_booking.xml
new file mode 100644
index 0000000..79c7e1e
--- /dev/null
+++ b/OlympusServices/app/src/main/res/layout/activity_make_booking.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OlympusServices/app/src/main/res/layout/activity_service_provider_bookings.xml b/OlympusServices/app/src/main/res/layout/activity_service_provider_bookings.xml
new file mode 100644
index 0000000..28b14a4
--- /dev/null
+++ b/OlympusServices/app/src/main/res/layout/activity_service_provider_bookings.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/OlympusServices/app/src/main/res/layout/activity_service_provider_welcome.xml b/OlympusServices/app/src/main/res/layout/activity_service_provider_welcome.xml
index 1103a39..903316c 100644
--- a/OlympusServices/app/src/main/res/layout/activity_service_provider_welcome.xml
+++ b/OlympusServices/app/src/main/res/layout/activity_service_provider_welcome.xml
@@ -57,6 +57,7 @@
android:layout_height="60dp"
android:layout_marginTop="20dp"
android:text="Bookings"
+ android:onClick="SeeBookings"
android:theme="@style/AppTheme.Button" />
+ //component used from https://github.com/rengwuxian/MaterialEditText
+
+