├── 0.txt ├── LICENSE ├── README.md ├── RUN_ME.apk ├── Source Code ├── .gitignore ├── .idea │ ├── .name │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── 0.txt ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── final_project │ │ │ ├── BookAppointmentTest.java │ │ │ ├── BookDifferentServiceAppointmentTest.java │ │ │ ├── BookMultipleAppointmentTest.java │ │ │ ├── CancelAppointmentTest.java │ │ │ ├── ExampleInstrumentedTest.kt │ │ │ ├── HoursTest.java │ │ │ ├── InvalidClinicAddressTest.java │ │ │ ├── InvalidClinicNameTest.java │ │ │ ├── InvalidTimeInPastTest.java │ │ │ ├── LocationMapTest.java │ │ │ ├── MainActivityTest.java │ │ │ ├── ServicesTest.java │ │ │ ├── WithoutSettingDateTest.java │ │ │ └── WithoutSettingTimeTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── final_project │ │ │ ├── AddServices.java │ │ │ ├── Admin.java │ │ │ ├── Administrator.java │ │ │ ├── Appointment.java │ │ │ ├── AppointmentFinishedList.java │ │ │ ├── AppointmentUpcomingList.java │ │ │ ├── Booking.java │ │ │ ├── Category.java │ │ │ ├── CheckIn.java │ │ │ ├── ClinicList.java │ │ │ ├── DataBaseService.java │ │ │ ├── DataBaseUser.java │ │ │ ├── Employee.java │ │ │ ├── EmployeeHours.java │ │ │ ├── EmployeeUser.java │ │ │ ├── Hours.java │ │ │ ├── InsuranceType.java │ │ │ ├── MainActivity.java │ │ │ ├── Patient.java │ │ │ ├── PatientUser.java │ │ │ ├── PaymentMethod.java │ │ │ ├── Person.java │ │ │ ├── PickDate.java │ │ │ ├── PickTime.java │ │ │ ├── Profile.java │ │ │ ├── Service.java │ │ │ ├── ServiceList.java │ │ │ ├── ServiceRole.java │ │ │ ├── Services.java │ │ │ ├── SignIn.java │ │ │ ├── SignUp.java │ │ │ ├── SpecificClinic.java │ │ │ ├── User.java │ │ │ ├── UserList.java │ │ │ ├── ViewServices.java │ │ │ ├── ViewUsers.java │ │ │ └── WalkInClinic.java │ │ └── res │ │ ├── drawable-anydpi │ │ ├── ic_geolocate.xml │ │ └── ic_geolocate_black.xml │ │ ├── drawable-hdpi │ │ ├── ic_geolocate.png │ │ └── ic_geolocate_black.png │ │ ├── drawable-mdpi │ │ ├── ic_geolocate.png │ │ └── ic_geolocate_black.png │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ ├── ic_geolocate.png │ │ └── ic_geolocate_black.png │ │ ├── drawable-xxhdpi │ │ ├── ic_geolocate.png │ │ └── ic_geolocate_black.png │ │ ├── drawable │ │ ├── clock.png │ │ ├── ic_launcher_background.xml │ │ ├── info_button.png │ │ ├── logo3.png │ │ └── map.png │ │ ├── layout │ │ ├── activity_add_services.xml │ │ ├── activity_admin.xml │ │ ├── activity_appointment.xml │ │ ├── activity_check_in.xml │ │ ├── activity_employee.xml │ │ ├── activity_employee_hours.xml │ │ ├── activity_hours.xml │ │ ├── activity_main.xml │ │ ├── activity_patient.xml │ │ ├── activity_pick_date.xml │ │ ├── activity_pick_time.xml │ │ ├── activity_profile.xml │ │ ├── activity_services.xml │ │ ├── activity_sign_in.xml │ │ ├── activity_sign_up.xml │ │ ├── activity_specific_clinic.xml │ │ ├── activity_view_services.xml │ │ ├── activity_view_users.xml │ │ ├── appointment_dialog.xml │ │ ├── info_hours_dialog.xml │ │ ├── layout_appointment_finished_list.xml │ │ ├── layout_appointment_list.xml │ │ ├── layout_clinic_list.xml │ │ ├── layout_service_list.xml │ │ ├── layout_user_list.xml │ │ ├── rating_dialog.xml │ │ ├── remove_dialog.xml │ │ └── update_dialog.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── es │ └── 0.txt ├── fr │ └── 0.txt ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── crowdin.yml /0.txt: -------------------------------------------------------------------------------- 1 | Plesae translate this text! 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Tech With Tim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Walk-In-Clinic-Android-App 2 | **My first ever android app!** Written in Java with android studio. This is a walk in clinic organizer/scheduling software. 3 | 4 | This app was co-developed in my software engineering class with 4 other students. My main responsibillity was implementing the back end functionallity and database component. 5 | 6 | ## Running the App 7 | The only way to run this app is to download and run the **RUN_ME.apk** 8 | 9 | Once you run the app you'll need to create an account to sign in! Choose an employee or patient account and start exploring the app! Remember this isn't really built to work in reality. It was built for a school project... 10 | 11 | You won't be able to run the app from the source code as I've removed my firebase credentials. 12 | 13 | ## Known Bugs 14 | LOTS, please don't be too hard on me :0 15 | 16 | ## DataBase Information 17 | This project uses Google Firebase! 18 | 19 | ### Why Is Your Code So Bad?? 20 | Ya about that... So everything that I did in this project I learned as I created it. I have never programmed an android app before and well let's just say you'll be able to tell. The project was not planned or designed very well before development began and therefore there is a lot of redundancy and just horribly written code. Not to mention this project did have a strict deadline and a lot of rules and regulations. Anyways I think it's pretty good for a first try at android development! 21 | 22 | 23 | # 💻 Launch Your Software Development Career Today! 24 | 25 | 🎓 **No degree? No problem!** My program equips you with everything you need to break into tech and land an entry-level software development role. 26 | 27 | 🚀 **Why Join?** 28 | - 💼 **$70k+ starting salary potential** 29 | - 🕐 **Self-paced:** Complete on your own time 30 | - 🤑 **Affordable:** Low risk compared to expensive bootcamps or degrees 31 | - 🎯 **45,000+ job openings** in the market 32 | 33 | 👉 **[Start your journey today!](https://techwithtim.net/dev)** 34 | No experience needed—just your determination. Future-proof your career and unlock six-figure potential like many of our students have! 35 | -------------------------------------------------------------------------------- /RUN_ME.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/RUN_ME.apk -------------------------------------------------------------------------------- /Source Code/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /Source Code/.idea/.name: -------------------------------------------------------------------------------- 1 | final_project -------------------------------------------------------------------------------- /Source Code/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /Source Code/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /Source Code/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /Source Code/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Source Code/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source Code/0.txt: -------------------------------------------------------------------------------- 1 | Translate me into another language please 2 | -------------------------------------------------------------------------------- /Source Code/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Source Code/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.google.gms.google-services' 3 | 4 | android { 5 | compileSdkVersion 29 6 | buildToolsVersion "29.0.2" 7 | defaultConfig { 8 | applicationId "com.example.final_project" 9 | minSdkVersion 23 10 | targetSdkVersion 29 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | 22 | compileOptions { 23 | sourceCompatibility JavaVersion.VERSION_1_8 24 | targetCompatibility JavaVersion.VERSION_1_8 25 | } 26 | sourceSets { main { java.srcDirs = ['src/main/java', 'src/test'] } } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 32 | implementation 'androidx.appcompat:appcompat:1.1.0' 33 | implementation 'androidx.core:core-ktx:1.1.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 35 | implementation 'com.google.android.gms:play-services-location:16.0.0' 36 | implementation 'com.google.android.gms:play-services-maps:16.1.0' 37 | implementation 'com.google.android.libraries.places:places:1.1.0' 38 | implementation 'com.google.firebase:firebase-database:16.0.4' 39 | implementation 'com.google.android.material:material:1.0.0' 40 | implementation 'com.google.firebase:firebase-auth:16.0.5' 41 | testImplementation 'junit:junit:4.12' 42 | testImplementation 'androidx.test.ext:junit:1.1.0' 43 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 44 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 45 | // Required for instrumented tests 46 | androidTestImplementation 'androidx.annotation:annotation:1.0.0' 47 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 48 | androidTestImplementation 'androidx.test:rules:1.1.0' 49 | androidTestImplementation 'androidx.test:runner:1.1.0' 50 | androidTestImplementation('com.android.support.test.espresso:espresso-contrib:2.2.2') { 51 | exclude group: 'com.android.support', module: 'appcompat' 52 | exclude module: 'support-annotations' 53 | exclude module: 'support-v4' 54 | exclude module: 'support-v13' 55 | exclude module: 'recyclerview-v7' 56 | exclude module: 'appcompat-v7' 57 | } 58 | implementation 'joda-time:joda-time:2.9.4' 59 | } 60 | -------------------------------------------------------------------------------- /Source Code/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/BookAppointmentTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class BookAppointmentTest { 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | @Test 36 | public void changeText_sameActivity() { 37 | 38 | onView(withId(R.id.SignInButton)).perform(click()); 39 | onView(ViewMatchers.withId(R.id.passwordField2)) 40 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 41 | onView(ViewMatchers.withId(R.id.usernameField2)) 42 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 43 | onView(withId(R.id.signInButton)).perform(click()); 44 | while (true) { 45 | try { 46 | onView(withId(R.id.bookButton)).perform(click()); 47 | break; 48 | } catch (Exception e) { 49 | onView(withId(R.id.signInButton)).perform(click()); 50 | } 51 | } 52 | 53 | onView(ViewMatchers.withId(R.id.nameField2)) 54 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 55 | onView(ViewMatchers.withId(R.id.addressField)) 56 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 57 | 58 | onView(withId(R.id.sundayCB)).perform(click()); 59 | onView(withId(R.id.mondayCB)).perform(click()); 60 | onView(withId(R.id.tuesdayCB)).perform(click()); 61 | onView(withId(R.id.wednesdayCB)).perform(click()); 62 | onView(withId(R.id.thursdayCB)).perform(click()); 63 | onView(withId(R.id.fridayCB)).perform(click()); 64 | onView(withId(R.id.saturdayCB)).perform(click()); 65 | onView(withId(R.id.searchBtn)).perform(click()); 66 | try { 67 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 68 | } catch (Exception e) { 69 | System.out.println("No clinic available"); 70 | } 71 | onView(withId(R.id.dateBtn)).perform(click()); 72 | 73 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 14)); 74 | onView(withId(R.id.saveDate)).perform(click()); 75 | onView(withId(R.id.timeBtn)).perform(click()); 76 | onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 77 | onView(withId(R.id.saveTime)).perform(click()); 78 | onView(withId(R.id.bookBtn)).perform(click()); 79 | 80 | 81 | //temporary 82 | onView(withId(R.id.appointmentBtn)).perform(click()); 83 | try { 84 | onData(anything()).inAdapterView(withId(R.id.upcomingAptList)).atPosition(0).perform(click()); 85 | } catch (Exception e) { 86 | System.out.println("No appointment available"); 87 | } 88 | onView(withId(R.id.cancelBtn)).perform(click()); 89 | 90 | 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/BookDifferentServiceAppointmentTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class BookDifferentServiceAppointmentTest { 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | @Test 36 | public void changeText_sameActivity() { 37 | 38 | onView(withId(R.id.SignInButton)).perform(click()); 39 | onView(ViewMatchers.withId(R.id.passwordField2)) 40 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 41 | onView(ViewMatchers.withId(R.id.usernameField2)) 42 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 43 | onView(withId(R.id.signInButton)).perform(click()); 44 | while (true) { 45 | try { 46 | onView(withId(R.id.bookButton)).perform(click()); 47 | break; 48 | } catch (Exception e) { 49 | onView(withId(R.id.signInButton)).perform(click()); 50 | } 51 | } 52 | onView(ViewMatchers.withId(R.id.nameField2)) 53 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 54 | onView(ViewMatchers.withId(R.id.addressField)) 55 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 56 | onView(withId(R.id.searchBtn)).perform(click()); 57 | try { 58 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 59 | } catch (Exception e) { 60 | System.out.println("No clinic available"); 61 | } 62 | onView(withId(R.id.service_spinner)).perform(click()); 63 | try { 64 | onData(anything()).atPosition(1).perform(click()); 65 | } catch (Exception e) { 66 | System.out.println("No service available"); 67 | } 68 | 69 | onView(withId(R.id.dateBtn)).perform(click()); 70 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 14)); 71 | onView(withId(R.id.saveDate)).perform(click()); 72 | onView(withId(R.id.timeBtn)).perform(click()); 73 | onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 74 | onView(withId(R.id.saveTime)).perform(click()); 75 | onView(withId(R.id.bookBtn)).perform(click()); 76 | onView(withId(R.id.appointmentBtn)).perform(click()); 77 | try { 78 | onData(anything()).inAdapterView(withId(R.id.upcomingAptList)).atPosition(0).perform(click()); 79 | } catch (Exception e) { 80 | System.out.println("No appointment available"); 81 | } 82 | onView(withId(R.id.cancelBtn)).perform(click()); 83 | 84 | 85 | 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/BookMultipleAppointmentTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.test.espresso.contrib.PickerActions; 4 | import androidx.test.espresso.matcher.ViewMatchers; 5 | import androidx.test.rule.ActivityTestRule; 6 | 7 | import org.junit.Rule; 8 | import org.junit.Test; 9 | 10 | import static androidx.test.espresso.Espresso.onData; 11 | import static androidx.test.espresso.Espresso.onView; 12 | import static androidx.test.espresso.action.ViewActions.click; 13 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 14 | import static androidx.test.espresso.action.ViewActions.typeText; 15 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 16 | import static org.hamcrest.core.IsAnything.anything; 17 | 18 | public class BookMultipleAppointmentTest { 19 | private Administrator admin; 20 | 21 | @Rule 22 | public ActivityTestRule activityRuleMain 23 | = new ActivityTestRule<>(MainActivity.class); 24 | 25 | @Rule 26 | public ActivityTestRule activityRuleProfile; 27 | 28 | 29 | @Test 30 | public void changeText_sameActivity() { 31 | 32 | onView(withId(R.id.SignInButton)).perform(click()); 33 | onView(ViewMatchers.withId(R.id.passwordField2)) 34 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 35 | onView(ViewMatchers.withId(R.id.usernameField2)) 36 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 37 | onView(withId(R.id.signInButton)).perform(click()); 38 | while (true) { 39 | try { 40 | onView(withId(R.id.bookButton)).perform(click()); 41 | break; 42 | } catch (Exception e) { 43 | onView(withId(R.id.signInButton)).perform(click()); 44 | } 45 | } 46 | 47 | onView(ViewMatchers.withId(R.id.nameField2)) 48 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 49 | onView(ViewMatchers.withId(R.id.addressField)) 50 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 51 | onView(withId(R.id.searchBtn)).perform(click()); 52 | try { 53 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 54 | } catch (Exception e) { 55 | System.out.println("No clinic available"); 56 | } 57 | onView(withId(R.id.dateBtn)).perform(click()); 58 | 59 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 14)); 60 | onView(withId(R.id.saveDate)).perform(click()); 61 | onView(withId(R.id.timeBtn)).perform(click()); 62 | onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 63 | onView(withId(R.id.saveTime)).perform(click()); 64 | onView(withId(R.id.bookBtn)).perform(click()); 65 | onView(withId(R.id.bookButton)).perform(click()); 66 | onView(ViewMatchers.withId(R.id.nameField2)) 67 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 68 | onView(ViewMatchers.withId(R.id.addressField)) 69 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 70 | onView(withId(R.id.searchBtn)).perform(click()); 71 | try { 72 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 73 | } catch (Exception e) { 74 | System.out.println("No clinic available"); 75 | } 76 | onView(withId(R.id.dateBtn)).perform(click()); 77 | 78 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 15)); 79 | onView(withId(R.id.saveDate)).perform(click()); 80 | onView(withId(R.id.timeBtn)).perform(click()); 81 | onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 82 | onView(withId(R.id.saveTime)).perform(click()); 83 | onView(withId(R.id.bookBtn)).perform(click()); 84 | onView(withId(R.id.appointmentBtn)).perform(click()); 85 | for (int i=0;i<2;i++) { 86 | try { 87 | onData(anything()).inAdapterView(withId(R.id.upcomingAptList)).atPosition(0).perform(click()); 88 | } catch (Exception e) { 89 | System.out.println("No appointment available"); 90 | } 91 | onView(withId(R.id.cancelBtn)).perform(click()); 92 | } 93 | 94 | } 95 | } -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/CancelAppointmentTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class CancelAppointmentTest { 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | @Test 36 | public void changeText_sameActivity() { 37 | 38 | onView(withId(R.id.SignInButton)).perform(click()); 39 | onView(ViewMatchers.withId(R.id.passwordField2)) 40 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 41 | onView(ViewMatchers.withId(R.id.usernameField2)) 42 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 43 | onView(withId(R.id.signInButton)).perform(click()); 44 | while (true) { 45 | try { 46 | onView(withId(R.id.bookButton)).perform(click()); 47 | break; 48 | } catch (Exception e) { 49 | onView(withId(R.id.signInButton)).perform(click()); 50 | } 51 | } 52 | onView(ViewMatchers.withId(R.id.nameField2)) 53 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 54 | onView(ViewMatchers.withId(R.id.addressField)) 55 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 56 | onView(withId(R.id.searchBtn)).perform(click()); 57 | try { 58 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 59 | } catch (Exception e) { 60 | System.out.println("No clinic available"); 61 | } 62 | onView(withId(R.id.dateBtn)).perform(click()); 63 | //must increment day each time, for each test 64 | 65 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 14)); 66 | onView(withId(R.id.saveDate)).perform(click()); 67 | onView(withId(R.id.timeBtn)).perform(click()); 68 | onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 69 | onView(withId(R.id.saveTime)).perform(click()); 70 | onView(withId(R.id.bookBtn)).perform(click()); 71 | onView(withId(R.id.appointmentBtn)).perform(click()); 72 | try { 73 | onData(anything()).inAdapterView(withId(R.id.upcomingAptList)).atPosition(0).perform(click()); 74 | } catch (Exception e) { 75 | System.out.println("No appointment available"); 76 | } 77 | onView(withId(R.id.cancelBtn)).perform(click()); 78 | 79 | 80 | 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.final_project 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry; 4 | import androidx.test.ext.junit.runners.AndroidJUnit4; 5 | 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.example.final_project", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/HoursTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import static androidx.test.espresso.Espresso.onView; 4 | import static androidx.test.espresso.action.ViewActions.click; 5 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 6 | import static androidx.test.espresso.action.ViewActions.replaceText; 7 | import static androidx.test.espresso.action.ViewActions.scrollTo; 8 | import static androidx.test.espresso.action.ViewActions.typeText; 9 | import static androidx.test.espresso.assertion.ViewAssertions.matches; 10 | import static androidx.test.espresso.matcher.RootMatchers.withDecorView; 11 | import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; 12 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 13 | import static androidx.test.espresso.matcher.ViewMatchers.withText; 14 | 15 | import static org.hamcrest.Matchers.is; 16 | import static org.hamcrest.Matchers.not; 17 | 18 | import org.junit.After; 19 | import org.junit.Before; 20 | import org.junit.Rule; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import androidx.test.espresso.matcher.ViewMatchers; 25 | import androidx.test.rule.ActivityTestRule; 26 | import androidx.test.runner.AndroidJUnit4; 27 | 28 | import java.util.ArrayList; 29 | import java.util.concurrent.TimeUnit; 30 | 31 | 32 | @RunWith(AndroidJUnit4.class) 33 | 34 | public class HoursTest { 35 | 36 | @Rule 37 | public ActivityTestRule activityRuleMain 38 | = new ActivityTestRule<>(MainActivity.class); 39 | 40 | @Rule 41 | public ActivityTestRule activityRuleProfile; 42 | 43 | 44 | @Test 45 | public void changeText_sameActivity() { 46 | 47 | onView(withId(R.id.SignInButton)).perform(click()); 48 | onView(ViewMatchers.withId(R.id.passwordField2)) 49 | .perform(typeText("EspressoUser123"), closeSoftKeyboard()); 50 | onView(ViewMatchers.withId(R.id.usernameField2)) 51 | .perform(typeText("EspressoUser123"), closeSoftKeyboard()); 52 | onView(withId(R.id.signInButton)).perform(click()); 53 | while (true) { 54 | try { 55 | onView(withId(R.id.hoursButton)).perform(click()); 56 | break; 57 | } catch (Exception e) { 58 | onView(withId(R.id.signInButton)).perform(click()); 59 | continue; 60 | } 61 | } 62 | 63 | onView(withId(R.id.sundayOpening)).perform(replaceText(""), closeSoftKeyboard()); 64 | onView(withId(R.id.sundayClosing)).perform(replaceText(""), closeSoftKeyboard()); 65 | 66 | onView(withId(R.id.sundayClosing)).perform(typeText("17:00"), closeSoftKeyboard()); 67 | onView(withId(R.id.sundayOpening)).perform(typeText("26:04"), closeSoftKeyboard()); 68 | onView(withId(R.id.saveButton)).perform(click()); 69 | 70 | onView(withId(R.id.sundayOpening)).perform(replaceText(""), closeSoftKeyboard()); 71 | onView(withId(R.id.sundayOpening)).perform(typeText("12:77"), closeSoftKeyboard()); 72 | onView(withId(R.id.saveButton)).perform(click()); 73 | 74 | onView(withId(R.id.sundayOpening)).perform(replaceText(""), closeSoftKeyboard()); 75 | onView(withId(R.id.sundayOpening)).perform(typeText("6000"), closeSoftKeyboard()); 76 | onView(withId(R.id.saveButton)).perform(click()); 77 | 78 | onView(withId(R.id.sundayOpening)).perform(replaceText(""), closeSoftKeyboard()); 79 | onView(withId(R.id.sundayOpening)).perform(typeText("27"), closeSoftKeyboard()); 80 | onView(withId(R.id.saveButton)).perform(click()); 81 | 82 | onView(withId(R.id.sundayOpening)).perform(replaceText(""), closeSoftKeyboard()); 83 | onView(withId(R.id.sundayOpening)).perform(typeText("23:"), closeSoftKeyboard()); 84 | onView(withId(R.id.saveButton)).perform(click()); 85 | 86 | onView(withId(R.id.sundayOpening)).perform(replaceText(""), closeSoftKeyboard()); 87 | onView(withId(R.id.sundayOpening)).perform(typeText("8:30"), closeSoftKeyboard()); 88 | onView(withId(R.id.saveButton)).perform(click()); 89 | } 90 | } -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/InvalidClinicAddressTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class InvalidClinicAddressTest { 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | @Test 36 | public void invalidClinicAddress() { 37 | 38 | onView(withId(R.id.SignInButton)).perform(click()); 39 | onView(ViewMatchers.withId(R.id.passwordField2)) 40 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 41 | onView(ViewMatchers.withId(R.id.usernameField2)) 42 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 43 | onView(withId(R.id.signInButton)).perform(click()); 44 | while (true) { 45 | try { 46 | onView(withId(R.id.bookButton)).perform(click()); 47 | break; 48 | } catch (Exception e) { 49 | onView(withId(R.id.signInButton)).perform(click()); 50 | } 51 | } 52 | 53 | //onView(ViewMatchers.withId(R.id.nameField2)) 54 | //.perform(typeText("test_test_test__test_test_test_test_test_test_test_test_test_test_test_test_test_test"), closeSoftKeyboard()); 55 | onView(ViewMatchers.withId(R.id.addressField)) 56 | .perform(typeText("test_test_test__test_test_test_test_test_test_test_test_test_test_test_test_test_test"), closeSoftKeyboard()); 57 | onView(withId(R.id.searchBtn)).perform(click()); 58 | try { 59 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 60 | } catch (Exception e) { 61 | System.out.println("No clinic available, so test is passed"); 62 | } 63 | } 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/InvalidClinicNameTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class InvalidClinicNameTest { 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | @Test 36 | public void invalidClinicName() { 37 | 38 | onView(withId(R.id.SignInButton)).perform(click()); 39 | onView(ViewMatchers.withId(R.id.passwordField2)) 40 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 41 | onView(ViewMatchers.withId(R.id.usernameField2)) 42 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 43 | onView(withId(R.id.signInButton)).perform(click()); 44 | while (true) { 45 | try { 46 | onView(withId(R.id.bookButton)).perform(click()); 47 | break; 48 | } catch (Exception e) { 49 | onView(withId(R.id.signInButton)).perform(click()); 50 | } 51 | } 52 | 53 | onView(ViewMatchers.withId(R.id.nameField2)) 54 | .perform(typeText("test_test_test__test_test_test_test_test_test_test_test_test_test_test_test_test_test"), closeSoftKeyboard()); 55 | //onView(ViewMatchers.withId(R.id.addressField)) 56 | //.perform(typeText(""), closeSoftKeyboard()); 57 | onView(withId(R.id.searchBtn)).perform(click()); 58 | try { 59 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 60 | } catch (Exception e) { 61 | System.out.println("No clinic available, so test passed"); 62 | } 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/InvalidTimeInPastTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class InvalidTimeInPastTest{ 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | 36 | @Test 37 | public void bookInPast() { 38 | 39 | onView(withId(R.id.SignInButton)).perform(click()); 40 | onView(ViewMatchers.withId(R.id.passwordField2)) 41 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 42 | onView(ViewMatchers.withId(R.id.usernameField2)) 43 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 44 | onView(withId(R.id.signInButton)).perform(click()); 45 | while (true) { 46 | try { 47 | onView(withId(R.id.bookButton)).perform(click()); 48 | break; 49 | } catch (Exception e) { 50 | onView(withId(R.id.signInButton)).perform(click()); 51 | } 52 | } 53 | 54 | onView(ViewMatchers.withId(R.id.nameField2)) 55 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 56 | onView(ViewMatchers.withId(R.id.addressField)) 57 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 58 | 59 | onView(withId(R.id.searchBtn)).perform(click()); 60 | try { 61 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 62 | } catch (Exception e) { 63 | System.out.println("No clinic available"); 64 | } 65 | //try to book an appt in the past, make sure it doesnt crash 66 | onView(withId(R.id.dateBtn)).perform(click()); 67 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2019, 1, 1)); 68 | onView(withId(R.id.saveDate)).perform(click()); 69 | onView(withId(R.id.timeBtn)).perform(click()); 70 | onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 71 | onView(withId(R.id.saveTime)).perform(click()); 72 | //onView(withId(R.id.bookBtn)).perform(click()); 73 | 74 | } 75 | } -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/LocationMapTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.test.espresso.matcher.ViewMatchers; 4 | import androidx.test.rule.ActivityTestRule; 5 | 6 | import org.junit.Rule; 7 | import org.junit.Test; 8 | 9 | import static androidx.test.espresso.Espresso.onData; 10 | import static androidx.test.espresso.Espresso.onView; 11 | import static androidx.test.espresso.action.ViewActions.click; 12 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 13 | import static androidx.test.espresso.action.ViewActions.typeText; 14 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 15 | import static org.hamcrest.core.IsAnything.anything; 16 | 17 | public class LocationMapTest { 18 | private Administrator admin; 19 | 20 | @Rule 21 | public ActivityTestRule activityRuleMain 22 | = new ActivityTestRule<>(MainActivity.class); 23 | 24 | @Rule 25 | public ActivityTestRule activityRuleProfile; 26 | 27 | 28 | @Test 29 | public void changeText_sameActivity() { 30 | 31 | onView(withId(R.id.SignInButton)).perform(click()); 32 | onView(ViewMatchers.withId(R.id.passwordField2)) 33 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 34 | onView(ViewMatchers.withId(R.id.usernameField2)) 35 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 36 | onView(withId(R.id.signInButton)).perform(click()); 37 | while (true) { 38 | try { 39 | onView(withId(R.id.bookButton)).perform(click()); 40 | break; 41 | } catch (Exception e) { 42 | onView(withId(R.id.signInButton)).perform(click()); 43 | } 44 | } 45 | onView(ViewMatchers.withId(R.id.nameField2)) 46 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 47 | onView(ViewMatchers.withId(R.id.addressField)) 48 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 49 | onView(withId(R.id.searchBtn)).perform(click()); 50 | try { 51 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 52 | } catch (Exception e) { 53 | System.out.println("No clinic available"); 54 | } 55 | onView(withId(R.id.locationBtn)).perform(click()); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/MainActivityTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import static androidx.test.espresso.Espresso.onView; 4 | import static androidx.test.espresso.action.ViewActions.click; 5 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 6 | import static androidx.test.espresso.action.ViewActions.replaceText; 7 | import static androidx.test.espresso.action.ViewActions.typeText; 8 | import static androidx.test.espresso.action.ViewActions.longClick; 9 | import static androidx.test.espresso.assertion.ViewAssertions.matches; 10 | import static androidx.test.espresso.matcher.RootMatchers.withDecorView; 11 | import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; 12 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 13 | import static androidx.test.espresso.matcher.ViewMatchers.withText; 14 | 15 | import static org.hamcrest.Matchers.is; 16 | import static org.hamcrest.Matchers.not; 17 | 18 | import org.junit.After; 19 | import org.junit.Before; 20 | import org.junit.Rule; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import androidx.test.espresso.matcher.ViewMatchers; 25 | import androidx.test.rule.ActivityTestRule; 26 | import androidx.test.runner.AndroidJUnit4; 27 | 28 | import java.util.ArrayList; 29 | 30 | 31 | @RunWith(AndroidJUnit4.class) 32 | public class MainActivityTest { 33 | 34 | private Administrator admin; 35 | 36 | @Rule 37 | public ActivityTestRule activityRuleMain 38 | = new ActivityTestRule<>(MainActivity.class); 39 | 40 | @Rule 41 | public ActivityTestRule activityRuleProfile; 42 | 43 | 44 | @Test 45 | public void changeText_sameActivity() { 46 | 47 | onView(withId(R.id.SignInButton)).perform(click()); 48 | onView(ViewMatchers.withId(R.id.passwordField2)) 49 | .perform(typeText("EspressoUser123"), closeSoftKeyboard()); 50 | onView(ViewMatchers.withId(R.id.usernameField2)) 51 | .perform(typeText("EspressoUser123"), closeSoftKeyboard()); 52 | onView(withId(R.id.signInButton)).perform(click()); 53 | while (true) { 54 | try { 55 | onView(withId(R.id.profileButton)).perform(click()); 56 | break; 57 | } catch (Exception e) { 58 | onView(withId(R.id.signInButton)).perform(click()); 59 | continue; 60 | } 61 | } 62 | 63 | activityRuleProfile = new ActivityTestRule<>(Profile.class); 64 | 65 | 66 | onView(withId(R.id.addressField2)).perform(replaceText(""), closeSoftKeyboard()); 67 | onView(withId(R.id.phoneNumField)).perform(replaceText(""), closeSoftKeyboard()); 68 | onView(withId(R.id.nameField)).perform(replaceText(""), closeSoftKeyboard()); 69 | onView(withId(R.id.saveButton)).perform(click()); 70 | 71 | 72 | onView(withId(R.id.addressField2)).perform(typeText("100 Bank Street"), closeSoftKeyboard()); 73 | onView(withId(R.id.saveButton)).perform(click()); 74 | onView(withId(R.id.phoneNumField)).perform(typeText("(905)-806-2222"), closeSoftKeyboard()); 75 | onView(withId(R.id.saveButton)).perform(click()); 76 | onView(withId(R.id.nameField)).perform(typeText("Test"), closeSoftKeyboard()); 77 | onView(withId(R.id.saveButton)).perform(click()); 78 | 79 | } 80 | } -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/ServicesTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.test.espresso.matcher.ViewMatchers; 4 | import androidx.test.rule.ActivityTestRule; 5 | 6 | import org.junit.Rule; 7 | import org.junit.Test; 8 | 9 | import static androidx.test.espresso.Espresso.onData; 10 | import static androidx.test.espresso.Espresso.onView; 11 | import static androidx.test.espresso.action.ViewActions.click; 12 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 13 | import static androidx.test.espresso.action.ViewActions.typeText; 14 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 15 | import static androidx.test.espresso.action.ViewActions.longClick; // ADDED THIS 16 | import static org.hamcrest.core.IsAnything.anything; 17 | import static org.hamcrest.object.HasToString.hasToString; 18 | 19 | public class ServicesTest { 20 | 21 | private Administrator admin; 22 | 23 | @Rule 24 | public ActivityTestRule activityRuleMain 25 | = new ActivityTestRule<>(MainActivity.class); 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleProfile; 29 | 30 | 31 | @Test 32 | public void changeText_sameActivity() { 33 | 34 | onView(withId(R.id.SignInButton)).perform(click()); 35 | onView(ViewMatchers.withId(R.id.passwordField2)) 36 | .perform(typeText("EspressoUser123"), closeSoftKeyboard()); 37 | onView(ViewMatchers.withId(R.id.usernameField2)) 38 | .perform(typeText("EspressoUser123"), closeSoftKeyboard()); 39 | onView(withId(R.id.signInButton)).perform(click()); 40 | while (true) { 41 | try { 42 | onView(withId(R.id.servicesButton)).perform(click()); 43 | break; 44 | } catch (Exception e) { 45 | onView(withId(R.id.signInButton)).perform(click()); 46 | continue; 47 | } 48 | } 49 | 50 | //goes into service picks the first service then deletes 51 | //goes into services again, picks the second service then deletes 52 | 53 | onView(withId(R.id.servicesBtn)).perform(click()); 54 | try { 55 | onData(anything()).inAdapterView(withId(R.id.serviceList)).atPosition(0).perform(longClick()); 56 | onData(anything()).inAdapterView(withId(R.id.serviceList)).atPosition(0).perform(longClick()); 57 | }catch (Exception e){ 58 | System.out.println("No services available"); 59 | } 60 | onView(withId(R.id.backBtn)).perform(click()); 61 | 62 | 63 | } 64 | } -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/WithoutSettingDateTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class WithoutSettingDateTest { 24 | 25 | private Administrator admin; 26 | 27 | @Rule 28 | public ActivityTestRule activityRuleMain 29 | = new ActivityTestRule<>(MainActivity.class); 30 | 31 | @Rule 32 | public ActivityTestRule activityRuleProfile; 33 | 34 | 35 | 36 | @Test 37 | public void bookWithoutDate() { 38 | 39 | onView(withId(R.id.SignInButton)).perform(click()); 40 | onView(ViewMatchers.withId(R.id.passwordField2)) 41 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 42 | onView(ViewMatchers.withId(R.id.usernameField2)) 43 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 44 | onView(withId(R.id.signInButton)).perform(click()); 45 | while (true) { 46 | try { 47 | onView(withId(R.id.bookButton)).perform(click()); 48 | break; 49 | } catch (Exception e) { 50 | onView(withId(R.id.signInButton)).perform(click()); 51 | } 52 | } 53 | 54 | onView(ViewMatchers.withId(R.id.nameField2)) 55 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 56 | onView(ViewMatchers.withId(R.id.addressField)) 57 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 58 | 59 | onView(withId(R.id.searchBtn)).perform(click()); 60 | try { 61 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 62 | } catch (Exception e) { 63 | System.out.println("No clinic available"); 64 | } 65 | //onView(withId(R.id.dateBtn)).perform(click()); 66 | //onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 14)); 67 | //onView(withId(R.id.saveDate)).perform(click()); 68 | onView(withId(R.id.timeBtn)).perform(click()); 69 | //onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 70 | //onView(withId(R.id.saveTime)).perform(click()); 71 | onView(withId(R.id.bookBtn)).perform(click()); 72 | 73 | } 74 | } -------------------------------------------------------------------------------- /Source Code/app/src/androidTest/java/com/example/final_project/WithoutSettingTimeTest.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.widget.DatePicker; 4 | 5 | import androidx.test.espresso.ViewAction; 6 | import androidx.test.espresso.contrib.PickerActions; 7 | import androidx.test.espresso.matcher.ViewMatchers; 8 | import androidx.test.rule.ActivityTestRule; 9 | 10 | import org.hamcrest.Matchers; 11 | import org.junit.Rule; 12 | import org.junit.Test; 13 | 14 | import static androidx.test.espresso.Espresso.onData; 15 | import static androidx.test.espresso.Espresso.onView; 16 | import static androidx.test.espresso.action.ViewActions.click; 17 | import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; 18 | import static androidx.test.espresso.action.ViewActions.longClick; 19 | import static androidx.test.espresso.action.ViewActions.typeText; 20 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 21 | import static org.hamcrest.core.IsAnything.anything; 22 | 23 | public class WithoutSettingTimeTest { 24 | private Administrator admin; 25 | 26 | @Rule 27 | public ActivityTestRule activityRuleMain 28 | = new ActivityTestRule<>(MainActivity.class); 29 | 30 | @Rule 31 | public ActivityTestRule activityRuleProfile; 32 | 33 | @Test 34 | public void bookWithoutTime() { 35 | 36 | onView(withId(R.id.SignInButton)).perform(click()); 37 | onView(ViewMatchers.withId(R.id.passwordField2)) 38 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 39 | onView(ViewMatchers.withId(R.id.usernameField2)) 40 | .perform(typeText("PatientTest123"), closeSoftKeyboard()); 41 | onView(withId(R.id.signInButton)).perform(click()); 42 | while (true) { 43 | try { 44 | onView(withId(R.id.bookButton)).perform(click()); 45 | break; 46 | } catch (Exception e) { 47 | onView(withId(R.id.signInButton)).perform(click()); 48 | } 49 | } 50 | 51 | onView(ViewMatchers.withId(R.id.nameField2)) 52 | .perform(typeText("Clinic Test"), closeSoftKeyboard()); 53 | onView(ViewMatchers.withId(R.id.addressField)) 54 | .perform(typeText("157 Laurier East"), closeSoftKeyboard()); 55 | 56 | onView(withId(R.id.searchBtn)).perform(click()); 57 | try { 58 | onData(anything()).inAdapterView(withId(R.id.clinicList)).atPosition(0).perform(click()); 59 | } catch (Exception e) { 60 | System.out.println("No clinic available"); 61 | } 62 | onView(withId(R.id.dateBtn)).perform(click()); 63 | 64 | //below we try to book an appt without setting time 65 | 66 | onView(withId(R.id.datePicker)).perform(PickerActions.setDate(2100, 12, 14)); 67 | onView(withId(R.id.saveDate)).perform(click()); 68 | //onView(withId(R.id.timeBtn)).perform(click()); 69 | //onView(withId(R.id.timePicker)).perform(PickerActions.setTime(9, 30)); 70 | //onView(withId(R.id.saveTime)).perform(click()); 71 | onView(withId(R.id.bookBtn)).perform(click()); 72 | 73 | } 74 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/AddServices.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.content.Intent; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.AdapterView; 10 | import android.widget.Button; 11 | import android.widget.ListView; 12 | import android.widget.Toast; 13 | 14 | import com.google.firebase.database.DataSnapshot; 15 | import com.google.firebase.database.DatabaseError; 16 | import com.google.firebase.database.DatabaseReference; 17 | import com.google.firebase.database.FirebaseDatabase; 18 | import com.google.firebase.database.ValueEventListener; 19 | 20 | import java.util.ArrayList; 21 | 22 | public class AddServices extends AppCompatActivity { 23 | 24 | private Employee activeUser; 25 | private Button backButton; 26 | private Button servicesButton; 27 | private ArrayList services; 28 | private ArrayList users; 29 | private ArrayList allServices; 30 | 31 | private static DatabaseReference databaseServices = FirebaseDatabase.getInstance().getReference("services"); 32 | ListView listViewServices; 33 | 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | setContentView(R.layout.activity_add_services); 39 | 40 | Intent i = getIntent(); 41 | activeUser = (Employee) i.getSerializableExtra("user"); 42 | 43 | allServices = (ArrayList) i.getSerializableExtra("services"); 44 | services = new ArrayList<>(); 45 | users = (ArrayList) i.getSerializableExtra("users"); 46 | listViewServices = (ListView)findViewById(R.id.serviceList); 47 | 48 | listViewServices.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { 49 | @Override 50 | public boolean onItemLongClick(AdapterView adapterView, View view, int i, long l) { 51 | DataBaseService service = services.get(i); 52 | if(!activeUser.getWalkInClinic().getServiceIds().contains(service.getId())){ 53 | activeUser.getWalkInClinic().addService(service.getId()); 54 | activeUser.updateWalkinClinic(); 55 | Toast.makeText(getApplicationContext(),"Service Added", Toast.LENGTH_LONG).show(); 56 | openUserServices(); 57 | }else{ 58 | Toast.makeText(getApplicationContext(), "Service is Already Added", Toast.LENGTH_LONG).show(); 59 | } 60 | return true; 61 | } 62 | }); 63 | 64 | backButton = (Button) findViewById(R.id.backBtn); 65 | backButton.setOnClickListener(new View.OnClickListener() { 66 | @Override 67 | public void onClick(View v) { 68 | openUserServices(); 69 | } 70 | }); 71 | 72 | databaseServices.addValueEventListener(new ValueEventListener() { 73 | @Override 74 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) { 75 | services.clear(); 76 | for(DataSnapshot postSnapshot : dataSnapshot.getChildren()) { 77 | DataBaseService service = postSnapshot.getValue(DataBaseService.class); 78 | if(!activeUser.getWalkInClinic().getServiceIds().contains(service.getId())){ 79 | services.add(service); 80 | } 81 | } 82 | ServiceList serviceAdapter = new ServiceList(AddServices.this, services); 83 | listViewServices.setAdapter(serviceAdapter); 84 | } 85 | 86 | @Override 87 | public void onCancelled(@NonNull DatabaseError databaseError) { 88 | 89 | } 90 | }); 91 | } 92 | 93 | 94 | public void openUserServices() { 95 | Intent intent = new Intent(this, Services.class); 96 | intent.putExtra("user", activeUser); 97 | intent.putExtra("users", users); 98 | intent.putExtra("services", allServices); 99 | startActivity(intent); 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Admin.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import android.content.Intent; 8 | import android.os.Bundle; 9 | import android.view.View; 10 | import android.widget.Button; 11 | import android.widget.TextView; 12 | 13 | import com.google.firebase.database.DataSnapshot; 14 | import com.google.firebase.database.DatabaseError; 15 | import com.google.firebase.database.DatabaseReference; 16 | import com.google.firebase.database.FirebaseDatabase; 17 | import com.google.firebase.database.ValueEventListener; 18 | 19 | import java.util.ArrayList; 20 | 21 | 22 | public class Admin extends AppCompatActivity { 23 | 24 | private Button button, userButton, serviceButton; 25 | private Administrator activeUser; 26 | private TextView welcome; 27 | private ArrayList services; 28 | private ArrayList users; 29 | 30 | 31 | @Override 32 | protected void onCreate(Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | setContentView(R.layout.activity_admin); 35 | button = (Button) findViewById(R.id.signoutButton); 36 | button.setOnClickListener(new View.OnClickListener() { 37 | @Override 38 | public void onClick(View v) { 39 | openMain(); 40 | } 41 | }); 42 | 43 | userButton = (Button) findViewById(R.id.usersBtn); 44 | userButton.setOnClickListener(new View.OnClickListener() { 45 | @Override 46 | public void onClick(View v) { 47 | openActivity(ViewUsers.class); 48 | } 49 | }); 50 | 51 | serviceButton = (Button) findViewById(R.id.serviceBtn); 52 | serviceButton.setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | openActivity(ViewServices.class); 56 | } 57 | }); 58 | 59 | Intent i = getIntent(); 60 | activeUser = (Administrator) i.getSerializableExtra("user"); 61 | services = (ArrayList) i.getSerializableExtra("services"); 62 | users = (ArrayList) i.getSerializableExtra("users"); 63 | 64 | } 65 | 66 | 67 | // HOW TO CHANGE SCREENS AND PASS THROUGH NEEDED VALUES 68 | // You'll need to pass the activeUser to each screen 69 | // you go to. This is because activeUser has the methods 70 | // to update services/users and has access to the list 71 | // of all users and services. 72 | 73 | /** 74 | * Use this to open another activity. I've set the intent to pass 75 | * through the activeUser object so you can reference it from the 76 | * other activities. 77 | * @param activity name of the class 78 | * Example usage 79 | * openActivity(Admin.class) 80 | * 81 | * Look at this classes onCreate to see how to get the information 82 | * from another activity. 83 | */ 84 | public void openActivity(Class activity){ 85 | Intent intent = new Intent(this, activity); 86 | intent.putExtra("user", activeUser); 87 | intent.putExtra("services", services); 88 | intent.putExtra("users", users); 89 | startActivity(intent); 90 | } 91 | 92 | public void openMain() { 93 | Intent intent = new Intent(this, MainActivity.class); 94 | startActivity(intent); 95 | } 96 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/AppointmentUpcomingList.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.app.Activity; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.TextView; 9 | 10 | import java.text.SimpleDateFormat; 11 | import java.util.Date; 12 | import java.util.List; 13 | 14 | public class AppointmentUpcomingList extends ArrayAdapter { 15 | private Activity context; 16 | List bookings; 17 | 18 | public AppointmentUpcomingList(Activity context, List bookings) { 19 | super(context, R.layout.layout_service_list, bookings); 20 | this.context = context; 21 | this.bookings = bookings; 22 | } 23 | 24 | @Override 25 | public View getView(int position, View convertView, ViewGroup parent) { 26 | LayoutInflater inflater = context.getLayoutInflater(); 27 | View listViewItem = inflater.inflate(R.layout.layout_appointment_list, null, true); 28 | 29 | TextView textViewName = (TextView) listViewItem.findViewById(R.id.clinicName); 30 | TextView textViewDate = (TextView) listViewItem.findViewById(R.id.dateTime); 31 | TextView textViewService = (TextView) listViewItem.findViewById(R.id.clinicService); 32 | 33 | Booking booking = bookings.get(position); 34 | textViewName.setText(booking.getClinic().getName()); 35 | String pattern = "yyyy-MM-dd HH:mm "; 36 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); 37 | Date showDate = new Date(); 38 | showDate.setHours(booking.getTime().getHours()); 39 | showDate.setMinutes(booking.getTime().getMinutes()); 40 | showDate.setDate(booking.getTime().getDate()); 41 | showDate.setMonth(booking.getTime().getMonth()); 42 | showDate.setYear(booking.getTime().getYear()); 43 | 44 | String date = simpleDateFormat.format(showDate); 45 | textViewDate.setText(date); 46 | textViewService.setText(booking.getService().getName()); 47 | return listViewItem; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Booking.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | 7 | public class Booking implements Serializable { 8 | private Integer _rating; 9 | private String _walkInId, _patientId, _serviceId; 10 | private Date _time; 11 | private WalkInClinic clinic; 12 | private Patient patient; 13 | private DataBaseService service; 14 | private String _id; 15 | 16 | public Booking(String walkInId, String patientId, String serviceId){ 17 | _walkInId = walkInId; 18 | _patientId = patientId; 19 | _serviceId = serviceId; 20 | _rating = 0; // means no rating yet 21 | _id = null; 22 | } 23 | 24 | public Booking(){ 25 | _walkInId = null; 26 | _patientId = null; 27 | _serviceId = null; 28 | _rating = 0; // means no rating yet 29 | _id = null; 30 | } 31 | 32 | 33 | public String getWalkInId(){return _walkInId;} 34 | public String getPatientId(){return _patientId;} 35 | public String getServiceId(){return _serviceId;} 36 | public Integer getRating(){return _rating;} 37 | public Date getTime(){return _time;} 38 | public String getId(){return _id;} 39 | 40 | public void setWalkInId(String id){_walkInId = id;} 41 | public void setRating(Integer rate){_rating = rate;} 42 | public void setServiceId(String id){_serviceId = id;} 43 | public void setTime(Date time){_time = time;} 44 | public void setPatientId(String id){_patientId = id;} 45 | public void setId(String id){_id = id;} 46 | 47 | public void setClinic(WalkInClinic w){clinic = w;} 48 | public void setPatient(Patient p){patient = p;} 49 | public void setService(DataBaseService s){service = s;} 50 | 51 | public WalkInClinic getClinic(){return clinic;} 52 | public Patient getPatient(){return patient;} 53 | public DataBaseService getService(){return service;} 54 | 55 | // compares times 56 | public boolean equals(Booking booking){ 57 | return this._time.getTime() == booking.getTime().getTime(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Category.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | public enum Category { 4 | GENERAL, 5 | OTHER 6 | } 7 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/ClinicList.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.app.Activity; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.ImageView; 9 | import android.widget.TextView; 10 | 11 | import androidx.core.content.ContextCompat; 12 | 13 | import java.util.ArrayList; 14 | import java.util.Arrays; 15 | import java.util.List; 16 | 17 | public class ClinicList extends ArrayAdapter { 18 | private Activity context; 19 | List clinics; 20 | private ImageView star1, star2, star3, star4, star5; 21 | 22 | public ClinicList(Activity context, List clinics) { 23 | super(context, R.layout.layout_clinic_list, clinics); 24 | this.context = context; 25 | this.clinics = clinics; 26 | } 27 | 28 | @Override 29 | public View getView(int position, View convertView, ViewGroup parent) { 30 | LayoutInflater inflater = context.getLayoutInflater(); 31 | View listViewItem = inflater.inflate(R.layout.layout_clinic_list, null, true); 32 | 33 | TextView textViewName = (TextView) listViewItem.findViewById(R.id.clinicName); 34 | TextView textViewAddress= (TextView) listViewItem.findViewById(R.id.dateTime); 35 | 36 | WalkInClinic clinic = clinics.get(position); 37 | textViewName.setText(clinic.getName()); 38 | textViewAddress.setText(String.valueOf(clinic.getAddress())); 39 | 40 | ArrayList stars = new ArrayList<>(); 41 | star1 = listViewItem.findViewById(R.id.star1); 42 | star2 = listViewItem.findViewById(R.id.star2); 43 | star3 = listViewItem.findViewById(R.id.star3); 44 | star4 = listViewItem.findViewById(R.id.star4); 45 | star5 = listViewItem.findViewById(R.id.star5); 46 | stars.add(star1); stars.add(star2); stars.add(star3); stars.add(star4); stars.add(star5); 47 | 48 | Integer rating = clinic.getRating(); 49 | for(int x = 0; x < Math.min(rating, 5); x++){ 50 | stars.get(x).setImageDrawable(ContextCompat.getDrawable(context,android.R.drawable.btn_star_big_on)); 51 | } 52 | 53 | return listViewItem; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/DataBaseService.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.provider.ContactsContract; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Used strictly for saving user data to the database 10 | */ 11 | 12 | public class DataBaseService implements Serializable { 13 | private String _name; 14 | private Category _category; 15 | private String _id; 16 | private ServiceRole _role; 17 | 18 | public DataBaseService(String id, String name, ServiceRole role){ 19 | this._name = name; 20 | this._id = id; 21 | this._role = role; 22 | } 23 | 24 | public DataBaseService(String id, String name, ServiceRole role, Category category){ 25 | this._name = name; 26 | this._category = category; 27 | this._role = role; 28 | this._id = id; 29 | } 30 | 31 | public void print(){ 32 | System.out.println("Name: " + _name + ", Role: " + _role + ", ID: " + _id); 33 | } 34 | 35 | public DataBaseService(){} 36 | 37 | public void setName(String name){_name = name;} 38 | public String getName() {return _name;} 39 | public void setId(String id){_id = id;} 40 | public String getId(){return _id;} 41 | public void setCategory(Category category){this._category = category;} 42 | public Category getCategory(){return _category;} 43 | public void setRole(ServiceRole role){this._role = role;} 44 | public ServiceRole getRole(){return this._role;} 45 | } 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/DataBaseUser.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.provider.ContactsContract; 4 | 5 | import java.io.Serializable; 6 | import java.sql.Time; 7 | import java.util.ArrayList; 8 | import java.util.Arrays; 9 | 10 | /** 11 | * Used strictly for saving user data to the database 12 | */ 13 | public class DataBaseUser implements Serializable { 14 | private String _name; 15 | private String _username; 16 | private String _password; 17 | private String _id; 18 | private String _role; 19 | private String _clinicId; 20 | private ArrayList openHours, closeHours; 21 | private ArrayList notWorkingDays; 22 | 23 | public DataBaseUser(String id, String name, String username, String password, String role){ 24 | this._name = name; 25 | this._username = username; 26 | this._password = password; 27 | this._role = role; 28 | this._id = id; 29 | this._clinicId = ""; 30 | this.openHours = new ArrayList(); 31 | this.closeHours = new ArrayList(); 32 | this.notWorkingDays = new ArrayList<>(); 33 | } 34 | 35 | public DataBaseUser(String id, String username, String password, String role){ 36 | this._username = username; 37 | this._password = password; 38 | this._role = role; 39 | this._id = id; 40 | this._clinicId = ""; 41 | this.openHours = new ArrayList(); 42 | this.closeHours = new ArrayList(); 43 | this.notWorkingDays = new ArrayList<>(); 44 | } 45 | 46 | public DataBaseUser(String id,String username, String password){ 47 | this._username = username; 48 | this._password = password; 49 | this._role = "Admin"; 50 | this._id = id; 51 | this._clinicId = ""; 52 | this.openHours = new ArrayList(); 53 | this.closeHours = new ArrayList(); 54 | this.notWorkingDays = new ArrayList<>(); 55 | } 56 | 57 | public DataBaseUser(){} 58 | 59 | public void setName(String name){_name = name;} 60 | public String getName() {return _name;} 61 | public void setId(String id){_id = id;} 62 | public String getId(){return _id;} 63 | public void setUsername(String username){_username = username;} 64 | public String getUsername(){return _username;} 65 | public void setPassword(String password){_password = password;} 66 | public String getPassword() {return _password;} 67 | public void setRole(String role){this._role = role;} 68 | public String getRole(){return _role;} 69 | public String getClinicId(){return _clinicId;} 70 | public void setClinicId(String id){_clinicId = id;} 71 | public void setOpenHours(ArrayList opens){this.openHours = opens;} 72 | public ArrayList getOpenHours(){return this.openHours;} 73 | public void setCloseHours(ArrayList closes){this.closeHours = closes;} 74 | public ArrayList getCloseHours(){return this.closeHours;} 75 | public void setNotWorkingDays (ArrayList n){notWorkingDays = n;} 76 | public ArrayList getNotWorkingDays (){return notWorkingDays;} 77 | } 78 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Employee.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | // Widget imports 4 | import android.widget.EditText; 5 | import android.widget.Button; 6 | import android.widget.AdapterView; 7 | import android.widget.Toast; 8 | 9 | import com.google.firebase.database.DatabaseReference; 10 | import com.google.firebase.database.FirebaseDatabase; 11 | 12 | import java.sql.Time; 13 | import java.util.ArrayList; 14 | 15 | public class Employee extends User{ 16 | 17 | private ArrayList walkinclinicServices; 18 | private WalkInClinic walkInClinic; 19 | private static DatabaseReference databaseWalkIn; 20 | private static DatabaseReference databaseUsers; 21 | private String clinicId; 22 | private ArrayList openHours, closeHours; 23 | private ArrayList notWorkingDays; 24 | 25 | public Employee(String name, String username, String password, String clinicId){ 26 | super(name, username, password); 27 | this.clinicId = clinicId; 28 | init(); 29 | } 30 | 31 | public Employee(String name, String username, String password){ 32 | super(name, username, password); 33 | super.addRole("Employee"); 34 | init(); 35 | } 36 | 37 | public Employee(String username, String password){ 38 | super(username, password); 39 | init(); 40 | } 41 | 42 | private void init(){ 43 | try{ 44 | databaseWalkIn = FirebaseDatabase.getInstance().getReference("clinics"); 45 | databaseUsers = FirebaseDatabase.getInstance().getReference("users"); 46 | }catch(Exception e){} 47 | super.addRole("Employee"); 48 | this.clinicId = clinicId; 49 | walkInClinic = null; 50 | openHours = new ArrayList<>(); 51 | closeHours = new ArrayList<>(); 52 | notWorkingDays = new ArrayList<>(); 53 | } 54 | 55 | public void setOpenHours(ArrayList opens){this.openHours = opens;} 56 | public ArrayList getOpenHours(){return this.openHours;} 57 | public void setCloseHours(ArrayList closes){this.closeHours = closes;} 58 | public ArrayList getCloseHours(){return this.closeHours;} 59 | 60 | public ArrayList getNotWorkingDays(){return notWorkingDays;} 61 | public void setNotWorkingDays(ArrayList n){notWorkingDays = n;} 62 | public void setClinicId(String id){this.clinicId = id;} 63 | 64 | public void update(){ 65 | try{ 66 | DatabaseReference dR = databaseUsers.child(id); 67 | DataBaseUser usr = new DataBaseUser(id, name, username, password, getRole()); 68 | usr.setClinicId(getClinicId()); 69 | usr.setCloseHours(closeHours); 70 | usr.setOpenHours(openHours); 71 | usr.setNotWorkingDays(notWorkingDays); 72 | dR.setValue(usr); 73 | }catch (Exception ex){ 74 | throw new IllegalArgumentException("Clinic doesn't exist"); 75 | } 76 | } 77 | 78 | 79 | public String getClinicId(){return clinicId;} 80 | 81 | public WalkInClinic getWalkInClinic(){ 82 | return walkInClinic; 83 | } 84 | 85 | public void setWalkInClinic(WalkInClinic clinic){ 86 | walkInClinic = clinic; 87 | } 88 | 89 | public void createWalkInClinic(WalkInClinic clinic) throws IllegalStateException{ 90 | if (walkInClinic != null){ 91 | throw new IllegalStateException("Clinic already exists"); 92 | } 93 | walkInClinic = clinic; 94 | String id_ = databaseWalkIn.push().getKey(); // get unique database key 95 | clinic.setId(id_); 96 | this.clinicId = id_; 97 | databaseWalkIn.child(id_).setValue(clinic); // save in database 98 | DatabaseReference dR = FirebaseDatabase.getInstance().getReference("users").child(getId()); 99 | DataBaseUser usr = new DataBaseUser(getId(), get_name(), get_username(), get_password(), getRole()); 100 | usr.setClinicId(id_); 101 | dR.setValue(usr); 102 | } 103 | 104 | public void updateWalkinClinic(){ 105 | try{ 106 | DatabaseReference dR = databaseWalkIn.child(walkInClinic.getId()); 107 | dR.setValue(walkInClinic); 108 | }catch (Exception ex){ 109 | throw new IllegalArgumentException("Clinic doesn't exist"); 110 | } 111 | } 112 | 113 | public void setOpeningTimes(ArrayList opening) throws IllegalArgumentException{ 114 | if (opening.size() != 7){ 115 | throw new IllegalArgumentException("Length of array must be 7"); 116 | } 117 | walkInClinic.setOpeningTimes(opening); 118 | } 119 | 120 | public void setClosingTimes(ArrayList closing) throws IllegalArgumentException{ 121 | if (closing.size() != 7){ 122 | throw new IllegalArgumentException("Length of array must be 7"); 123 | } 124 | walkInClinic.setClosingTimes(closing); 125 | } 126 | 127 | public void setClosedDays(ArrayList days) throws IllegalArgumentException{ 128 | if (days.size() != 7){ 129 | throw new IllegalArgumentException("Length of array must be 7"); 130 | } 131 | walkInClinic.setClosedDays(days); 132 | } 133 | 134 | public ArrayList getClosingTimes(){ 135 | return walkInClinic.getClosingTimes(); 136 | } 137 | 138 | public ArrayList getOpeningTimes(){ 139 | return walkInClinic.getOpeningTimes(); 140 | } 141 | 142 | public ArrayList getClosedDays(){return walkInClinic.getClosedDays();} 143 | 144 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/EmployeeUser.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.TextView; 10 | import android.widget.Toast; 11 | 12 | import com.google.firebase.database.DataSnapshot; 13 | import com.google.firebase.database.DatabaseError; 14 | import com.google.firebase.database.DatabaseReference; 15 | import com.google.firebase.database.FirebaseDatabase; 16 | import com.google.firebase.database.ValueEventListener; 17 | 18 | import java.util.ArrayList; 19 | 20 | public class EmployeeUser extends AppCompatActivity { 21 | 22 | private Button button; 23 | private TextView welcome; 24 | private Employee activeUser; 25 | private ArrayList services; 26 | private ArrayList users; 27 | private Button button2, button3, button4, button5; 28 | private static DatabaseReference databaseWalkIn = FirebaseDatabase.getInstance().getReference("clinics"); 29 | private boolean profileComplete = false; 30 | 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | setContentView(R.layout.activity_employee); 36 | 37 | welcome = (TextView) findViewById(R.id.welcomeText); 38 | 39 | Intent i = getIntent(); 40 | activeUser = (Employee) i.getSerializableExtra("user"); 41 | services = (ArrayList) i.getSerializableExtra("services"); 42 | users = (ArrayList) i.getSerializableExtra("users"); 43 | 44 | button = (Button) findViewById(R.id.signoutButton); 45 | button.setOnClickListener(new View.OnClickListener() { 46 | @Override 47 | public void onClick(View v) { 48 | openActivity(MainActivity.class); 49 | } 50 | }); 51 | 52 | button2 = (Button) findViewById(R.id.profileButton); 53 | button2.setOnClickListener(new View.OnClickListener() { 54 | @Override 55 | public void onClick(View v) { 56 | openActivity(Profile.class); 57 | } 58 | }); 59 | 60 | button3 = (Button) findViewById(R.id.hoursButton); 61 | button3.setOnClickListener(new View.OnClickListener() { 62 | @Override 63 | public void onClick(View v) { 64 | if (profileComplete) 65 | openActivity(Hours.class); 66 | else{ 67 | Toast.makeText(getApplicationContext(), "Please complete your profile first", Toast.LENGTH_LONG).show(); 68 | } 69 | 70 | } 71 | }); 72 | 73 | button4 = (Button) findViewById(R.id.servicesButton); 74 | button4.setOnClickListener(new View.OnClickListener() { 75 | @Override 76 | public void onClick(View v) { 77 | if (profileComplete) 78 | openActivity(Services.class); 79 | else{ 80 | Toast.makeText(getApplicationContext(), "Please complete your profile first", Toast.LENGTH_LONG).show(); 81 | } 82 | } 83 | }); 84 | 85 | button5 = (Button) findViewById(R.id.employeeHoursBtn); 86 | button5.setOnClickListener(new View.OnClickListener() { 87 | @Override 88 | public void onClick(View v) { 89 | if(profileComplete) { 90 | openActivity(EmployeeHours.class); 91 | }else{ 92 | Toast.makeText(getApplicationContext(), "Please complete your profile first", Toast.LENGTH_LONG).show(); 93 | } 94 | } 95 | }); 96 | 97 | databaseWalkIn.addValueEventListener(new ValueEventListener() { 98 | @Override 99 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) { 100 | for(DataSnapshot postSnapshot : dataSnapshot.getChildren()){ 101 | WalkInClinic clinic = postSnapshot.getValue(WalkInClinic.class); 102 | if (clinic.getId().equals(activeUser.getClinicId())){// DON'T REMOVE THIS 103 | activeUser.setWalkInClinic(clinic); 104 | if(!activeUser.getWalkInClinic().getName().equals("")){ 105 | profileComplete = true; 106 | } 107 | } 108 | } 109 | } 110 | 111 | @Override 112 | public void onCancelled(@NonNull DatabaseError databaseError) { 113 | 114 | } 115 | }); 116 | 117 | welcome.setText("Welcome " + activeUser.get_username() + " you are logged in as employee."); 118 | 119 | 120 | } 121 | 122 | public void openActivity(Class activity){ 123 | Intent intent = new Intent(this, activity); 124 | intent.putExtra("user", activeUser); 125 | intent.putExtra("services", services); 126 | intent.putExtra("users", users); 127 | 128 | startActivity(intent); 129 | } 130 | 131 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/InsuranceType.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | public enum InsuranceType { 4 | TYPE1, 5 | TYPE2 6 | } 7 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.widget.Button; 9 | 10 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_main); 16 | 17 | Button button1 = findViewById(R.id.SignInButton); 18 | Button button2 = findViewById(R.id.SignUpButton); 19 | 20 | 21 | button1.setOnClickListener(this); 22 | button2.setOnClickListener(this); 23 | 24 | 25 | } 26 | 27 | @Override 28 | public void onClick(View v) { 29 | switch (v.getId()) { 30 | case R.id.SignInButton: 31 | openSignIn(); 32 | break; 33 | case R.id.SignUpButton: 34 | openSignUp(); 35 | break; 36 | } 37 | } 38 | 39 | public void openSignIn() { 40 | Intent intent = new Intent(this, SignIn.class); 41 | startActivity(intent); 42 | } 43 | 44 | public void openSignUp() { 45 | Intent intent = new Intent(this, SignUp.class); 46 | startActivity(intent); 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Patient.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | public class Patient extends User { 4 | 5 | public Patient(String name, String username, String password){ 6 | super(name,username, password); 7 | super.addRole("Patient"); 8 | } 9 | 10 | public Patient(String username, String password){ 11 | super(username, password); 12 | super.addRole("Patient"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/PatientUser.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.Button; 8 | import android.widget.TextView; 9 | import java.util.ArrayList; 10 | 11 | 12 | public class PatientUser extends AppCompatActivity { 13 | private Button button; 14 | private Patient activeUser; 15 | private TextView welcome; 16 | 17 | private Button book; 18 | private Button appointment; 19 | 20 | private ArrayList services; 21 | private ArrayList users; 22 | private ArrayList clinics; 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_patient); 28 | 29 | button = (Button) findViewById(R.id.signoutButton); 30 | book = (Button) findViewById(R.id.appointmentBtn); 31 | appointment = (Button) findViewById(R.id.bookButton); 32 | 33 | Intent i = getIntent(); 34 | activeUser = (Patient) i.getSerializableExtra("user"); 35 | services = (ArrayList) i.getSerializableExtra("services"); 36 | users = (ArrayList) i.getSerializableExtra("users"); 37 | 38 | button.setOnClickListener(new View.OnClickListener() { 39 | @Override 40 | public void onClick(View v) { 41 | openActivity(MainActivity.class); 42 | } 43 | }); 44 | 45 | book.setOnClickListener(new View.OnClickListener() { 46 | @Override 47 | public void onClick(View v) { 48 | openActivity(Appointment.class); 49 | } 50 | }); 51 | 52 | appointment.setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | openActivity(CheckIn.class); 56 | } 57 | }); 58 | 59 | welcome = (TextView) findViewById(R.id.welcomeText); 60 | 61 | activeUser = (Patient) i.getSerializableExtra("user"); 62 | welcome.setText("Welcome " + activeUser.get_username() + " you are logged in as patient."); 63 | } 64 | 65 | 66 | public void openActivity(Class activity){ 67 | Intent intent = new Intent(this, activity); 68 | intent.putExtra("user", activeUser); 69 | intent.putExtra("users", users); 70 | intent.putExtra("services", services); 71 | 72 | startActivity(intent); 73 | } 74 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/PaymentMethod.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | public enum PaymentMethod { 4 | CREDIT, 5 | DEBIT, 6 | CASH 7 | } 8 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Person.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import java.io.Serializable; 4 | 5 | public abstract class Person implements Serializable { 6 | 7 | protected String name; 8 | 9 | protected String username; 10 | 11 | protected String password; 12 | 13 | protected String id; 14 | 15 | public String get_name(){ 16 | return this.name; 17 | } 18 | 19 | public String get_username(){ 20 | return this.username; 21 | } 22 | 23 | public String get_password(){ 24 | return this.password; 25 | } 26 | 27 | public void setId(String id){this.id = id;} 28 | 29 | public String getId(){return id;} 30 | 31 | public void print(){ 32 | System.out.println("Name: " + name + ", Username: " + username + ", Password: " + password); 33 | } 34 | 35 | public abstract boolean login(); 36 | 37 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/PickDate.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class PickDate extends AppCompatActivity { 8 | 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | setContentView(R.layout.activity_pick_date); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/PickTime.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class PickTime extends AppCompatActivity { 8 | 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | setContentView(R.layout.activity_pick_time); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Service.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import com.google.firebase.database.DatabaseReference; 4 | import com.google.firebase.database.FirebaseDatabase; 5 | 6 | public class Service { 7 | private String name; 8 | private Category category; 9 | private ServiceRole role; 10 | private static DatabaseReference databaseServices = FirebaseDatabase.getInstance().getReference("services"); 11 | 12 | public Service(String name, ServiceRole role){ 13 | this.name = name; 14 | this.role = role; 15 | this.category = Category.GENERAL; 16 | } 17 | 18 | public Service(String name, ServiceRole role, Category category){ 19 | this.name = name; 20 | this.role = role; 21 | this.category = category; 22 | } 23 | 24 | public String getName(){ 25 | return this.name; 26 | } 27 | 28 | public Category getCategory(){ 29 | return this.category; 30 | } 31 | 32 | public ServiceRole getRole(){ 33 | return this.role; 34 | } 35 | 36 | public void setName(String name){ 37 | this.name = name; 38 | } 39 | 40 | public void setCategory(Category category){ 41 | this.category = category; 42 | } 43 | 44 | public void setRole(ServiceRole role){ 45 | this.role = role; 46 | } 47 | 48 | public boolean save(){ 49 | if (this.name != null && this.category != null && this.role != null){ 50 | String id = databaseServices.push().getKey(); // get unique database key 51 | DataBaseService DB = new DataBaseService(id, name, role, category); 52 | databaseServices.child(id).setValue(DB); // save in database 53 | return true; 54 | } 55 | return false; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/ServiceList.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.app.Activity; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.TextView; 9 | 10 | import java.util.List; 11 | 12 | public class ServiceList extends ArrayAdapter { 13 | private Activity context; 14 | List services; 15 | 16 | public ServiceList(Activity context, List services) { 17 | super(context, R.layout.layout_service_list, services); 18 | this.context = context; 19 | this.services = services; 20 | } 21 | 22 | @Override 23 | public View getView(int position, View convertView, ViewGroup parent) { 24 | LayoutInflater inflater = context.getLayoutInflater(); 25 | View listViewItem = inflater.inflate(R.layout.layout_service_list, null, true); 26 | 27 | TextView textViewName = (TextView) listViewItem.findViewById(R.id.textViewName); 28 | TextView textViewRole = (TextView) listViewItem.findViewById(R.id.textViewRole); 29 | 30 | DataBaseService service = services.get(position); 31 | textViewName.setText("Name: " + service.getName()); 32 | textViewRole.setText("Performed By: " + String.valueOf(service.getRole())); 33 | return listViewItem; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/ServiceRole.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | public enum ServiceRole { 4 | Doctor, 5 | Nurse, 6 | Staff 7 | } 8 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/Services.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.content.Intent; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.AdapterView; 10 | import android.widget.Button; 11 | import android.widget.ListView; 12 | import android.widget.Toast; 13 | 14 | import com.google.firebase.database.DataSnapshot; 15 | import com.google.firebase.database.DatabaseError; 16 | import com.google.firebase.database.DatabaseReference; 17 | import com.google.firebase.database.FirebaseDatabase; 18 | import com.google.firebase.database.ValueEventListener; 19 | 20 | import java.util.ArrayList; 21 | 22 | public class Services extends AppCompatActivity { 23 | 24 | private Employee activeUser; 25 | private Button backButton; 26 | private Button servicesButton; 27 | ListView listViewServices; 28 | private ArrayList allServices; 29 | private ArrayList users; 30 | private static DatabaseReference databaseClinics = FirebaseDatabase.getInstance().getReference("clinics"); 31 | private ArrayList services; 32 | 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.activity_services); 37 | 38 | backButton = (Button) findViewById(R.id.backBtn); 39 | backButton.setOnClickListener(new View.OnClickListener() { 40 | @Override 41 | public void onClick(View v) { 42 | openUser(); 43 | } 44 | }); 45 | 46 | servicesButton = (Button) findViewById(R.id.servicesBtn); 47 | servicesButton.setOnClickListener(new View.OnClickListener() { 48 | @Override 49 | public void onClick(View v) { 50 | openServices(); 51 | } 52 | }); 53 | 54 | Intent i = getIntent(); 55 | activeUser = (Employee) i.getSerializableExtra("user"); 56 | services = new ArrayList<>(); 57 | allServices = (ArrayList) i.getSerializableExtra("services"); 58 | users = (ArrayList) i.getSerializableExtra("users"); 59 | 60 | listViewServices = (ListView)findViewById(R.id.serviceList); 61 | 62 | listViewServices.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { 63 | @Override 64 | public boolean onItemLongClick(AdapterView adapterView, View view, int i, long l) { 65 | DataBaseService service = services.get(i); 66 | activeUser.getWalkInClinic().removeService(service.getId()); 67 | activeUser.updateWalkinClinic(); 68 | Toast.makeText(getApplicationContext(),"Service Removed", Toast.LENGTH_LONG); 69 | return true; 70 | } 71 | }); 72 | 73 | databaseClinics.addValueEventListener(new ValueEventListener() { 74 | @Override 75 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) { 76 | services.clear(); 77 | for(DataSnapshot postSnapshot : dataSnapshot.getChildren()) { 78 | WalkInClinic clinic = postSnapshot.getValue(WalkInClinic.class); 79 | 80 | if (clinic.getId().equals(activeUser.getClinicId())) { 81 | for (String id : clinic.getServiceIds()) { 82 | for (DataBaseService s : allServices) { 83 | if (s.getId().equals(id)) { 84 | services.add(s); 85 | } 86 | } 87 | } 88 | } 89 | } 90 | ServiceList serviceAdapter = new ServiceList(Services.this, services); 91 | listViewServices.setAdapter(serviceAdapter); 92 | } 93 | 94 | @Override 95 | public void onCancelled(@NonNull DatabaseError databaseError) { 96 | 97 | } 98 | }); 99 | } 100 | 101 | public void openUser() { 102 | Intent intent = new Intent(this, EmployeeUser.class); 103 | intent.putExtra("user", activeUser); 104 | intent.putExtra("users", users); 105 | intent.putExtra("services", allServices); 106 | startActivity(intent); 107 | } 108 | 109 | public void openServices() { 110 | Intent intent = new Intent(this, AddServices.class); 111 | intent.putExtra("user", activeUser); 112 | intent.putExtra("users", users); 113 | intent.putExtra("services", allServices); 114 | startActivity(intent); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/User.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | import androidx.annotation.NonNull; 3 | 4 | import java.util.List; 5 | 6 | // Firebase imports 7 | import com.google.firebase.database.DatabaseReference; 8 | import com.google.firebase.database.FirebaseDatabase; 9 | import java.util.ArrayList; 10 | 11 | 12 | public class User extends Person { 13 | 14 | private String userRole; 15 | 16 | private static DatabaseReference databaseUsers; 17 | 18 | public User(String name, String username, String password){ 19 | this.name = name; 20 | this.username = username; 21 | this.password = password; 22 | this.userRole = ""; 23 | this.id = ""; 24 | init(); 25 | } 26 | 27 | public User(String username, String password){ 28 | this.username = username; 29 | this.password = password; 30 | this.name = null; 31 | this.id = ""; 32 | init(); 33 | } 34 | 35 | private void init(){ 36 | try{ 37 | databaseUsers = FirebaseDatabase.getInstance().getReference("users"); 38 | }catch(Exception e){} 39 | } 40 | 41 | 42 | public void addRole(String role){ 43 | this.userRole = role; 44 | } 45 | 46 | public String getRole(){ 47 | return this.userRole; 48 | } 49 | 50 | public boolean save(){ 51 | if (this.name != null && this.username != null && this.password!=null && this.userRole != null){ 52 | String id = databaseUsers.push().getKey(); // get unique database key 53 | DataBaseUser DB = new DataBaseUser(id, name, username, password, userRole); 54 | this.id = id; 55 | databaseUsers.child(id).setValue(DB); // save in database 56 | return true; 57 | } 58 | return false; 59 | } 60 | 61 | 62 | @Override 63 | public boolean login() { 64 | return false; 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/UserList.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import android.app.Activity; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.TextView; 9 | 10 | import java.util.List; 11 | 12 | public class UserList extends ArrayAdapter { 13 | private Activity context; 14 | List users; 15 | 16 | public UserList(Activity context, List users) { 17 | super(context, R.layout.layout_user_list, users); 18 | this.context = context; 19 | this.users = users; 20 | } 21 | 22 | @Override 23 | public View getView(int position, View convertView, ViewGroup parent) { 24 | LayoutInflater inflater = context.getLayoutInflater(); 25 | View listViewItem = inflater.inflate(R.layout.layout_user_list, null, true); 26 | 27 | TextView textViewName = (TextView) listViewItem.findViewById(R.id.textViewName); 28 | TextView textViewRole = (TextView) listViewItem.findViewById(R.id.textViewRole); 29 | TextView textViewUsername = (TextView) listViewItem.findViewById(R.id.textViewUsername); 30 | 31 | DataBaseUser user = users.get(position); 32 | textViewName.setText("Name: " + user.getName()); 33 | textViewRole.setText("Role: " + String.valueOf(user.getRole())); 34 | textViewUsername.setText("Username: " + String.valueOf(user.getUsername())); 35 | return listViewItem; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/ViewUsers.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | import android.content.Intent; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.AdapterView; 10 | import android.widget.Button; 11 | import android.widget.ListView; 12 | import android.widget.Toast; 13 | 14 | import com.google.firebase.database.DataSnapshot; 15 | import com.google.firebase.database.DatabaseError; 16 | import com.google.firebase.database.DatabaseReference; 17 | import com.google.firebase.database.FirebaseDatabase; 18 | import com.google.firebase.database.ValueEventListener; 19 | 20 | import java.util.ArrayList; 21 | 22 | public class ViewUsers extends AppCompatActivity { 23 | private Administrator activeUser; 24 | private ArrayList users; 25 | private static DatabaseReference databaseUsers = FirebaseDatabase.getInstance().getReference("users"); 26 | ListView listViewUsers; 27 | Button back; 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | setContentView(R.layout.activity_view_users); 33 | 34 | users = new ArrayList<>(); 35 | 36 | listViewUsers = (ListView)findViewById(R.id.userList); 37 | 38 | listViewUsers.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { 39 | @Override 40 | public boolean onItemLongClick(AdapterView adapterView, View view, int i, long l) { 41 | DataBaseUser user = users.get(i); 42 | showUpdateDeleteDialog(user); 43 | return true; 44 | } 45 | }); 46 | 47 | back = (Button) findViewById(R.id.backBtn); 48 | back.setOnClickListener(new View.OnClickListener() { 49 | @Override 50 | public void onClick(View v) { 51 | goBack(); 52 | } 53 | }); 54 | 55 | Intent i = getIntent(); 56 | activeUser = (Administrator) i.getSerializableExtra("user"); 57 | users = (ArrayList) i.getSerializableExtra("users"); 58 | activeUser.setUsers(users); 59 | 60 | databaseUsers.addValueEventListener(new ValueEventListener() { 61 | @Override 62 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) { 63 | users.clear(); 64 | for(DataSnapshot postSnapshot : dataSnapshot.getChildren()){ 65 | DataBaseUser usr = postSnapshot.getValue(DataBaseUser.class); 66 | 67 | if(!usr.getRole().equals("Admin")){ 68 | users.add(usr); // add all users expect admin 69 | } 70 | } 71 | activeUser.setUsers(users); 72 | UserList usersAdapter = new UserList(ViewUsers.this, users); 73 | listViewUsers.setAdapter(usersAdapter); 74 | } 75 | 76 | @Override 77 | public void onCancelled(@NonNull DatabaseError databaseError) { 78 | 79 | } 80 | }); 81 | 82 | } 83 | 84 | private void showUpdateDeleteDialog(DataBaseUser user) { 85 | activeUser.deleteUser(user); 86 | Toast.makeText(this, "User deleted", Toast.LENGTH_LONG).show(); 87 | } 88 | 89 | public void goBack(){ 90 | Intent i = new Intent(this, Admin.class); 91 | i.putExtra("user", activeUser); 92 | i.putExtra("users", activeUser.getUsers()); 93 | i.putExtra("services", activeUser.getServices()); 94 | startActivity(i); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Source Code/app/src/main/java/com/example/final_project/WalkInClinic.java: -------------------------------------------------------------------------------- 1 | package com.example.final_project; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | 7 | public class WalkInClinic implements Serializable { 8 | private String _id; 9 | private String _name; 10 | private String _address; 11 | private ArrayList _paymentMethods; 12 | private String _phoneNumber; 13 | private ArrayList _insuranceTypes; 14 | private ArrayList _serviceIds, _closingTimes, _openingTimes; 15 | private ArrayList _closedDays; 16 | private Integer _rating, _numOfRatings; 17 | private static int DEFAULT_RATING = 3; 18 | private ArrayList _allRatings; 19 | 20 | public WalkInClinic(String name, String address, ArrayList paymentMethods, String phoneNumber, ArrayList insuranceTypes, ArrayList openingTimes, ArrayList closingTimes){ 21 | _name = name; 22 | _address = address; 23 | _paymentMethods = paymentMethods; 24 | _phoneNumber = phoneNumber; 25 | _insuranceTypes = insuranceTypes; 26 | _serviceIds = new ArrayList<>(); 27 | _openingTimes = openingTimes; 28 | _closingTimes = closingTimes; 29 | _closedDays = new ArrayList<>(Arrays.asList(0,0,0,0,0,0,0));; 30 | _id = null; 31 | _rating = DEFAULT_RATING; 32 | _numOfRatings = 0; 33 | _allRatings = new ArrayList<>(); 34 | } 35 | 36 | public WalkInClinic(String name, String address, ArrayList paymentMethods, String phoneNumber, ArrayList insuranceTypes){ 37 | _name = name; 38 | _address = address; 39 | _paymentMethods = paymentMethods; 40 | _phoneNumber = phoneNumber; 41 | _insuranceTypes = insuranceTypes; 42 | _serviceIds = new ArrayList<>(); 43 | _openingTimes = new ArrayList<>(Arrays.asList("","","","","","","")); 44 | _closingTimes = new ArrayList<>(Arrays.asList("","","","","","","")); 45 | _closedDays = new ArrayList<>(Arrays.asList(1,1,1,1,1,1,1)); 46 | _id = null; 47 | _rating = DEFAULT_RATING; 48 | _numOfRatings = 0; 49 | _allRatings = new ArrayList<>(Arrays.asList(0,0,0,0,0)); 50 | } 51 | 52 | 53 | public WalkInClinic(String name, String address, ArrayList paymentMethods, String phoneNumber, ArrayList insuranceTypes, ArrayList openingTimes, ArrayList closingTimes, ArrayList serviceIds){ 54 | _name = name; 55 | _address = address; 56 | _paymentMethods = paymentMethods; 57 | _phoneNumber = phoneNumber; 58 | _insuranceTypes = insuranceTypes; 59 | _serviceIds = serviceIds; 60 | _openingTimes = openingTimes; 61 | _closingTimes = closingTimes; 62 | _closedDays = new ArrayList<>(Arrays.asList(1,1,1,1,1,1,1)); 63 | _id = null; 64 | _rating = DEFAULT_RATING; 65 | _numOfRatings = 0; 66 | _allRatings = new ArrayList<>(Arrays.asList(0,0,0,0,0)); 67 | } 68 | 69 | public WalkInClinic(){ 70 | _serviceIds = new ArrayList<>(); 71 | _closingTimes = new ArrayList<>(Arrays.asList("","","","","","","")); 72 | _openingTimes = new ArrayList<>(Arrays.asList("","","","","","","")); 73 | _paymentMethods = new ArrayList<>(); 74 | _insuranceTypes = new ArrayList<>(); 75 | _closedDays = new ArrayList<>(Arrays.asList(1,1,1,1,1,1,1)); 76 | _id = null; 77 | _rating = DEFAULT_RATING; 78 | _numOfRatings = 0; 79 | _allRatings = new ArrayList<>(Arrays.asList(0,0,0,0,0)); 80 | } 81 | 82 | public void setId(String id){_id = id;} 83 | public void setName(String name){_name = name;} 84 | public void setAddress(String address){_address = address;} 85 | public void setPaymentMethods(ArrayList methods){_paymentMethods = methods;} 86 | public void setPhoneNumber(String phoneNumber){_phoneNumber = phoneNumber;} 87 | public void setInsuranceTypes(ArrayList insuranceTypes){_insuranceTypes = insuranceTypes;} 88 | public void setServiceIds(ArrayList val){_serviceIds = val;} 89 | public void setClosingTimes(ArrayList closingTimes){_closingTimes = closingTimes;} 90 | public void setOpeningTimes(ArrayList openingTimes){_openingTimes = openingTimes;} 91 | public void setClosedDays(ArrayList days){_closedDays = days;} 92 | public void setRating(Integer rate){_rating = rate;} 93 | public void setNumOfRatings(Integer num){_numOfRatings = num;} 94 | public void setAllRatings(ArrayList arr){_allRatings = arr;} 95 | public void addService(String id){ 96 | _serviceIds.add(id); 97 | } 98 | 99 | public void removeService(String id) throws IllegalArgumentException{ 100 | try { 101 | _serviceIds.remove(id); 102 | } catch(Exception ex){ 103 | throw new IllegalArgumentException("No service with that Id"); 104 | } 105 | } 106 | 107 | public void decrementRating(int rate){ 108 | _numOfRatings--; 109 | _allRatings.set(rate-1, _allRatings.get(rate-1)-1); 110 | } 111 | 112 | public void addRating(int rate){ 113 | _numOfRatings++; 114 | _allRatings.set(rate-1, _allRatings.get(rate-1)+1); 115 | int sum = 0; 116 | for(int j = 0; j<5;j++){ 117 | sum = sum + _allRatings.get(j) * (j+1); 118 | } 119 | _rating = Math.round(sum / _numOfRatings); 120 | } 121 | 122 | 123 | public String getId(){return _id;} 124 | public String getName(){return _name;} 125 | public String getAddress(){return _address;} 126 | public ArrayList getPaymentMethods(){return _paymentMethods;} 127 | public String getPhoneNumber(){return _phoneNumber;} 128 | public ArrayList getInsuranceTypes(){return _insuranceTypes;} 129 | public ArrayList getServiceIds(){return _serviceIds;} 130 | public ArrayList getClosingTimes(){return _closingTimes;} 131 | public ArrayList getOpeningTimes(){return _openingTimes;} // times represented like [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday] 132 | public ArrayList getClosedDays(){return _closedDays;} 133 | public Integer getRating(){return _rating;} 134 | public Integer getNumOfRatings(){return _numOfRatings;} 135 | public ArrayList getAllRatings(){return _allRatings;} 136 | } 137 | -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-anydpi/ic_geolocate.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-anydpi/ic_geolocate_black.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-hdpi/ic_geolocate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-hdpi/ic_geolocate.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-hdpi/ic_geolocate_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-hdpi/ic_geolocate_black.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-mdpi/ic_geolocate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-mdpi/ic_geolocate.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-mdpi/ic_geolocate_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-mdpi/ic_geolocate_black.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-xhdpi/ic_geolocate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-xhdpi/ic_geolocate.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-xhdpi/ic_geolocate_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-xhdpi/ic_geolocate_black.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-xxhdpi/ic_geolocate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-xxhdpi/ic_geolocate.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable-xxhdpi/ic_geolocate_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable-xxhdpi/ic_geolocate_black.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable/clock.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable/info_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable/info_button.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable/logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable/logo3.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/drawable/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techwithtim/Walk-In-Clinic-Android-App/aaea719cf6164309c1a46d60a36f2e49096caf01/Source Code/app/src/main/res/drawable/map.png -------------------------------------------------------------------------------- /Source Code/app/src/main/res/layout/activity_add_services.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 14 | 15 | 18 | 19 | 30 | 31 | 35 | 36 | 37 | 38 | 41 | 42 | 49 | 50 | 53 | 54 | 67 | 68 | 69 | 72 | -------------------------------------------------------------------------------- /Source Code/app/src/main/res/layout/update_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 18 | 19 | 24 | 25 | 28 | 29 | /> 30 | 39 | 40 | 48 | 49 | 57 | 58 | 59 | 60 | 61 | 65 | 66 |