Commit 8c27f598 authored by Thejan Ganepola's avatar Thejan Ganepola

frontend1

parent 95585db5
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/heal (1).iml" filepath="$PROJECT_DIR$/.idea/heal (1).iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="dbbebeeb-c190-4229-bb97-ac92d6fc8080" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ProjectId" id="2HVYqQEt2sGQwxyeMO24sjChSO6" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="android.sdk.path" value="$USER_HOME$/AppData/Local/Android/Sdk" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../Heal_Pharmacy" />
<property name="settings.editor.selected.configurable" value="AndroidSdkUpdater" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="dbbebeeb-c190-4229-bb97-ac92d6fc8080" name="Default Changelist" comment="" />
<created>1668371907327</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1668371907327</updated>
</task>
<servers />
</component>
<component name="WindowStateProjectService">
<state x="481" y="159" key="FileChooserDialogImpl" timestamp="1668372091544">
<screen x="0" y="0" width="1536" height="816" />
</state>
<state x="481" y="159" key="FileChooserDialogImpl/0.0.1536.816@0.0.1536.816" timestamp="1668372091544" />
</component>
</project>
\ No newline at end of file
*.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
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
namespace 'com.kaviz.heal'
compileSdk 32
buildFeatures {
viewBinding true;
}
defaultConfig {
applicationId "com.kaviz.heal"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-database:20.1.0'
implementation 'com.google.firebase:firebase-auth:21.1.0'
implementation 'com.google.firebase:firebase-storage:20.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// From here, my implementations
implementation 'com.mikhaellopez:circularimageview:4.3.1'
implementation 'com.github.bumptech.glide:glide:4.14.2'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
}
\ No newline at end of file
{
"project_info": {
"project_number": "987611176745",
"project_id": "heal-9eca0",
"storage_bucket": "heal-9eca0.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:987611176745:android:b2c4f436d19b30eff5e138",
"android_client_info": {
"package_name": "com.kaviz.heal"
}
},
"oauth_client": [
{
"client_id": "987611176745-aoc4qj44hiohvvhksub8e81a4a9i21ei.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDpAXVWmMY_38td6WZS6xxtxlmyh0WS5QQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "987611176745-aoc4qj44hiohvvhksub8e81a4a9i21ei.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
# 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
-keep class androidx.appcompat.widget.** { *; }
\ No newline at end of file
package com.kaviz.heal;
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.kaviz.heal", appContext.getPackageName());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/app_logo_background"/>
<foreground android:drawable="@mipmap/app_logo_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/app_logo_background"/>
<foreground android:drawable="@mipmap/app_logo_foreground"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="app_logo_background">#FFFFFF</color>
</resources>
\ No newline at end of file
<?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.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MICROPHONE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.audio.low_latency" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.audio.pro" />
<uses-feature android:name="android.hardware.microphone" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/app_logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/app_logo_round"
android:supportsRtl="true"
android:theme="@style/Theme.Heal"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".Activities.ChatRobotActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.ShowPharmaciesActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.ChatBotActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.PrescriptionScanActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.HealthTipsActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.GraphsAndPredictionActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.UserDetailsActivity"
android:exported="false"
android:theme="@style/UserDetailsTheme">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.Authentication.RegisterActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.HomeActivity"
android:exported="false"
android:theme="@style/HomeTheme">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Activities.Authentication.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" />
</application>
</manifest>
\ No newline at end of file
package com.kaviz.heal.API;
import com.google.gson.JsonObject;
import com.kaviz.heal.Model.ResponseModelOne;
import com.kaviz.heal.Model.ResponseModelThree;
import com.kaviz.heal.Model.ResponseModelTwo;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
public interface ApiRequestData {
@GET("/risk")
Call<ResponseModelOne>getGraphsAndPrediction();
@GET("/diwo")
Call<ResponseModelTwo>getHealthTips();
@FormUrlEncoded
@POST("/pharmacy")
Call<ResponseModelThree>getPharmacyZ(
@Field("user_location") String user_location,
@Field("medicine_list") String medicine_list
);
@POST("/pharmacy")
Call<ResponseModelThree>getPharmacies(@Body JsonObject jsonObject);
}
package com.kaviz.heal.API;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class RetroServer {
private static final String BASE_URL = "http://ec2-54-242-87-59.compute-1.amazonaws.com:5001";
private static Retrofit retrofit;
public static Retrofit connectRetrofit() {
if (retrofit == null) {
return new Retrofit.Builder().baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return retrofit;
}
}
package com.kaviz.heal.Activities.Authentication;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.kaviz.heal.Activities.HomeActivity;
import com.kaviz.heal.Model.User;
import com.kaviz.heal.databinding.ActivityMainBinding;
import java.util.Objects;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
//firebase objects
private FirebaseAuth auth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
makeFullScreen();
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
//initialize objects
auth = FirebaseAuth.getInstance();
//for play animation
setAnimation();
//login button process
binding.loginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//for login user validation
loginProcess();
}
});
//for navigate registration activity
binding.newUserText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, RegisterActivity.class));
}
});
}
//method for login user validation
private void loginProcess() {
String email = binding.emailText.getText().toString();
String password = binding.passwordText.getText().toString();
if (email.isEmpty()) {
binding.emailText.setError("Enter Email");
} else if (password.isEmpty()) {
binding.passwordText.setError("Enter Password");
} else {
binding.progressBar.setVisibility(View.VISIBLE);
binding.loginButton.setEnabled(false);
//for login user
loginUser(new User(email, password));
}
}
//method for login user
private void loginUser(User user) {
auth.signInWithEmailAndPassword(user.getEmail(), user.getPassword())
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
showToast("Successfully Logged In!");
Intent intent = new Intent(MainActivity.this, HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
} else {
showToast("Error - "+ Objects.requireNonNull(task.getException()).getMessage());
}
binding.progressBar.setVisibility(View.GONE);
binding.loginButton.setEnabled(true);
}
});
}
//for play animation
private void setAnimation() {
binding.loginAreaLayout.animate().alpha(0f).setDuration(1);
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, -1000);
animation.setDuration(1500);
animation.setFillAfter(false);
animation.setAnimationListener(new MyAnimationListener());
binding.textLayout.setAnimation(animation);
}
@Override
protected void onStart() {
super.onStart();
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
startActivity(new Intent(this, HomeActivity.class));
}
}
// For hide the status bar.
private void makeFullScreen() {
//getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Hide the app bar.
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
}
//class for animation listener
private class MyAnimationListener implements Animation.AnimationListener {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
binding.textLayout.clearAnimation();
binding.textLayout.setVisibility(View.INVISIBLE);
binding.loginAreaLayout.animate().alpha(1f).setDuration(1500);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
}
private void showToast(String message) {
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
}
\ No newline at end of file
package com.kaviz.heal.Activities.Authentication;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.kaviz.heal.Activities.UserDetailsActivity;
import com.kaviz.heal.Model.User;
import com.kaviz.heal.databinding.ActivityRegisterBinding;
import java.util.Objects;
public class RegisterActivity extends AppCompatActivity {
ActivityRegisterBinding binding;
//firebase objects
private FirebaseAuth auth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityRegisterBinding.inflate(getLayoutInflater());
makeFullScreen();
setContentView(binding.getRoot());
//initialize objects
auth = FirebaseAuth.getInstance();
//for navigate registration activity
binding.alreadyUserText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(RegisterActivity.this, MainActivity.class));
}
});
//for handle register button
binding.registerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
registerButtonProcess();
}
});
}
//for handle register button process
private void registerButtonProcess() {
String email = binding.emailText.getText().toString();
String password = binding.passwordText.getText().toString();
if (email.isEmpty()) {
binding.emailText.setError("Enter Email");
} else if (password.isEmpty()) {
binding.passwordText.setError("Enter Password");
} else {
binding.progressBar.setVisibility(View.VISIBLE);
binding.registerButton.setEnabled(false);
//for register user
registerUser(new User(email, password));
}
}
//for register user
private void registerUser(User user) {
auth.createUserWithEmailAndPassword(user.getEmail(), user.getPassword())
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
showToast("Successfully Registered!");
Intent intent = new Intent(RegisterActivity.this, UserDetailsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
} else {
showToast("Error - "+ Objects.requireNonNull(task.getException()).getMessage());
}
binding.progressBar.setVisibility(View.GONE);
binding.registerButton.setEnabled(true);
}
});
}
// For hide the status bar.
private void makeFullScreen() {
//getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Hide the app bar.
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
}
private void showToast(String message) {
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.webkit.PermissionRequest;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.widget.Toast;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityChatBotBinding;
public class ChatBotActivity extends AppCompatActivity {
private ActivityChatBotBinding binding;
private static final int MY_PERMISSIONS_REQUEST_RECORD_AUDIO = 101;
private PermissionRequest myRequest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityChatBotBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getResources().getString(R.string.live_chat));
}
setWebView();
// try {
//
// binding.chatBotWebView.getSettings().setJavaScriptEnabled(true);
// binding.chatBotWebView.getSettings().setUseWideViewPort(true);
// binding.chatBotWebView.getSettings().setLoadWithOverviewMode(true);
// binding.chatBotWebView.loadUrl("https://kosalaproject.000webhostapp.com/");
//
// } catch (Exception e) {
//
// Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
//
// }
}
private void setWebView() {
binding.chatBotWebView.getSettings().setJavaScriptEnabled(true);
binding.chatBotWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
binding.chatBotWebView.setWebViewClient(new WebViewClient());
binding.chatBotWebView.getSettings().setSaveFormData(true);
binding.chatBotWebView.getSettings().setSupportZoom(false);
binding.chatBotWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
binding.chatBotWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
binding.chatBotWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onPermissionRequest(final PermissionRequest request) {
myRequest = request;
for (String permission : request.getResources()) {
switch (permission) {
case "android.webkit.resource.AUDIO_CAPTURE": {
askForPermission(request.getOrigin().toString(), Manifest.permission.RECORD_AUDIO, MY_PERMISSIONS_REQUEST_RECORD_AUDIO);
break;
}
}
}
}
});
binding.chatBotWebView.loadUrl("https://kosalaproject.000webhostapp.com/");
}
@Override
public void onBackPressed() {
if (binding.chatBotWebView.canGoBack()) {
binding.chatBotWebView.goBack();
} else {
super.onBackPressed();
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_RECORD_AUDIO: {
Log.d("WebView", "PERMISSION FOR AUDIO");
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// permission was granted, yay! Do the
// contacts-related task you need to do.
myRequest.grant(myRequest.getResources());
binding.chatBotWebView.loadUrl("https://kosalaproject.000webhostapp.com/");
} else {
// permission denied, boo! Disable the
// functionality that depends on this permission.
}
}
// other 'case' lines to check for other
// permissions this app might request
}
}
public void askForPermission(String origin, String permission, int requestCode) {
Log.d("WebView", "inside askForPermission for" + origin + "with" + permission);
if (ContextCompat.checkSelfPermission(getApplicationContext(),
permission)
!= PackageManager.PERMISSION_GRANTED) {
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(ChatBotActivity.this,
permission)) {
// Show an expanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(ChatBotActivity.this,
new String[]{permission},
requestCode);
}
} else {
myRequest.grant(myRequest.getResources());
}
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.widget.Toast;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityChatRobotBinding;
public class ChatRobotActivity extends AppCompatActivity {
ActivityChatRobotBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityChatRobotBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getResources().getString(R.string.robot_solutions));
}
try {
binding.webView.getSettings().setJavaScriptEnabled(true);
binding.webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
binding.webView.setWebViewClient(new WebViewClient());
binding.webView.getSettings().setSaveFormData(true);
binding.webView.getSettings().setSupportZoom(false);
binding.webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
binding.webView.getSettings().setPluginState(WebSettings.PluginState.ON);
binding.webView.loadUrl("https://medibot-api.herokuapp.com/api/v1.0/?csrfmiddlewaretoken=uHTimuDB9kf1ljFD8cAMEEU514jWpWZBE85lzchmsUpE2P3n093p9I0HuTPjZjCL");
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.github.mikephil.charting.data.BarData;
import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.utils.ColorTemplate;
import com.kaviz.heal.API.ApiRequestData;
import com.kaviz.heal.API.RetroServer;
import com.kaviz.heal.Model.ResponseModelOne;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityGraphsAndPredictionBinding;
import java.util.ArrayList;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class GraphsAndPredictionActivity extends AppCompatActivity {
private ActivityGraphsAndPredictionBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityGraphsAndPredictionBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getResources().getString(R.string.graphs_future_predictions));
}
getGraphsAndPrediction();
}
private void getGraphsAndPrediction() {
binding.progressBar.setVisibility(View.VISIBLE);
ApiRequestData apiRequestData = RetroServer.connectRetrofit().create(ApiRequestData.class);
Call<ResponseModelOne>call = apiRequestData.getGraphsAndPrediction();
call.enqueue(new Callback<ResponseModelOne>() {
@Override
public void onResponse(@NonNull Call<ResponseModelOne> call, @NonNull Response<ResponseModelOne> response) {
if (response.body().getStatus().equals("success")) {
int [] bloodOxygenLevel = response.body().getBloodOxygenLevel();
int [] heartRate = response.body().getHeartRate();
int [] bodyTemperature = response.body().getBodyTemperature();
String riskLevel = response.body().getRiskLevel();
showBarchart(bloodOxygenLevel, heartRate, bodyTemperature, riskLevel);
}
}
@Override
public void onFailure(@NonNull Call<ResponseModelOne> call, @NonNull Throwable t) {
Toast.makeText(GraphsAndPredictionActivity.this, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
binding.progressBar.setVisibility(View.GONE);
}
});
}
private void showBarchart(int[] bloodOxygenLevel, int[] heartRate, int[] bodyTemperature, String riskLevel) {
ArrayList<BarEntry>bloodOxygenLevelList = new ArrayList<>();
ArrayList<BarEntry>heartRateList = new ArrayList<>();
ArrayList<BarEntry>bodyTemperatureList = new ArrayList<>();
for (int i = 0; i <= 10; i++) {
bloodOxygenLevelList.add(new BarEntry(i, (float) bloodOxygenLevel[i]));
heartRateList.add(new BarEntry(i, (float) heartRate[i]));
bodyTemperatureList.add(new BarEntry(i, (float) bodyTemperature[i]));
}
BarDataSet bloodOxygenLevelData = new BarDataSet(bloodOxygenLevelList, "Blood Oxygen Level");
BarDataSet heartRateData = new BarDataSet(heartRateList, "Heart Rate");
BarDataSet bodyTemperatureData = new BarDataSet(bodyTemperatureList, "Body Temperature Level");
bloodOxygenLevelData.setColors(ColorTemplate.COLORFUL_COLORS);
heartRateData.setColors(ColorTemplate.COLORFUL_COLORS);
bodyTemperatureData.setColors(ColorTemplate.COLORFUL_COLORS);
bloodOxygenLevelData.setDrawValues(false);
heartRateData.setDrawValues(false);
bodyTemperatureData.setDrawValues(false);
binding.bloodOxygenLevelBarChart.setData(new BarData(bloodOxygenLevelData));
binding.heartRateBarChart.setData(new BarData(heartRateData));
binding.bodyTemperatureBarChart.setData(new BarData(bodyTemperatureData));
binding.bloodOxygenLevelBarChart.animateY(3000);
binding.heartRateBarChart.animateY(3000);
binding.bodyTemperatureBarChart.animateY(3000);
binding.bloodOxygenLevelBarChart.getDescription().setText("Blood Oxygen Level");
binding.heartRateBarChart.getDescription().setText("Heart Rate");
binding.bodyTemperatureBarChart.getDescription().setText("Body Temperature Level");
binding.bloodOxygenLevelBarChart.getDescription().setTextColor(Color.BLUE);
binding.predictionText.setText(riskLevel);
binding.progressBar.setVisibility(View.GONE);
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.kaviz.heal.API.ApiRequestData;
import com.kaviz.heal.API.RetroServer;
import com.kaviz.heal.Model.ResponseModelTwo;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityHealthTipsBinding;
import java.util.Arrays;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class HealthTipsActivity extends AppCompatActivity {
ActivityHealthTipsBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityHealthTipsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getResources().getString(R.string.health_tips));
}
getHealthTips();
}
private void getHealthTips() {
binding.progressBar.setVisibility(View.VISIBLE);
ApiRequestData apiRequestData = RetroServer.connectRetrofit().create(ApiRequestData.class);
Call<ResponseModelTwo>call = apiRequestData.getHealthTips();
call.enqueue(new Callback<ResponseModelTwo>() {
@Override
public void onResponse(@NonNull Call<ResponseModelTwo> call, @NonNull Response<ResponseModelTwo> response) {
if (response.isSuccessful()) {
if (response.body() != null) {
if (response.body().getStatus().equals("success")) {
showHealthTips(response.body().getExercisePlan(), response.body().getDietPlan());
}
}
}
}
@Override
public void onFailure(@NonNull Call<ResponseModelTwo> call, @NonNull Throwable t) {
Toast.makeText(HealthTipsActivity.this, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
binding.progressBar.setVisibility(View.GONE);
}
});
}
private void showHealthTips(String exercisePlan, String dietPlan) {
binding.exercisePlanText.setText(exercisePlan);
binding.dietPlanText.setText(dietPlan);
binding.progressBar.setVisibility(View.GONE);
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.google.firebase.auth.FirebaseAuth;
import com.kaviz.heal.Activities.Authentication.MainActivity;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityHomeBinding;
public class HomeActivity extends AppCompatActivity {
private ActivityHomeBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityHomeBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolBar);
binding.prescriptionScanning.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomeActivity.this, PrescriptionScanActivity.class));
}
});
binding.graphsAndPrediction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomeActivity.this, GraphsAndPredictionActivity.class));
}
});
binding.healthTips.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomeActivity.this, HealthTipsActivity.class));
}
});
binding.chatBotSecond.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomeActivity.this, ChatRobotActivity.class));
}
});
binding.liveChat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final ProgressDialog progressDialog = new ProgressDialog(HomeActivity.this);
progressDialog.setMessage("Please Wait...");
progressDialog.setCancelable(false);
progressDialog.show();
startActivity(new Intent(HomeActivity.this, ChatBotActivity.class));
progressDialog.dismiss();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.logOutUser) {
System.out.println("Clicked");
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(HomeActivity.this);
builder.setTitle("Warning");
builder.setMessage("Are you sure you want to log out");
builder.setNegativeButton("YES", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
FirebaseAuth.getInstance().signOut();
Intent intent = new Intent(HomeActivity.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
});
builder.setPositiveButton("NO", null);
builder.show();
}
}
return super.onOptionsItemSelected(item);
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.SparseArray;
import android.view.View;
import android.widget.Toast;
import com.google.android.gms.vision.Frame;
import com.google.android.gms.vision.text.TextBlock;
import com.google.android.gms.vision.text.TextRecognizer;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.kaviz.heal.API.ApiRequestData;
import com.kaviz.heal.API.RetroServer;
import com.kaviz.heal.Model.Pharmacy;
import com.kaviz.heal.Model.ResponseModelThree;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityPrescriptionScanBinding;
import com.theartofdev.edmodo.cropper.CropImage;
import com.theartofdev.edmodo.cropper.CropImageView;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class PrescriptionScanActivity extends AppCompatActivity {
private ActivityPrescriptionScanBinding binding;
private static final int REQUEST_CAMERA_CODE = 100;
private Bitmap bitmap;
private static final int REQUEST_CODE = 100;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityPrescriptionScanBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getResources().getString(R.string.prescription_scan));
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, REQUEST_CAMERA_CODE);
}
binding.scanButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
binding.dataText.setText("");
CropImage.activity().setGuidelines(CropImageView.Guidelines.ON).start(PrescriptionScanActivity.this);
}
});
binding.sendPrescriptionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendLocationWithData();
}
});
}
private void sendLocationWithData() {
binding.progressBar.setVisibility(View.VISIBLE);
final String location = "6.9154908,79.9726544";
final String medicines = binding.dataText.getText().toString().toLowerCase();
JSONObject jsonObjectMain = new JSONObject();
try {
jsonObjectMain.put("user_location", location);
jsonObjectMain.put("medicine_list", medicines);
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
JsonObject jsonObject = (JsonObject) new JsonParser().parse(jsonObjectMain.toString());
System.out.println(jsonObject.toString());
ApiRequestData apiRequestData = RetroServer.connectRetrofit().create(ApiRequestData.class);
Call<ResponseModelThree>getPharmacies = apiRequestData.getPharmacies(jsonObject);
getPharmacies.enqueue(new Callback<ResponseModelThree>() {
@Override
public void onResponse(@NonNull Call<ResponseModelThree> call, @NonNull Response<ResponseModelThree> response) {
if (response.isSuccessful()) {
if (response.body().getStatus().equals("success")) {
ArrayList<Pharmacy> pharmacyList = (ArrayList<Pharmacy>) response.body().getPharmacy_recommendation();
System.out.println(pharmacyList.get(0).getName());
if (!pharmacyList.isEmpty()) {
Intent intent = new Intent(PrescriptionScanActivity.this, ShowPharmaciesActivity.class);
intent.putExtra("PharmacyList", pharmacyList);
intent.putExtra("Medicines", medicines);
startActivity(intent);
} else {
Toast.makeText(PrescriptionScanActivity.this, "No pharmacy could be found!", Toast.LENGTH_SHORT).show();
}
binding.progressBar.setVisibility(View.GONE);
}
}
}
@Override
public void onFailure(@NonNull Call<ResponseModelThree> call, @NonNull Throwable t) {
Toast.makeText(PrescriptionScanActivity.this, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
binding.progressBar.setVisibility(View.GONE);
}
});
binding.progressBar.setVisibility(View.GONE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
CropImage.ActivityResult result = CropImage.getActivityResult(data);
if (resultCode == RESULT_OK) {
Uri uri = result.getUri();
try {
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);
getTextFromImage(bitmap);
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
}
}
private void getTextFromImage(Bitmap bitmap) {
TextRecognizer recognizer = new TextRecognizer.Builder(this).build();
if (!recognizer.isOperational()) {
Toast.makeText(this, "Something Wrong!", Toast.LENGTH_SHORT).show();
} else {
Frame frame = new Frame.Builder().setBitmap(bitmap).build();
SparseArray<TextBlock> textBlockSparseArray = recognizer.detect(frame);
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < textBlockSparseArray.size(); i++) {
TextBlock textBlock = textBlockSparseArray.valueAt(i);
stringBuilder.append(textBlock.getValue());
//stringBuilder.append("\n");
}
binding.dataText.setText(stringBuilder.toString());
binding.scanButton.setText(R.string.retake);
binding.sendPrescriptionButton.setVisibility(View.VISIBLE);
}
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import android.app.Dialog;
import android.os.Bundle;
import android.util.ArrayMap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.kaviz.heal.Adapters.PharmacyAdapter;
import com.kaviz.heal.Interfaces.ClickEvents;
import com.kaviz.heal.Model.Pharmacy;
import com.kaviz.heal.Model.User;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityShowPharmaciesBinding;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class ShowPharmaciesActivity extends AppCompatActivity implements ClickEvents {
private ActivityShowPharmaciesBinding binding;
private ArrayList<Pharmacy>pharmacyList;
private Dialog addNumberDialog;
private Pharmacy pharmacy;
private String medicines;
private FirebaseAuth auth;
private FirebaseDatabase database;
String userName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityShowPharmaciesBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle("Pharmacy List");
}
database = FirebaseDatabase.getInstance();
auth = FirebaseAuth.getInstance();
pharmacyList = (ArrayList<Pharmacy>) getIntent().getSerializableExtra("PharmacyList");
medicines = getIntent().getStringExtra("Medicines");
final PharmacyAdapter adapter = new PharmacyAdapter(this, pharmacyList, this);
binding.pharmacyRecyclerView.setLayoutManager(new LinearLayoutManager(this));
binding.pharmacyRecyclerView.setHasFixedSize(true);
binding.pharmacyRecyclerView.setAdapter(adapter);
initializeAddCategoryDialog();
}
@Override
public void onClick(int position) {
pharmacy = pharmacyList.get(position);
System.out.println(pharmacy.getName());
addNumberDialog.show();
}
private void initializeAddCategoryDialog() {
addNumberDialog = new Dialog(this);
addNumberDialog.setContentView(R.layout.add_number_layout);
addNumberDialog.setCancelable(true);
addNumberDialog.getWindow().setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.progress_background));
addNumberDialog.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
EditText numberNameText = addNumberDialog.findViewById(R.id.numberNameText);
AppCompatButton addNumberButton = addNumberDialog.findViewById(R.id.addNumberButton);
numberNameText.getText().clear();
addNumberButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
binding.progressBar.setVisibility(View.VISIBLE);
String number = numberNameText.getText().toString();
if (number.isEmpty()) {
Toast.makeText(ShowPharmaciesActivity.this, "Enter Mobile Number", Toast.LENGTH_SHORT).show();
binding.progressBar.setVisibility(View.GONE);
} else {
addNumberDialog.cancel();
addDataToPharmacy(pharmacy, number);
}
}
});
}
private void addDataToPharmacy(Pharmacy pharmacy, String number) {
binding.progressBar.setVisibility(View.VISIBLE);
database.getReference().child("UserDetails").child(auth.getCurrentUser().getUid())
.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
User user = snapshot.getValue(User.class);
if (user != null) {
userName = user.getName();
Map<String, Object>dataMap = new ArrayMap<>();
dataMap.put("clientName", user.getName());
dataMap.put("phoneNumber", number);
dataMap.put("medicines", medicines);
database.getReference().child("Orders").push().setValue(dataMap).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Toast.makeText(ShowPharmaciesActivity.this, "The order has been sent Successfully!", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(ShowPharmaciesActivity.this, "Error - "+task.getException().getMessage(), Toast.LENGTH_SHORT).show();
}
binding.progressBar.setVisibility(View.GONE);
}
});
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(ShowPharmaciesActivity.this, error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
\ No newline at end of file
package com.kaviz.heal.Activities;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.webkit.MimeTypeMap;
import android.widget.RadioButton;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import com.kaviz.heal.Activities.Authentication.RegisterActivity;
import com.kaviz.heal.Model.User;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.ActivityUserDetailsBinding;
import java.util.Objects;
public class UserDetailsActivity extends AppCompatActivity {
private static final int IMAGE_REQUEST_CODE = 100;
private ActivityUserDetailsBinding binding;
//firebase objects
private FirebaseAuth auth;
private FirebaseDatabase database;
private Uri imageURI;
private String imageURL = "default";
private String gender = "none";
private ProgressDialog showDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityUserDetailsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
//initialize objects
auth = FirebaseAuth.getInstance();
database = FirebaseDatabase.getInstance();
//for enable show dialog object
showDialog();
//for add click event change profile (open gallery)
binding.userProfilePicture.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openImageChooser();
}
});
binding.submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
registerButtonProcess();
}
});
}
//handle register button
private void registerButtonProcess() {
String name = binding.nameText.getText().toString();
String height = binding.heightText.getText().toString();
String weight = binding.weightText.getText().toString();
String address = binding.addressText.getText().toString();
int selectedRadioButtonID = binding.genderGroup.getCheckedRadioButtonId();
RadioButton selectedRadioButton = findViewById(selectedRadioButtonID);
if (selectedRadioButton != null) {
gender = selectedRadioButton.getText().toString();
}
if (name.isEmpty()) {
binding.nameText.setError("Enter Name");
} else if (height.isEmpty()){
binding.heightText.setError("Enter Height");
} else if (weight.isEmpty()) {
binding.weightText.setError("Enter Weight");
} else if (address.isEmpty()) {
binding.addressText.setError("Enter Address");
} else if (gender.equals("none")) {
Toast.makeText(this, "Please Select Your Gender", Toast.LENGTH_SHORT).show();
} else {
showDialog.show();
binding.submitButton.setEnabled(false);
User user = new User(name, Double.parseDouble(height), Double.parseDouble(weight), address, gender, imageURL);
registerUser(user);
}
}
//for register user
private void registerUser(User user) {
database.getReference().child("UserDetails").child(auth.getCurrentUser().getUid())
.setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
showToast("Data Successfully Submitted!");
startActivity(new Intent(UserDetailsActivity.this, HomeActivity.class));
finishAffinity();
} else {
showToast("Error - "+task.getException().getMessage());
}
showDialog.dismiss();
binding.submitButton.setEnabled(false);
}
});
}
//method for open image chooser (gallery)
private void openImageChooser() {
Intent intent = new Intent();
intent.setType("image/");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, IMAGE_REQUEST_CODE);
}
private void showDialog() {
showDialog = new ProgressDialog(this);
showDialog.setMessage("Please Wait");
showDialog.setCancelable(false);
}
//for get image url
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IMAGE_REQUEST_CODE && resultCode == RESULT_OK) {
if (data != null) {
if (data.getData() != null) {
imageURI = data.getData();
uploadImage();
}
}
}
}
//for upload image to firebase
private void uploadImage() {
final ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setTitle("Uploading Image");
progressDialog.setMessage("Please Wait...");
progressDialog.setCancelable(false);
progressDialog.show();
StorageReference fileReference = FirebaseStorage.getInstance().getReference().child("Uploads")
.child(System.currentTimeMillis()+"."+getFileExtension(imageURI));
fileReference.putFile(imageURI).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
if (task.isSuccessful()) {
fileReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
try {
imageURL = uri.toString();
Glide.with(UserDetailsActivity.this).load(imageURL).placeholder(R.drawable.user_placeholder).into(binding.userProfilePicture);
progressDialog.dismiss();
Toast.makeText(UserDetailsActivity.this, "Successfully Profile Picture Uploaded!", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(UserDetailsActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
} else {
Toast.makeText(UserDetailsActivity.this, Objects.requireNonNull(task.getException()).getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
//for get image extension
private String getFileExtension(Uri imageURI) {
ContentResolver contentResolver = getContentResolver();
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
return mimeTypeMap.getExtensionFromMimeType(contentResolver.getType(imageURI));
}
private void showToast(String message) {
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
}
\ No newline at end of file
package com.kaviz.heal.Adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.kaviz.heal.Interfaces.ClickEvents;
import com.kaviz.heal.Model.Pharmacy;
import com.kaviz.heal.R;
import com.kaviz.heal.databinding.PharmacyListDesignBinding;
import java.util.ArrayList;
public class PharmacyAdapter extends RecyclerView.Adapter<PharmacyAdapter.PharmacyViewHolder> {
private Context context;
private ArrayList<Pharmacy>pharmacyList;
private ClickEvents clickEvents;
public PharmacyAdapter(Context context, ArrayList<Pharmacy> pharmacyList, ClickEvents clickEvents) {
this.context = context;
this.pharmacyList = pharmacyList;
this.clickEvents = clickEvents;
}
@NonNull
@Override
public PharmacyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new PharmacyViewHolder(LayoutInflater.from(context).inflate(R.layout.pharmacy_list_design, parent, false));
}
@Override
public void onBindViewHolder(@NonNull PharmacyViewHolder holder, int position) {
Pharmacy pharmacy = pharmacyList.get(position);
String pharmacyName = "Pharmacy Name : "+pharmacy.getName();
String distance = "Distance : "+pharmacy.getDistance();
String availableMedicines = "Available Medicines : "+pharmacy.getAvailable_medicines()
.replace("[", "").replace("]", "").replace("'", "");
holder.binding.pharmacyName.setText(pharmacyName);
holder.binding.distanceText.setText(distance);
holder.binding.availableMedicinesText.setText(availableMedicines);
}
@Override
public int getItemCount() {
return pharmacyList.size();
}
public class PharmacyViewHolder extends RecyclerView.ViewHolder {
PharmacyListDesignBinding binding;
public PharmacyViewHolder(@NonNull View itemView) {
super(itemView);
binding = PharmacyListDesignBinding.bind(itemView);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
clickEvents.onClick(getAdapterPosition());
}
});
}
}
}
package com.kaviz.heal.Interfaces;
public interface ClickEvents {
void onClick(int position);
}
package com.kaviz.heal.Model;
import java.io.Serializable;
public class Pharmacy implements Serializable {
private String name;
private String distance;
private String available_medicines;
public Pharmacy() {
}
public Pharmacy(String name, String distance, String available_medicines) {
this.name = name;
this.distance = distance;
this.available_medicines = available_medicines;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDistance() {
return distance;
}
public void setDistance(String distance) {
this.distance = distance;
}
public String getAvailable_medicines() {
return available_medicines;
}
public void setAvailable_medicines(String available_medicines) {
this.available_medicines = available_medicines;
}
}
package com.kaviz.heal.Model;
public class ResponseModelOne {
private String status;
private int [] HeartRate;
private int [] BloodOxygenLevel;
private int [] BodyTemperature;
private String RiskLevel;
public ResponseModelOne() {
}
public ResponseModelOne(String status, int[] heartRate, int[] bloodOxygenLevel, int[] bodyTemperature, String riskLevel) {
this.status = status;
HeartRate = heartRate;
BloodOxygenLevel = bloodOxygenLevel;
BodyTemperature = bodyTemperature;
RiskLevel = riskLevel;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public int[] getHeartRate() {
return HeartRate;
}
public void setHeartRate(int[] heartRate) {
HeartRate = heartRate;
}
public int[] getBloodOxygenLevel() {
return BloodOxygenLevel;
}
public void setBloodOxygenLevel(int[] bloodOxygenLevel) {
BloodOxygenLevel = bloodOxygenLevel;
}
public int[] getBodyTemperature() {
return BodyTemperature;
}
public void setBodyTemperature(int[] bodyTemperature) {
BodyTemperature = bodyTemperature;
}
public String getRiskLevel() {
return RiskLevel;
}
public void setRiskLevel(String riskLevel) {
RiskLevel = riskLevel;
}
}
package com.kaviz.heal.Model;
import java.util.List;
public class ResponseModelThree {
private String status;
private List<Pharmacy> pharmacy_recommendation;
public ResponseModelThree() {
}
public ResponseModelThree(String status, List<Pharmacy> pharmacy_recommendation) {
this.status = status;
this.pharmacy_recommendation = pharmacy_recommendation;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<Pharmacy> getPharmacy_recommendation() {
return pharmacy_recommendation;
}
public void setPharmacy_recommendation(List<Pharmacy> pharmacy_recommendation) {
this.pharmacy_recommendation = pharmacy_recommendation;
}
}
package com.kaviz.heal.Model;
public class ResponseModelTwo {
private String status;
private int [] HeartRate;
private int [] BloodOxygenLevel;
private int [] BodyTemperature;
private String ExercisePlan;
private String DietPlan;
public ResponseModelTwo() {
}
public ResponseModelTwo(String status, int[] heartRate, int[] bloodOxygenLevel, int[] bodyTemperature, String exercisePlan, String dietPlan) {
this.status = status;
HeartRate = heartRate;
BloodOxygenLevel = bloodOxygenLevel;
BodyTemperature = bodyTemperature;
ExercisePlan = exercisePlan;
DietPlan = dietPlan;
}
public String getStatus() {
return status;
}
public void setSuccess(String success) {
this.status = success;
}
public int[] getHeartRate() {
return HeartRate;
}
public void setHeartRate(int[] heartRate) {
HeartRate = heartRate;
}
public int[] getBloodOxygenLevel() {
return BloodOxygenLevel;
}
public void setBloodOxygenLevel(int[] bloodOxygenLevel) {
BloodOxygenLevel = bloodOxygenLevel;
}
public int[] getBodyTemperature() {
return BodyTemperature;
}
public void setBodyTemperature(int[] bodyTemperature) {
BodyTemperature = bodyTemperature;
}
public String getExercisePlan() {
return ExercisePlan;
}
public void setExercisePlan(String exercisePlan) {
ExercisePlan = exercisePlan;
}
public String getDietPlan() {
return DietPlan;
}
public void setDietPlan(String dietPlan) {
DietPlan = dietPlan;
}
}
package com.kaviz.heal.Model;
public class User {
private String name;
private String email;
private String password;
private double height;
private double weight;
private String address;
private String gender;
private String imageURL;
public User() {
}
public User(String email, String password) {
this.email = email;
this.password = password;
}
public User(String name, double height, double weight, String address, String gender, String imageURL) {
this.name = name;
this.height = height;
this.weight = weight;
this.address = address;
this.gender = gender;
this.imageURL = imageURL;
}
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
public double getHeight() {
return height;
}
public double getWeight() {
return weight;
}
public String getAddress() {
return address;
}
public String getGender() {
return gender;
}
public String getImageURL() {
return imageURL;
}
}
<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
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:color="@color/themeBlue"
android:width="1dp"/>
<corners
android:radius="100dp"/>
</shape>
\ No newline at end of file
<vector android:height="24dp" android:tint="#2EA7D6"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<vector android:height="24dp" android:tint="#FCFEFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>
<vector android:height="24dp" android:tint="#2EA7D6"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12.65,10C11.83,7.67 9.61,6 7,6c-3.31,0 -6,2.69 -6,6s2.69,6 6,6c2.61,0 4.83,-1.67 5.65,-4H17v4h4v-4h2v-4H12.65zM7,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid
android:color="@color/white"/>
<corners
android:radius="10dp"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="300dp"/>
<solid
android:color="@color/themeBlue"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#FF00CC"
android:endColor="#333399"
android:type="linear"
android:angle="0"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activities.ChatBotActivity">
<WebView
android:id="@+id/chatBotWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activities.ChatRobotActivity">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activities.GraphsAndPredictionActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="180dp"
android:layout_centerHorizontal="true"
android:visibility="gone"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical">
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/bloodOxygenLevelBarChart"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_margin="16dp"/>
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/heartRateBarChart"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_margin="16dp"/>
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/bodyTemperatureBarChart"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_margin="16dp"/>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_margin="20dp"
app:cardCornerRadius="12dp"
app:cardBackgroundColor="@color/themeBlue"
app:cardElevation="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/white"
android:textAlignment="center"
android:text="@string/future_predictions"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/according_to_the_data_analyzed"
android:textColor="@color/white"
android:textStyle="italic"
android:textSize="16sp"
android:textAlignment="center"
android:layout_marginTop="2dp"/>
<TextView
android:id="@+id/predictionText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="16sp"
android:textColor="@color/white"
android:padding="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:layout_gravity="center"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
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"
tools:context=".Activities.HealthTipsActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/transparent"
android:layout_alignParentTop="true">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="8dp"
app:cardCornerRadius="12dp"
app:cardBackgroundColor="@color/themeBlue"
app:cardElevation="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/white"
android:textAlignment="center"
android:text="@string/exercise_plan"/>
<TextView
android:id="@+id/exercisePlanText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:textStyle="italic"
android:textSize="16sp"
android:padding="16dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
app:cardCornerRadius="12dp"
app:cardBackgroundColor="@color/themeBlue"
app:cardElevation="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/white"
android:textAlignment="center"
android:text="@string/diet_plan"/>
<TextView
android:id="@+id/dietPlanText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:textStyle="italic"
android:textSize="16sp"
android:padding="16dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
android:indeterminateTint="@android:color/holo_red_light"/>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/splash_screen_gradient"
tools:context=".Activities.Authentication.MainActivity">
<LinearLayout
android:id="@+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="vertical"
android:layout_centerInParent="true"
android:background="@android:color/transparent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="45sp"
android:fontFamily="@font/dirtyline"
android:layout_gravity="center_horizontal"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/health_tracker"
android:textColor="@color/white"
android:textSize="18sp"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
<androidx.cardview.widget.CardView
android:id="@+id/loginAreaLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_centerInParent="true"
app:cardElevation="12dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/transparent">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:indeterminateTint="@color/themeBlue"
android:visibility="gone"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/heal_logo"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/logo" />
<EditText
android:id="@+id/emailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:autofillHints="emailAddress"
android:inputType="textEmailAddress"
android:hint="@string/email"
android:padding="13dp"
android:drawableStart="@drawable/email"
android:drawablePadding="8dp"
android:background="@drawable/edit_text_background"/>
<EditText
android:id="@+id/passwordText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:autofillHints="password"
android:inputType="textPassword"
android:hint="@string/password"
android:padding="13dp"
android:drawablePadding="8dp"
android:drawableStart="@drawable/password"
android:background="@drawable/edit_text_background"/>
<Button
android:id="@+id/loginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/login"
android:backgroundTint="@color/themeBlue"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"/>
<TextView
android:id="@+id/newUserText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/new_user_register_now_text"
android:textAlignment="textEnd"
android:textColor="@color/themeBlue"
android:padding="3dp"
android:layout_marginRight="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="16dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
\ No newline at end of file
<?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=".Activities.PrescriptionScanActivity">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
android:indeterminateTint="@color/themeBlue"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/buttonLayout"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_margin="16dp">
<TextView
android:id="@+id/dataText"
android:padding="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="@string/click_the_scan_button_to_start_the_process"
android:textColor="@color/black"/>
</ScrollView>
<LinearLayout
android:id="@+id/buttonLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:layout_margin="6dp"
android:background="@android:color/transparent">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/scanButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/themeBlue"
android:textColor="@color/white"
android:text="@string/scan"
android:layout_margin="10dp"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/sendPrescriptionButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/themeBlue"
android:textColor="@color/white"
android:text="@string/send_prescription"
android:textAlignment="center"
android:layout_margin="10dp"
android:visibility="gone"/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/splash_screen_gradient"
tools:context=".Activities.Authentication.RegisterActivity">
<androidx.cardview.widget.CardView
android:id="@+id/loginAreaLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_centerInParent="true"
app:cardElevation="12dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/transparent">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:indeterminateTint="@color/themeBlue"
android:visibility="gone"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/heal_logo"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/logo" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello_there_let_s_sign_up"
android:textAlignment="center"
android:textColor="@color/themeBlue"
android:textSize="18sp"
android:textStyle="bold"
android:fontFamily="@font/often"
android:layout_marginBottom="4dp"/>
<EditText
android:id="@+id/emailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:autofillHints="emailAddress"
android:inputType="textEmailAddress"
android:hint="@string/email"
android:padding="13dp"
android:drawableStart="@drawable/email"
android:drawablePadding="8dp"
android:background="@drawable/edit_text_background"/>
<EditText
android:id="@+id/passwordText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:autofillHints="password"
android:inputType="textPassword"
android:hint="@string/password"
android:padding="13dp"
android:drawablePadding="8dp"
android:drawableStart="@drawable/password"
android:background="@drawable/edit_text_background"/>
<Button
android:id="@+id/registerButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/register"
android:backgroundTint="@color/themeBlue"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"/>
<TextView
android:id="@+id/alreadyUserText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/already_user_login"
android:textAlignment="textEnd"
android:textColor="@color/themeBlue"
android:padding="3dp"
android:layout_marginRight="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="16dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".Activities.ShowPharmaciesActivity">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminateTint="@color/purple_700"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/pharmacyRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ededed"
tools:context=".Activities.UserDetailsActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello_there"
android:textAlignment="center"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/please_enter_the_required_information_below"
android:textAlignment="center"
android:layout_marginTop="4dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textColor="#333333"
android:textSize="16sp"/>
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/userProfilePicture"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/user_placeholder"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center_horizontal"
app:civ_border_color="@color/themeBlue"
app:civ_border_width="2dp"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="6dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<EditText
android:id="@+id/nameText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name"
android:autofillHints="name"
android:inputType="textPersonName" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<EditText
android:id="@+id/heightText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/height"
android:autofillHints="number"
android:inputType="numberDecimal" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enter_the_value_in_inches"
android:textAlignment="center"
android:textColor="@color/black"
android:layout_marginBottom="8dp"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<EditText
android:id="@+id/weightText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/weight"
android:autofillHints="number"
android:inputType="numberDecimal"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enter_the_value_in_kg"
android:textAlignment="center"
android:textColor="@color/black"
android:layout_marginBottom="8dp"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<EditText
android:id="@+id/addressText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/address"
android:autofillHints="postalAddress"
android:inputType="textMultiLine" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sex"
android:layout_gravity="center_vertical"
android:textSize="16sp"
android:textColor="@color/themeBlue"
android:layout_marginEnd="12dp"/>
<RadioGroup
android:id="@+id/genderGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/maleRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/male"
android:buttonTint="@color/themeBlue"/>
<RadioButton
android:id="@+id/femaleRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/female"
android:buttonTint="@color/themeBlue"/>
</RadioGroup>
</LinearLayout>
<Button
android:id="@+id/submitButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/submit"
android:backgroundTint="@color/themeBlue"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"/>
<TextView
android:id="@+id/alreadyUserText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/already_user_login"
android:textAlignment="textEnd"
android:textColor="@color/themeBlue"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="32dp"/>
</LinearLayout>
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content">
<EditText
android:id="@+id/numberNameText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/enter_number"
android:autofillHints="phone"
android:inputType="phone"
android:textColor="@color/black"
android:backgroundTint="@color/themeBlue"
android:textCursorDrawable="@null"
android:layout_marginLeft="32dp"
android:layout_marginTop="32dp"
android:layout_marginRight="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/addNumberButton"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="22dp"
android:layout_marginRight="32dp"
android:layout_marginBottom="32dp"
android:text="@string/add_number"
android:background="@drawable/round_corner_button"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/numberNameText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
app:cardCornerRadius="8dp"
app:cardBackgroundColor="@color/themeBlue"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/pharmacyName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="15sp"
android:padding="6dp"/>
<TextView
android:id="@+id/distanceText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="15sp"
android:padding="6dp"/>
<TextView
android:id="@+id/availableMedicinesText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="15sp"
android:padding="6dp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/logOutUser"
android:title="@string/log_out"/>
</menu>
\ No newline at end of file
<?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="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?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="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Heal" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="themeBlue">#2ea7d6</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Heal</string>
<string name="health_tracker">Health Tracker</string>
<string name="email">Email</string>
<string name="password">Password</string>
<string name="login">Login</string>
<string name="logo">Logo</string>
<string name="new_user_register_now_text">New User? Register</string>
<string name="hello_there">Hello There</string>
<string name="please_enter_the_required_information_below">Please enter the required information below</string>
<string name="name">Name</string>
<string name="height">Height</string>
<string name="weight">Weight</string>
<string name="address">Address</string>
<string name="enter_password">Enter Password</string>
<string name="sex">Gender</string>
<string name="male">Male</string>
<string name="female">Female</string>
<string name="register">Register</string>
<string name="already_user_login">Already User? Login</string>
<string name="hello_there_let_s_sign_up">Hello There, Let\'s Sign Up</string>
<string name="enter_the_value_in_inches">(Enter the value in inches)</string>
<string name="submit">Submit</string>
<string name="enter_the_value_in_kg">Enter the value in KG</string>
<string name="heart">Heart</string>
<string name="graphs_future_predictions"><![CDATA[Graphs & Future Predictions]]></string>
<string name="graph">Graph</string>
<string name="camera">Camera</string>
<string name="prescription_scan">Prescription Scan</string>
<string name="health">Health</string>
<string name="live_chat">Live Chat</string>
<string name="menu">Menu</string>
<string name="future_predictions">Future Predictions</string>
<string name="according_to_the_data_analyzed">According to the data analyzed,</string>
<string name="health_tips">Health Tips</string>
<string name="exercise_plan">Exercise Plan</string>
<string name="diet_plan">Diet Plan</string>
<string name="scan">Scan</string>
<string name="send_prescription">Send Prescription</string>
<string name="retake">Retake</string>
<string name="click_the_scan_button_to_start_the_process">Click the Scan button to start the process</string>
<string name="log_out">Log Out</string>
<string name="add_number">Add Order</string>
<string name="enter_number">Enter Your Mobile Number</string>
<string name="robot_solutions">Robot Solutions</string>
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Heal" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/themeBlue</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="UserDetailsTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/themeBlue</item>
<item name="colorPrimaryVariant">@color/themeBlue</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="HomeTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/themeBlue</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="colorControlNormal">@color/white</item>
</style>
</resources>
\ No newline at end of file
<?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
<?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
package com.kaviz.heal;
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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment