diff --git a/MyHospital/.firebaserc b/MyHospital/.firebaserc new file mode 100644 index 0000000000000000000000000000000000000000..abc3c99f180fc2f6882a8c0b96e76186060317c7 --- /dev/null +++ b/MyHospital/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "myhospital-louli" + } +} diff --git a/MyHospital/.gitignore b/MyHospital/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..aa724b77071afcbd9bb398053e05adaf7ac9405a --- /dev/null +++ b/MyHospital/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/MyHospital/.idea/.gitignore b/MyHospital/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..26d33521af10bcc7fd8cea344038eaaeb78d0ef5 --- /dev/null +++ b/MyHospital/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/MyHospital/.idea/.name b/MyHospital/.idea/.name new file mode 100644 index 0000000000000000000000000000000000000000..61121bf89d32a98ead2f3692f166072f5965dab9 --- /dev/null +++ b/MyHospital/.idea/.name @@ -0,0 +1 @@ +ChatApp \ No newline at end of file diff --git a/MyHospital/.idea/appInsightsSettings.xml b/MyHospital/.idea/appInsightsSettings.xml new file mode 100644 index 0000000000000000000000000000000000000000..6e98d0e8e9a8f02fec127468d288b12d2def344c --- /dev/null +++ b/MyHospital/.idea/appInsightsSettings.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="AppInsightsSettings"> + <option name="selectedTabId" value="Firebase Crashlytics" /> + <option name="tabSettings"> + <map> + <entry key="Firebase Crashlytics"> + <value> + <InsightsFilterSettings> + <option name="connection"> + <ConnectionSetting> + <option name="appId" value="com.example.chatapp" /> + <option name="mobileSdkAppId" value="1:949730560966:android:cec117fd99a9d459bf80c7" /> + <option name="projectId" value="myhospital-finalversion" /> + <option name="projectNumber" value="949730560966" /> + </ConnectionSetting> + </option> + <option name="signal" value="SIGNAL_UNSPECIFIED" /> + <option name="timeIntervalDays" value="THIRTY_DAYS" /> + <option name="visibilityType" value="ALL" /> + </InsightsFilterSettings> + </value> + </entry> + </map> + </option> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/.idea/compiler.xml b/MyHospital/.idea/compiler.xml new file mode 100644 index 0000000000000000000000000000000000000000..b589d56e9f285d8cfdc6c270853a5d439021a278 --- /dev/null +++ b/MyHospital/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/.idea/deploymentTargetSelector.xml b/MyHospital/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000000000000000000000000000000000000..b268ef36cd2de3a14ddddf25aa9f5d4e95731e18 --- /dev/null +++ b/MyHospital/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/.idea/gradle.xml b/MyHospital/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..cc87c153784272bbe9ff601190fa1c3a663b2244 --- /dev/null +++ b/MyHospital/.idea/gradle.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleHome" value="$USER_HOME$/gradle-8.8" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/.idea/kotlinc.xml b/MyHospital/.idea/kotlinc.xml new file mode 100644 index 0000000000000000000000000000000000000000..6d0ee1c2a93d68c40488d9db245d48a739c69277 --- /dev/null +++ b/MyHospital/.idea/kotlinc.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="KotlinJpsPluginSettings"> + <option name="version" value="2.0.0" /> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/.idea/migrations.xml b/MyHospital/.idea/migrations.xml new file mode 100644 index 0000000000000000000000000000000000000000..f8051a6f973e69a86e6f07f1a1c87f17a31c7235 --- /dev/null +++ b/MyHospital/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/.idea/misc.xml b/MyHospital/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..8978d23db569daa721cb26dde7923f4c673d1fc9 --- /dev/null +++ b/MyHospital/.idea/misc.xml @@ -0,0 +1,9 @@ +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/app/.gitignore b/MyHospital/app/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..42afabfd2abebf31384ca7797186a27a4b7dbee8 --- /dev/null +++ b/MyHospital/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/MyHospital/app/.idea/.gitignore b/MyHospital/app/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..26d33521af10bcc7fd8cea344038eaaeb78d0ef5 --- /dev/null +++ b/MyHospital/app/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/MyHospital/app/.idea/gradle.xml b/MyHospital/app/.idea/gradle.xml new file mode 100644 index 0000000000000000000000000000000000000000..cfb18c2752752a0c44b4f9370302449324e32731 --- /dev/null +++ b/MyHospital/app/.idea/gradle.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="distributionType" value="LOCAL" /> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleHome" value="$USER_HOME$/gradle-8.8" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + <option name="parallelModelFetch" value="true" /> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/app/.idea/material_theme_project_new.xml b/MyHospital/app/.idea/material_theme_project_new.xml new file mode 100644 index 0000000000000000000000000000000000000000..312222c8d4291d2515aea0c33c114ac53321d095 --- /dev/null +++ b/MyHospital/app/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="MaterialThemeProjectNewConfig"> + <option name="metadata"> + <MTProjectMetadataState> + <option name="migrated" value="true" /> + <option name="pristineConfig" value="false" /> + <option name="userId" value="-5d17e73c:18f59c4adc3:-7ffe" /> + </MTProjectMetadataState> + </option> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/app/.idea/migrations.xml b/MyHospital/app/.idea/migrations.xml new file mode 100644 index 0000000000000000000000000000000000000000..f8051a6f973e69a86e6f07f1a1c87f17a31c7235 --- /dev/null +++ b/MyHospital/app/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/app/.idea/misc.xml b/MyHospital/app/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..3040d03eac7808595e6eba1929f2e79d28037e12 --- /dev/null +++ b/MyHospital/app/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/MyHospital/app/ApplicationRelease.jks b/MyHospital/app/ApplicationRelease.jks new file mode 100644 index 0000000000000000000000000000000000000000..becf749b2fca887d043872d26f5b1da864b30c98 Binary files /dev/null and b/MyHospital/app/ApplicationRelease.jks differ diff --git a/MyHospital/app/build.gradle.kts b/MyHospital/app/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..b9d2b28028a87f734cdf57aa7557a57e285b5043 --- /dev/null +++ b/MyHospital/app/build.gradle.kts @@ -0,0 +1,65 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.google.gms.google.services) +} + +android { + namespace = "com.example.chatapp" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.chatapp" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation(platform("com.google.firebase:firebase-bom:32.1.0")) // Import the BoM for Firebase + // Firebase dependencies + implementation("com.google.firebase:firebase-auth") + implementation("com.google.firebase:firebase-database") + implementation("com.google.firebase:firebase-storage") + implementation("com.google.firebase:firebase-functions") + implementation("com.google.firebase:firebase-analytics") + implementation("com.google.firebase:firebase-appcheck") + implementation("com.google.firebase:firebase-appcheck-debug") + implementation("com.google.firebase:firebase-appcheck-playintegrity") + + implementation("com.firebaseui:firebase-ui-database:8.0.2") + implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation("androidx.cardview:cardview:1.0.0") + implementation("com.github.bumptech.glide:glide:4.16.0") + implementation("de.hdodenhof:circleimageview:3.1.0") + implementation("com.orhanobut:dialogplus:1.11@aar") + implementation("com.google.android.material:material:1.6.1") + + // Other dependencies + implementation(libs.appcompat) + implementation(libs.material) + implementation(libs.activity) + implementation(libs.constraintlayout) + + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} +apply(plugin = "com.google.gms.google-services") \ No newline at end of file diff --git a/MyHospital/app/google-services.json b/MyHospital/app/google-services.json new file mode 100644 index 0000000000000000000000000000000000000000..ce708f1dca30c9266af10d6fed6de8063f885cc0 --- /dev/null +++ b/MyHospital/app/google-services.json @@ -0,0 +1,30 @@ +{ + "project_info": { + "project_number": "949730560966", + "firebase_url": "https://myhospital-finalversion-default-rtdb.firebaseio.com", + "project_id": "myhospital-finalversion", + "storage_bucket": "myhospital-finalversion.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:949730560966:android:cec117fd99a9d459bf80c7", + "android_client_info": { + "package_name": "com.example.chatapp" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBVsnkfngqm_Vb8Y-DXHKlBJSFsgAqTuQw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/MyHospital/app/proguard-rules.pro b/MyHospital/app/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..481bb434814107eb79d7a30b676d344b0df2f8ce --- /dev/null +++ b/MyHospital/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/MyHospital/app/src/androidTest/java/com/example/chatapp/ExampleInstrumentedTest.java b/MyHospital/app/src/androidTest/java/com/example/chatapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000000000000000000000000000000000000..90c4cd03b0670f84ca6b8240c1b14b842c3ef06b --- /dev/null +++ b/MyHospital/app/src/androidTest/java/com/example/chatapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.chatapp; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.chatapp", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/MyHospital/app/src/loureen/release/app-release.apk b/MyHospital/app/src/loureen/release/app-release.apk new file mode 100644 index 0000000000000000000000000000000000000000..0770e1f0a65f61bfa854ca68b2012fa8728446e5 Binary files /dev/null and b/MyHospital/app/src/loureen/release/app-release.apk differ diff --git a/MyHospital/app/src/loureen/release/baselineProfiles/0/app-release.dm b/MyHospital/app/src/loureen/release/baselineProfiles/0/app-release.dm new file mode 100644 index 0000000000000000000000000000000000000000..4dd16283830a8527df6bef769a261b8dbe0e3b9f Binary files /dev/null and b/MyHospital/app/src/loureen/release/baselineProfiles/0/app-release.dm differ diff --git a/MyHospital/app/src/loureen/release/baselineProfiles/1/app-release.dm b/MyHospital/app/src/loureen/release/baselineProfiles/1/app-release.dm new file mode 100644 index 0000000000000000000000000000000000000000..6602d278b125e1fe00f1e6a2237e600aee192481 Binary files /dev/null and b/MyHospital/app/src/loureen/release/baselineProfiles/1/app-release.dm differ diff --git a/MyHospital/app/src/loureen/release/output-metadata.json b/MyHospital/app/src/loureen/release/output-metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..27b0020c5d10669a28023346e343bff3be5c421a --- /dev/null +++ b/MyHospital/app/src/loureen/release/output-metadata.json @@ -0,0 +1,37 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.example.chatapp", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-release.apk" + } + ], + "elementType": "File", + "baselineProfiles": [ + { + "minApi": 28, + "maxApi": 30, + "baselineProfiles": [ + "baselineProfiles/1/app-release.dm" + ] + }, + { + "minApi": 31, + "maxApi": 2147483647, + "baselineProfiles": [ + "baselineProfiles/0/app-release.dm" + ] + } + ], + "minSdkVersionForDexing": 24 +} \ No newline at end of file diff --git a/MyHospital/app/src/main/AndroidManifest.xml b/MyHospital/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..928196fb63be91668e29f095f16664fafe719486 --- /dev/null +++ b/MyHospital/app/src/main/AndroidManifest.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" > + + <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher_foreground" + android:label="MyHospital" + android:roundIcon="@mipmap/ic_launcher_foreground" + android:supportsRtl="true" + android:theme="@style/Theme.ChatApp" + tools:targetApi="31" > + + <activity + android:name=".RequistChange" + android:exported="false" /> + <activity + android:name=".MyCalender" + android:exported="false" /> + <activity + android:name=".AllCalender" + android:exported="false" /> + <activity + android:name=".TextActivity" + android:exported="false" /> + <activity + android:name=".ChatActivity" + android:exported="false" /> + <activity + android:name=".SignUpAcrivity" + android:exported="false" /> + <activity + android:name=".SignInActivity" + android:exported="true" > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity + android:name=".MainActivity" + android:exported= "false"/> + + <meta-data + android:name="preloaded_fonts" + android:resource="@array/preloaded_fonts" /> + </application> + +</manifest> \ No newline at end of file diff --git a/MyHospital/app/src/main/ic_launcher-playstore.png b/MyHospital/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000000000000000000000000000000000000..2d909a67159d4de9c51e43c85578606be89572ce Binary files /dev/null and b/MyHospital/app/src/main/ic_launcher-playstore.png differ diff --git a/MyHospital/app/src/main/java/com/example/chatapp/AllCalender.java b/MyHospital/app/src/main/java/com/example/chatapp/AllCalender.java new file mode 100644 index 0000000000000000000000000000000000000000..2d655f29afb572404b1a9dc21ffcc6e0a865dd8c --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/AllCalender.java @@ -0,0 +1,265 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.widget.Button; +import android.widget.CalendarView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +import com.google.firebase.FirebaseApp; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +public class AllCalender extends AppCompatActivity { + private CalendarView calendarView; // CalendarView for displaying calendar + private Button btnMain; // Button for main actions + private DatabaseReference databaseReference; // Reference to Firebase database + + private TextView tvShiftDetails; // TextView for displaying shift details + + + @SuppressLint("MissingInflatedId") // Suppress lint warning for missing inflated ID + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState);// Call superclass method + FirebaseApp.initializeApp(this);// Initialize Firebase app + setContentView(R.layout.activity_allcalender);// Set the content view to the activity layout + + Toolbar toolbar = findViewById(R.id.toolbar);// Find the toolbar by ID + setSupportActionBar(toolbar);// Set the toolbar as the app bar for the activity + getSupportActionBar().setTitle(""); // Set the toolbar title to empty + + + initFirebase(); // Initialize Firebase components + setupCalendar(); // Set up the calendar view + tvShiftDetails = findViewById(R.id.tvShiftDetails);// Find the shift details text view by ID + } + + // Method to initialize Firebase components and Getting Firebase database reference + private void initFirebase() { + FirebaseAuth auth = FirebaseAuth.getInstance(); + if (auth.getCurrentUser() == null) { + Toast.makeText(this, "No signed-in user found", Toast.LENGTH_LONG).show(); + // Redirect to login activity or handle user session + } else { + + databaseReference = FirebaseDatabase.getInstance().getReference("MyHospital/Users/Shifts"); + } + } + + // Setting Calender and correct date formate + private void setupCalendar() { + calendarView = findViewById(R.id.calendarView); + calendarView.setOnDateChangeListener((view, year, month, dayOfMonth) -> { + @SuppressLint("DefaultLocale") + String date = String.format("%02d.%02d.%04d", dayOfMonth, month + 1, year); // Ensuring month is correctly adjusted and zero-padded + Log.d("AllCalender", "Selected date: " + date); // Log the selected date to ensure the correct formate + searchDatabase(date); + }); + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(calendarView, (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + + // Method to search the database for shifts on a specific date + private void searchDatabase(String date) { + // Check if database reference is initialized + if (databaseReference == null) { + Toast.makeText(this, "Database reference is not initialized", Toast.LENGTH_SHORT).show(); + return; + } + + + // Retrieve shift details from Firebase for the selected date + databaseReference.addListenerForSingleValueEvent(new ValueEventListener() { + // Handle data change + @Override + public void onDataChange(@NonNull DataSnapshot dataSnapshot) { + StringBuilder detailsBuilder = new StringBuilder();// StringBuilder for shift details + List<TextModel> shiftsList = new ArrayList<>();// List to store shifts + + // Iterate over user snapshots + for (DataSnapshot userSnapshot : dataSnapshot.getChildren()) { + // Iterate over shift snapshots + for (DataSnapshot shiftSnapshot : userSnapshot.getChildren()) { + // Get shift as TextModel + TextModel shift = shiftSnapshot.getValue(TextModel.class); + // Check if shift is not null + if (shift != null) { + // Check if shift date matches the searched date + if (date.equals(shift.getDateFrom())) { + // Then add shift to the list + shiftsList.add(shift); + } + } else { + //Toast an message Shift is null for Shift ID + Toast.makeText(AllCalender.this, "Shift is null for Shift ID:"+shiftSnapshot.getKey(), Toast.LENGTH_SHORT).show(); + + } + } + } + + // Sort shiftsList by shiftSelection + Collections.sort(shiftsList, new Comparator<TextModel>() { + @Override + public int compare(TextModel shift1, TextModel shift2) { + return shift1.getShiftSelection().compareTo(shift2.getShiftSelection()); + } + }); + + // Display the sorted shifts + for (TextModel shift : shiftsList) { + detailsBuilder + .append("\nName: ").append(shift.getUserName()) + .append("\nDate : ").append(shift.getDateFrom()) + .append("\nAt: ").append(shift.getShiftSelection()) + .append("\nDepartment: ").append(shift.getDepartment()) + .append("\nShift Room: ").append(shift.getSectionSelect()) + .append("\nColleague: ").append(shift.getColleg()) + .append("\n───────────────────\n"); + } + + if (detailsBuilder.length() == 0) { + tvShiftDetails.setText("No shifts found for: " + date); + } else { + tvShiftDetails.setText(detailsBuilder.toString()); + } + } + + @Override + public void onCancelled(DatabaseError databaseError) { + Toast.makeText(AllCalender.this, "Error fetching data: " + databaseError.getMessage(), Toast.LENGTH_SHORT).show(); + Log.e("AllCalender", "Database error: " + databaseError.getMessage()); // Log the error + } + }); + } + + // Overriding the onCreateOptionsMenu + // Inflate the menu options and Get menu inflater + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.main_calender, menu); // Inflate the Calender menu and return true to display the menu + return true; + } + + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + //define the MenueItems and then set the visibility + MenuItem shiftAnfrage = menu.findItem(R.id.ShiftAnfrage); + MenuItem onDayCalender = menu.findItem(R.id.onDayCalender); + + + // Logic to set visibility who can see the Items + //if admin he is the only to see the Change Request. + boolean isLoggedIn = checkUserLoggedIn(); + shiftAnfrage.setVisible(isLoggedIn); + //onDayCalender only can be seen by others than the Admin + onDayCalender.setVisible(!isLoggedIn); + + + return super.onPrepareOptionsMenu(menu); + } + + //extra main_menu icons added and handelt + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + + if (item.getItemId() == R.id.ShiftAnfrage) { + // only Shift Leiter can see this Activity If Shifts Request icon selected then start Request activity where the Requests can be shown + // Finish current activity and return true as item handled + FirebaseAuth.getInstance(); + startActivity(new Intent(AllCalender.this, RequistChange.class)); + finish(); + return true; + } + // If Send Message icon selected then start Main activity where the Message can be sended + // Finish current activity and return true as item handled + if (item.getItemId() == R.id.sendMessage) { + FirebaseAuth.getInstance(); + startActivity(new Intent(AllCalender.this, MainActivity.class)); + finish(); + return true; + } + // If Shift List icon selected then start TextActivity activity where the list displayed + // Finish current activity and return true as item handled + + if (item.getItemId() == R.id.listShift) { + FirebaseAuth.getInstance(); + startActivity(new Intent(AllCalender.this, TextActivity.class)); + finish(); + return true; + } + // If on day calendar icon selected then start my calendar activity + // Finish current activity and return true as item handled + if (item.getItemId() == R.id.onDayCalender) { + startActivity(new Intent(AllCalender.this, MyCalender.class)); + finish(); + return true; + } + // If home icon selected then Start main activity then Finish current activity + // And return true as item handled + if (item.getItemId() == R.id.home) { + startActivity(new Intent(AllCalender.this, MainActivity.class)); + finish(); + return true; + } + // If logout icon selected then sign out from Firebase and then start sign-in activity + if (item.getItemId() == R.id.logout) { + FirebaseAuth.getInstance().signOut(); + + startActivity(new Intent(AllCalender.this, SignInActivity.class)); + finish(); + return true; + } + return false;// Return false if item not handled + + } + + // Check if user is logged in as ShiftsLeiter email + // And return true if email matches. + private boolean checkUserLoggedIn() { + String loggedInUserEmail = getLoggedInUserEmail(); + return "loureen@gmail.com".equals(loggedInUserEmail); + } + + // Get the logged in user's email + private String getLoggedInUserEmail() { + // Get current Firebase user and check If user is not null then return the user´s email + // otherwise return null. + FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + if (user != null) { + return user.getEmail(); + } else { + return null; + } + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/ChatActivity.java b/MyHospital/app/src/main/java/com/example/chatapp/ChatActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..7ee49023df548e27cd9d5d22353d6d60ca1e3549 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/ChatActivity.java @@ -0,0 +1,248 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.gms.tasks.OnFailureListener; +import com.google.android.gms.tasks.OnSuccessListener; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.UUID; + +public class ChatActivity extends AppCompatActivity { + + String recieverId, recieverName, senderRoom, recieverRoom; // Declare variables for receiver ID, name, sender and receiver rooms + DatabaseReference dbRefSender, dbRefReciver, userRef; // Declare database references for sender, receiver, and user + ImageView btnsendMessageIcon; // Declare ImageView for send message button + EditText messageSendText; // Declare EditText for message input + RecyclerView recyclerView; // Declare RecyclerView for displaying messages + MessageAdapter messageAdapter; // Declare MessageAdapter for RecyclerView + + + @Override + protected void onCreate(Bundle savedInstanceState) { // onCreate method + super.onCreate(savedInstanceState); // Call superclass method + EdgeToEdge.enable(this); // Enable edge-to-edge display + setContentView(R.layout.activity_chat); // Set the content view to the activity layout + + Toolbar toolbar = findViewById(R.id.toolbar); // Find the toolbar by ID + setSupportActionBar(toolbar); // Set the toolbar as the app bar + + userRef = FirebaseDatabase.getInstance().getReference("MyHospital/Users/Chats"); // Get Firebase reference for user chats + recieverId = getIntent().getStringExtra("userID"); // Get receiver ID from intent + recieverName = getIntent().getStringExtra("userName"); // Get receiver name from intent + + getSupportActionBar().setTitle(recieverName + "´s Chat"); // Set the title of the app bar + + + + // Get sender and receiver room IDs if receiver ID is not null + if (recieverId != null) { + senderRoom = FirebaseAuth.getInstance().getUid() + recieverId; // Create sender room ID + recieverRoom = recieverId + FirebaseAuth.getInstance().getUid(); // Create receiver room ID + } + + btnsendMessageIcon = findViewById(R.id.btnsendMessageIcon); // Find the send message button by ID + messageAdapter = new MessageAdapter(this); // Initialize MessageAdapter + recyclerView = findViewById(R.id.chatRecycler); // Find the RecyclerView by ID + messageSendText = findViewById(R.id.messageEditSend); // Find the message input EditText by ID + recyclerView.setAdapter(messageAdapter); // Set the adapter for RecyclerView + recyclerView.setLayoutManager(new LinearLayoutManager(this)); // Set layout manager for RecyclerView + + + //show all old Messages in chatroom for sender and reciever from Database + // Get Firebase references for sender and receiver chats + dbRefSender = FirebaseDatabase.getInstance().getReference("MyHospital/Users/Chats").child(senderRoom); + dbRefReciver = FirebaseDatabase.getInstance().getReference("MyHospital/Users/Chats").child(recieverRoom); + + // Add event listener for new messages in sender's chat room + dbRefSender.addValueEventListener(new ValueEventListener() { + // Handle data change + @SuppressLint("NotifyDataSetChanged") + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + // Create list to store messages + List<MessageModel> messages = new ArrayList<>(); + // Iterate over message snapshots + for (DataSnapshot dataSnapshot : snapshot.getChildren()) { + // Get message model from snapshot + MessageModel messageModel = dataSnapshot.getValue(MessageModel.class); + // Add message to list + messages.add(messageModel); + } + // Sort messages by timestamp + messages.sort(Comparator.comparingLong(MessageModel::getTimestamp)); + // Clear adapter + messageAdapter.clear(); + // Add sorted messages to adapter + for (MessageModel message : messages) { + messageAdapter.add(message); + } + // Notify adapter of data change + messageAdapter.notifyDataSetChanged(); + + // Scroll to the latest message + recyclerView.scrollToPosition(messageAdapter.getItemCount() - 1); + + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { + // Handle error (logging, showing a message, etc.) + } + }); + // Set click listener for send message button + btnsendMessageIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // Handle button click then get message text + String message = messageSendText.getText().toString(); + //if there is a message written and is not empty + if (!message.trim().isEmpty()) { + // Send the message + SendMessage(message); + } else { + //Otherwise show toast if message is empty + Toast.makeText(ChatActivity.this, "No Message Written", Toast.LENGTH_SHORT).show(); + } + } + }); + + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + // Method to send a message by Generating unique ID for message and Creating a message model + private void SendMessage(String message) { + String messageId = UUID.randomUUID().toString(); + MessageModel messageModel = new MessageModel(messageId, FirebaseAuth.getInstance().getUid(), message); + messageAdapter.add(messageModel);// Add message to adapter and take the Names from the MessageModal + + // Add message to sender's chat room in database + dbRefSender.child(messageId).setValue(messageModel) + .addOnSuccessListener(new OnSuccessListener<Void>() { + // Handling success + @Override + public void onSuccess(Void unused) { + // Scroll to the latest message + recyclerView.scrollToPosition(messageAdapter.getItemCount() - 1); + } + }).addOnFailureListener(new OnFailureListener() { + // Handle failure + @Override + public void onFailure(@NonNull Exception e) { + // Show toast on failure + Toast.makeText(ChatActivity.this, "Failed to Send the MSG", Toast.LENGTH_SHORT).show(); + } + }); + // Add message to receiver's chat room in databas + dbRefReciver.child(messageId).setValue(messageModel); + // Clear message input + messageSendText.setText(""); + } + + // Inflate menu options,Get menu inflater,Inflate chat menu and then + // Return true to display the menu + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.chat_menu, menu); + return true; + } + + // Prepare menu options + public boolean onPrepareOptionsMenu(Menu menu) { + MenuItem shiftAnfrage = menu.findItem(R.id.ShiftAnfrage); + MenuItem showAllShifts = menu.findItem(R.id.ShowAllShifts); + MenuItem onDayCalender = menu.findItem(R.id.onDayCalender); + + // Logic to set visibility + boolean isLoggedIn = checkUserLoggedIn(); // Replace with your actual logic + shiftAnfrage.setVisible(isLoggedIn); + showAllShifts.setVisible(!isLoggedIn); + onDayCalender.setVisible(!isLoggedIn); + return super.onPrepareOptionsMenu(menu); + } + + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == R.id.ShiftAnfrage) { + startActivity(new Intent(ChatActivity.this, MainActivity.class)); + finish(); + return true; + } + + if(item.getItemId()== R.id.ShowAllShifts){ + startActivity(new Intent(ChatActivity.this, AllCalender.class)); + finish(); + return true; + } + if(item.getItemId()== R.id.listShift){ + startActivity(new Intent(ChatActivity.this, TextActivity.class)); + finish(); + return true; + } + if(item.getItemId()== R.id.onDayCalender){ + startActivity(new Intent(ChatActivity.this, MyCalender.class)); + finish(); + return true; + } + if (item.getItemId() == R.id.home) { + startActivity(new Intent(ChatActivity.this, MainActivity.class)); + finish(); + return true; + } + return false; + } + + // Check if user is logged in as ShiftsLeiter email + // And return true if email matches. + private boolean checkUserLoggedIn() { + String loggedInUserEmail = getLoggedInUserEmail(); // Replace with actual logic to get the user's email + return "loureen@gmail.com".equals(loggedInUserEmail); + } + + // Get the logged in user's email + private String getLoggedInUserEmail() { + // Get current Firebase user and check If user is not null then return the user´s email + // otherwise return null. + FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + if (user != null) { + return user.getEmail(); + } else { + return null; + } + } +} \ No newline at end of file diff --git a/MyHospital/app/src/main/java/com/example/chatapp/MainActivity.java b/MyHospital/app/src/main/java/com/example/chatapp/MainActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..5853b169436e291508d6286d62ef7ec19d420080 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/MainActivity.java @@ -0,0 +1,248 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.widget.SearchView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.FirebaseApp; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.List; + +public class MainActivity extends AppCompatActivity { + + + RecyclerView recyclerView; // Declare RecyclerView for displaying users + DatabaseReference databaseReference; // Declare DatabaseReference for Firebase + UsersAdapter usersAdapter; // Declare UsersAdapter for RecyclerView + + + @SuppressLint({"MissingInflatedId", "WrongViewCast"}) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + FirebaseApp.initializeApp(this); + setContentView(R.layout.activity_main); + + + // Find the toolbar by ID, Set the toolbar as the app bar and Set the toolbar title to empty + Toolbar toolbar= findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + // Set the toolbar title to empty + getSupportActionBar().setTitle(""); + // Fetch user's name and display welcome message + FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser(); + // Get the current user then Check if user is not null then Get user ID + if (currentUser != null) { + String uid = currentUser.getUid(); + // Get reference to user's data + DatabaseReference userRef = FirebaseDatabase.getInstance().getReference("MyHospital/Users").child(uid); + + // Get reference to user's data + userRef.addListenerForSingleValueEvent(new ValueEventListener() { + // Handle data change and Get user model from snapshot + @Override + public void onDataChange(@NonNull DataSnapshot dataSnapshot) { + UserModel userModel = dataSnapshot.getValue(UserModel.class); + // Check if user model is not null + if (userModel != null) { + String welcomeText = userModel.getUserName().toUpperCase(); // Get user's name and convert to uppercase + TextView tvWelcome = findViewById(R.id.tvWelcome);// Find the welcome TextView by ID + tvWelcome.setText(welcomeText);// Set welcome text in TextView + } + } + + // Handle database error and // Log warning message + @Override + public void onCancelled(@NonNull DatabaseError databaseError) { + Log.w("Firebase", "Failed to read user"); + } + }); + } + + + + // Initialize RecyclerView and Adapter + usersAdapter = new UsersAdapter(this); // Initialize UsersAdapter + recyclerView = findViewById(R.id.recycler); // Find the RecyclerView by ID + recyclerView.setAdapter(usersAdapter); // Set adapter for RecyclerView + recyclerView.setLayoutManager(new LinearLayoutManager(this)); // Set layout manager for RecyclerView + + + + // Setup SearchView by finding the id and Set query text listener for SearchView + SearchView searchView = findViewById(R.id.searchView); + searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + // Handle query text submit and Filter users based on query + @Override + public boolean onQueryTextSubmit(String query) { + usersAdapter.filter(query); + return false; + } + + // Handle query text change and Filter users based on new text + @Override + public boolean onQueryTextChange(String newText) { + usersAdapter.filter(newText); + return false; + } + }); + + + + // Initialize database reference for users and Get reference to users data + databaseReference= FirebaseDatabase.getInstance().getReference("MyHospital/Users"); + databaseReference.addValueEventListener(new ValueEventListener() { + @SuppressLint("NotifyDataSetChanged") + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + + // Handle data change and Clear adapter + usersAdapter.clear(); + // Iterate over user snapshots + for(DataSnapshot dataSnapshot:snapshot.getChildren()){ + // Get user ID + String uId=dataSnapshot.getKey(); + // Get user model from snapshot + UserModel userModel= dataSnapshot.getValue(UserModel.class); + + // Check if user model is valid + if(userModel != null && userModel.getUserID() !=null && !userModel.getUserID().equals(FirebaseAuth.getInstance().getUid())){ + //Update if not matching and add user to Adapter + usersAdapter.add(userModel); + + } + } + List<UserModel> userModelList= usersAdapter.getUserModelList(); + usersAdapter.notifyDataSetChanged();// Notify adapter of data change + } + + // Handle database error and show Toast on error + @Override + public void onCancelled(@NonNull DatabaseError error) { + Toast.makeText(MainActivity.this, "Database error: " + error.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + + + + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + //Initializing Menu inflator for menu icons + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater= getMenuInflater(); + inflater.inflate(R.menu.main_menu,menu); + return true; + } + + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + // Prepare menu options to handle the visibility + MenuItem shiftAnfrage = menu.findItem(R.id.ShiftAnfrage); + MenuItem onDayCalender = menu.findItem(R.id.onDayCalender); + + + + // Logic to set visibility + boolean isLoggedIn = checkUserLoggedIn(); + shiftAnfrage.setVisible(isLoggedIn); + onDayCalender.setVisible(!isLoggedIn); + + + + return super.onPrepareOptionsMenu(menu); + } + //extra main_menu icons added and handelt + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if(item.getItemId()== R.id.logout){ + FirebaseAuth.getInstance().signOut(); + startActivity(new Intent(MainActivity.this,SignInActivity.class)); + finish(); + return true; + } + if(item.getItemId()== R.id.onDayCalender){ + FirebaseAuth.getInstance(); + startActivity(new Intent(MainActivity.this, MyCalender.class)); + finish(); + return true; + } + + if(item.getItemId()== R.id.ShowAllShifts){ + FirebaseAuth.getInstance(); + startActivity(new Intent(MainActivity.this, AllCalender.class)); + finish(); + return true; + } + if(item.getItemId()== R.id.ShiftAnfrage){ + + FirebaseAuth.getInstance(); + startActivity(new Intent(MainActivity.this, RequistChange.class)); + finish(); + return true; + } + if(item.getItemId()== R.id.listShift){ + + FirebaseAuth.getInstance(); + startActivity(new Intent(MainActivity.this, TextActivity.class)); + finish(); + return true; + } + + + return false; + + } + // Check if user is logged in as Shifts lieder email + // And return true if email matches. + private boolean checkUserLoggedIn() { + String loggedInUserEmail = getLoggedInUserEmail(); + return "loureen@gmail.com".equals(loggedInUserEmail); + } + + // Get the logged in user's email + // Get current Firebase user and check If user is not null then return the user´s email + // otherwise return null. + private String getLoggedInUserEmail() { + FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + if (user != null) { + return user.getEmail(); + } else { + return null; + } + } + + +} \ No newline at end of file diff --git a/MyHospital/app/src/main/java/com/example/chatapp/MessageAdapter.java b/MyHospital/app/src/main/java/com/example/chatapp/MessageAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4d37276af0f0c52af4f9415d6dacc725003ed918 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/MessageAdapter.java @@ -0,0 +1,171 @@ +package com.example.chatapp; + + +import android.annotation.SuppressLint; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.auth.FirebaseAuth; + +import java.util.ArrayList; +import java.util.List; + +public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.MyViewHolder> { + private static final String CHANNEL_ID = "chat_app_notifications"; // Define channel ID for notifications + private Context context; // Declare context + private List<MessageModel> MessageModelList; // Declare list for message models + // to store the full list + private List<MessageModel> MessageModelListFull; // Declare list for full message models + private static final int VIEW_TYPE_SEND = 1; // Define view type for sent messages + private static final int VIEW_TYPE_RECIVED = 2; // Define view type for received messages + + + public MessageAdapter(Context context) { // Constructor for MessageAdapter + this.context = context; // Initialize context + this.MessageModelList = new ArrayList<>(); // Initialize message model list + this.MessageModelListFull = new ArrayList<>(MessageModelList); // Copy the full list + createNotificationChannel(); // Create notification channel + } + + + // Add user Model List + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + public void add(MessageModel MessageModel) { // Method to add a message model + MessageModelList.add(MessageModel); // Add message to list + MessageModelListFull.add(MessageModel); // Add message to full list + notifyDataSetChanged(); // Notify adapter of data change + if (!MessageModel.getSenderID().equals(FirebaseAuth.getInstance().getUid())) { // If message is not from current user + showNotification(MessageModel); // Show notification + } + + + } + + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + public void clear() { // Method to clear messages + MessageModelList.clear(); // Clear message list + MessageModelListFull.clear(); // Clear full message list + notifyDataSetChanged(); // Notify adapter of data change + } + + @NonNull + @Override + public MessageAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { // Create view holder + LayoutInflater inflater = LayoutInflater.from(parent.getContext()); // Get layout inflater + if (viewType == VIEW_TYPE_SEND) { // Check if view type is for sent messages + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.message_row_send, parent, false); // Inflate sent message layout + return new MyViewHolder(view); // Return view holder for sent message + } else { // If view type is for received messages + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.message_row_recived, parent, false); // Inflate received message layout + return new MyViewHolder(view); // Return view holder for received message + } + } + + @Override + public int getItemViewType(int position) { // Get item view type + if (getMessageModelList().get(position).getSenderID().equals(FirebaseAuth.getInstance().getUid())) { // Check if message is from current user + return VIEW_TYPE_SEND; // Return view type for sent message + } else { // If message is from other user + return VIEW_TYPE_RECIVED; // Return view type for received message + } + } + + @Override + public void onBindViewHolder(@NonNull MessageAdapter.MyViewHolder holder, int position) { // Bind view holder + MessageModel MessageModel = MessageModelList.get(position); // Get message model for position + + if (MessageModel.getSenderID().equals(FirebaseAuth.getInstance().getUid())) { // Check if message is from current user + holder.txtViewSendMessage.setText(MessageModel.getMessage()); // Set text for sent message + } else { // If message is from other user + holder.txtViewRecivedMessage.setText(MessageModel.getMessage()); // Set text for received message + } + } + + @Override + public int getItemCount() { // Get item count + return MessageModelList.size(); // Return size of message model list + } + + public List<MessageModel> getMessageModelList() { // Get message model list + return MessageModelList; // Return message model list + } + + // Define MyViewHolder class and Declare TextViews for sent and received messages + public class MyViewHolder extends RecyclerView.ViewHolder { + //define Card View user_row xml + private TextView txtViewSendMessage, txtViewRecivedMessage; + + // Constructor for MyViewHolder,Call superclass constructor + public MyViewHolder(@NonNull android.view.View itemView) { + super(itemView); + // Find TextView for sent message by ID + txtViewSendMessage = itemView.findViewById(R.id.tvSendMessage); + // Find TextView for received message by ID + txtViewRecivedMessage = itemView.findViewById(R.id.tvRecievedMessage); + + } + + + } + + // Method to create notification channel +// Method to create notification channel + private void createNotificationChannel() { + // Check if SDK version is Oreo or higher + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + // Set channel name + CharSequence name = "Chat Notifications"; + // Set channel description + String description = "Notifications for new chat messages"; + // Create notification channel + int importance = NotificationManager.IMPORTANCE_DEFAULT; + NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance); + channel.setDescription(description); + // Get notification manager + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + // Create notification channel + notificationManager.createNotificationChannel(channel); + } + } + + // Method to show notification + private void showNotification(MessageModel messageModel) { + Intent intent = new Intent(context, MainActivity.class); // Open MainActivity when the notification is clicked + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); // Set intent flags + + // Create pending intent + PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); + + NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID) // Build notification + .setSmallIcon(R.drawable.add_msg) // Set small icon + .setContentTitle("New Message") // Set content title + .setContentText(messageModel.getMessage()) // Set content text + .setPriority(NotificationCompat.PRIORITY_DEFAULT) // Set priority + .setContentIntent(pendingIntent) // Set the pending intent to be triggered when the notification is clicked + .setAutoCancel(true); // Automatically remove the notification when clicked + + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); // Get notification manager + + // Use a constant notification ID to ensure only one notification is shown + int notificationId = 1; // Use a constant ID for all notifications + notificationManager.notify(notificationId, builder.build()); // Show notification + } + + + + + +} + diff --git a/MyHospital/app/src/main/java/com/example/chatapp/MessageModel.java b/MyHospital/app/src/main/java/com/example/chatapp/MessageModel.java new file mode 100644 index 0000000000000000000000000000000000000000..60674191ee00c1c89a0845413aaa8774f1dc9e4c --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/MessageModel.java @@ -0,0 +1,62 @@ +package com.example.chatapp; + +// Define MessageModel class to provides a structured way to store and manage message data. +// This makes it easy to pass message objects around the application, +// such as saving them to a database or displaying them in a UI. +public class MessageModel { + + private String messageId, senderID, message,RecieverID; + private long timestamp; + + // Default constructor required for calls to DataSnapshot.getValue(MessageModel.class) + public MessageModel() { + } + + public MessageModel(String messageId, String senderID, String message) { // Constructor for MessageModel + this.messageId = messageId; // Initialize message ID + this.senderID = senderID; // Initialize sender ID + this.message = message; // Initialize message + this.timestamp = System.currentTimeMillis(); // Initialize timestamp with current time + } + + // All Setter and Gitter + public String getRecieverID() { + return RecieverID; + } + + public void setRecieverID(String recieverID) { + RecieverID = recieverID; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String getSenderID() { + return senderID; + } + + public void setSenderID(String senderID) { + this.senderID = senderID; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/MyCalender.java b/MyHospital/app/src/main/java/com/example/chatapp/MyCalender.java new file mode 100644 index 0000000000000000000000000000000000000000..f2c736d67004a674dfbb42ae0a2b81fa8d464699 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/MyCalender.java @@ -0,0 +1,140 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.widget.Button; +import android.widget.CalendarView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +import com.google.firebase.FirebaseApp; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.Query; +import com.google.firebase.database.ValueEventListener; + +//Same As the All Calender but hier shows only users loggenin Shifts in a Calender view +// it allow the user to see his Shifts in form of Calender View and then if changes required he can Handle it +public class MyCalender extends AppCompatActivity { + private CalendarView calendarView; + private DatabaseReference databaseReference; + + // TextView for displaying shift details + private TextView tvShiftDetails; + + @SuppressLint("MissingInflatedId") + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + FirebaseApp.initializeApp(this); + setContentView(R.layout.activity_my_calender); + + initFirebase(); + setupCalendar(); + setupButton(); + tvShiftDetails = findViewById(R.id.tvShiftDetails); + } + + private void initFirebase() { + FirebaseAuth auth = FirebaseAuth.getInstance(); + if (auth.getCurrentUser() == null) { + Toast.makeText(this, "No signed-in user found", Toast.LENGTH_LONG).show(); + // Redirect to login activity or handle user session + } else { + databaseReference = FirebaseDatabase.getInstance().getReference("MyHospital/Users/Shifts").child(auth.getCurrentUser().getUid()); + } + } + + private void setupCalendar() { + calendarView = findViewById(R.id.calendarView); + calendarView.setOnDateChangeListener((view, dayOfMonth, month, year) -> { + + + @SuppressLint("DefaultLocale") + String date = String.format("%d.%02d.%02d", year, month + 1, dayOfMonth); + System.out.println(date);// Ensuring month is correctly adjusted + searchDatabase(date); + }); + + ViewCompat.setOnApplyWindowInsetsListener(calendarView, (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + private void setupButton() { + Button calendarButton = findViewById(R.id.calendarButton); + calendarButton.setOnClickListener(v -> { + Intent intent = new Intent(MyCalender.this, MainActivity.class); + + startActivity(intent); + + }); + } + + private void searchDatabase(String date) { + if (databaseReference == null) { + Toast.makeText(this, "Database reference is not initialized", Toast.LENGTH_SHORT).show(); + return; + } + + Query query = databaseReference.orderByChild("DateFrom").equalTo(date); + query.addListenerForSingleValueEvent(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot dataSnapshot) { + if (dataSnapshot.exists()) { + StringBuilder detailsBuilder = new StringBuilder(); + for (DataSnapshot snapshot : dataSnapshot.getChildren()) { + TextModel shift = snapshot.getValue(TextModel.class); + if (shift != null) { + detailsBuilder + + .append("Shift ID: ").append(shift.getShiftsID()) + .append("\nName: ").append(shift.getUserName()) + .append("\nShift At: ").append(shift.getShiftSelection()) + .append("\nDate : ").append(shift.getDateFrom()) + + .append("\nDepartment: ").append(shift.getDepartment()) + .append("\nDetails: ").append(shift.getDetails()) + .append("\nColleague: ").append(shift.getColleg()) + .append("\nCreated On: ").append(shift.getTime()) + .append("\n───────────────────\n"); + + } + } + tvShiftDetails.setText(detailsBuilder.toString()); + } else { + tvShiftDetails.setText("No shifts found for: " + date); + } + } + + @Override + public void onCancelled(DatabaseError databaseError) { + Toast.makeText(MyCalender.this, "Error fetching data: " + databaseError.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + } + + private void displayShiftDetails(TextModel shift) { + String details = "Shift ID: " + shift.getShiftsID() + + "\nShift Date " + shift.getDateFrom() + + "\nTime: " + shift.getTime() + + "\nDepartment: " + shift.getDepartment() + + "\nShift Selection: " + shift.getShiftSelection() + + "\nDetails: " + shift.getDetails() + + "\nColleague: " + shift.getColleg() + + "\nScheduled By: " + shift.getUserName(); + Toast.makeText(this, details, Toast.LENGTH_LONG).show(); + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/RequistAdapter.java b/MyHospital/app/src/main/java/com/example/chatapp/RequistAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..4f83987ac1de2c3f329e711687a1683ecd7d07ee --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/RequistAdapter.java @@ -0,0 +1,200 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.SharedPreferences; +import android.graphics.Color; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CheckBox; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +public class RequistAdapter extends RecyclerView.Adapter<RequistAdapter.RequistViewHolder> { + private Context context; // Declare context + private List<RequistModel> requistModelList; // Declare list for request models + private List<RequistModel> requistModelListFull; // Declare list for full request models + private FirebaseAuth auth; // Declare FirebaseAuth + private DatabaseReference databaseReference; // Declare DatabaseReference + private SharedPreferences sharedPreferences; // Declare SharedPreferences + + // Constructor for RequistAdapter + public RequistAdapter(Context context) { + this.context = context; // Initialize context + this.requistModelList = new ArrayList<>(); // Initialize request model list + this.requistModelListFull = new ArrayList<>(requistModelList); // Initialize full request model list + this.sharedPreferences = context.getSharedPreferences("RequistPrefs", Context.MODE_PRIVATE); // Initialize SharedPreferences + this.auth = FirebaseAuth.getInstance(); // Initialize FirebaseAuth + this.databaseReference = FirebaseDatabase.getInstance().getReference("MyHospital/Users/Shifts/ChangeRequist"); // Initialize DatabaseReference + + fetchDataFromFirebase(); // Fetch data from Firebase + } + + // Fetch data from Firebase + private void fetchDataFromFirebase() { + databaseReference.addValueEventListener(new ValueEventListener() { + @SuppressLint("NotifyDataSetChanged") + @Override + public void onDataChange(@NonNull DataSnapshot dataSnapshot) { + requistModelList.clear(); // Clear request model list + for (DataSnapshot userSnapshot : dataSnapshot.getChildren()) { // Iterate over user snapshots + for (DataSnapshot requistSnapshot : userSnapshot.getChildren()) { // Iterate over request snapshots + RequistModel requistModel = requistSnapshot.getValue(RequistModel.class); // Get request model + if (requistModel != null) { // If request model is not null + requistModel.setRequistID(requistSnapshot.getKey()); // Set request ID + requistModel.setUserID(userSnapshot.getKey()); // Set user ID + requistModelList.add(requistModel); // Add request model to list + } + } + } + requistModelListFull.clear(); // Clear full request model list + requistModelListFull.addAll(requistModelList); // Add all request models to full list + sortRequistModelList(); // Sort the list after fetching data + notifyDataSetChanged(); // Notify adapter of data change + } + + @Override + public void onCancelled(@NonNull DatabaseError databaseError) { + // Handle database error + Log.e("RequistAdapter", "Database error: " + databaseError.getMessage()); + } + }); + } + + // Method to add a request model + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + public void add(RequistModel requistModel) { + // Add request model to list + requistModelList.add(requistModel); + // Add request model to full list + requistModelListFull.add(requistModel); + // Sort the list after adding a new request + sortRequistModelList(); + // Notify adapter of data change + notifyDataSetChanged(); + } + + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + public void clear() { // Method to clear request models + requistModelList.clear(); // Clear request model list + requistModelListFull.clear(); // Clear full request model list + notifyDataSetChanged(); // Notify adapter of data change + } + + // Inflate request row layout + @NonNull + @Override + public RequistViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.requist_row, parent, false); + return new RequistViewHolder(view); // Return view holder + } + + @Override + public void onBindViewHolder(@NonNull RequistViewHolder holder, int position) { + // Get request model for position + RequistModel requistModel = requistModelList.get(position); + + holder.Name.setText(requistModel.getName().toLowerCase().trim()); // Set name + holder.ShiftsID.setText(requistModel.getShiftsID()); // Set shifts ID + holder.DateFrom.setText(requistModel.getDateFrom().toLowerCase().trim()); // Set date from + holder.Time.setText(requistModel.getTime().toLowerCase().trim()); // Set time + holder.Department.setText(requistModel.getDepartment().toLowerCase().trim()); // Set department + holder.ShiftSelection.setText(requistModel.getShiftSelection().toLowerCase().trim()); // Set shift selection + holder.Details.setText(requistModel.getDetails().toLowerCase().trim()); // Set details + holder.ChangeRequist.setText(requistModel.getChangeRequist().toLowerCase().trim()); // Set change request + + // Generate a unique key for each checkbox using ShiftsID + String checkboxKey = "checkbox_" + requistModel.getShiftsID(); + + + boolean isChecked = sharedPreferences.getBoolean(checkboxKey, false); // Get checkbox state from SharedPreferences + holder.requistCheckBox.setChecked(isChecked); // Set checkbox state + if (isChecked) { // If checkbox is checked + holder.textLayout.setBackgroundColor(Color.parseColor("#E7CCCC")); // Set background color + } else { // If checkbox is not checked + holder.textLayout.setBackgroundColor(Color.parseColor("#5E6A69")); // Set background color + } + + + holder.requistCheckBox.setOnCheckedChangeListener((buttonView, isChecked1) -> { // Set checkbox change listener + SharedPreferences.Editor editor = sharedPreferences.edit(); // Get SharedPreferences editor + editor.putBoolean(checkboxKey, isChecked1); // Save checkbox state + editor.apply(); // Apply changes + if (isChecked1) { // If checkbox is checked + holder.textLayout.setBackgroundColor(Color.parseColor("#E7CCCC")); // Set background color + } else { // If checkbox is not checked + holder.textLayout.setBackgroundColor(Color.parseColor("#5E6A69")); // Set background color + } + }); + } + + + // Get item count and Return size of request model list + @Override + public int getItemCount() { + return requistModelList.size(); + } + + + + // Sort request model list by date and define date format + private void sortRequistModelList() { + Collections.sort(requistModelList, (o1, o2) -> { + SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy", Locale.getDefault()); + try { + Date date1 = sdf.parse(o1.getDateFrom()); + Date date2 = sdf.parse(o2.getDateFrom()); + if (date1 != null && date2 != null) { + return date2.compareTo(date1); // Descending order + } + // Handle parse exception and Print stack trace + } catch (ParseException e) { + e.printStackTrace(); + } + // Return 0 if comparison cannot be made + return 0; + }); + } + + // Define RequistViewHolder class + public class RequistViewHolder extends RecyclerView.ViewHolder { + private TextView Name, DateFrom, Time, Department, ShiftSelection, Details, ChangeRequist, ShiftsID; // Declare TextViews + public CheckBox requistCheckBox; // Declare CheckBox + public RelativeLayout textLayout; // Declare RelativeLayout + + // Constructor for RequistViewHolder + public RequistViewHolder(@NonNull View itemView) { + super(itemView); // Call superclass constructor + ShiftsID = itemView.findViewById(R.id.userid); // Find shifts ID TextView by ID + Name = itemView.findViewById(R.id.username); // Find name TextView by ID + DateFrom = itemView.findViewById(R.id.userDateFrom); // Find date from TextView by ID + Time = itemView.findViewById(R.id.userTime); // Find time TextView by ID + Department = itemView.findViewById(R.id.userDepartment); // Find department TextView by ID + ShiftSelection = itemView.findViewById(R.id.userSchichtTime); // Find shift selection TextView by ID + Details = itemView.findViewById(R.id.userShiftDetails); // Find details TextView by ID + ChangeRequist = itemView.findViewById(R.id.requistChange); // Find change request TextView by ID + requistCheckBox = itemView.findViewById(R.id.requistCheckBox); // Find request CheckBox by ID + textLayout = itemView.findViewById(R.id.textLayout); // Find text layout by ID + } + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/RequistChange.java b/MyHospital/app/src/main/java/com/example/chatapp/RequistChange.java new file mode 100644 index 0000000000000000000000000000000000000000..23e0ad47b76e971bce738f54070d4d59d5e2d0e1 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/RequistChange.java @@ -0,0 +1,159 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.FirebaseApp; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.Objects; + +// Define RequistChange class extending AppCompatActivity +public class RequistChange extends AppCompatActivity { + DatabaseReference databaseReference; // Declare DatabaseReference for Firebase + RequistAdapter requistAdapter; // Declare RequistAdapter for RecyclerView + private FirebaseAuth auth; // Declare FirebaseAuth + private FirebaseDatabase firebaseDatabase; // Declare FirebaseDatabase + + + // onCreate method,Enable edge-to-edge display, Initialize Firebase app and Set the content view to the activity layout + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + FirebaseApp.initializeApp(this); + setContentView(R.layout.activity_requist_change); + + + Toolbar toolbar = findViewById(R.id.toolbar); // Find the toolbar by ID + setSupportActionBar(toolbar); // Set the toolbar as the app bar + Objects.requireNonNull(getSupportActionBar()).setTitle(""); // Set the toolbar title to empty + + + auth = FirebaseAuth.getInstance(); // Initialize FirebaseAuth + firebaseDatabase = FirebaseDatabase.getInstance(); // Initialize FirebaseDatabase + + + // Initialize RequestAdapter + requistAdapter= new RequistAdapter(this); + // Initialize FirebaseDatabase + RecyclerView recyclerView = findViewById(R.id.recycler); + // Initialize RequestAdapter + recyclerView.setAdapter(requistAdapter); + // Find the RecyclerView by ID + recyclerView.setLayoutManager(new LinearLayoutManager(this)); + + // Fetch Content (requests) from Firebase + fetchRequist(); + + + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + // Fetch requests from Firebase + private void fetchRequist() { + // Get reference to change requests from database + databaseReference = firebaseDatabase.getReference().child("MyHospital/Users/Shifts/ChangeRequist"); + // Add value event listener + databaseReference.addValueEventListener(new ValueEventListener() { + // Handle data change + @SuppressLint("NotifyDataSetChanged") + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { + requistAdapter.clear();// Clear adapter + for (DataSnapshot userSnapshot : snapshot.getChildren()) { // Iterate over user snapshots + for (DataSnapshot shiftSnapshot : userSnapshot.getChildren()) { // Iterate over shift snapshots + RequistModel requistModel = shiftSnapshot.getValue(RequistModel.class); // Get request model + if (requistModel != null && requistModel.getTime() != null) { // If request model is valid + requistAdapter.add(requistModel); // Add request model to adapter + } + } + } + // Notify adapter of data change + requistAdapter.notifyDataSetChanged(); + } + + // Handle database error + @Override + public void onCancelled(@NonNull DatabaseError error) { + Toast.makeText(RequistChange.this, "Database error: " + error.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + } + + // Initialize menu and Get menu inflater + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater= getMenuInflater(); + inflater.inflate(R.menu.menu_requist,menu); + return true; // Return true to display the menu + } + + + + + // handling menu icons and there functionality + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if(item.getItemId()== R.id.logout){ + FirebaseAuth.getInstance().signOut(); + startActivity(new Intent(RequistChange.this,SignInActivity.class)); + finish(); + return true; + } + if(item.getItemId()== R.id.home){ + FirebaseAuth.getInstance(); + startActivity(new Intent(RequistChange.this, MainActivity.class)); + finish(); + return true; + } + + if(item.getItemId()== R.id.ShowAllShifts){ + FirebaseAuth.getInstance(); + startActivity(new Intent(RequistChange.this, AllCalender.class)); + finish(); + return true; + } + + if(item.getItemId()== R.id.listShift){ + + FirebaseAuth.getInstance(); + startActivity(new Intent(RequistChange.this, TextActivity.class)); + finish(); + return true; + } + + + return false; + + } + + + +} \ No newline at end of file diff --git a/MyHospital/app/src/main/java/com/example/chatapp/RequistModel.java b/MyHospital/app/src/main/java/com/example/chatapp/RequistModel.java new file mode 100644 index 0000000000000000000000000000000000000000..937476cad72014354bbfa861b2cdf4da48d6c0cd --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/RequistModel.java @@ -0,0 +1,119 @@ +package com.example.chatapp; + +// Define RequistModel class to provides a structured way to store and manage Change Request data. +// This makes it easy to pass the Requested objects around the application, +// such as saving them to a database or displaying them in a UI. +public class RequistModel { + private String UserID,Name,DateFrom,Time,Department,ShiftSelection,Details,ChangeRequist,ShiftsID,RequistID; + private long timestamp; + + // Default constructor required for calls to DataSnapshot + public RequistModel() { + } + + + + public RequistModel(String requistID,String userID,String shiftId, String userName, String dateFrom, String time, String department, String shiftSelection, String details, String shangeRequist) { + + UserID= userID; + Name = userName; + DateFrom = dateFrom; + Time = time; + Department = department; + ShiftSelection = shiftSelection; + Details = details; + ChangeRequist = shangeRequist; + this.timestamp = System.currentTimeMillis(); + ShiftsID=shiftId; + RequistID=requistID; + } + + + public String getUserID() { + return UserID; + } + + public void setUserID(String userID) { + UserID = userID; + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getDateFrom() { + return DateFrom; + } + + public void setDateFrom(String dateFrom) { + DateFrom = dateFrom; + } + + public String getTime() { + return Time; + } + + public void setTime(String time) { + Time = time; + } + + public String getDepartment() { + return Department; + } + + public void setDepartment(String department) { + Department = department; + } + + public String getShiftSelection() { + return ShiftSelection; + } + + public void setShiftSelection(String shiftSelection) { + ShiftSelection = shiftSelection; + } + + public String getDetails() { + return Details; + } + + public void setDetails(String details) { + Details = details; + } + + public String getChangeRequist() { + return ChangeRequist; + } + + public void setChangeRequist(String changeRequist) { + ChangeRequist = changeRequist; + } + + public String getShiftsID() { + return ShiftsID; + } + + public void setShiftsID(String shiftsID) { + ShiftsID = shiftsID; + } + + public String getRequistID() { + return RequistID; + } + + public void setRequistID(String requistID) { + RequistID = requistID; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/SignInActivity.java b/MyHospital/app/src/main/java/com/example/chatapp/SignInActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..fb16d580aa366988c61db5d16908ef5270640359 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/SignInActivity.java @@ -0,0 +1,129 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +import com.google.android.gms.tasks.OnFailureListener; +import com.google.android.gms.tasks.OnSuccessListener; +import com.google.firebase.FirebaseApiNotAvailableException; +import com.google.firebase.auth.AuthResult; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; + +// Define SignInActivity class extending AppCompatActivity +public class SignInActivity extends AppCompatActivity { + EditText userEmail, userPassword; // Declare EditTexts for user email and password + TextView btnLogin, btnSignup; // Declare TextViews for login and signup buttons + String email, passsword; // Declare strings for email and password + DatabaseReference databaseReference; // Declare DatabaseReference for Firebase + + @SuppressLint("MissingInflatedId") + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_signin); + + + //get Referance to see EveryThing in DataBase + databaseReference = FirebaseDatabase.getInstance().getReference("MyHospital/Users"); + + + userEmail = findViewById(R.id.emailLogin); // Find user email EditText by ID + userPassword = findViewById(R.id.passwordLogin); // Find user password EditText by ID + btnLogin = findViewById(R.id.btnLogin); // Find login button TextView by ID + btnSignup = findViewById(R.id.btnSignup); // Find signup button TextView by ID + + // Set click listener for login button + btnLogin.setOnClickListener(new View.OnClickListener() { + // Handle button click-> Get email and password from EditText then Check if email is empty + @Override + public void onClick(View v) { + email = userEmail.getText().toString().trim(); + passsword = userPassword.getText().toString().trim(); + if (TextUtils.isEmpty(email)) { + // Set error message + userEmail.setError("Please Enter our Email"); + // Request focus on email EditText + userEmail.requestFocus(); + return; + } + // Check if password is empty, Set error message and Request focus on password EditText + if (TextUtils.isEmpty(passsword)) { + userPassword.setError("Please Enter our Email"); + userPassword.requestFocus(); + return; + } + // Call SignIn method + SignIn(); + } + }); + + // Set click listener for signup button + btnSignup.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // Create intent for SignUpActivity and then Start SignUpActivity + Intent intent = new Intent(SignInActivity.this, SignUpAcrivity.class); + startActivity(intent); + } + }); + + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + + + + // Method to sign in user with email and password + //Handle success and failure + private void SignIn() { + FirebaseAuth.getInstance().signInWithEmailAndPassword(email.trim(), passsword) + .addOnSuccessListener(new OnSuccessListener<AuthResult>() { + @Override + public void onSuccess(AuthResult authResult) { + //passing the same name to Sign in + String username = FirebaseAuth.getInstance().getCurrentUser().getDisplayName(); // Get user's display name + String userEmail = FirebaseAuth.getInstance().getCurrentUser().getEmail(); // Get user's email + Intent intent = new Intent(SignInActivity.this, MainActivity.class); // Create intent for MainActivity + //passing name As user Name + intent.putExtra("UserName", username); + startActivity(intent); + finish(); + + } + }).addOnFailureListener(new OnFailureListener() { + @Override + public void onFailure(@NonNull Exception e) { + // Check if exception is FirebaseApiNotAvailableException + if (e instanceof FirebaseApiNotAvailableException) { + Toast.makeText(SignInActivity.this, "User dosent Exist", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(SignInActivity.this, "SignInActivity Failed", Toast.LENGTH_SHORT).show(); + } + + } + }); + } + +} \ No newline at end of file diff --git a/MyHospital/app/src/main/java/com/example/chatapp/SignUpAcrivity.java b/MyHospital/app/src/main/java/com/example/chatapp/SignUpAcrivity.java new file mode 100644 index 0000000000000000000000000000000000000000..6c3d79bb7077205bd0eb8ed950513120002ce04e --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/SignUpAcrivity.java @@ -0,0 +1,177 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.EditText; +import android.widget.Spinner; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +import com.google.android.gms.tasks.OnFailureListener; +import com.google.android.gms.tasks.OnSuccessListener; +import com.google.firebase.auth.AuthResult; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.auth.UserProfileChangeRequest; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; + +import java.util.Objects; + + +public class SignUpAcrivity extends AppCompatActivity { + EditText userEmail, userPassword, userName, userLastname, userAddress; // Declare EditTexts for user information + TextView btnSignup; // Declare TextView for signup button + String txtEmail, txtPassword, txtName, txtLastname, txtuserAddress, txtDepartment, txtRole, txtRoomNumber; // Declare strings for user information + Spinner userSpinnerRole, userSpinnerDepartment, userSpinnerRoomNumber; // Declare Spinners for role, department, and room number + DatabaseReference databaseReference; // Declare DatabaseReference for Firebase + + + // Suppress lint warning + // Define Sign Up Activity class extending AppCompatActivity + @SuppressLint("MissingInflatedId") + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_signup); + + // Get reference to Firebase database + databaseReference = FirebaseDatabase.getInstance().getReference("MyHospital/Users"); + + + userEmail = findViewById(R.id.emailSignup); // Find user email EditText by ID + userPassword = findViewById(R.id.passwordSignup); // Find user password EditText by ID + userName = findViewById(R.id.nameSignup); // Find user name EditText by ID + userLastname = findViewById(R.id.lastnameSignup); // Find user last name EditText by ID + userAddress = findViewById(R.id.fullAddress); // Find user address EditText by ID + userSpinnerRoomNumber = findViewById(R.id.roomNummber); // Find room number Spinner by ID + userSpinnerDepartment = findViewById(R.id.spinnerDepartment); // Find department Spinner by ID + userSpinnerRole = findViewById(R.id.spinnerRole); // Find role Spinner by ID + btnSignup = findViewById(R.id.sbtnSignup); // Find signup button TextView by ID + + // Create an ArrayAdapter using the string array and a default spinner layout + ArrayAdapter<CharSequence> updateAdapterDepartment = ArrayAdapter.createFromResource(this, + R.array.department_array, android.R.layout.simple_spinner_item); + // Specify the layout to use when the list of choices appears + updateAdapterDepartment.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + // Apply the adapter to the spinner + userSpinnerDepartment.setAdapter(updateAdapterDepartment); + + + // Create an ArrayAdapter using the string array and a default spinner layout + ArrayAdapter<CharSequence> updateAdapterRole = ArrayAdapter.createFromResource(this, + R.array.Role_array, android.R.layout.simple_spinner_item); + // Specify the layout to use when the list of choices appears + updateAdapterRole.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + // Apply the adapter to the spinner + userSpinnerRole.setAdapter(updateAdapterRole); + + // Create an ArrayAdapter using the string array and a default spinner layout + ArrayAdapter<CharSequence> updateAdapterRoomNumber = ArrayAdapter.createFromResource(this, + R.array.Room_numbers_array, android.R.layout.simple_spinner_item); + // Specify the layout to use when the list of choices appears + updateAdapterRoomNumber.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + // Apply the adapter to the spinner + userSpinnerRoomNumber.setAdapter(updateAdapterRoomNumber); + + // Set click listener for signup button and Handle button click + btnSignup.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + txtEmail = userEmail.getText().toString().toLowerCase().trim(); // Get email from EditText + txtPassword = userPassword.getText().toString().toLowerCase().trim(); // Get password from EditText + txtName = userName.getText().toString().toLowerCase().trim(); // Get name from EditText + txtLastname = userLastname.getText().toString().toLowerCase().trim(); // Get last name from EditText + txtuserAddress = userAddress.getText().toString().toLowerCase().trim(); // Get address from EditText + txtRoomNumber = userSpinnerRoomNumber.getSelectedItem().toString().toLowerCase().trim(); // Get selected room number + txtDepartment = userSpinnerDepartment.getSelectedItem().toString().trim(); // Get selected department + txtRole = userSpinnerRole.getSelectedItem().toString().toLowerCase().trim(); // Get selected role + + + + if (TextUtils.isEmpty(txtEmail) || TextUtils.isEmpty(txtPassword) || TextUtils.isEmpty(txtLastname) || TextUtils.isEmpty(txtuserAddress)) { // Check if any required field is empty + userEmail.setError("Enter All Values"); // Set error message + userEmail.requestFocus(); // Request focus on email EditText + } else if (txtPassword.length() < 6) { // Check if password is too short + Toast.makeText(SignUpAcrivity.this, "Password too short", Toast.LENGTH_SHORT).show(); // Show toast message + } else { + signUp(txtEmail, txtPassword); // Call signUp method + } + } + + }); + + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + + + + // Method to sign up user + private void signUp(String email, String password) { + // Initialize FirebaseAuth instance + FirebaseAuth auth = FirebaseAuth.getInstance(); + + // Create user with email and password then Handle success then Handle failure + auth.createUserWithEmailAndPassword(txtEmail.trim(), txtPassword) + .addOnSuccessListener(new OnSuccessListener<AuthResult>() { + @Override + public void onSuccess(AuthResult authResult) { + // Create user profile change request and Set display name + UserProfileChangeRequest userProfileChangeRequest = new UserProfileChangeRequest.Builder() + .setDisplayName(SignUpAcrivity.this.txtName).build(); + + // Get current Firebase user + FirebaseUser firebaseUser = FirebaseAuth.getInstance().getCurrentUser(); + // Check if Firebase user is not null + if (firebaseUser != null) { + // Update user profile + firebaseUser.updateProfile(userProfileChangeRequest); + + // Create user model,Get reference to Firebase database and save User´s data(information) to DataBase, + UserModel userModel = new UserModel(FirebaseAuth.getInstance().getUid(), SignUpAcrivity.this.txtName, txtEmail, txtLastname, txtuserAddress, txtDepartment, txtRole, txtRoomNumber); + DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("MyHospital/Users"); + databaseReference.child(Objects.requireNonNull(FirebaseAuth.getInstance().getUid())).setValue(userModel); + + // Create intent for starting MainActivity + Intent intent = new Intent(SignUpAcrivity.this, MainActivity.class); + //passing name As user Name + intent.putExtra("UserName", SignUpAcrivity.this.txtName); + + + startActivity(intent); + finish(); + } else { + Toast.makeText(SignUpAcrivity.this, "Failed to get Firebase user!", Toast.LENGTH_SHORT).show(); + } + } + }) + .addOnFailureListener(new OnFailureListener() { + @Override + public void onFailure(@NonNull Exception e) { + Toast.makeText(SignUpAcrivity.this, "Sign Up Failed: " + e.getMessage(), Toast.LENGTH_SHORT).show(); + } + }); + } + + + +} \ No newline at end of file diff --git a/MyHospital/app/src/main/java/com/example/chatapp/TextActivity.java b/MyHospital/app/src/main/java/com/example/chatapp/TextActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..040ef593729e2938c28bc8d453ca972abccc1b79 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/TextActivity.java @@ -0,0 +1,276 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.SearchView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.activity.EdgeToEdge; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.FirebaseApp; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.Objects; + +public class TextActivity extends AppCompatActivity { + + TextAdapter textAdapter; // Declare TextAdapter + DatabaseReference databaseReference; // Declare DatabaseReference + private FirebaseAuth auth; // Declare FirebaseAuth + private FirebaseDatabase firebaseDatabase; // Declare FirebaseDatabase + private String loggedInUserEmail; // Declare string for logged in user's email + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + FirebaseApp.initializeApp(this); + setContentView(R.layout.activity_text); + + // Find the toolbar by ID then set content then set title to empty + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + Objects.requireNonNull(getSupportActionBar()).setTitle(""); + + auth = FirebaseAuth.getInstance(); // Initialize FirebaseAuth + firebaseDatabase = FirebaseDatabase.getInstance(); // Initialize FirebaseDatabase + loggedInUserEmail = getCurrentUserEmail(); // Initialize logged in user's email + + // Fetch user's name and display welcome message + // Get current Firebase user + FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser(); + if (currentUser != null) { + String uid = currentUser.getUid(); + // Get reference to current user's data + DatabaseReference userRef = FirebaseDatabase.getInstance().getReference("MyHospital/Users").child(uid); + + // Add listener for single value event + userRef.addListenerForSingleValueEvent(new ValueEventListener() { + @Override + public void onDataChange(@NonNull DataSnapshot dataSnapshot) { + // Get user model from data snapshot + UserModel userModel = dataSnapshot.getValue(UserModel.class); + // Check if user model is not null + if (userModel != null) { + // Create welcome text + String welcomeText = userModel.getUserName().toUpperCase() + "`s Shifts"; + // Find welcome TextView by ID + TextView tvWelcome = findViewById(R.id.tvWelcome); + tvWelcome.setText(welcomeText);// Set welcome text + } + } + + @Override + public void onCancelled(@NonNull DatabaseError databaseError) { + Log.w("Firebase", "Failed to read user"); // Log warning message + } + }); + } + + // Find back button by ID and start Main Activity if clicked + Button btnBackshowShift = findViewById(R.id.btnBackshowShift); + btnBackshowShift.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(new Intent(TextActivity.this, MainActivity.class)); + } + }); + + + + textAdapter = new TextAdapter(this); // Initialize TextAdapter + RecyclerView recyclerView = findViewById(R.id.recycler); // Find RecyclerView by ID + recyclerView.setAdapter(textAdapter); // Set adapter for RecyclerView + recyclerView.setLayoutManager(new LinearLayoutManager(this)); // Set layout manager for RecyclerView + + // Setup SearchView and Find SearchView by ID + SearchView searchView = findViewById(R.id.searchView); + // Set query text listener for SearchView + searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + @Override + public boolean onQueryTextSubmit(String query) { // Handle query text submit + textAdapter.filter(query); // Filter textAdapter with query + return false; // Return false to indicate no further action is needed + } + + @Override + public boolean onQueryTextChange(String newText) { // Handle query text change + textAdapter.filter(newText); // Filter textAdapter with newText + return false; // Return false to indicate no further action is needed + } + }); + + // Call method to fetch shifts + fetchShifts(); + + //Original code to set window insets listener for edge-to-edge display + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } + + private void fetchShifts() { // Method to fetch shifts + if (checkIfAdmin()) { // Check if the current user is an admin + // Fetch all shifts if the user is admin + databaseReference = firebaseDatabase.getReference().child("MyHospital/Users/Shifts"); // Get reference to all shifts + databaseReference.addValueEventListener(new ValueEventListener() { // Add value event listener + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { // Handle data change + textAdapter.clear(); // Clear text adapter + for (DataSnapshot userSnapshot : snapshot.getChildren()) { // Iterate over user snapshots + for (DataSnapshot shiftSnapshot : userSnapshot.getChildren()) { // Iterate over shift snapshots + TextModel textModel = shiftSnapshot.getValue(TextModel.class); // Get TextModel from shift snapshot + if (textModel != null && textModel.getTime() != null) { // Check if TextModel is valid + textAdapter.add(textModel); // Add TextModel to text adapter + } + } + } + textAdapter.notifyDataSetChanged(); // Notify adapter of data change + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { // Handle database error + Toast.makeText(TextActivity.this, "Database error: " + error.getMessage(), Toast.LENGTH_SHORT).show(); // Show database error toast + } + }); + } else { // If the user is not an admin + // Fetch only the logged-in user's shifts if the user is not admin + FirebaseUser currentUser = auth.getCurrentUser(); // Get current Firebase user + if (currentUser != null) { // Check if current user is not null + String userId = currentUser.getUid(); // Get current user's UID + databaseReference = firebaseDatabase.getReference().child("MyHospital/Users/Shifts").child(userId); // Get reference to current user's shifts + databaseReference.addValueEventListener(new ValueEventListener() { // Add value event listener + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + @Override + public void onDataChange(@NonNull DataSnapshot snapshot) { // Handle data change + textAdapter.clear(); // Clear text adapter + for (DataSnapshot dataSnapshot : snapshot.getChildren()) { // Iterate over shift snapshots + TextModel textModel = dataSnapshot.getValue(TextModel.class); // Get TextModel from shift snapshot + if (textModel != null && textModel.getTime() != null) { // Check if TextModel is valid + textAdapter.add(textModel); // Add TextModel to text adapter + } + } + textAdapter.notifyDataSetChanged(); // Notify adapter of data change + } + + @Override + public void onCancelled(@NonNull DatabaseError error) { // Handle database error + Toast.makeText(TextActivity.this, "Database error: " + error.getMessage(), Toast.LENGTH_SHORT).show(); // Show database error toast + } + }); + } else { + Log.e("TextActivity", "User is not authenticated"); // Log authentication error + // Optionally, redirect to login screen or show a message to the user + } + } + } + + + private boolean checkIfAdmin() { // Method to check if the current user is an admin + String currentUserEmail = getCurrentUserEmail(); // Get current user's email + return currentUserEmail != null && currentUserEmail.equalsIgnoreCase("loureen@gmail.com"); // Check if email matches admin email + } + + private String getCurrentUserEmail() { // Method to get the current user's email + FirebaseUser user = auth.getCurrentUser(); // Get current Firebase user + return user != null ? user.getEmail() : null; // Return user's email if user is not null, otherwise return null + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { // Method to create options menu + getMenuInflater().inflate(R.menu.menu_shifts, menu); // Inflate menu with menu_shifts + return true; // Return true to display the menu + } + + + // Method to prepare the options menu by Find icons menu item by ID + + public boolean onPrepareOptionsMenu(Menu menu) { + MenuItem AddMessage = menu.findItem(R.id.AddMessage); + MenuItem onDayCalender = menu.findItem(R.id.onDayCalender); + MenuItem allShiftsCalender = menu.findItem(R.id.allShiftsCalender); + MenuItem logout = menu.findItem(R.id.logout); + MenuItem shiftAnfrage = menu.findItem(R.id.ShiftAnfrage); + + + // Logic to set visibility + boolean isLoggedIn = checkUserLoggedIn(); // Check if the user is logged in + shiftAnfrage.setVisible(isLoggedIn); // Set visibility of shiftAnfrage based on login status + onDayCalender.setVisible(!isLoggedIn); // Set visibility of onDayCalender based on login status + // Call superclass method + return super.onPrepareOptionsMenu(menu); + } + + // Method to handle options item selection and start related activitys + @Override + public boolean onOptionsItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == R.id.logout) { + FirebaseAuth.getInstance().signOut(); + startActivity(new Intent(this, SignInActivity.class)); + finish(); + return true; + } + if (item.getItemId() == R.id.AddMessage) { + startActivity(new Intent(TextActivity.this, MainActivity.class)); + finish(); + return true; + } + if (item.getItemId() == R.id.onDayCalender) { + startActivity(new Intent(TextActivity.this, MyCalender.class)); + finish(); + return true; + } + + if (item.getItemId() == R.id.allShiftsCalender) { + startActivity(new Intent(TextActivity.this, AllCalender.class)); + finish(); + return true; + } + if (item.getItemId() == R.id.ShiftAnfrage) { + startActivity(new Intent(TextActivity.this, RequistChange.class)); + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + + // Method to check if the user is logged in is the same as Shift Lieder Email + private boolean checkUserLoggedIn() { + String loggedInUserEmail = getLoggedInUserEmail(); // Replace with actual logic to get the user's email + return "loureen@gmail.com".equals(loggedInUserEmail); + } + + // Method to get the logged-in user's email + private String getLoggedInUserEmail() { + FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + if (user != null) { + return user.getEmail(); + } else { + return null; + } + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/TextAdapter.java b/MyHospital/app/src/main/java/com/example/chatapp/TextAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..2efff59ed453a1517899cacf758d17188b028c3d --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/TextAdapter.java @@ -0,0 +1,360 @@ +package com.example.chatapp;// Package declaration +// Importing All necessery library +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.app.TaskStackBuilder; +import android.content.Context; +import android.content.Intent; +import android.icu.text.SimpleDateFormat; +import android.os.Build; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.Spinner; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.core.app.NotificationCompat; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.orhanobut.dialogplus.DialogPlus; +import com.orhanobut.dialogplus.ViewHolder; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +// Define TextAdapter class extending RecyclerView.Adapter +public class TextAdapter extends RecyclerView.Adapter<TextAdapter.TextViewHolder> { + private static final String CHANNEL_ID = "shift_notifications"; // Declare constant for notification channel ID + private Context context; // Declare context + private List<TextModel> textModelList; // Declare list for text models + private List<TextModel> textModelListFull; // Declare list for full text models + private FirebaseAuth auth; // Declare FirebaseAuth + private FirebaseDatabase firebaseDatabase; // Declare FirebaseDatabase + private DatabaseReference databaseReference; // Declare DatabaseReference + private String loggedInUserEmail; // Declare string for logged-in user's email + + + // Constructor for TextAdapter + public TextAdapter(Context context) { + this.context = context; // Initialize context + this.textModelList = new ArrayList<>(); // Initialize text model list + this.textModelListFull = new ArrayList<>(); // Initialize full text model list + this.auth = FirebaseAuth.getInstance(); // Initialize FirebaseAuth + this.firebaseDatabase = FirebaseDatabase.getInstance(); // Initialize FirebaseDatabase + this.databaseReference = firebaseDatabase.getReference("MyHospital/Users/Shifts"); // Initialize DatabaseReference + this.loggedInUserEmail = getCurrentUserEmail(); // Initialize logged-in user's email + createNotificationChannel(); // Create the notification channel + } + + // Method to add a text model + public void add(TextModel textModel) { + textModelList.add(textModel); // Add text model to list + textModelListFull.add(textModel); // Add text model to full list + sortTextModelList(); // Sort the list after adding a new shift + notifyDataSetChanged(); // Notify adapter of data change + showNotification(textModel); // Show notification for new shift + } + + + // Method to clear text models lists + public void clear() { + textModelList.clear(); // Clear text model list + textModelListFull.clear(); // Clear full text model list + notifyDataSetChanged(); // Notify adapter of data change + } + + @NonNull + @Override + public TextViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.main_shift, parent, false); + return new TextViewHolder(view); + } + + + // Bind data to ViewHolder + @Override + public void onBindViewHolder(@NonNull TextViewHolder holder, int position) { + // Get TextModel at position + TextModel textModel = textModelList.get(position); + + holder.timeAdded.setText(textModel.getTime().toLowerCase().trim()); // Set time added + holder.ShiftsID.setText(textModel.getShiftsID().toLowerCase().trim()); // Set ShiftsID + holder.UserName.setText(textModel.getUserName().toUpperCase().trim()); // Set user name + holder.dateFrom.setText(textModel.getDateFrom().toLowerCase().trim()); // Set date from + holder.department.setText(textModel.getDepartment().toLowerCase().trim()); // Set department + holder.shiftSelection.setText(textModel.getShiftSelection().toLowerCase().trim()); // Set shift selection + holder.details.setText(textModel.getDetails().toLowerCase().trim()); // Set details + holder.colleg.setText(textModel.getColleg().toLowerCase().trim()); // Set colleagues + holder.SectionSelect.setText(textModel.getSectionSelect().toLowerCase().trim()); // Set section select + + holder.itemView.setOnClickListener(v -> { // Set item click listener + Intent intent = new Intent(context, MainActivity.class); // Create intent for MainActivity + intent.putExtra("userID", textModel.getUserID()); // Pass user ID to intent + intent.putExtra("ShiftsID", textModel.getShiftsID()); // Pass ShiftsID to intent + context.startActivity(intent); // Start MainActivity + }); + + + if (auth.getCurrentUser() != null && "loureen@gmail.com".equals(auth.getCurrentUser().getEmail())) { // Check if current user is admin + holder.btnDeleteShift.setVisibility(View.VISIBLE); // Show delete shift button + holder.btnSendRequist.setVisibility(View.GONE); // Hide send request button + } else { + holder.btnDeleteShift.setVisibility(View.GONE); // Hide delete shift button + holder.btnSendRequist.setVisibility(View.VISIBLE); // Show send request button + } + + holder.btnDeleteShift.setOnClickListener(v -> showDeleteConfirmationDialog(textModel, holder)); // Set delete shift button click listener + holder.btnSendRequist.setOnClickListener(v -> { // Set send request button click listener + final DialogPlus dialogPlus = DialogPlus.newDialog(holder.UserName.getContext()) // Create new DialogPlus dialog + .setContentHolder(new ViewHolder(R.layout.popup_shift_requist)) // Set content holder to popup_shift_requist layout + .setExpanded(true, 2800) // Set dialog to be expanded with height of 2800 + .create(); + + dialogPlus.show(); // Show dialog + View view = dialogPlus.getHolderView(); // Get dialog view + + TextView shiftsID = view.findViewById(R.id.ShiftsID); // Find ShiftsID TextView by ID + TextView userName = view.findViewById(R.id.username); // Find username TextView by ID + TextView time = view.findViewById(R.id.myTime); // Find time TextView by ID + TextView dateFrom = view.findViewById(R.id.DateFrom); // Find dateFrom TextView by ID + TextView shiftSelection = view.findViewById(R.id.pShiftSelection); // Find shift selection TextView by ID + TextView department = view.findViewById(R.id.pDepartment); // Find department TextView by ID + EditText shiftDetails = view.findViewById(R.id.pShiftDetails); // Find shift details EditText by ID + Spinner changeRequistSpinner = view.findViewById(R.id.ChangeRequist); // Find change request Spinner by ID + + + ArrayAdapter<CharSequence> adapterChangeRequist = ArrayAdapter.createFromResource(holder.UserName.getContext(), + R.array.Change_Requist, android.R.layout.simple_spinner_item); // Create adapter for change request spinner + adapterChangeRequist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // Set dropdown view resource + changeRequistSpinner.setAdapter(adapterChangeRequist); // Set adapter for change request spinner + + // Find add change dialog button by ID + Button btnAddChangeDialog = view.findViewById(R.id.btnAddChangeDialog); + + + shiftsID.setText(textModel.getShiftsID()); // Set ShiftsID TextView + department.setText(textModel.getDepartment()); // Set department TextView + shiftSelection.setText(textModel.getShiftSelection()); // Set shift selection TextView + userName.setText(textModel.getUserName()); // Set username TextView + dateFrom.setText(textModel.getDateFrom()); // Set dateFrom TextView + + // Check if time is not null set time TextView + if (textModel.getTime() != null) { + time.setText(textModel.getTime()); + } else { + String currentTime = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss", Locale.getDefault()).format(new Date()); + time.setText(currentTime); + } + + // Set click listener for add change dialog button + btnAddChangeDialog.setOnClickListener(v1 -> { + btnAddChangeDialog.setEnabled(false); // Disable the button to prevent multiple clicks + String currentTime = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss", Locale.getDefault()).format(new Date()); // Get the current time + String changeRequist = changeRequistSpinner.getSelectedItem().toString(); // Get the selected change request + Map<String, Object> map = new HashMap<>(); // Create a map to store shift details + map.put("ShiftsID", shiftsID.getText().toString().toLowerCase()); // Put ShiftsID in the map + map.put("Name", userName.getText().toString().toLowerCase()); // Put name in the map + map.put("DateFrom", dateFrom.getText().toString().toLowerCase()); // Put date from in the map + map.put("Department", department.getText().toString().toLowerCase()); // Put department in the map + map.put("ShiftSelection", shiftSelection.getText().toString().toLowerCase()); // Put shift selection in the map + map.put("ChangeRequist", changeRequist.toLowerCase()); // Put change request in the map + map.put("Details", shiftDetails.getText().toString().toLowerCase()); // Put details in the map + map.put("Time", currentTime); // Put current time in the map + + databaseReference.child("ChangeRequist").child(auth.getCurrentUser().getUid()) // Reference to ChangeRequist node in database + .push().setValue(map) // Push the map to the database + .addOnSuccessListener(unused -> { // Add success listener + Toast.makeText(context, "Requist Added Successfully", Toast.LENGTH_LONG).show(); // Show success toast + dialogPlus.dismiss(); // Dismiss the dialog + }).addOnFailureListener(e -> { // Add failure listener + Toast.makeText(holder.UserName.getContext(), "Error while Adding Shift", Toast.LENGTH_SHORT).show(); // Show error toast + dialogPlus.dismiss(); // Dismiss the dialog + }); + }); + }); + + + } + + private void showDeleteConfirmationDialog(TextModel textModel, TextViewHolder holder) { // Method to show delete confirmation dialog + AlertDialog.Builder builder = new AlertDialog.Builder(holder.UserName.getContext()); // Create AlertDialog builder + builder.setTitle("Are you sure to DELETE " + textModel.getUserName()); // Set dialog title + builder.setMessage("Deleted data can't be undone"); // Set dialog message + builder.setPositiveButton("Delete", (dialog, which) -> { // Set positive button and click listener + deleteRequistFromFirebase(textModel.getUserID(), textModel.getShiftsID()); // Call method to delete request from Firebase + removeUser(textModel); // Call method to remove user from adapter + Toast.makeText(holder.UserName.getContext(), "Request is Deleted", Toast.LENGTH_SHORT).show(); // Show deletion toast + }); + builder.setNegativeButton("Cancel", (dialog, which) -> // Set negative button and click listener + Toast.makeText(holder.UserName.getContext(), "Cancelled", Toast.LENGTH_SHORT).show() // Show cancellation toast + ); + builder.show(); // Show the dialog + } + + private void removeUser(TextModel textModel) { // Method to remove user from adapter + textModelList.remove(textModel); // Remove text model from list + textModelListFull.remove(textModel); // Remove text model from full list + notifyDataSetChanged(); // Notify adapter of data change + } + + // Method to delete request from Firebase by Checking if user ID and shift ID are valid + private void deleteRequistFromFirebase(String userId, String shiftID) { + if (userId != null && !userId.isEmpty() && shiftID != null && !shiftID.isEmpty()) { + // Remove value from database + databaseReference.child(userId).child(shiftID).removeValue().addOnCompleteListener(task -> { + if (task.isSuccessful()) { + Toast.makeText(context, "Request successfully deleted", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(context, "Request deletion failed", Toast.LENGTH_SHORT).show(); + } + }); + } else { + Toast.makeText(context, "Invalid User ID or Shift ID", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public int getItemCount() { + return textModelList.size(); + } + + + // Method to filter the textModelList based on search text + @SuppressLint("NotifyDataSetChanged") + public void filter(String text) { + textModelList.clear();// Clear the current list + if (text.trim().isEmpty()) { + textModelList.addAll(textModelListFull); + } else { + String[] searchTerms = text.toLowerCase().trim().split("\\s+"); // Split the search text into terms + for (TextModel item : textModelListFull) { // Iterate over the full list + for (String term : searchTerms) { // Iterate over search terms + if (item.getDepartment().toLowerCase().contains(term) || // Check if term is in department + item.getDateFrom().toLowerCase().contains(term) || // Check if term is in dateFrom + item.getUserName().toLowerCase().contains(term) || // Check if term is in userName + item.getShiftSelection().toLowerCase().contains(term) || // Check if term is in shiftSelection + item.getColleg().toLowerCase().contains(term) || // Check if term is in colleg + item.getDetails().toLowerCase().contains(term)) { // Check if term is in details + textModelList.add(item); // Add item to filtered list + break; // Break inner loop if term matches + } + } + } + } + // Notify adapter of data change + notifyDataSetChanged(); + } + + private void sortTextModelList() { // Method to sort the textModelList + Collections.sort(textModelList, (o1, o2) -> { // Sort the list using a comparator + SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy", Locale.getDefault()); // Date format + try { + Date date1 = sdf.parse(o1.getDateFrom()); // Parse date from o1 + Date date2 = sdf.parse(o2.getDateFrom()); // Parse date from o2 + if (date1 != null && date2 != null) { // Check if dates are not null + return date2.compareTo(date1); // Compare dates in descending order + } + } catch (ParseException e) { + e.printStackTrace(); // Print stack trace for parse exception + } + return 0; // Return 0 if comparison fails + }); + } + + private String getCurrentUserEmail() { // Method to get the current user's email + if (auth.getCurrentUser() != null) { // Check if current user is not null + return auth.getCurrentUser().getEmail(); // Return user's email + } + return null; // Return null if user is null + } + + + // Define TextViewHolder class extending RecyclerView.ViewHolder + public class TextViewHolder extends RecyclerView.ViewHolder { + private TextView dateFrom, timeAdded, department, shiftSelection, details, colleg, UserName, ShiftsID, SectionSelect; // Declare TextViews + ImageButton btnDeleteShift, btnSendRequist; // Declare ImageButtons + + // Constructor for TextViewHolder + public TextViewHolder(@NonNull View itemView) { + super(itemView); + dateFrom = itemView.findViewById(R.id.userDateFrom); + ShiftsID = itemView.findViewById(R.id.ShiftsID); + UserName = itemView.findViewById(R.id.username); + timeAdded = itemView.findViewById(R.id.userTime); + department = itemView.findViewById(R.id.userDepartment); + shiftSelection = itemView.findViewById(R.id.userSchichtTime); + details = itemView.findViewById(R.id.userShiftDetails); + colleg = itemView.findViewById(R.id.userShiftColleg); + SectionSelect = itemView.findViewById(R.id.userRoomSelection); + btnDeleteShift = itemView.findViewById(R.id.btnDeleteShift); + btnSendRequist = itemView.findViewById(R.id.btnSendRequist); + + } + } + // Method to create notification channel + private void createNotificationChannel() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + CharSequence name = "Shift Notifications"; + String description = "Notifications for new shifts"; + int importance = NotificationManager.IMPORTANCE_DEFAULT; + NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance); + channel.setDescription(description); + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + notificationManager.createNotificationChannel(channel); + } + } + + // Displays a notification to the user if the provided textModel belongs to the currently authenticated user. + private void showNotification(TextModel textModel) { + // Check if the notification is for the currently authenticated user + if (textModel.getUserID().equals(FirebaseAuth.getInstance().getUid())) { + // Create an intent to launch the MyCalendar activity + Intent intent = new Intent(context, MyCalender.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + + // Create a TaskStackBuilder to manage the back stack for the notification's intent + TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); + stackBuilder.addNextIntentWithParentStack(intent); + + // Create a PendingIntent for the notification's action + PendingIntent pendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); + + // Build the notification using NotificationCompat + NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID) + .setSmallIcon(R.drawable.calenderadd) // Set the notification icon + .setContentTitle("You have New Shift") // Set the notification title + .setContentText("On : " + textModel.getDateFrom() + "\n In: " + textModel.getDepartment() + "\n At: " + textModel.getShiftSelection()) // Set the notification text + .setPriority(NotificationCompat.PRIORITY_DEFAULT) // Set the notification priority + .setContentIntent(pendingIntent) // Set the PendingIntent to be triggered when the notification is clicked + .setAutoCancel(true); // Automatically remove the notification when it is clicked + + // Get the NotificationManager service to display the notification + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + // Define a unique ID for this notification type + int notificationId = 2; // Use a constant ID for TextModel notifications + // Show the notification + notificationManager.notify(notificationId, builder.build()); + } + } + + + +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/TextModel.java b/MyHospital/app/src/main/java/com/example/chatapp/TextModel.java new file mode 100644 index 0000000000000000000000000000000000000000..ed2443977f1f67ed4795e8916f179a5caa354d03 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/TextModel.java @@ -0,0 +1,124 @@ +package com.example.chatapp; + + +// Define TextModel class to provides a structured way to store and manage Shifts Addition data. +// This makes it easy to pass the Shifts objects around the application, +// such as saving them to a database or displaying them in a UI. +public class TextModel { + + private String DateFrom,Time,Department,ShiftSelection,Details,Colleg,ShiftsID; + + private String UserName,UserID,SectionSelect; + + + // Default constructor required for calls to DataSnapshot + public TextModel() { + } + + public TextModel(String SectionSelect,String userID,String dateFrom,String shiftsID, String time, String department, String shiftSelection, String details, String colleg,String UserName) { + DateFrom = dateFrom; + Time = time; + Department = department; + ShiftSelection = shiftSelection; + Details = details; + Colleg = colleg; + ShiftsID= shiftsID; + UserName= UserName; + UserID=userID; + SectionSelect=SectionSelect; + + } + + public String getSectionSelect() { + return SectionSelect; + } + + public void setSectionSelect(String sectionSelect) { + SectionSelect = sectionSelect; + } + + public String getUserID() { + return UserID; + } + + public void setUserID(String userID) { + UserID = userID; + } + + public String getShiftsID() { + return ShiftsID; + } + + public void setShiftsID(String shiftsID) { + ShiftsID = shiftsID; + } + + public String getDateFrom() { + return DateFrom; + } + + public void setDateFrom(String dateFrom) { + DateFrom = dateFrom; + } + + + + public String getTime() { + return Time; + } + + public void setTime(String time) { + Time = time; + } + + public String getDepartment() { + return Department; + } + + public void setDepartment(String department) { + Department = department; + } + + public String getShiftSelection() { + return ShiftSelection; + } + + public void setShiftSelection(String shiftSelection) { + ShiftSelection = shiftSelection; + } + + public String getDetails() { + return Details; + } + + public void setDetails(String details) { + Details = details; + } + + public String getColleg() { + return Colleg; + } + + public void setColleg(String colleg) { + Colleg = colleg; + } + +// public String getUserName() { +// return Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getDisplayName(); +// } +// +// public void setUserName(String userName) { +// this.userName = userName; +// } +// + + + public String getUserName() { + return UserName; + } + + public void setUserName(String userName) { + this.UserName = userName; + } + +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/UserModel.java b/MyHospital/app/src/main/java/com/example/chatapp/UserModel.java new file mode 100644 index 0000000000000000000000000000000000000000..ccb0d1f7f36184b8aa1bcee9811a8d6e63bd09e5 --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/UserModel.java @@ -0,0 +1,228 @@ +package com.example.chatapp; + +// Define UserModel class in Main Activity to provides a structured way to store and manage Users data. +// This makes it easy to pass the Users Data objects around the application, +// such as saving them to a database or displaying them in a UI. +public class UserModel { + String userID, userName, userEmail, userLastname, userFullAddress, userDepartment, userRole, userRoomNumber; + private long timestamp; + private String Fullname, DateFrom, Time, Department, ShiftSelection, Details, Colleg,SectionSelect; + private String messageId; + private String senderID; + private String message; + private String senderRoom, recieverRoom; + private String ShiftsID,ShangeRequist; + + + + // Default constructor required for calls to DataSnapshot + public UserModel() { + } + + public UserModel(String userID, String userName, String userEmail, String userLastname, String userFullAddress, String userRole, String userDepartment, String roomNumber) { + this.userID = userID; + this.userName = userName; + this.userEmail = userEmail; + this.userLastname = userLastname; + this.userFullAddress = userFullAddress; + this.userDepartment = userDepartment; + this.userRole = userRole; + this.userRoomNumber = roomNumber; + this.timestamp = System.currentTimeMillis(); + } + + + public String getShangeRequist() { + return ShangeRequist; + } + + public void setShangeRequist(String shangeRequist) { + ShangeRequist = shangeRequist; + } + + public String getSenderID() { + return senderID; + } + + public void setSenderID(String senderID) { + this.senderID = senderID; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + // Getters and Setters for all fields + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + public String getUserLastname() { + return userLastname; + } + + public void setUserLastname(String userLastname) { + this.userLastname = userLastname; + } + + public String getUserFullAddress() { + return userFullAddress; + } + + public void setUserFullAddress(String userFullAddress) { + this.userFullAddress = userFullAddress; + } + + public String getUserDepartment() { + return userDepartment; + } + + public void setUserDepartment(String userDepartment) { + this.userDepartment = userDepartment; + } + + public String getUserRole() { + return userRole; + } + + public void setUserRole(String userRole) { + this.userRole = userRole; + } + + public String getUserRoomNumber() { + return userRoomNumber; + } + + public void setUserRoomNumber(String userRoomNumber) { + this.userRoomNumber = userRoomNumber; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public String getFullname() { + return getUserName()+" "+getUserLastname(); + } + + public void setFullname(String fullname) { + Fullname = fullname; + } + + public String getDateFrom() { + return DateFrom; + } + + public void setDateFrom(String dateFrom) { + DateFrom = dateFrom; + } + + public String getTime() { + return Time; + } + + public void setTime(String time) { + Time = time; + } + + public String getDepartment() { + return Department; + } + + public void setDepartment(String department) { + Department = department; + } + + public String getShiftSelection() { + return ShiftSelection; + } + + public void setShiftSelection(String shiftSelection) { + ShiftSelection = shiftSelection; + } + + public String getDetails() { + return Details; + } + + public void setDetails(String details) { + Details = details; + } + + public String getColleg() { + return Colleg; + } + + public void setColleg(String colleg) { + Colleg = colleg; + } + + + public String getSenderRoom() { + return senderRoom; + } + + public void setSenderRoom(String senderRoom) { + this.senderRoom = senderRoom; + } + + public String getRecieverRoom() { + return recieverRoom; + } + + public void setRecieverRoom(String recieverRoom) { + this.recieverRoom = recieverRoom; + } + + public String getShiftsID() { + return ShiftsID; + } + + public void setShiftsID(String shiftsID) { + ShiftsID = shiftsID; + } + + public String getSectionSelect() { + return SectionSelect; + } + + public void setSectionSelect(String sectionSelect) { + SectionSelect = sectionSelect; + } +} diff --git a/MyHospital/app/src/main/java/com/example/chatapp/UsersAdapter.java b/MyHospital/app/src/main/java/com/example/chatapp/UsersAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..7b0d192839e343ea68deb7fee1bf4b9e67c21e3f --- /dev/null +++ b/MyHospital/app/src/main/java/com/example/chatapp/UsersAdapter.java @@ -0,0 +1,435 @@ +package com.example.chatapp; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.DatePickerDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.icu.util.Calendar; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.DatePicker; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.Spinner; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.MutableData; +import com.google.firebase.database.Transaction; +import com.orhanobut.dialogplus.DialogPlus; +import com.orhanobut.dialogplus.ViewHolder; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +// Define UsersAdapter class extending RecyclerView.Adapter +public class UsersAdapter extends RecyclerView.Adapter<UsersAdapter.MyViewHolder> { + private Context context; // Declare context + private List<UserModel> userModelList; // Declare list for user models + private List<UserModel> userModelListFull; // Declare list for full user models + private FirebaseAuth auth; // Declare FirebaseAuth + private FirebaseDatabase firebaseDatabase; // Declare FirebaseDatabase + private DatabaseReference databaseReference; // Declare DatabaseReference + private String loggedInUserEmail; // Declare string for logged in user's email + + // Constructor for UsersAdapter + public UsersAdapter(Context context) { + this.context = context; // Initialize context + this.userModelList = new ArrayList<>(); // Initialize user model list + this.userModelListFull = new ArrayList<>(userModelList); // Initialize full user model list + this.auth = FirebaseAuth.getInstance(); // Initialize FirebaseAuth + this.firebaseDatabase = FirebaseDatabase.getInstance(); // Initialize FirebaseDatabase + this.databaseReference = firebaseDatabase.getReference("MyHospital/Users"); // Initialize DatabaseReference + this.loggedInUserEmail = getCurrentUserEmail(); // Initialize logged in user's email + } + + public void add(UserModel userModel) { // Method to add a user model + userModelList.add(userModel); // Add user model to list + userModelListFull.add(userModel); // Add user model to full list + notifyDataSetChanged(); // Notify adapter of data change + } + + @SuppressLint("NotifyDataSetChanged") // Suppress lint warning + public void clear() { // Method to clear user models + userModelList.clear(); // Clear user model list + userModelListFull.clear(); // Clear full user model list + notifyDataSetChanged(); // Notify adapter of data change + } + + + // Create view holder, Inflate user row layout and Return view holder + @NonNull + @Override + public UsersAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + @SuppressLint("RestrictedApi") + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.user_row, parent, false);// Inflate user row layout and Return view holder + return new MyViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull UsersAdapter.MyViewHolder holder, int position) { + UserModel userModel = userModelList.get(position); // Get user model at position + holder.name.setText(userModel.getUserName().toLowerCase().trim()); // Set user name + holder.lastname.setText(userModel.getUserLastname().toLowerCase().trim()); // Set user last name + holder.department.setText(userModel.getUserDepartment().toLowerCase().trim()); // Set user department + holder.role.setText(userModel.getUserRole().toLowerCase().trim()); // Set user role + holder.roomNumber.setText(userModel.getUserRoomNumber().toLowerCase().trim()); // Set user room number + holder.email.setText(userModel.getUserEmail().toLowerCase().trim()); // Set user email + + // Method to get the current user's email to Set buttons Visibility + if (auth.getCurrentUser() != null && "loureen@gmail.com".equals(auth.getCurrentUser().getEmail())) { + // Show add shift and deleteSift button if current user is shift lieder + holder.btnAddSchift.setVisibility(View.VISIBLE); + holder.btnDeleteUser.setVisibility(View.VISIBLE); + } else { + // hide add shift and delete shift button if current user is not SHift Lieder + holder.btnAddSchift.setVisibility(View.GONE); + holder.btnDeleteUser.setVisibility(View.GONE); + } + // Set item click listener + holder.itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // Create intent for ChatActivity to start the Chat Activity and passing the UserID and UserName + Intent intent = new Intent(context, ChatActivity.class); + intent.putExtra("userID", userModel.getUserID()); + intent.putExtra("userName", userModel.getUserName()); + context.startActivity(intent); + } + }); + + // Set delete button click listener if in holder delete button is clicked + holder.itemView.findViewById(R.id.btnDeleteUser).setOnClickListener(new View.OnClickListener() { + // if Clicked then show first deletion confirmation + @Override + public void onClick(View v) { + showDeleteConfirmationDialog(userModel, holder); + } + }); + + // Set add shift button click listener + holder.btnAddSchift.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // if Clicked then Create a new DialogPlus dialog then Set content holder to popup_add_shift layout + //and Set dialog to be expanded with a height of 2800 + final DialogPlus dialogPlus = DialogPlus.newDialog(holder.name.getContext()) + .setContentHolder(new ViewHolder(R.layout.popup_add_schift)) + .setExpanded(true, 2800) + .create(); + + // Check if current user is Shift Leader + if (checkIfAdmin()) { + // Generate a new ShiftsID and then show dialog + String shiftsID = databaseReference.child("Shifts").push().getKey(); + dialogPlus.show(); + + // Get dialog view + View view = dialogPlus.getHolderView(); + + TextView Fullname = view.findViewById(R.id.username); // Find username TextView by ID + TextView ShiftsID = view.findViewById(R.id.ShiftsID); // Find ShiftsID TextView by ID + TextView UserID = view.findViewById(R.id.userID); // Find userID TextView by ID + TextView time = view.findViewById(R.id.myTime); // Find time TextView by ID + TextView dateFrom = view.findViewById(R.id.DateFrom); // Find dateFrom TextView by ID + EditText shiftDetails = view.findViewById(R.id.pShiftDetails); // Find shiftDetails EditText by ID + EditText colleagues = view.findViewById(R.id.pColleagues); // Find colleagues EditText by ID + + Spinner departmentSpinner = view.findViewById(R.id.pDepartment); // Find department Spinner by ID + ArrayAdapter<CharSequence> adapterDepartment = ArrayAdapter.createFromResource(holder.name.getContext(), + R.array.department_array, android.R.layout.simple_spinner_item); // Create adapter for department spinner + adapterDepartment.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // Set dropdown view resource + departmentSpinner.setAdapter(adapterDepartment); // Set adapter for department spinner + + Spinner ShiftSpinner = view.findViewById(R.id.pShiftSelection); // Find shift selection Spinner by ID + ArrayAdapter<CharSequence> adapterShift = ArrayAdapter.createFromResource(holder.name.getContext(), + R.array.shift_Time_array, android.R.layout.simple_spinner_item); // Create adapter for shift spinner + adapterShift.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // Set dropdown view resource + ShiftSpinner.setAdapter(adapterShift); // Set adapter for shift spinner + + Spinner SectionSpinner = view.findViewById(R.id.pSection); // Find section Spinner by ID + ArrayAdapter<CharSequence> adapterSection = ArrayAdapter.createFromResource(holder.name.getContext(), + R.array.Section_Array, android.R.layout.simple_spinner_item); // Create adapter for section spinner + adapterSection.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // Set dropdown view resource + SectionSpinner.setAdapter(adapterSection); // Set adapter for section spinner + + Button btnAddSchiftDialog = view.findViewById(R.id.btnAddSchiftDialog); // Find add shift dialog button by ID + Fullname.setText(userModel.getFullname()); // Set fullname TextView with user model fullname + UserID.setText(userModel.getUserID()); // Set userID TextView with user model ID + ShiftsID.setText(shiftsID); // Set ShiftsID TextView with generated ShiftsID + + shiftDetails.setText(userModel.getDetails()); // Set shift details EditText with user model details + colleagues.setText(userModel.getColleg()); // Set colleagues EditText with user model colleagues + + // Check if user model time is not null then Set time TextView with user model time + if (userModel.getTime() != null) { + time.setText(userModel.getTime()); + } else { + String currentTime = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss", Locale.getDefault()).format(new Date()); + time.setText(currentTime); + } + + // Set date from TextView with "Select Date " text + dateFrom.setText("Select Date"); + // Set date from click listener + dateFrom.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Calendar mCurrentDate = Calendar.getInstance(); // Get current date + int year = mCurrentDate.get(Calendar.YEAR); // Get current year + int month = mCurrentDate.get(Calendar.MONTH); // Get current month + int day = mCurrentDate.get(Calendar.DAY_OF_MONTH); // Get current day + + DatePickerDialog datePickerDialog = new DatePickerDialog(holder.name.getContext(), new DatePickerDialog.OnDateSetListener() { + @Override + public void onDateSet(DatePicker datePicker, int selectedYear, int selectedMonth, int selectedDay) { + // Increment month by 1 + selectedMonth = selectedMonth + 1; + // Set date format + dateFrom.setText(String.format(Locale.getDefault(), "%02d.%02d.%d", selectedDay, selectedMonth, selectedYear)); + } + }, year, month, day); // Initialize date picker dialog with current date + + datePickerDialog.setTitle("Select Date"); // Set date picker dialog title + datePickerDialog.show(); // Show date picker dialog + } + }); + + btnAddSchiftDialog.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + btnAddSchiftDialog.setEnabled(false); // Disable add shift dialog button + String selectedDate = dateFrom.getText().toString(); + String currentTime = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss", Locale.getDefault()).format(new Date()); // Get current time + String department = departmentSpinner.getSelectedItem().toString(); // Get selected department + String shift = ShiftSpinner.getSelectedItem().toString(); // Get selected shift + String sectionSelect = SectionSpinner.getSelectedItem().toString(); // Get selected section + + // Create map for shift details + Map<String, Object> shiftData = new HashMap<>(); + shiftData.put("DateFrom", selectedDate.toLowerCase()); + shiftData.put("UserName", userModel.getFullname().toLowerCase()); + shiftData.put("ShiftsID", ShiftsID.getText().toString()); + shiftData.put("UserID", UserID.getText().toString()); + shiftData.put("Department", department.toLowerCase()); + shiftData.put("SectionSelect", sectionSelect.toLowerCase()); + shiftData.put("ShiftSelection", shift.toLowerCase()); + shiftData.put("Details", shiftDetails.getText().toString().toLowerCase()); + shiftData.put("Colleg", colleagues.getText().toString().toLowerCase()); + shiftData.put("Time", currentTime); + + // Use a Firebase transaction to check and add shift + databaseReference.child("Shifts").child(userModel.getUserID()).runTransaction(new Transaction.Handler() { + @NonNull + @Override + public Transaction.Result doTransaction(@NonNull MutableData mutableData) { + for (MutableData child : mutableData.getChildren()) { + String existingDate = child.child("DateFrom").getValue(String.class); + if (existingDate != null && existingDate.equalsIgnoreCase(selectedDate)) { + return Transaction.abort(); // Abort if shift already exists for the selected date + } + } + mutableData.child(shiftsID).setValue(shiftData); + return Transaction.success(mutableData); + } + + @Override + public void onComplete(DatabaseError databaseError, boolean committed, DataSnapshot dataSnapshot) { + if (committed) { + // Show success message and dismiss dialog + Toast.makeText(holder.name.getContext(), userModel.getFullname().toUpperCase() + " Shift is Added Successfully", Toast.LENGTH_SHORT).show(); + dialogPlus.dismiss(); + } else { + // Show failure message and re-enable button + Toast.makeText(holder.name.getContext(), "Shift already exists on this date or Error while Adding Shift", Toast.LENGTH_SHORT).show(); + btnAddSchiftDialog.setEnabled(true); + } + } + }); + } + }); + } else { + // Show error message + Toast.makeText(holder.name.getContext(), "You do not have permission to Add New Shift", Toast.LENGTH_LONG).show(); + } + } + }); + + + } + + + // Method to show delete confirmation dialog + private void showDeleteConfirmationDialog(UserModel userModel, MyViewHolder holder) { + if (checkIfAdmin()) { + // Create an AlertDialog builder and Set dialog title then Set dialog message + AlertDialog.Builder builder = new AlertDialog.Builder(holder.name.getContext()); + builder.setTitle("Are you sure to DELETE " + userModel.getUserName() + " " + userModel.getUserLastname()); + builder.setMessage("Deleted data can't be undone"); + // Set positive button and click listener + builder.setPositiveButton("Delete", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + // Call method to delete user from Firebase + deleteUserFromFirebase(userModel); + } + }); + // Set negative button and click listener + builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Toast.makeText(holder.name.getContext(), "Cancelled", Toast.LENGTH_SHORT).show(); + } + }); + // Show the dialog + builder.show(); + } else { + Toast.makeText(holder.name.getContext(), "You do not have permission to delete users.", Toast.LENGTH_LONG).show(); + } + } + + // Method to delete user from Firebase by getting user ID + private void deleteUserFromFirebase(UserModel userModel) { + String userId = userModel.getUserID(); + // Fetch sign-in methods for user's email + auth.fetchSignInMethodsForEmail(userModel.getUserEmail()) + .addOnCompleteListener(task -> { + // Check if sign-in methods exist then Get current Firebase user + if (task.isSuccessful() && task.getResult() != null && !task.getResult().getSignInMethods().isEmpty()) { + FirebaseUser user = auth.getCurrentUser(); + if (user != null) { + // Delete user from authentication and Remove user from database + user.delete().addOnCompleteListener(deleteTask -> { + if (deleteTask.isSuccessful()) { + databaseReference.child(userId).removeValue().addOnCompleteListener(dbTask -> { + if (dbTask.isSuccessful()) { + // Remove user from adapter + removeUser(userModel); + Toast.makeText(context, userModel.getUserName() + " " + userModel.getUserLastname() + "User deleted successfully", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(context, "Failed to delete" + userModel.getUserName() + " from database", Toast.LENGTH_SHORT).show(); + } + }); + } else { + Toast.makeText(context, "Failed to delete user from authentication", Toast.LENGTH_SHORT).show(); + } + }); + } + } else { + // Remove user from database if no sign-in methods exist + databaseReference.child(userId).removeValue().addOnCompleteListener(dbTask -> { + if (dbTask.isSuccessful()) { + // Remove user from adapter + removeUser(userModel); + Toast.makeText(context, "User deleted successfully", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(context, "Failed to delete user from database", Toast.LENGTH_SHORT).show(); + } + }); + } + }); + } + + // Method to remove a user model from list and from full list and then Notify adapter of data change + @SuppressLint("NotifyDataSetChanged") + private void removeUser(UserModel userModel) { + userModelList.remove(userModel); + userModelListFull.remove(userModel); + notifyDataSetChanged(); + } + + // Method to get item count by Returning size of user model list + @Override + public int getItemCount() { + return userModelList.size(); + } + + // Method to get user model list by Returning user model list + public List<UserModel> getUserModelList() { + return userModelList; + } + + // Method to filter user models first must Clear user model list + //then Check if search text is empty then Add all user models to list + @SuppressLint("NotifyDataSetChanged") + public void filter(String text) { + userModelList.clear(); + if (text.trim().isEmpty()) { + userModelList.addAll(userModelListFull); + } else { + // Split search text into terms + String[] searchTerms = text.toLowerCase().trim().split("\\s+"); + // Iterate over full user model list + for (UserModel item : userModelListFull) { + // Iterate over search terms + for (String term : searchTerms) { + if (item.getUserName().toLowerCase().contains(term) || // Check if user name contains term + item.getUserLastname().toLowerCase().contains(term) || // Check if user last name contains term + item.getUserEmail().toLowerCase().contains(term) || // Check if user email contains term + item.getUserDepartment().toLowerCase().contains(term) || // Check if user department contains term + item.getUserRole().toLowerCase().contains(term) || // Check if user role contains term + item.getUserRoomNumber().toLowerCase().contains(term)) { // Check if user room number contains term + userModelList.add(item); // Add user model to list + break; // Break inner loop + } + } + } + } + // At the End notify adapter of data change + notifyDataSetChanged(); + } + + // Method to get the current user's email from Firebase and chack if it is not null + // then check if the email equals to Shifts Lieder email + private String getCurrentUserEmail() { + FirebaseUser user = auth.getCurrentUser(); + if (user != null) { + return user.getEmail(); + } + return null; + } + + private boolean checkIfAdmin() { + String currentUserEmail = getCurrentUserEmail(); + return currentUserEmail != null && currentUserEmail.equalsIgnoreCase("loureen@gmail.com"); + } + + // Define MyViewHolder class extending RecyclerView.ViewHolder + public class MyViewHolder extends RecyclerView.ViewHolder { + private TextView name, lastname, department, role, email, roomNumber; // Declare TextViews for user details + ImageButton btnDeleteUser, btnSendRequist, btnAddSchift; // Declare ImageButtons for actions + // Constructor for MyViewHolder + public MyViewHolder(@NonNull android.view.View itemView) { + // Call superclass constructor + super(itemView); + name = itemView.findViewById(R.id.username); // Find username TextView by ID + lastname = itemView.findViewById(R.id.userLastname); // Find lastname TextView by ID + department = itemView.findViewById(R.id.userDepartment); // Find department TextView by ID + role = itemView.findViewById(R.id.userRolee); // Find role TextView by ID + roomNumber = itemView.findViewById(R.id.userRoomNumnber); // Find room number TextView by ID + email = itemView.findViewById(R.id.userEmail); // Find email TextView by ID + btnDeleteUser = itemView.findViewById(R.id.btnDeleteUser); // Find delete user button by ID + btnAddSchift = itemView.findViewById(R.id.btnAddSchift); // Find add shift button by ID + btnSendRequist = itemView.findViewById(R.id.btnSendRequist); // Find send request button by ID + } + } +} diff --git a/MyHospital/app/src/main/logo-playstore.png b/MyHospital/app/src/main/logo-playstore.png new file mode 100644 index 0000000000000000000000000000000000000000..2d909a67159d4de9c51e43c85578606be89572ce Binary files /dev/null and b/MyHospital/app/src/main/logo-playstore.png differ diff --git a/MyHospital/app/src/main/res/drawable/add_msg.xml b/MyHospital/app/src/main/res/drawable/add_msg.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1ad1d510d307ab7dbcec5a880739fdec2308e3e --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/add_msg.xml @@ -0,0 +1,26 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M4,7L10.2,11.65C11.267,12.45 12.733,12.45 13.8,11.65L20,7" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M13,19H5C3.895,19 3,18.105 3,17V7C3,5.895 3.895,5 5,5H19C20.105,5 21,5.895 21,7V12" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M18.5,14V16.5M18.5,19V16.5M18.5,16.5H16M18.5,16.5H21" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#ED0D0D" + android:strokeLineCap="round"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/anfrage.xml b/MyHospital/app/src/main/res/drawable/anfrage.xml new file mode 100644 index 0000000000000000000000000000000000000000..a40e77b9050cd7d1105a2fd539cf0e9e08b51166 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/anfrage.xml @@ -0,0 +1,24 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="50dp" + android:height="50dp" + android:viewportWidth="412.88" + android:viewportHeight="412.88"> + <path + android:pathData="M199.98,176.81c-2.07,-4.93 -7.03,-8.1 -11.77,-10.04l-32.05,-14.76l-15.4,-12.98l-24.68,24.55l10.33,69.08c0.04,0.24 -0.02,0.49 -0.17,0.68l-10.92,14.94c-0.17,0.24 -0.45,0.38 -0.75,0.38s-0.57,-0.14 -0.75,-0.38l-10.92,-14.94c-0.14,-0.19 -0.2,-0.44 -0.17,-0.68l10.33,-69.08l-24.68,-24.55L73.01,152.01l-32.05,14.76c-4.74,1.95 -10.43,6.39 -11.77,10.04c0,0 -34.83,82.94 -15.94,82.94h202.67C234.82,259.74 199.98,176.81 199.98,176.81z" + android:fillColor="@color/white"/> + <path + android:pathData="M114.58,138.56c32.78,0 57.24,-30.54 57.79,-81.75C172.73,21.27 155.81,0 114.58,0C73.36,0 56.43,21.27 56.79,56.81C57.35,108.02 81.81,138.56 114.58,138.56z" + android:fillColor="@color/off_white"/> + <path + android:pathData="M383.69,329.94c-2.06,-4.94 -7.03,-8.1 -11.77,-10.04l-32.05,-14.76l-15.4,-12.98l-24.69,24.56l10.35,69.19c0.04,0.24 -0.02,0.48 -0.17,0.68l-10.92,14.94c-0.17,0.24 -0.45,0.38 -0.75,0.38c-0.29,0 -0.57,-0.14 -0.75,-0.38l-10.92,-14.94c-0.14,-0.19 -0.2,-0.44 -0.17,-0.68l10.35,-69.19l-24.69,-24.56l-15.4,12.98l-32.05,14.76c-4.74,1.95 -10.21,6.34 -11.77,10.04c0,0 -34.83,82.94 -15.94,82.94h202.67C418.52,412.88 383.69,329.94 383.69,329.94z" + android:fillColor="@color/white"/> + <path + android:pathData="M240.5,209.94c0.56,51.21 25.01,81.75 57.79,81.75s57.24,-30.54 57.79,-81.75c0.35,-35.54 -16.57,-56.81 -57.79,-56.81C257.06,153.13 240.13,174.4 240.5,209.94z" + android:fillColor="@color/white"/> + <path + android:pathData="M162.38,383.57c-41.49,0 -78.79,-23.89 -96.43,-60.59l9.23,-1.77c2.34,-0.45 4.26,-2.11 5.05,-4.37c0.78,-2.25 0.3,-4.75 -1.26,-6.55l-27.26,-31.51c-1.28,-1.48 -3.13,-2.31 -5.05,-2.31c-0.42,0 -0.84,0.04 -1.26,0.12c-2.34,0.45 -4.26,2.11 -5.05,4.37l-13.66,39.37c-0.78,2.25 -0.3,4.75 1.26,6.55c1.56,1.8 3.97,2.64 6.3,2.19l11.48,-2.2c19.92,46.27 65.62,76.72 116.65,76.72c5.53,0 10.01,-4.48 10.01,-10.01C172.38,388.05 167.9,383.57 162.38,383.57z" + android:fillColor="@color/maroon"/> + <path + android:pathData="M201.35,31.93c41.49,0 78.79,23.89 96.43,60.59l-9.23,1.77c-2.34,0.45 -4.27,2.11 -5.05,4.36c-0.78,2.25 -0.3,4.75 1.26,6.55l27.26,31.51c1.28,1.48 3.13,2.31 5.05,2.31c0.42,0 0.84,-0.04 1.26,-0.12c2.34,-0.45 4.27,-2.11 5.05,-4.37l13.66,-39.37c0.78,-2.25 0.3,-4.75 -1.26,-6.55c-1.56,-1.8 -3.97,-2.64 -6.3,-2.19l-11.48,2.2c-19.92,-46.27 -65.62,-76.72 -116.65,-76.72c-5.53,0 -10.01,4.48 -10.01,10.01C191.34,27.45 195.82,31.93 201.35,31.93z" + android:fillColor="#973D3D"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/button_backgound.xml b/MyHospital/app/src/main/res/drawable/button_backgound.xml new file mode 100644 index 0000000000000000000000000000000000000000..8316b49520cf82bb8fbd378568971237155d0efe --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/button_backgound.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <item android:state_pressed="true"> + <shape android:shape="rectangle"> + <corners android:radius="9dp"/> + <solid android:color="@color/PrimaryDark"/> + </shape> + </item> + <item > + <shape android:shape="rectangle"> + <corners android:radius="9dp"/> + <solid android:color="@color/Primary"/> + </shape> + </item> +</selector> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/calender.xml b/MyHospital/app/src/main/res/drawable/calender.xml new file mode 100644 index 0000000000000000000000000000000000000000..c2380cac96af2bcce3a990f6c3a07fa73ff044e3 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/calender.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="#AABCC3"/> + + <corners android:radius="30dp"/> + <stroke + android:width="2dp" + android:color="#2F4B55" + /> +</shape> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/calenderadd.xml b/MyHospital/app/src/main/res/drawable/calenderadd.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c89833966fb7f9fe7e60d17ba5d3656edaf17cc --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/calenderadd.xml @@ -0,0 +1,15 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="32.75" + android:viewportHeight="32.75"> + <path + android:pathData="M29.375,1.25h-1.123c0.029,-0.093 0.059,-0.186 0.059,-0.289c0,-0.53 -0.432,-0.961 -0.963,-0.961s-0.961,0.431 -0.961,0.961c0,0.103 0.028,0.196 0.059,0.289h-3.68c0.029,-0.093 0.059,-0.186 0.059,-0.289C22.823,0.431 22.393,0 21.861,0C21.331,0 20.9,0.431 20.9,0.961c0,0.103 0.029,0.196 0.059,0.289h-3.682c0.029,-0.093 0.059,-0.186 0.059,-0.289c0,-0.53 -0.43,-0.961 -0.961,-0.961c-0.531,0 -0.961,0.431 -0.961,0.961c0,0.103 0.028,0.196 0.058,0.289h-3.681c0.029,-0.093 0.059,-0.186 0.059,-0.289C11.85,0.431 11.419,0 10.889,0c-0.531,0 -0.962,0.431 -0.962,0.961c0,0.103 0.028,0.196 0.058,0.289h-3.68c0.03,-0.093 0.059,-0.186 0.059,-0.289C6.364,0.43 5.934,0 5.403,0C4.872,0 4.441,0.431 4.441,0.961c0,0.103 0.028,0.196 0.058,0.289H3.375c-1.518,0 -2.75,1.233 -2.75,2.75v26c0,1.518 1.232,2.75 2.75,2.75H26.27l5.855,-5.855V4C32.125,2.483 30.893,1.25 29.375,1.25zM30.625,26.273l-0.311,0.311h-2.355c-1.102,0 -2,0.9 -2,2v2.355l-0.311,0.311H3.375c-0.689,0 -1.25,-0.561 -1.25,-1.25V5h28.5V26.273z" + android:fillColor="#000000"/> + <path + android:pathData="M15.049,23.682l2.652,0l0,-3.981l3.979,0l0,-2.652l-3.979,0l0,-3.98l-2.652,0l0,3.98l-3.979,0l0,2.652l3.979,0z" + android:fillColor="#000000"/> + <path + android:pathData="M16.376,28.229c5.433,0 9.853,-4.42 9.853,-9.854c0,-5.434 -4.42,-9.854 -9.853,-9.854c-5.434,0 -9.854,4.42 -9.854,9.854C6.522,23.809 10.942,28.229 16.376,28.229zM16.376,10.037c4.597,0 8.337,3.741 8.337,8.338c0,4.598 -3.74,8.338 -8.337,8.338c-4.598,0 -8.339,-3.74 -8.339,-8.338C8.037,13.778 11.778,10.037 16.376,10.037z" + android:fillColor="#000000"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/calenderdot.xml b/MyHospital/app/src/main/res/drawable/calenderdot.xml new file mode 100644 index 0000000000000000000000000000000000000000..40178f1538e195c58afb8cc9c44a65c5ff9c7417 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/calenderdot.xml @@ -0,0 +1,15 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="1024" + android:viewportHeight="1024"> + <path + android:pathData="M266.8,537.7c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM449.6,537.7c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM632.4,537.7c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM815.1,537.7c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM266.8,679.3c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM449.6,679.3c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM632.4,679.3c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM815.1,679.3c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM266.8,821c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM449.6,821c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM632.4,821c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM815.1,821c0,22.6 -18.3,41 -41,41s-41,-18.3 -41,-41 18.3,-41 41,-41 41,18.3 41,41zM228.2,81.9v153.6c0,11.3 9.2,20.5 20.5,20.5s20.5,-9.2 20.5,-20.5v-153.6c0,-11.3 -9.2,-20.5 -20.5,-20.5s-20.5,9.2 -20.5,20.5zM756.3,81.9v153.6c0,11.3 9.2,20.5 20.5,20.5s20.5,-9.2 20.5,-20.5v-153.6c0,-11.3 -9.2,-20.5 -20.5,-20.5s-20.5,9.2 -20.5,20.5z" + android:fillColor="@color/white"/> + <path + android:pathData="M890.9,137.5c33.9,0 61.4,27.5 61.4,61.4v703.4c0,33.9 -27.5,61.4 -61.4,61.4h-757.8c-33.9,0 -61.4,-27.5 -61.4,-61.4L71.7,199c0,-33.9 27.5,-61.4 61.4,-61.4h757.8zM133.1,178.5c-11.3,0 -20.5,9.2 -20.5,20.5v703.4c0,11.3 9.2,20.5 20.5,20.5h757.8c11.3,0 20.5,-9.2 20.5,-20.5L911.4,199c0,-11.3 -9.2,-20.5 -20.5,-20.5h-757.8z" + android:fillColor="@color/white"/> + <path + android:pathData="M575,338.3c0,-33.9 -27.5,-61.4 -61.4,-61.4s-61.4,27.5 -61.4,61.4c0,33.9 27.5,61.4 61.4,61.4s61.4,-27.5 61.4,-61.4zM616,338.3c0,56.6 -45.8,102.4 -102.4,102.4s-102.4,-45.8 -102.4,-102.4c0,-56.6 45.8,-102.4 102.4,-102.4s102.4,45.8 102.4,102.4z" + android:fillColor="#3089CF"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/chrirug.xml b/MyHospital/app/src/main/res/drawable/chrirug.xml new file mode 100644 index 0000000000000000000000000000000000000000..a11a5d888d0bc0d1493a526f1611e548b70420d1 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/chrirug.xml @@ -0,0 +1,24 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="512" + android:viewportHeight="512"> + <path + android:pathData="M318.91,337.75c-1.34,-3.22 -2.25,-6.78 -2.66,-10.72c-1.56,-14.84 0.59,-18.66 3,-29.69c2.3,-2.44 4.52,-5.16 6.69,-8.22l-7.7,-5.03H196.36l-9.45,6.19c1.89,2.59 3.84,4.91 5.84,7.05c2.42,11.03 4.55,14.84 3.02,29.7c-0.41,3.94 -1.31,7.5 -2.66,10.72c-19.88,47.94 -134.77,25.66 -134.77,128C58.34,482.63 114.81,512 256,512s197.66,-29.38 197.66,-46.25C453.66,363.41 338.77,385.69 318.91,337.75zM394.25,482.88c-24.34,6.25 -68.11,13.66 -138.25,13.66s-113.91,-7.41 -138.25,-13.66c-31.92,-8.16 -41.67,-16.69 -43.92,-19.11c0.38,-22.58 7.09,-38.8 21.06,-50.98c13.41,-11.69 32.03,-18.53 50.05,-25.16c18.92,-6.94 38.3,-14.06 51.3,-27.25l49.94,41.09l9.83,8.09l9.83,-8.09l49.94,-41.09c13,13.19 32.39,20.31 51.3,27.25c18.02,6.63 36.64,13.47 50.06,25.16c13.95,12.19 20.67,28.41 21.05,50.98C435.94,466.19 426.19,474.72 394.25,482.88z" + android:fillColor="#000000"/> + <path + android:pathData="M324.34,213.73v63.05l6.67,4.38c4.95,-8.59 9.67,-19.31 14.48,-32.88c12.73,-4.69 25.67,-15.47 31.69,-42.06c2.45,-10.88 -1.09,-21.06 -7.75,-28.91L324.34,213.73z" + android:fillColor="#000000"/> + <path + android:pathData="M142.39,154.75l3.19,13.53l47.61,38.44h124.77l51.41,-41.5c2.86,-11.61 6.28,-29.56 6.09,-48.38H138.72c0.63,11.41 2.34,21.44 4.03,30.38C142.59,149.72 142.39,152.22 142.39,154.75z" + android:fillColor="#000000"/> + <path + android:pathData="M166.52,248.28c5.05,14.22 9.98,25.3 15.19,34.09l5.11,-3.34v-65.3l-44.58,-36.02c-6.44,7.81 -9.83,17.81 -7.41,28.52C140.83,232.81 153.78,243.63 166.52,248.28z" + android:fillColor="#000000"/> + <path + android:pathData="M221.48,84.38c8.92,8.94 21.31,14.47 34.95,14.47c13.63,0 26.02,-5.53 34.94,-14.47c2.39,-2.38 4.5,-5 6.38,-7.81h69.86c-7.19,-15.86 -20.14,-28.97 -42.23,-34.84c-10.27,-12.84 -19.98,-19.88 -30.59,-23.45c-1.06,-1.33 -2.2,-2.58 -3.41,-3.8C282.45,5.53 270.06,0 256.44,0c-13.64,0 -26.03,5.53 -34.95,14.47c-1.97,1.97 -3.77,4.13 -5.39,6.41c-1.33,-0.08 -2.77,-0.23 -4.36,-0.47c-15.55,-2.25 -28.16,-6.97 -31.95,-8.88c-2.17,-1.09 -22.69,17.09 -28.41,31.97c-4.59,11.92 -7.7,22.91 -9.72,33.06h73.47C216.98,79.38 219.11,82 221.48,84.38zM229.39,22.38c6.94,-6.94 16.47,-11.19 27.05,-11.19s20.09,4.25 27.05,11.19c6.92,6.94 11.19,16.47 11.2,27.06c-0.02,10.56 -4.28,20.09 -11.2,27.03c-6.95,6.94 -16.47,11.22 -27.05,11.22s-20.11,-4.28 -27.05,-11.22S218.19,60 218.19,49.44C218.19,38.84 222.45,29.31 229.39,22.38z" + android:fillColor="@color/black"/> + <path + android:pathData="M256.44,64.28c8.19,0 14.84,-6.66 14.84,-14.84c0,-8.22 -6.66,-14.84 -14.84,-14.84c-8.2,0 -14.84,6.63 -14.84,14.84C241.59,57.63 248.23,64.28 256.44,64.28z" + android:fillColor="#AA3434"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/delete.xml b/MyHospital/app/src/main/res/drawable/delete.xml new file mode 100644 index 0000000000000000000000000000000000000000..41a4d7994f1a00ee62802fdcc509ed804a77e4fb --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/delete.xml @@ -0,0 +1,41 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M10,12V17" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M14,12V17" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M4,7H20" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M6,10V18C6,19.657 7.343,21 9,21H15C16.657,21 18,19.657 18,18V10" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M9,5C9,3.895 9.895,3 11,3H13C14.105,3 15,3.895 15,5V7H9V5Z" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/edit.xml b/MyHospital/app/src/main/res/drawable/edit.xml new file mode 100644 index 0000000000000000000000000000000000000000..ab3e6b50df40f2d99c194be5d18f1431ccd776c9 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/edit.xml @@ -0,0 +1,34 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M4,5L15,5" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M4,8H15" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M4,11H11" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> + <path + android:pathData="M18.456,13.542L13.927,18.072C13.648,18.351 13.292,18.541 12.905,18.619L10.815,19.037L11.233,16.947C11.311,16.56 11.501,16.205 11.78,15.925L16.31,11.396M18.456,13.542L19.585,12.413C19.976,12.023 19.976,11.39 19.585,10.999L18.853,10.267C18.462,9.876 17.829,9.876 17.438,10.267L16.31,11.396M18.456,13.542L16.31,11.396" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/home.xml b/MyHospital/app/src/main/res/drawable/home.xml new file mode 100644 index 0000000000000000000000000000000000000000..455600da622ab682bbec3f42aff0ffb96d9d00dd --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/home.xml @@ -0,0 +1,48 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M22,22L2,22" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M2,11L6.063,7.75M22,11L13.874,4.499C12.778,3.623 11.222,3.623 10.126,4.499L9.344,5.125" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M15.5,5.5V3.5C15.5,3.224 15.724,3 16,3H18.5C18.776,3 19,3.224 19,3.5V8.5" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M4,22V9.5" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M20,9.5V13.5M20,22V17.5" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M15,22V17C15,15.586 15,14.879 14.561,14.439C14.121,14 13.414,14 12,14C10.586,14 9.879,14 9.439,14.439M9,22V17" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white" + android:strokeLineCap="round"/> + <path + android:pathData="M14,9.5C14,10.605 13.105,11.5 12,11.5C10.895,11.5 10,10.605 10,9.5C10,8.395 10.895,7.5 12,7.5C13.105,7.5 14,8.395 14,9.5Z" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="@color/white"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/ic_launcher_background.xml b/MyHospital/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca3826a46ce070f906d0d3fbe6987df882134381 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector + android:height="108dp" + android:width="108dp" + android:viewportHeight="108" + android:viewportWidth="108" + xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z"/> + <path android:fillColor="#00000000" android:pathData="M9,0L9,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,0L19,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,0L29,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,0L39,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,0L49,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,0L59,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,0L69,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,0L79,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M89,0L89,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M99,0L99,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,9L108,9" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,19L108,19" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,29L108,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,39L108,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,49L108,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,59L108,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,69L108,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,79L108,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,89L108,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,99L108,99" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,29L89,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,39L89,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,49L89,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,59L89,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,69L89,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,79L89,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,19L29,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,19L39,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,19L49,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,19L59,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,19L69,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,19L79,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/ic_launcher_foreground.xml b/MyHospital/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000000000000000000000000000000000000..2b068d11462a4b96669193de13a711a3a36220a0 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/list_svgrepo_com.xml b/MyHospital/app/src/main/res/drawable/list_svgrepo_com.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b2d5b7f7ea8b8492e91a6248f2757e842155d40 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/list_svgrepo_com.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="487.3" + android:viewportHeight="487.3"> + <path + android:pathData="M487.2,69.7c0,12.9 -10.5,23.4 -23.4,23.4h-322c-12.9,0 -23.4,-10.5 -23.4,-23.4s10.5,-23.4 23.4,-23.4h322.1C476.8,46.4 487.2,56.8 487.2,69.7zM463.9,162.3H141.8c-12.9,0 -23.4,10.5 -23.4,23.4s10.5,23.4 23.4,23.4h322.1c12.9,0 23.4,-10.5 23.4,-23.4C487.2,172.8 476.8,162.3 463.9,162.3zM463.9,278.3H141.8c-12.9,0 -23.4,10.5 -23.4,23.4s10.5,23.4 23.4,23.4h322.1c12.9,0 23.4,-10.5 23.4,-23.4C487.2,288.8 476.8,278.3 463.9,278.3zM463.9,394.3H141.8c-12.9,0 -23.4,10.5 -23.4,23.4s10.5,23.4 23.4,23.4h322.1c12.9,0 23.4,-10.5 23.4,-23.4C487.2,404.8 476.8,394.3 463.9,394.3zM38.9,30.8C17.4,30.8 0,48.2 0,69.7s17.4,39 38.9,39s38.9,-17.5 38.9,-39S60.4,30.8 38.9,30.8zM38.9,146.8C17.4,146.8 0,164.2 0,185.7s17.4,38.9 38.9,38.9s38.9,-17.4 38.9,-38.9S60.4,146.8 38.9,146.8zM38.9,262.8C17.4,262.8 0,280.2 0,301.7s17.4,38.9 38.9,38.9s38.9,-17.4 38.9,-38.9S60.4,262.8 38.9,262.8zM38.9,378.7C17.4,378.7 0,396.1 0,417.6s17.4,38.9 38.9,38.9s38.9,-17.4 38.9,-38.9C77.8,396.2 60.4,378.7 38.9,378.7z" + android:fillColor="@color/white"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/logo_background.xml b/MyHospital/app/src/main/res/drawable/logo_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca3826a46ce070f906d0d3fbe6987df882134381 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/logo_background.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector + android:height="108dp" + android:width="108dp" + android:viewportHeight="108" + android:viewportWidth="108" + xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z"/> + <path android:fillColor="#00000000" android:pathData="M9,0L9,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,0L19,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,0L29,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,0L39,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,0L49,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,0L59,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,0L69,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,0L79,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M89,0L89,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M99,0L99,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,9L108,9" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,19L108,19" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,29L108,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,39L108,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,49L108,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,59L108,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,69L108,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,79L108,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,89L108,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,99L108,99" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,29L89,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,39L89,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,49L89,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,59L89,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,69L89,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,79L89,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,19L29,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,19L39,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,19L49,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,19L59,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,19L69,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,19L79,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/logout.xml b/MyHospital/app/src/main/res/drawable/logout.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb980a05d2faf8da3a91e6524482e1dd5e938ece --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/logout.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="25" + android:viewportHeight="25"> + <path + android:pathData="M11.75,10.374C11.75,10.788 12.086,11.124 12.5,11.124C12.914,11.124 13.25,10.788 13.25,10.374L11.75,10.374ZM13.25,4.5C13.25,4.086 12.914,3.75 12.5,3.75C12.086,3.75 11.75,4.086 11.75,4.5L13.25,4.5ZM9.811,7.162C10.188,6.99 10.354,6.545 10.183,6.168C10.011,5.791 9.566,5.625 9.189,5.796L9.811,7.162ZM5.5,12.66L4.75,12.656L4.75,12.669L5.5,12.66ZM12.5,19.5L12.509,18.75C12.503,18.75 12.497,18.75 12.491,18.75L12.5,19.5ZM19.5,12.66L20.25,12.669L20.25,12.656L19.5,12.66ZM15.811,5.796C15.434,5.625 14.989,5.791 14.817,6.168C14.646,6.545 14.812,6.99 15.189,7.162L15.811,5.796ZM13.25,10.374L13.25,4.5L11.75,4.5L11.75,10.374L13.25,10.374ZM9.189,5.796C6.498,7.022 4.766,9.7 4.75,12.656L6.25,12.664C6.262,10.292 7.652,8.144 9.811,7.162L9.189,5.796ZM4.75,12.669C4.799,16.905 8.273,20.299 12.509,20.25L12.491,18.75C9.084,18.789 6.29,16.059 6.25,12.651L4.75,12.669ZM12.491,20.25C16.727,20.299 20.201,16.905 20.25,12.669L18.75,12.651C18.71,16.059 15.916,18.789 12.509,18.75L12.491,20.25ZM20.25,12.656C20.235,9.7 18.502,7.022 15.811,5.796L15.189,7.162C17.347,8.144 18.738,10.292 18.75,12.664L20.25,12.656Z" + android:fillColor="@color/white"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/open_day_calendar.xml b/MyHospital/app/src/main/res/drawable/open_day_calendar.xml new file mode 100644 index 0000000000000000000000000000000000000000..35f87a9005fcf5cf5be2da42062e226d4de08a26 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/open_day_calendar.xml @@ -0,0 +1,21 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="37.884" + android:viewportHeight="37.885"> + <path + android:pathData="M31.212,8.157h-3.346L19.832,1.32c0.045,-0.111 0.072,-0.233 0.072,-0.36c0,-0.529 -0.431,-0.96 -0.96,-0.96c-0.531,0 -0.961,0.431 -0.961,0.96c0,0.127 0.027,0.249 0.072,0.36l-8.034,6.837H6.674c-1.432,0 -2.595,1.164 -2.595,2.595V35.29c0,1.433 1.163,2.595 2.595,2.595h21.606l5.524,-5.525V10.752C33.806,9.321 32.642,8.157 31.212,8.157zM28.675,11.48c0,0.771 -0.626,1.396 -1.396,1.396s-1.396,-0.625 -1.396,-1.396s0.625,-1.396 1.396,-1.396S28.675,10.71 28.675,11.48zM18.458,1.767c0.144,0.088 0.304,0.154 0.486,0.154s0.341,-0.065 0.488,-0.153l7.508,6.39H10.947L18.458,1.767zM24.507,11.48c0,0.771 -0.625,1.396 -1.398,1.396c-0.77,0 -1.394,-0.625 -1.394,-1.396s0.624,-1.396 1.394,-1.396C23.882,10.084 24.507,10.71 24.507,11.48zM20.339,11.48c0,0.771 -0.626,1.396 -1.396,1.396c-0.771,0 -1.396,-0.625 -1.396,-1.396s0.626,-1.396 1.396,-1.396S20.339,10.71 20.339,11.48zM16.17,11.48c0,0.771 -0.623,1.396 -1.393,1.396c-0.774,0 -1.399,-0.625 -1.399,-1.396s0.625,-1.396 1.399,-1.396C15.547,10.084 16.17,10.71 16.17,11.48zM10.607,10.084c0.771,0 1.396,0.626 1.396,1.396s-0.625,1.396 -1.396,1.396s-1.396,-0.625 -1.396,-1.396S9.837,10.084 10.607,10.084zM32.392,31.773l-0.294,0.291h-2.224c-1.038,0 -1.887,0.852 -1.887,1.889v2.224l-0.293,0.293H6.674c-0.651,0 -1.18,-0.528 -1.18,-1.18V14.527H32.39v17.247H32.392z" + android:fillColor="@color/white"/> + <path + android:pathData="M9.048,28.029c0.17,0.326 0.415,0.582 0.735,0.765c0.32,0.183 0.75,0.274 1.29,0.274s0.97,-0.092 1.29,-0.274c0.32,-0.185 0.565,-0.438 0.735,-0.765c0.17,-0.328 0.28,-0.719 0.33,-1.176c0.05,-0.457 0.075,-0.955 0.075,-1.494c0,-0.541 -0.025,-1.039 -0.075,-1.496c-0.05,-0.457 -0.16,-0.848 -0.33,-1.174c-0.17,-0.326 -0.415,-0.582 -0.735,-0.766c-0.32,-0.184 -0.75,-0.275 -1.29,-0.275s-0.97,0.092 -1.29,0.275c-0.32,0.184 -0.565,0.438 -0.735,0.766c-0.17,0.326 -0.28,0.719 -0.33,1.174c-0.05,0.457 -0.075,0.955 -0.075,1.496c0,0.539 0.025,1.037 0.075,1.494C8.769,27.311 8.878,27.703 9.048,28.029zM10.118,24.139c0.023,-0.332 0.07,-0.605 0.14,-0.82c0.07,-0.213 0.17,-0.369 0.3,-0.465c0.13,-0.096 0.301,-0.145 0.515,-0.145c0.214,0 0.385,0.049 0.515,0.145c0.13,0.098 0.23,0.252 0.3,0.465c0.07,0.213 0.116,0.488 0.14,0.82c0.023,0.334 0.035,0.74 0.035,1.221c0,0.479 -0.012,0.888 -0.035,1.225s-0.07,0.609 -0.14,0.82c-0.07,0.209 -0.17,0.363 -0.3,0.459c-0.13,0.098 -0.302,0.146 -0.515,0.146s-0.385,-0.048 -0.515,-0.146c-0.13,-0.096 -0.23,-0.25 -0.3,-0.459c-0.07,-0.211 -0.117,-0.483 -0.14,-0.82c-0.023,-0.336 -0.035,-0.745 -0.035,-1.225C10.083,24.879 10.095,24.473 10.118,24.139z" + android:fillColor="@color/white"/> + <path + android:pathData="M15.793,26.079h0.77c0.34,0 0.65,-0.044 0.93,-0.13c0.28,-0.086 0.518,-0.217 0.715,-0.391c0.197,-0.173 0.35,-0.395 0.46,-0.664c0.11,-0.271 0.165,-0.592 0.165,-0.966c0,-0.267 -0.033,-0.528 -0.1,-0.784c-0.066,-0.257 -0.177,-0.486 -0.33,-0.686c-0.153,-0.2 -0.355,-0.361 -0.605,-0.484s-0.558,-0.186 -0.925,-0.186h-2.52v7.14h1.44V26.079zM15.793,22.85h0.6c0.36,0 0.617,0.094 0.77,0.279c0.153,0.186 0.23,0.46 0.23,0.82c0,0.367 -0.088,0.637 -0.265,0.81c-0.177,0.173 -0.408,0.261 -0.695,0.261h-0.64V22.85z" + android:fillColor="@color/white"/> + <path + android:pathData="M23.633,27.749l-2.649,0l0,-1.92l2.399,0l0,-1.179l-2.399,0l0,-1.681l2.549,0l0,-1.18l-3.99,0l0,7.14l4.09,0z" + android:fillColor="@color/white"/> + <path + android:pathData="M25.673,23.929l0.02,0l1.76,5l1.64,0l0,-7.14l-1.32,0l0,4.89l-0.02,0l-1.74,-4.89l-1.66,0l0,7.14l1.32,0z" + android:fillColor="@color/white"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/person.xml b/MyHospital/app/src/main/res/drawable/person.xml new file mode 100644 index 0000000000000000000000000000000000000000..f4cc4181e277aced6466d738a30437c1de7c36fc --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/person.xml @@ -0,0 +1,5 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> + + <path android:fillColor="@android:color/white" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/> + +</vector> diff --git a/MyHospital/app/src/main/res/drawable/replay.xml b/MyHospital/app/src/main/res/drawable/replay.xml new file mode 100644 index 0000000000000000000000000000000000000000..58d26c427aada32b24971c4d733cda61c7873a21 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/replay.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="8" + android:viewportHeight="8"> + <path + android:pathData="M3.5,1c-1.93,0 -3.5,1.57 -3.5,3.5 0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5v0.5h-1l2,2 2,-2h-1v-0.5c0,-1.93 -1.57,-3.5 -3.5,-3.5z" + android:fillColor="@color/white"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/round.xml b/MyHospital/app/src/main/res/drawable/round.xml new file mode 100644 index 0000000000000000000000000000000000000000..40f35592fb4d8722831a879f01f1ee41bdb40af9 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/round.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="#3A403F"/> + + <corners android:radius="15dp"/> + <stroke + android:width="3dp" + android:color="#0D525C" + /> +</shape> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/rounded.xml b/MyHospital/app/src/main/res/drawable/rounded.xml new file mode 100644 index 0000000000000000000000000000000000000000..cf00eb0974cfb6e7c0730cf30e8934745abc5344 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/rounded.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="@color/off_white"/> + <stroke + android:width="3dp" + android:color="@color/black"/> + <corners + android:radius="20dp"/> + + +</shape> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/rounded_recived.xml b/MyHospital/app/src/main/res/drawable/rounded_recived.xml new file mode 100644 index 0000000000000000000000000000000000000000..82dca00238ab6843f941eb19f3028efe602da7b2 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/rounded_recived.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="#284744"/> + <corners android:radius="10dp"/> +</shape> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/rounded_send.xml b/MyHospital/app/src/main/res/drawable/rounded_send.xml new file mode 100644 index 0000000000000000000000000000000000000000..e06d8a4d2ea8524ccb0348588107f09ccf491836 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/rounded_send.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="#173A4A"/> + <corners android:radius="10dp"/> +</shape> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/roundedshift.xml b/MyHospital/app/src/main/res/drawable/roundedshift.xml new file mode 100644 index 0000000000000000000000000000000000000000..a87460dcf3c79c0fbbe91100fa41487278ffdeb5 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/roundedshift.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + + <solid android:color="#A8BFBD"/> + + <corners android:radius="15dp"/> + <stroke + android:width="4dp" + android:color="#0A2D32" + /> +</shape> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/drawable/search.xml b/MyHospital/app/src/main/res/drawable/search.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b1b9aabd0c4a69dad8fe7a7723a8c991a7258c7 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/search.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="25dp" + android:height="25dp" + android:viewportWidth="16" + android:viewportHeight="16"> + <path + android:pathData="M12.027,9.92L16,13.95 14,16l-4.075,-3.976A6.465,6.465 0,0 1,6.5 13C2.91,13 0,10.083 0,6.5 0,2.91 2.917,0 6.5,0 10.09,0 13,2.917 13,6.5a6.463,6.463 0,0 1,-0.973 3.42zM1.997,6.452c0,2.48 2.014,4.5 4.5,4.5 2.48,0 4.5,-2.015 4.5,-4.5 0,-2.48 -2.015,-4.5 -4.5,-4.5 -2.48,0 -4.5,2.014 -4.5,4.5z" + android:fillColor="@color/white" + android:fillType="evenOdd"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/sendmessage.xml b/MyHospital/app/src/main/res/drawable/sendmessage.xml new file mode 100644 index 0000000000000000000000000000000000000000..575958b5ee78857af43453ef7c808635581d446d --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/sendmessage.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M5.5,9H3.5" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="#0095FF" + android:strokeLineCap="round"/> + <path + android:pathData="M5,15L4,15" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="#C31B54" + android:strokeLineCap="round"/> + <path + android:pathData="M4,12H2" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="#A52016" + android:strokeLineCap="round"/> + <path + android:pathData="M12.041,12.765C12.455,12.765 12.791,12.429 12.791,12.015C12.791,11.601 12.455,11.265 12.041,11.265V12.765ZM9.268,12.765H12.041V11.265H9.268V12.765Z" + android:fillColor="#D757ED"/> + <path + android:pathData="M11.837,4.809L12.191,4.148L11.837,4.809ZM20.539,9.477L20.185,10.138L20.539,9.477ZM20.536,14.545L20.889,15.207L20.536,14.545ZM11.838,19.193L11.484,18.532H11.484L11.838,19.193ZM8.137,15.793L7.418,15.578L8.137,15.793ZM8.131,8.204L7.413,8.418L8.131,8.204ZM9.183,11.729L8.464,11.943L9.183,11.729ZM11.482,5.469L20.185,10.138L20.894,8.816L12.191,4.148L11.482,5.469ZM20.182,13.884L11.484,18.532L12.191,19.855L20.889,15.207L20.182,13.884ZM8.855,16.008L9.901,12.516L8.464,12.086L7.418,15.578L8.855,16.008ZM9.901,11.514L8.85,7.99L7.413,8.418L8.464,11.943L9.901,11.514ZM11.484,18.532C10.751,18.924 9.988,18.759 9.441,18.256C8.888,17.749 8.585,16.913 8.855,16.008L7.418,15.578C6.974,17.062 7.473,18.486 8.426,19.361C9.384,20.241 10.829,20.583 12.191,19.855L11.484,18.532ZM20.185,10.138C21.607,10.901 21.605,13.124 20.182,13.884L20.889,15.207C23.368,13.882 23.371,10.145 20.894,8.816L20.185,10.138ZM12.191,4.148C10.83,3.417 9.384,3.757 8.425,4.636C7.471,5.51 6.97,6.934 7.413,8.418L8.85,7.99C8.58,7.085 8.885,6.249 9.438,5.742C9.986,5.24 10.75,5.076 11.482,5.469L12.191,4.148ZM9.901,12.516C9.999,12.189 9.999,11.841 9.901,11.514L8.464,11.943C8.478,11.99 8.478,12.039 8.464,12.086L9.901,12.516Z" + android:fillColor="@color/PrimaryDark"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/showshift.xml b/MyHospital/app/src/main/res/drawable/showshift.xml new file mode 100644 index 0000000000000000000000000000000000000000..de297db01076e8c74a197b6c94bacf1b6445ff07 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/showshift.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="100" + android:viewportHeight="100"> + <path + android:pathData="M76,42a2,2 0,0 1,2 2h0L78,74a6,6 0,0 1,-6 6L28,80a6,6 0,0 1,-6 -6h0L22,44a2,2 0,0 1,2 -2ZM50,46A15,15 0,1 0,65 61,15 15,0 0,0 50,46ZM52.87,53.17 L58.25,58.42a0.75,0.75 0,0 1,0 0.9l-5.38,5.19c-0.38,0.39 -0.9,0.06 -0.9,-0.59L51.97,60.81a6.17,6.17 0,0 0,-6.48 5.86,5.3 5.3,0 0,0 0,0.69L41.6,67.36A10.28,10.28 0,0 1,51.73 56.93L52,56.93L52,53.75C52,53.1 52.55,52.78 52.87,53.17ZM63,20a4,4 0,0 1,4 4h0v2h5a6,6 0,0 1,6 6h0v2a2,2 0,0 1,-2 2L24,36a2,2 0,0 1,-2 -2h0L22,32a6,6 0,0 1,6 -6h5L33,24a4,4 0,0 1,8 0h0v2L59,26L59,24A4,4 0,0 1,63 20Z" + android:fillColor="#000000"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/userdelete.xml b/MyHospital/app/src/main/res/drawable/userdelete.xml new file mode 100644 index 0000000000000000000000000000000000000000..830908289f46be16bf808e16e7cb054a873f54b3 --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/userdelete.xml @@ -0,0 +1,13 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M4,20V19C4,16.239 6.239,14 9,14H12.75M16,15L18.5,17.5M18.5,17.5L21,20M18.5,17.5L21,15M18.5,17.5L16,20M15,7C15,9.209 13.209,11 11,11C8.791,11 7,9.209 7,7C7,4.791 8.791,3 11,3C13.209,3 15,4.791 15,7Z" + android:strokeLineJoin="round" + android:strokeWidth="2" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeLineCap="round"/> +</vector> diff --git a/MyHospital/app/src/main/res/drawable/useredit.xml b/MyHospital/app/src/main/res/drawable/useredit.xml new file mode 100644 index 0000000000000000000000000000000000000000..143a527ed56440da6434702aec6c6a737f8841dd --- /dev/null +++ b/MyHospital/app/src/main/res/drawable/useredit.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="800dp" + android:height="800dp" + android:viewportWidth="640" + android:viewportHeight="640"> + <path + android:pathData="M224,320c70.7,0 128,-57.3 128,-128S294.7,64 224,64 96,121.3 96,192s57.3,128 128,128zM313.6,352h-16.7c-22.2,10.2 -46.9,16 -72.9,16s-50.6,-5.8 -72.9,-16h-16.7C60.2,352 0,412.2 0,486.4L0,528c0,26.5 21.5,48 48,48h274.9c-2.4,-6.8 -3.4,-14 -2.6,-21.3l6.8,-60.9 1.2,-11.1 7.9,-7.9 77.3,-77.3c-24.5,-27.7 -60,-45.5 -99.9,-45.5zM358.9,497.3l-6.8,61c-1.1,10.2 7.5,18.8 17.6,17.6l60.9,-6.8 137.9,-137.9 -71.7,-71.7 -137.9,137.8zM633,332.9L595.1,295c-9.3,-9.3 -24.5,-9.3 -33.8,0l-37.8,37.8 -4.1,4.1 71.8,71.7 41.8,-41.8c9.3,-9.4 9.3,-24.5 0,-33.9z" + android:fillColor="@color/white"/> +</vector> diff --git a/MyHospital/app/src/main/res/font/aclonica.xml b/MyHospital/app/src/main/res/font/aclonica.xml new file mode 100644 index 0000000000000000000000000000000000000000..a88a9687e230680f79dcb2232cddfcc5c29703d8 --- /dev/null +++ b/MyHospital/app/src/main/res/font/aclonica.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<font-family xmlns:app="http://schemas.android.com/apk/res-auto" + app:fontProviderAuthority="com.google.android.gms.fonts" + app:fontProviderPackage="com.google.android.gms" + app:fontProviderQuery="Aclonica" + app:fontProviderCerts="@array/com_google_android_gms_fonts_certs"> +</font-family> diff --git a/MyHospital/app/src/main/res/font/aladin.ttf b/MyHospital/app/src/main/res/font/aladin.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a2b6832b8b20d442664dec0c30b95a0076ddfdf0 Binary files /dev/null and b/MyHospital/app/src/main/res/font/aladin.ttf differ diff --git a/MyHospital/app/src/main/res/font/alex_brush.xml b/MyHospital/app/src/main/res/font/alex_brush.xml new file mode 100644 index 0000000000000000000000000000000000000000..f047b6c519b98a4914f410cb4e3cf47abbf0697c --- /dev/null +++ b/MyHospital/app/src/main/res/font/alex_brush.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<font-family xmlns:app="http://schemas.android.com/apk/res-auto" + app:fontProviderAuthority="com.google.android.gms.fonts" + app:fontProviderPackage="com.google.android.gms" + app:fontProviderQuery="Alex Brush" + app:fontProviderCerts="@array/com_google_android_gms_fonts_certs"> +</font-family> diff --git a/MyHospital/app/src/main/res/font/allan.xml b/MyHospital/app/src/main/res/font/allan.xml new file mode 100644 index 0000000000000000000000000000000000000000..935e814ab080255e2089d8c940fa4d6ab0ef4a82 --- /dev/null +++ b/MyHospital/app/src/main/res/font/allan.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<font-family xmlns:app="http://schemas.android.com/apk/res-auto" + app:fontProviderAuthority="com.google.android.gms.fonts" + app:fontProviderPackage="com.google.android.gms" + app:fontProviderQuery="Allan" + app:fontProviderCerts="@array/com_google_android_gms_fonts_certs"> +</font-family> diff --git a/MyHospital/app/src/main/res/font/amarante.ttf b/MyHospital/app/src/main/res/font/amarante.ttf new file mode 100644 index 0000000000000000000000000000000000000000..eb16e0067816683191cacb2e14339d6e02058ed1 Binary files /dev/null and b/MyHospital/app/src/main/res/font/amarante.ttf differ diff --git a/MyHospital/app/src/main/res/font/trocchi.ttf b/MyHospital/app/src/main/res/font/trocchi.ttf new file mode 100644 index 0000000000000000000000000000000000000000..faf7dd345bbec336d2d44ef8f56f5a8da53fc131 Binary files /dev/null and b/MyHospital/app/src/main/res/font/trocchi.ttf differ diff --git a/MyHospital/app/src/main/res/layout/activity_all_shift_show.xml b/MyHospital/app/src/main/res/layout/activity_all_shift_show.xml new file mode 100644 index 0000000000000000000000000000000000000000..ea346b955cfbb966beea0497d6a24871847c54db --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_all_shift_show.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:background="@color/off_white" + android:layout_height="match_parent" + tools:context=".MainActivity"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:layout_alignParentTop="true" + android:layout_alignParentEnd="true" + android:layout_marginTop="1dp" + android:layout_marginEnd="0dp" /> + + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rv_shifts" + android:layout_below="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_alignParentBottom="true" + android:layout_marginBottom="90dp" /> + + + <Button + android:id="@+id/btnBackshowShift" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/rv_shifts" + android:layout_alignParentStart="true" + android:layout_marginStart="80dp" + android:layout_marginTop="-75dp" + android:layout_marginEnd="50dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Back" + android:textSize="20sp" /> + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_allcalender.xml b/MyHospital/app/src/main/res/layout/activity_allcalender.xml new file mode 100644 index 0000000000000000000000000000000000000000..de1501dadb799313f24bf5b2bf395916fc66a183 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_allcalender.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".AllCalender"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="60dp" + android:hapticFeedbackEnabled="true" + android:background="@color/PrimaryDark"> + + </androidx.appcompat.widget.Toolbar> + + + <CalendarView + + android:id="@+id/calendarView" + android:layout_width="323dp" + android:layout_height="301dp" + android:layout_below="@+id/toolbar" + android:layout_alignParentTop="true" + android:layout_centerInParent="true" + android:layout_marginTop="89dp" + android:layout_marginRight="20dp" + android:background="@drawable/calender" /> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/calendarView" + + android:layout_marginTop="20dp"> + + <TextView + android:id="@+id/tvShiftDetails" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="20sp" + android:textColor="@color/black" + android:textStyle="bold" + android:padding="16dp" /> + + </ScrollView> + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_chat.xml b/MyHospital/app/src/main/res/layout/activity_chat.xml new file mode 100644 index 0000000000000000000000000000000000000000..5fcc5467fafda50ce36181571746c8cf5dcb6c02 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_chat.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/rounded" + tools:context=".ChatActivity"> + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="@color/PrimaryDark" + app:titleTextColor="@color/white" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/chatRecycler" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_below="@+id/toolbar" + android:layout_above="@+id/sendMsgLayout" + tools:ignore="NotSibling" /> + + <RelativeLayout + android:id="@+id/sendMsgLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:orientation="horizontal" + android:padding="13dp" + > + + <EditText + android:id="@+id/messageEditSend" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/round" + android:layout_marginStart="10dp" + android:textColor="@color/black" + android:backgroundTint="#D5EAF3" + android:inputType="textMultiLine" + android:hint="Write Message" + android:paddingEnd="35dp" + android:padding="18dp" + android:layout_marginBottom="3dp" + tools:ignore="RtlSymmetry" /> + <ImageView + android:id="@+id/btnsendMessageIcon" + android:layout_width="60dp" + android:layout_height="50dp" + android:paddingEnd="6dp" + android:layout_alignParentEnd="true" + android:paddingTop="4dp" + android:src="@drawable/sendmessage" + tools:ignore="RtlSymmetry" /> + + + + + </RelativeLayout> + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_main.xml b/MyHospital/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..10368c5d6f8bb3b69bd294cd3b455b07e51b4906 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/PrimaryVarient" + android:orientation="vertical" + tools:context=".MainActivity"> + + <SearchView + android:id="@+id/searchView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/toolbar" + android:layout_alignParentStart="true" + android:paddingLeft="20dp" + android:paddingRight="20dp" + android:queryHint="Search Users" + android:searchIcon="@drawable/search" + app:showAsAction="ifRoom" /> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="60dp" + android:hapticFeedbackEnabled="true" + android:background="@color/PrimaryDark" + app:titleTextColor="@color/black" > + <TextView + android:id="@+id/tvWelcome" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="#9EA5A8" + android:text="Welcome" + android:layout_marginStart="50dp" + android:layout_gravity="top" + android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title"/> + + </androidx.appcompat.widget.Toolbar> + + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/searchView" /> + + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_my_calender.xml b/MyHospital/app/src/main/res/layout/activity_my_calender.xml new file mode 100644 index 0000000000000000000000000000000000000000..cf3036454588d06509b10fd25881a295ccf74408 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_my_calender.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MyCalender"> + + + + + <CalendarView + + android:id="@+id/calendarView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:layout_marginTop="50dp" + android:layout_marginRight="20dp" + android:background="@drawable/calender" + android:layout_alignParentTop="true" + /> + <ScrollView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/calendarView" + android:layout_above="@+id/calendarButton" + android:layout_marginTop="20dp"> + + <TextView + android:id="@+id/tvShiftDetails" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="20sp" + android:textColor="@color/black" + android:textStyle="bold" + android:padding="16dp" /> + </ScrollView> + <Button + android:id="@+id/calendarButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Home" + android:textColor="@color/black" + android:background="@drawable/rounded" + android:padding="20dp" + android:layout_centerInParent="true" + android:layout_marginLeft="30dp" + android:textSize="22sp" + android:fontFamily="@font/trocchi" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" /> + + + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_requist_change.xml b/MyHospital/app/src/main/res/layout/activity_requist_change.xml new file mode 100644 index 0000000000000000000000000000000000000000..9bff3a14cd416c7ff5f8f4e4b40bd1669deb09ce --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_requist_change.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/off_white" + android:orientation="vertical" + tools:context=".RequistChange"> + + + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="60dp" + android:background="@color/PrimaryDark" + android:hapticFeedbackEnabled="true" + app:titleTextColor="@color/black"> + + <TextView + android:id="@+id/tvWelcome" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:layout_marginStart="50dp" + android:text="Welcome" + android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title" + android:textColor="#9EA5A8" /> + + </androidx.appcompat.widget.Toolbar> + + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scrollbars="vertical" + android:visibility="visible" + android:layout_below="@+id/toolbar" /> + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_signin.xml b/MyHospital/app/src/main/res/layout/activity_signin.xml new file mode 100644 index 0000000000000000000000000000000000000000..ff4e8622aadcc87fe981731f18486c11cc0d4b11 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_signin.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".SignInActivity"> + + + <ImageView + android:id="@+id/imageLogin" + android:layout_width="200dp" + android:layout_height="200dp" + android:layout_alignParentStart="true" + android:layout_marginStart="93dp" + android:layout_marginTop="30dp" + android:background="@drawable/round" + android:src="@mipmap/logo_foreground" /> + + <EditText + android:id="@+id/emailLogin" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/imageLogin" + android:layout_alignParentStart="true" + android:layout_marginStart="3dp" + android:layout_marginTop="60dp" + android:layout_marginBottom="20dp" + android:autofillHints="email" + android:hint="@string/email" + android:inputType="textEmailAddress" + android:textAlignment="center" + android:textSize="20sp" + tools:ignore="TextFields" /> + + <EditText + android:id="@+id/passwordLogin" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/emailLogin" + android:layout_alignParentEnd="true" + android:layout_marginTop="10dp" + android:layout_marginEnd="0dp" + android:hint="@string/password" + android:textAlignment="center" + android:importantForAutofill="no" + android:textSize="20sp" + android:inputType="textPassword" + tools:ignore="VisualLintTextFieldSize" /> + + <TextView + android:id="@+id/btnLogin" + android:layout_width="200dp" + android:layout_height="50dp" + android:layout_below="@+id/passwordLogin" + android:layout_marginTop="80dp" + android:layout_marginEnd="0dp" + android:background="@drawable/round" + android:text="Sign In" + + android:textAlignment="center" + android:layout_centerInParent="true" + android:textColor="@color/white" + android:textSize="30sp" + tools:ignore="VisualLintButtonSize" /> + + <TextView + android:id="@+id/btnSignup" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/btnLogin" + android:layout_marginTop="60dp" + android:layout_marginEnd="0dp" + android:layout_centerInParent="true" + android:text="Sign Up new Account !" + android:textAlignment="center" + android:textColor="@color/PrimaryDark" + android:textSize="20sp" + tools:ignore="VisualLintButtonSize" /> + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_signup.xml b/MyHospital/app/src/main/res/layout/activity_signup.xml new file mode 100644 index 0000000000000000000000000000000000000000..f35fd895e4cd756f21aa9a77c34d34ba62425a36 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_signup.xml @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".SignUpAcrivity"> + + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="66dp" + android:background="@color/PrimaryDark" + android:gravity="center" + android:text="Add Information" + android:textColor="@color/white" + android:textSize="30sp" /> + + + + <EditText + android:id="@+id/nameSignup" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="15dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="First Name" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + <EditText + android:id="@+id/lastnameSignup" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Last Name" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + <EditText + android:id="@+id/fullAddress" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Full Adress" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <Spinner + android:id="@+id/spinnerDepartment" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center_horizontal" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" + android:layout_marginEnd="10dp" + android:background="@drawable/rounded" + android:textAlignment="center" + android:entries="@array/department_array" + android:gravity="center" + android:spinnerMode="dialog" /> + <Spinner + android:id="@+id/roomNummber" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:textAlignment="center" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <Spinner + android:id="@+id/spinnerRole" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center_horizontal" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" + android:layout_marginEnd="10dp" + android:background="@drawable/rounded" + android:entries="@array/Role_array" + android:textAlignment="center" + android:gravity="center" + android:spinnerMode="dialog" /> + + <EditText + android:id="@+id/emailSignup" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Email" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" + android:inputType="textEmailAddress"/> + <EditText + android:id="@+id/passwordSignup" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Password" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" + android:inputType="textPassword"/> + + <TextView + android:id="@+id/sbtnSignup" + android:layout_marginStart="100dp" + android:layout_width="200dp" + android:layout_height="60dp" + android:layout_marginTop="40dp" + android:background="@drawable/rounded" + android:gravity="center_horizontal" + android:paddingTop="5dp" + android:text="Sign Up" + android:textColor="@color/white" + android:backgroundTint="@color/PrimaryDark" + android:textSize="25sp" /> + + + </LinearLayout> + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/activity_text.xml b/MyHospital/app/src/main/res/layout/activity_text.xml new file mode 100644 index 0000000000000000000000000000000000000000..a7950a62a9d7c384182f3f7cf48f4a7c844af8bc --- /dev/null +++ b/MyHospital/app/src/main/res/layout/activity_text.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/main" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/PrimaryVarient" + android:orientation="vertical" + tools:context=".TextActivity"> + + <SearchView + android:id="@+id/searchView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/toolbar" + android:layout_alignParentStart="true" + android:paddingLeft="20dp" + android:paddingRight="20dp" + + android:queryHint="Search Users" + android:searchIcon="@drawable/search" + app:showAsAction="ifRoom" /> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="60dp" + android:background="@color/PrimaryDark" + app:titleTextColor="@color/white" > + <TextView + android:id="@+id/tvWelcome" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="#9EA5A8" + android:text="Welcome" + android:layout_marginStart="50dp" + android:layout_gravity="top" + android:textAppearance="@style/TextAppearance.AppCompat.Title"/> + </androidx.appcompat.widget.Toolbar> + + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/searchView" + android:layout_above="@+id/btnBackshowShift" + /> + + <Button + android:id="@+id/btnBackshowShift" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="50dp" + android:layout_alignParentBottom="true" + android:layout_marginStart="50dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Back" + android:textSize="20sp" /> + + +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/main_shift.xml b/MyHospital/app/src/main/res/layout/main_shift.xml new file mode 100644 index 0000000000000000000000000000000000000000..fb734469ce1d6ac5b0cb38f8afc013711bec4907 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/main_shift.xml @@ -0,0 +1,270 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:elevation="10dp" + app:cardCornerRadius="30dp" + app:cardUseCompatPadding="true"> + + + <RelativeLayout + android:id="@+id/textLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#5E6A69" + android:padding="15dp"> + + + <TextView + android:id="@+id/username" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/aclonica" + android:text="Username" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/ShiftsID" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/username" + android:layout_centerHorizontal="true" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/aclonica" + android:text="SiftsID" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/userTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/ShiftsID" + android:layout_centerHorizontal="true" + android:layout_marginStart="80dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/trocchi" + android:text="@string/time_mainshift" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/Date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/ShiftsID" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/on" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/from" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/Date" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="Shift Date" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userDateFrom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/userTime" + android:layout_marginStart="20dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:layout_toEndOf="@+id/from" + android:text="@string/date_from" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/dep" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userDateFrom" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/dep" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userDepartment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userDateFrom" + android:layout_marginStart="70dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/dep" + android:fontFamily="@font/trocchi" + android:text="@string/deparment" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + <TextView + android:id="@+id/Room" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/dep" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="Room: " + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userRoomSelection" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userDepartment" + android:layout_marginStart="60dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@id/shift" + android:fontFamily="@font/trocchi" + android:text="RoomSection" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/shift" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/Room" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/shift" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userSchichtTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userRoomSelection" + android:layout_marginStart="56dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@id/shift" + android:fontFamily="@font/trocchi" + android:text="@string/schicht_time" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/details" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/shift" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/details" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userShiftDetails" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/details" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@id/details" + android:fontFamily="@font/trocchi" + android:text="@string/shift_details" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/colle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userShiftDetails" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/with" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userShiftColleg" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/colle" + android:layout_marginStart="30dp" + android:layout_toEndOf="@id/colle" + android:fontFamily="@font/trocchi" + android:text="@string/with" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <ImageButton + android:id="@+id/btnDeleteShift" + android:layout_width="50dp" + android:layout_height="50dp" + android:layout_below="@+id/userShiftColleg" + android:layout_alignParentEnd="true" + android:layout_marginTop="20dp" + android:layout_marginEnd="30dp" + android:background="@drawable/delete" + android:backgroundTint="@color/black" + android:textAllCaps="true" /> + + <ImageButton + android:id="@+id/btnSendRequist" + android:layout_width="50dp" + android:layout_height="50dp" + android:layout_below="@+id/userShiftColleg" + android:layout_marginTop="20dp" + android:layout_marginEnd="20dp" + android:layout_alignParentEnd="true" + android:layout_toStartOf="@+id/btnDeleteShift" + android:background="@drawable/anfrage" + android:backgroundTint="@color/black" + android:textAllCaps="true" /> + + + + </RelativeLayout> + + +</androidx.cardview.widget.CardView> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/message_row_recived.xml b/MyHospital/app/src/main/res/layout/message_row_recived.xml new file mode 100644 index 0000000000000000000000000000000000000000..4dd5fef96ba9c3035f95b2b344cd5ff72476c5f1 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/message_row_recived.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="start" + > + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:layout_margin="10dp" + android:background="@drawable/rounded_recived"> + + <TextView + android:id="@+id/tvRecievedMessage" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:fontFamily="@font/amarante" + android:textColor="@color/white" + android:textSize="18sp" /> + </RelativeLayout> + +</LinearLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/message_row_send.xml b/MyHospital/app/src/main/res/layout/message_row_send.xml new file mode 100644 index 0000000000000000000000000000000000000000..884321dfeca50fc48987066c502632951c57052a --- /dev/null +++ b/MyHospital/app/src/main/res/layout/message_row_send.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="end" + > + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:background="@drawable/rounded_send" + android:layout_margin="10dp"> + <TextView + android:id="@+id/tvSendMessage" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:fontFamily="@font/amarante" + android:textColor="@color/white" + android:textSize="18sp" + /> + </RelativeLayout> + +</LinearLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/popup_add_schift.xml b/MyHospital/app/src/main/res/layout/popup_add_schift.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3baf877b7bff1a0ee13f6b6e0b393750229862d --- /dev/null +++ b/MyHospital/app/src/main/res/layout/popup_add_schift.xml @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="66dp" + android:background="@color/gray" + android:gravity="center" + android:text="Add New Shift" + android:textColor="@color/white" + android:textSize="30sp" /> + <TextView + android:id="@+id/userID" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="UserID" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + + <TextView + android:id="@+id/ShiftsID" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="ShiftsID" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/username" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="User Name" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/myTime" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Time" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/DateFrom" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Shift Date" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <Spinner + android:id="@+id/pDepartment" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" + android:layout_marginEnd="10dp" + android:background="@drawable/rounded" + android:entries="@array/department_array" + android:gravity="center" + android:textAlignment="center" + android:prompt="@string/department_prompt" + android:spinnerMode="dialog" + /> + + <Spinner + android:id="@+id/pSection" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" + android:layout_marginEnd="10dp" + android:background="@drawable/rounded" + android:entries="@array/Section_Array" + android:gravity="center" + android:textAlignment="center" + android:prompt="@string/SectionRoom_prompt" + android:spinnerMode="dialog" + /> + + <Spinner + android:id="@+id/pShiftSelection" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center_horizontal" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" + android:layout_marginEnd="10dp" + android:background="@drawable/rounded" + android:textAlignment="center" + android:gravity="center" + android:entries="@array/shift_Time_array" + android:prompt="@string/shift_prompt" + android:spinnerMode="dialog" + /> + + + + <EditText + android:id="@+id/pShiftDetails" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Shift Details" + android:textColor="@color/black" /> + + <EditText + android:id="@+id/pColleagues" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Colleagues with Schift" + android:textColor="@color/black" /> + + <Button + android:id="@+id/btnAddSchiftDialog" + android:layout_width="match_parent" + android:layout_height="37dp" + android:layout_marginLeft="70dp" + android:layout_marginTop="10dp" + android:layout_marginRight="70dp" + android:background="@drawable/rounded" + android:backgroundTint="@color/gray" + android:gravity="center" + android:text="Add Schift" + android:textColor="@color/white" + android:textSize="21sp" /> + + + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/popup_shift_requist.xml b/MyHospital/app/src/main/res/layout/popup_shift_requist.xml new file mode 100644 index 0000000000000000000000000000000000000000..68c0ea8ec9d66caf534387a51a6925d3788c467b --- /dev/null +++ b/MyHospital/app/src/main/res/layout/popup_shift_requist.xml @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="66dp" + android:background="@color/gray" + android:gravity="center" + android:text="Request Change" + android:textColor="@color/white" + android:textSize="30sp" /> + + + <TextView + android:id="@+id/ShiftsID" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="ShiftsID" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/username" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Username" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + + <TextView + android:id="@+id/DateFrom" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Date" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/pDepartment" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Department" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + <TextView + android:id="@+id/pShiftSelection" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Shift Time:" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + + + <Spinner + android:id="@+id/ChangeRequist" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center_horizontal" + android:layout_marginStart="10dp" + android:layout_marginTop="10dp" + android:layout_marginEnd="10dp" + android:background="@drawable/rounded" + android:entries="@array/Change_Requist" + android:gravity="center" + android:prompt="@string/Change_prompt" + android:spinnerMode="dialog" + android:textAlignment="center" /> + + + <EditText + android:id="@+id/pShiftDetails" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_gravity="center" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:hint="Note: " + android:textColor="@color/black" /> + + + + <TextView + android:id="@+id/myTime" + android:layout_width="match_parent" + android:layout_height="50dp" + android:layout_marginLeft="10dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" + android:background="@drawable/rounded" + android:gravity="center" + android:text="Requist Time " + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <Button + android:id="@+id/btnAddChangeDialog" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="70dp" + android:layout_marginTop="10dp" + android:layout_marginRight="70dp" + android:background="@drawable/rounded" + android:backgroundTint="@color/gray" + android:gravity="center" + android:text="Request Change" + android:textColor="@color/white" + android:textSize="21sp" /> + + + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/requist_row.xml b/MyHospital/app/src/main/res/layout/requist_row.xml new file mode 100644 index 0000000000000000000000000000000000000000..888730d40cd1e866d637cceed15bcc439a65f665 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/requist_row.xml @@ -0,0 +1,230 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:elevation="10dp" + app:cardCornerRadius="30dp" + app:cardElevation="4dp" + app:contentPadding="10dp"> + + + <RelativeLayout + android:id="@+id/textLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#5E6A69" + android:padding="15dp"> + + + + <TextView + android:id="@+id/requistChange" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_centerInParent="true" + android:layout_marginStart="44dp" + android:layout_marginTop="10dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/amarante" + android:text="Request Change" + android:textColor="@color/white" + android:textSize="28sp" + android:textStyle="bold" /> + + + + <TextView + android:id="@+id/username" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/requistChange" + android:layout_centerHorizontal="true" + android:layout_marginStart="98dp" + android:layout_marginTop="10dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/allan" + android:text="Username" + android:textColor="@color/white" + android:textSize="25sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/userid" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/username" + android:layout_centerHorizontal="true" + android:layout_marginStart="50dp" + android:layout_marginTop="10dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/trocchi" + android:text="Shift id" + android:textColor="@color/white" + android:textSize="15sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userid" + android:layout_centerHorizontal="true" + android:layout_marginStart="87dp" + android:layout_marginTop="6dp" + android:layout_toEndOf="@+id/Date" + android:fontFamily="@font/trocchi" + android:text="@string/time_mainshift" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/Date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userid" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="On: " + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/from" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/Date" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="Shift Date" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/userDateFrom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/userTime" + android:layout_marginStart="26dp" + android:layout_marginTop="3dp" + android:layout_toEndOf="@id/from" + android:fontFamily="@font/trocchi" + android:text="@string/date_from" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/dep" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/from" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/dep" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userDepartment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userDateFrom" + android:layout_marginStart="79dp" + android:layout_marginTop="6dp" + android:layout_toEndOf="@+id/dep" + android:fontFamily="@font/trocchi" + android:text="@string/deparment" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/shift" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/dep" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/shift" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/userSchichtTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userDepartment" + android:layout_marginStart="67dp" + android:layout_marginTop="6dp" + android:layout_toEndOf="@id/shift" + android:fontFamily="@font/trocchi" + android:text="@string/schicht_time" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/details" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/shift" + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:fontFamily="@font/trocchi" + android:text="@string/details" + android:textColor="@color/black" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userShiftDetails" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/details" + android:layout_marginStart="0dp" + android:layout_marginTop="7dp" + android:layout_toEndOf="@id/details" + android:fontFamily="@font/trocchi" + android:text="@string/shift_details" + android:textColor="@color/white" + android:textSize="20sp" + android:textStyle="bold" /> + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:id="@+id/textLayoutCheck"> + <CheckBox + android:id="@+id/requistCheckBox" + android:layout_width="50dp" + android:layout_height="50dp" + android:layout_alignParentTop="true" + android:layout_alignParentEnd="true" + android:layout_marginStart="42dp" + android:layout_marginTop="0dp" + android:layout_marginEnd="7dp" + android:text="" + android:textColor="@color/white" /> + </RelativeLayout> + + + + + </RelativeLayout> + + +</androidx.cardview.widget.CardView> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/layout/user_row.xml b/MyHospital/app/src/main/res/layout/user_row.xml new file mode 100644 index 0000000000000000000000000000000000000000..0291e141051b46b9926ef7afb1a610bca7b73f83 --- /dev/null +++ b/MyHospital/app/src/main/res/layout/user_row.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.cardview.widget.CardView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="10dp" + app:cardCornerRadius="24dp" + app:cardElevation="4dp" + app:contentPadding="10dp"> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:orientation="vertical"> + + <ImageView + android:id="@+id/profile_image" + android:layout_width="80dp" + android:layout_height="80dp" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginStart="2dp" + android:layout_marginTop="34dp" + android:src="@drawable/chrirug" + /> + + <TextView + android:id="@+id/username" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginStart="20dp" + android:layout_marginTop="15dp" + android:layout_toEndOf="@+id/profile_image" + android:fontFamily="@font/aclonica" + android:text="UserName" + android:textColor="@color/PrimaryDark" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userLastname" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginStart="5dp" + android:layout_marginTop="15dp" + android:layout_toEndOf="@+id/username" + android:fontFamily="@font/aclonica" + android:text="Lastname" + android:textColor="@color/PrimaryDark" + android:textSize="20sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userDepartment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userLastname" + android:layout_centerHorizontal="true" + android:layout_marginStart="30dp" + android:layout_marginTop="10dp" + android:layout_toEndOf="@+id/profile_image" + android:fontFamily="@font/aclonica" + android:text="Department" + android:textColor="@color/PrimaryDark" + android:textSize="17sp" /> + + <TextView + android:id="@+id/userRolee" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userDepartment" + android:layout_marginStart="30dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/profile_image" + android:fontFamily="@font/aclonica" + android:text="Role" + android:textColor="@color/PrimaryDark" + android:textSize="15sp" + android:textStyle="bold" /> + + + <TextView + android:id="@+id/userRoomNumnber" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userRolee" + android:layout_centerHorizontal="true" + android:layout_marginStart="30dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/profile_image" + android:fontFamily="@font/aclonica" + android:text="Room No." + android:textColor="@color/PrimaryDark" + android:textSize="15sp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/userEmail" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userRoomNumnber" + android:layout_centerHorizontal="true" + android:layout_marginStart="30dp" + android:layout_marginTop="5dp" + android:layout_toEndOf="@+id/profile_image" + android:fontFamily="@font/aclonica" + android:text="Email" + android:textColor="@color/PrimaryDark" + android:textSize="15sp" + android:textStyle="bold" /> + + + <LinearLayout + android:id="@+id/btnEditDelete" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/userEmail" + android:layout_marginStart="100dp" + android:layout_marginTop="20dp" + android:orientation="horizontal"> + + <ImageButton + android:id="@+id/btnDeleteUser" + android:layout_width="50dp" + android:layout_height="50dp" + android:layout_marginStart="20dp" + android:layout_marginTop="20dp" + android:layout_marginEnd="10dp" + android:background="@drawable/userdelete" + android:backgroundTint="#512F2C" + android:textAllCaps="true" + /> + + + <ImageButton + + android:id="@+id/btnAddSchift" + android:layout_width="50dp" + android:layout_height="50dp" + android:layout_marginStart="20dp" + android:layout_marginTop="20dp" + android:layout_marginEnd="10dp" + android:background="@drawable/calenderadd" + android:backgroundTint="#231340" + android:textAllCaps="true" + /> + + + + + + + </LinearLayout> + + + </RelativeLayout> + + </androidx.cardview.widget.CardView> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/menu/chat_menu.xml b/MyHospital/app/src/main/res/menu/chat_menu.xml new file mode 100644 index 0000000000000000000000000000000000000000..755a508757d3faf7171c980521ee13118c518d07 --- /dev/null +++ b/MyHospital/app/src/main/res/menu/chat_menu.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <item + android:id="@+id/ShiftAnfrage" + android:title="Ask Shift" + android:icon="@drawable/anfrage" + app:showAsAction="always" + /> + <item + android:id="@+id/ShowAllShifts" + android:title="View All SHifts" + android:icon="@drawable/calenderdot" + app:showAsAction="always" + /> + <item + android:id="@+id/listShift" + android:title="View All SHifts" + android:icon="@drawable/list_svgrepo_com" + + app:showAsAction="always" + /> + + <item + android:id="@+id/onDayCalender" + android:title="One Day Shifts" + android:icon="@drawable/open_day_calendar" + app:showAsAction="always" + /> + + <item + android:id="@+id/home" + android:title="@string/send_message" + android:icon="@drawable/home" + app:showAsAction="always" + /> + + + +</menu> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/menu/main_calender.xml b/MyHospital/app/src/main/res/menu/main_calender.xml new file mode 100644 index 0000000000000000000000000000000000000000..e217da35f9d2a7ac855f2e0c1210a31d2366e687 --- /dev/null +++ b/MyHospital/app/src/main/res/menu/main_calender.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/home" + android:title="@string/send_message" + android:icon="@drawable/home" + app:showAsAction="always" + /> + <item + android:id="@+id/ShiftAnfrage" + android:title="Ask Shift" + android:icon="@drawable/anfrage" + app:showAsAction="always" + /> + + <item + android:id="@+id/sendMessage" + android:title="View All SHifts" + android:icon="@drawable/add_msg" + app:showAsAction="always" + /> + <item + android:id="@+id/listShift" + android:title="View All SHifts" + android:icon="@drawable/list_svgrepo_com" + + app:showAsAction="always" + /> + + + <item + android:id="@+id/onDayCalender" + android:title="One Day Shifts" + android:icon="@drawable/open_day_calendar" + app:showAsAction="always" + /> + + <item + android:id="@+id/logout" + android:title="logout" + android:icon="@drawable/replay" + app:showAsAction="always" + /> + + + +</menu> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/menu/main_menu.xml b/MyHospital/app/src/main/res/menu/main_menu.xml new file mode 100644 index 0000000000000000000000000000000000000000..c17b2f86675c392c44859d56beb85fb35696160d --- /dev/null +++ b/MyHospital/app/src/main/res/menu/main_menu.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <item + android:id="@+id/ShiftAnfrage" + android:title="Ask Shift" + android:icon="@drawable/anfrage" + app:showAsAction="always" + /> + <item + android:id="@+id/ShowAllShifts" + android:title="View All SHifts" + android:icon="@drawable/calenderdot" + app:showAsAction="always" + /> + <item + android:id="@+id/listShift" + android:title="View All SHifts" + android:icon="@drawable/list_svgrepo_com" + + app:showAsAction="always" + /> + + <item + android:id="@+id/onDayCalender" + android:title="One Day Shifts" + android:icon="@drawable/open_day_calendar" + app:showAsAction="always" + /> + + <item + android:id="@+id/logout" + android:title="logout" + android:icon="@drawable/replay" + app:showAsAction="always" + /> + + + +</menu> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/menu/menu_requist.xml b/MyHospital/app/src/main/res/menu/menu_requist.xml new file mode 100644 index 0000000000000000000000000000000000000000..e01343593dcb0a0185b584f6888c5da3ed0fe33e --- /dev/null +++ b/MyHospital/app/src/main/res/menu/menu_requist.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/home" + android:title="@string/send_message" + android:icon="@drawable/home" + app:showAsAction="always" + /> + <item + android:id="@+id/ShowAllShifts" + android:title="View All SHifts" + android:icon="@drawable/calenderdot" + app:showAsAction="always" + /> + <item + android:id="@+id/listShift" + android:title="View All SHifts" + android:icon="@drawable/list_svgrepo_com" + + app:showAsAction="always" + /> + + + + + <item + android:id="@+id/logout" + android:title="logout" + android:icon="@drawable/replay" + app:showAsAction="always" + /> + + + +</menu> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/menu/menu_shifts.xml b/MyHospital/app/src/main/res/menu/menu_shifts.xml new file mode 100644 index 0000000000000000000000000000000000000000..de4fb4eff68d899da777a7c6a0514f82cf54095c --- /dev/null +++ b/MyHospital/app/src/main/res/menu/menu_shifts.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <item + android:id="@+id/ShiftAnfrage" + android:title="Ask Shift" + android:icon="@drawable/anfrage" + app:showAsAction="always" + /> + <item + android:id="@+id/AddMessage" + android:title="@string/send_message" + android:icon="@drawable/add_msg" + app:showAsAction="always" + /> + + + <item + android:id="@+id/onDayCalender" + android:title="@string/one_day_shifts" + android:icon="@drawable/open_day_calendar" + app:showAsAction="always" + /> + <item + android:id="@+id/allShiftsCalender" + android:title="@string/one_day_shifts" + android:icon="@drawable/calenderdot" + app:showAsAction="always" + /> + + <item + android:id="@+id/logout" + android:title="logout" + android:icon="@drawable/replay" + app:showAsAction="always" + /> + + + +</menu> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/MyHospital/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000000000000000000000000000000000000..c4a603d4cce78b2fbd8094bd0224d4778bc8c976 --- /dev/null +++ b/MyHospital/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background"/> + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/MyHospital/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000000000000000000000000000000000000..c4a603d4cce78b2fbd8094bd0224d4778bc8c976 --- /dev/null +++ b/MyHospital/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background"/> + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/mipmap-anydpi-v26/logo.xml b/MyHospital/app/src/main/res/mipmap-anydpi-v26/logo.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5e851a896ac3c3c01a5f69c0636c05886652254 --- /dev/null +++ b/MyHospital/app/src/main/res/mipmap-anydpi-v26/logo.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/logo_background"/> + <foreground android:drawable="@mipmap/logo_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/mipmap-anydpi-v26/logo_round.xml b/MyHospital/app/src/main/res/mipmap-anydpi-v26/logo_round.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5e851a896ac3c3c01a5f69c0636c05886652254 --- /dev/null +++ b/MyHospital/app/src/main/res/mipmap-anydpi-v26/logo_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/logo_background"/> + <foreground android:drawable="@mipmap/logo_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..4d5c9bb04160dc526d6bebb76b595cfb08fb5f14 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..7316f63e3d712dfe368da32d341cc658bb2f9a1b Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..dff6e6b392514ed7a3bb0465be3aa565da302ea4 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-hdpi/logo.webp b/MyHospital/app/src/main/res/mipmap-hdpi/logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..4d5c9bb04160dc526d6bebb76b595cfb08fb5f14 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-hdpi/logo.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-hdpi/logo_foreground.webp b/MyHospital/app/src/main/res/mipmap-hdpi/logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..7316f63e3d712dfe368da32d341cc658bb2f9a1b Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-hdpi/logo_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-hdpi/logo_round.webp b/MyHospital/app/src/main/res/mipmap-hdpi/logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..dff6e6b392514ed7a3bb0465be3aa565da302ea4 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-hdpi/logo_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..d4534704ad94351049bef0d45f10d9a90dccebb2 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..8cfaad184b7dea1b3b38b4f378c6cc979840f7bb Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..9bc22133a01abfcc1b057d27d6e8cd221dae6974 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-mdpi/logo.webp b/MyHospital/app/src/main/res/mipmap-mdpi/logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..d4534704ad94351049bef0d45f10d9a90dccebb2 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-mdpi/logo.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-mdpi/logo_foreground.webp b/MyHospital/app/src/main/res/mipmap-mdpi/logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..8cfaad184b7dea1b3b38b4f378c6cc979840f7bb Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-mdpi/logo_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-mdpi/logo_round.webp b/MyHospital/app/src/main/res/mipmap-mdpi/logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..9bc22133a01abfcc1b057d27d6e8cd221dae6974 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-mdpi/logo_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..7351063c699e680d0cee7701060486f7b4bd085f Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..1e90e6400dab829aef69e3ffe29844010da5143c Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..01d16a1946e5185013e8f4d8721d61cd390fcf26 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xhdpi/logo.webp b/MyHospital/app/src/main/res/mipmap-xhdpi/logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..7351063c699e680d0cee7701060486f7b4bd085f Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xhdpi/logo.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xhdpi/logo_foreground.webp b/MyHospital/app/src/main/res/mipmap-xhdpi/logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..1e90e6400dab829aef69e3ffe29844010da5143c Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xhdpi/logo_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xhdpi/logo_round.webp b/MyHospital/app/src/main/res/mipmap-xhdpi/logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..01d16a1946e5185013e8f4d8721d61cd390fcf26 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xhdpi/logo_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..6e77d1e0057000d9e7119df67e5cfedb67e8192b Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..0fb193fe0585092865f485a8346b17f04a0e3e9c Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..5f2830de919007d055650df46ef7e1a8a5ffa8d9 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxhdpi/logo.webp b/MyHospital/app/src/main/res/mipmap-xxhdpi/logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..6e77d1e0057000d9e7119df67e5cfedb67e8192b Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxhdpi/logo.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxhdpi/logo_foreground.webp b/MyHospital/app/src/main/res/mipmap-xxhdpi/logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..0fb193fe0585092865f485a8346b17f04a0e3e9c Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxhdpi/logo_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxhdpi/logo_round.webp b/MyHospital/app/src/main/res/mipmap-xxhdpi/logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..5f2830de919007d055650df46ef7e1a8a5ffa8d9 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxhdpi/logo_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..2f1d44406fce0c63643c28def3bb328cabcbcd49 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..7c0fe9129e8a2c92793fb9f5e5cad69920cd3318 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..d85f768f8999b55faea8ef15d9b9061584f56a1d Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo.webp b/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..2f1d44406fce0c63643c28def3bb328cabcbcd49 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo_foreground.webp b/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..7c0fe9129e8a2c92793fb9f5e5cad69920cd3318 Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo_foreground.webp differ diff --git a/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo_round.webp b/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..d85f768f8999b55faea8ef15d9b9061584f56a1d Binary files /dev/null and b/MyHospital/app/src/main/res/mipmap-xxxhdpi/logo_round.webp differ diff --git a/MyHospital/app/src/main/res/values/array.xml b/MyHospital/app/src/main/res/values/array.xml new file mode 100644 index 0000000000000000000000000000000000000000..f495c21b2cd687837ee856d265e8abb2f939c2a1 --- /dev/null +++ b/MyHospital/app/src/main/res/values/array.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string-array name="department_array">Choose Department + <item>Surgery</item> + <item>Emergency Department</item> + <item>Cardiology</item> + <item>Intensive Care Unit (ICU)</item> + <item>Neurology</item> + <item>Orthopedics</item> + <item>Radiology</item> + <item>Pathology</item> + <item>Psychiatry</item> + <item>Endocrinology</item> + </string-array> + + <string-array name="shift_Time_array">Choose Department + <item> Morning(8:00-18:00)</item> + <item> Afternon(13:00-23:00)</item> + <item>Night(22:00-8.00)</item> + + </string-array> + <string-array name="Role_array">Choose Department + + <item> Surgeon</item> + <item> Doctor</item> + <item> Nurse</item> + <item> Assistant</item> + <item>Physical Therapist</item> + <item>Radiologist</item> + <item>Pathologist</item> + <item>Anesthesiologist</item> + <item>Psychologist</item> + <item>Receptionist</item> + <item>Cleaning Staff</item> + + </string-array> + <string-array name="Room_numbers_array"> + <item>110</item> + <item>111</item> + <item>112</item> + <item>113</item> + <item>114</item> + <item>115</item> + <item>116</item> + <item>117</item> + <item>118</item> + <item>119</item> + <item>120</item> + </string-array> + <string-array name="Section_Array"> + <item>1.1 to 1.10</item> + <item>1.11 to 1.20</item> + <item>2.1 to 2.10</item> + <item>2.11 to 2.20</item> + <item>OP 1 </item> + <item>OP 2 </item> + <item>OP 3 </item> + <item>ICU 1 </item> + <item>ICU 2</item> + <item>ICU 3 </item> + <item>ER 1 </item> + <item>ER 2 </item> + <item>ER 3 </item> + + </string-array> + + + + <string-array name="Change_Requist"> + <item>Change Shift</item> + <item>Swap Shift </item> + <item>Request Vacation</item> + <item>Report Absence</item> + <item>Request Sick Leave</item> + <item>Request Early Dismissal</item> + </string-array> + + + + +</resources> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/values/colors.xml b/MyHospital/app/src/main/res/values/colors.xml new file mode 100644 index 0000000000000000000000000000000000000000..f8b870b8747b95d4f3b092c992ab03109dc23c59 --- /dev/null +++ b/MyHospital/app/src/main/res/values/colors.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> + <color name="Primary">#3C91B8</color> + <color name="PrimaryDark">#114D68</color> + <color name="PrimaryAccent">#118FC8</color> + <color name="PrimaryVarient">#667E81</color> + <color name="purple_500">#DA6B49</color> + + <color name="blue">#45BAEF</color> + <color name="gray">#1D3440</color> + <color name="terquaz">#42E3F8</color> + <color name="terquaz_gray">#51869E</color> + <color name="jardon">#368E85</color> + <color name="maroon">#43100C</color> + <color name="off_white">#C4D0D6</color> +</resources> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/values/font_certs.xml b/MyHospital/app/src/main/res/values/font_certs.xml new file mode 100644 index 0000000000000000000000000000000000000000..d2226ac01c057907ca1fc71f1d3390d3deea9ca1 --- /dev/null +++ b/MyHospital/app/src/main/res/values/font_certs.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <array name="com_google_android_gms_fonts_certs"> + <item>@array/com_google_android_gms_fonts_certs_dev</item> + <item>@array/com_google_android_gms_fonts_certs_prod</item> + </array> + <string-array name="com_google_android_gms_fonts_certs_dev"> + <item> + MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs= + </item> + </string-array> + <string-array name="com_google_android_gms_fonts_certs_prod"> + <item> + MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK + </item> + </string-array> +</resources> diff --git a/MyHospital/app/src/main/res/values/preloaded_fonts.xml b/MyHospital/app/src/main/res/values/preloaded_fonts.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa6b253ed1e85721633c978be64d0ec7bbb072b3 --- /dev/null +++ b/MyHospital/app/src/main/res/values/preloaded_fonts.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <array name="preloaded_fonts" translatable="false"> + <item>@font/aclonica</item> + <item>@font/alex_brush</item> + <item>@font/allan</item> + </array> +</resources> diff --git a/MyHospital/app/src/main/res/values/strings.xml b/MyHospital/app/src/main/res/values/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..dbc0ae03483e84bbc918be7e54c623f4d46ee7ff --- /dev/null +++ b/MyHospital/app/src/main/res/values/strings.xml @@ -0,0 +1,79 @@ +<resources> + <string name="app_name">ChatApp</string> + <string name="login">login</string> + + + <string name="email">email</string> + <string name="password">password</string> + <string name="register_btn">register_btn</string> + <string name="register">Register</string> + + <string name="selectItem">Select Item</string> + <string name="Rolle">Rolle</string> + <string name="Abteilung">Abteilung</string> + <string name="name">Name</string> + <string name="lastname">Lastname</string> + <string name="sections">Sections</string> + <string name="save_update_infos">Save/Update infos</string> + <string name="signout">Signout</string> + <string name="id">ID</string> + <string name="username">username</string> + <string name="lastname_main">Lastname</string> + <string name="email_main">Email</string> + <string name="rolle">Rolle</string> + <string name="section">Section</string> + <string name="update_details">Update Details</string> + <string name="Name_popup">Name</string> + <string name="lastname_popup">Lastname</string> + <string name="number">Number</string> + <string name="room_number">Room Number</string> + <string name="email_popup">Email</string> + <string name="uppdate">Uppdate</string> + <string name="room_no">Room no.</string> + <string name="tel_number">Tel-Number</string> + <string name="todo">TODO</string> + <string name="todo_signout">TODO</string> + <string name="add_new_user">Add New User</string> + <string name="role">Role</string> + <string name="section_Add">Section</string> + <string name="back">Back</string> + <string name="add">Add</string> + <string name="add_new_user_">Add New User</string> + <string name="role_add">Role</string> + <string name="section_add">Section</string> + <string name="add_add">Add</string> + <string name="back_bakc">Back</string> + <string name="department_prompt">Choose a department</string> + <string name="Change_prompt">Choose an Requist</string> + <string name="SectionRoom_prompt">Choose an Section</string> + + <string name="shift_prompt">Choose a Shift</string> + <string name="date_to">Date To</string> + <string name="date_from">Date From</string> + <string name="update_shift">Update Shift</string> + <string name="time">Time</string> + <string name="date_to_update">Date To</string> + <string name="full_name">Full Name</string> + <string name="time_mainshift">Time</string> + <string name="on">On:</string> + <string name="from">From :</string> + <string name="to">To :</string> + <string name="dep">Dep :</string> + <string name="deparment">Deparment</string> + <string name="shift">Shift :</string> + <string name="schicht_time">Schicht Time</string> + <string name="details">Details :</string> + <string name="shift_details">Shift Details</string> + <string name="with">With :</string> + <string name="edit">Edit</string> + <string name="delete">Delete</string> + <string name="select_department">Select Department</string> + <string name="colleagues_with_schift">Colleagues with Shift</string> + <string name="view_all_shifts">View All Shifts</string> + <string name="ask_shift">Ask Shift</string> + <string name="send_message">Send Message</string> + <string name="one_day_shifts">One Day Shifts</string> + <string name="logout">logout</string> + + +</resources> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/values/themes.xml b/MyHospital/app/src/main/res/values/themes.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb2bb7f25fcabab678141e31d8c99ae9a1d7c152 --- /dev/null +++ b/MyHospital/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.ChatApp" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.ChatApp" parent="Theme.Design.Light.NoActionBar" /> +</resources> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/xml/backup_rules.xml b/MyHospital/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa0f996d2c2a6bdd11f5371de4268c8389d6c720 --- /dev/null +++ b/MyHospital/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/MyHospital/app/src/main/res/xml/data_extraction_rules.xml b/MyHospital/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000000000000000000000000000000000000..9ee9997b0b4726e57c27b2f7b21462b604ff8a88 --- /dev/null +++ b/MyHospital/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/MyHospital/app/src/test/java/com/example/chatapp/ExampleUnitTest.java b/MyHospital/app/src/test/java/com/example/chatapp/ExampleUnitTest.java new file mode 100644 index 0000000000000000000000000000000000000000..68108f700260f32bd2d65ce1472deca4bc46f898 --- /dev/null +++ b/MyHospital/app/src/test/java/com/example/chatapp/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.chatapp; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/MyHospital/build.gradle.kts b/MyHospital/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..aad4e366dc937b6686ff8e20ad10d1986c48b87b --- /dev/null +++ b/MyHospital/build.gradle.kts @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.google.gms.google.services) apply false +} diff --git a/MyHospital/firebase.json b/MyHospital/firebase.json new file mode 100644 index 0000000000000000000000000000000000000000..fdd52d15caf13e8bdeba9fdbb0858ccf065b9bfb --- /dev/null +++ b/MyHospital/firebase.json @@ -0,0 +1,26 @@ +{ + "functions": [ + { + "source": "functions", + "codebase": "default", + "ignore": [ + "venv", + ".git", + "firebase-debug.log", + "firebase-debug.*.log", + "*.local" + ] + }, + { + "source": "myhospital_loureen", + "codebase": "myhospital_loureen", + "ignore": [ + "node_modules", + ".git", + "firebase-debug.log", + "firebase-debug.*.log", + "*.local" + ] + } + ] +} diff --git a/MyHospital/gradle.properties b/MyHospital/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..4387edc225e5dd29788b0c5e26f7c3dbd57a1e4a --- /dev/null +++ b/MyHospital/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/MyHospital/gradle/libs.versions.toml b/MyHospital/gradle/libs.versions.toml new file mode 100644 index 0000000000000000000000000000000000000000..1da2a231bbe9d67eea2b2026c0b303baa3734ca5 --- /dev/null +++ b/MyHospital/gradle/libs.versions.toml @@ -0,0 +1,34 @@ +[versions] +agp = "8.4.1" +junit = "4.13.2" +junitVersion = "1.1.5" +espressoCore = "3.5.1" +appcompat = "1.7.0" +material = "1.12.0" +activity = "1.9.0" +constraintlayout = "2.1.4" +googleGmsGoogleServices = "4.4.2" +firebaseAuth = "23.0.0" +firebaseDatabase = "21.0.0" +firebaseStorage = "21.0.0" +firebaseAnalytics = "22.0.1" +firebaseFunctions = "21.0.0" + +[libraries] +junit = { group = "junit", name = "junit", version.ref = "junit" } +ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } +constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } +firebase-auth = { group = "com.google.firebase", name = "firebase-auth", version.ref = "firebaseAuth" } +firebase-database = { group = "com.google.firebase", name = "firebase-database", version.ref = "firebaseDatabase" } +firebase-storage = { group = "com.google.firebase", name = "firebase-storage", version.ref = "firebaseStorage" } +firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics", version.ref = "firebaseAnalytics" } +firebase-functions = { group = "com.google.firebase", name = "firebase-functions", version.ref = "firebaseFunctions" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +google-gms-google-services = { id = "com.google.gms.google-services", version.ref = "googleGmsGoogleServices" } + diff --git a/MyHospital/gradle/wrapper/gradle-wrapper.jar b/MyHospital/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f Binary files /dev/null and b/MyHospital/gradle/wrapper/gradle-wrapper.jar differ diff --git a/MyHospital/gradle/wrapper/gradle-wrapper.properties b/MyHospital/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..d335318150b52706fbe16b64452586b038210ebf --- /dev/null +++ b/MyHospital/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Jun 12 00:53:44 CEST 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/MyHospital/gradlew b/MyHospital/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..4f906e0c811fc9e230eb44819f509cd0627f2600 --- /dev/null +++ b/MyHospital/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/MyHospital/gradlew.bat b/MyHospital/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..107acd32c4e687021ef32db511e8a206129b88ec --- /dev/null +++ b/MyHospital/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/MyHospital/release.jks b/MyHospital/release.jks new file mode 100644 index 0000000000000000000000000000000000000000..e717d5c8b9ece1a9a36d3c66977a75c5ae83e809 Binary files /dev/null and b/MyHospital/release.jks differ diff --git a/MyHospital/settings.gradle.kts b/MyHospital/settings.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..14ac90685725a20ca3e003b906826538980e397c --- /dev/null +++ b/MyHospital/settings.gradle.kts @@ -0,0 +1,24 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "ChatApp" +include(":app") + \ No newline at end of file