Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added MedNudge.pptx
Binary file not shown.
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
61 changes: 59 additions & 2 deletions app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,58 @@
}
},
"oauth_client": [
{
"client_id": "328486990922-t2dca6dvad2c5qvpe1gs0al5vf0c4v2f.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.project.mednudge",
"certificate_hash": "58a44255f8cc044214986cf440aba7f48b41a9bc"
}
},
{
"client_id": "328486990922-1tv3tb9dn7tj0kl88vnd4m2eg0t46flr.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDKpJF0VnYgt8xEPEdWa00WC9TjvAM0gsA"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "328486990922-1tv3tb9dn7tj0kl88vnd4m2eg0t46flr.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:328486990922:android:e1eb9b6c38ae8a91",
"android_client_info": {
"package_name": "mednudge.splashscreen"
}
},
"oauth_client": [
{
"client_id": "328486990922-2n130kviksers2jmna1ujunug2ppslfo.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "mednudge.splashscreen",
"certificate_hash": "a36beb14efbc477c1aaa3e710ffde7113a91cea4"
}
},
{
"client_id": "328486990922-1tv3tb9dn7tj0kl88vnd4m2eg0t46flr.apps.googleusercontent.com",
"client_type": 3
Expand All @@ -29,8 +81,13 @@
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "328486990922-1tv3tb9dn7tj0kl88vnd4m2eg0t46flr.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
Expand Down
19 changes: 15 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
android:theme="@style/AppTheme.NoActionBar">

<activity android:name=".SplashActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.project.androidsplashscreen.MAINACTIVIY" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Expand Down
93 changes: 93 additions & 0 deletions app/src/main/java/com/project/mednudge/AddEditMedicine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package com.project.mednudge;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.Toast;

import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;


public class AddEditMedicine extends Fragment implements View.OnClickListener {
Button alarm;
FragmentTransaction fragmentTransaction;
Fragment fragment;
Toolbar toolbar;
DatabaseReference mDatabase;
EditText editMedicineName;
EditText editPrescribedBy;
EditText editDose;
Spinner editUnit;
RadioGroup editInstruction;
RadioButton instruction1;
EditText editRemark;
View view;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
view=inflater.inflate(R.layout.fragment_add_edit_medicine, container, false);
alarm=(Button) view.findViewById(R.id.button);
alarm.setOnClickListener(this);
toolbar=(Toolbar)view.findViewById(R.id.toolbar);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(toolbar);
activity.getSupportActionBar().setTitle("Add Medicine");
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mDatabase = FirebaseDatabase.getInstance().getReference("medicines");
editMedicineName=(EditText)view.findViewById(R.id.medicine_name);
editPrescribedBy=(EditText)view.findViewById(R.id.prescribed_by);
editDose=(EditText)view.findViewById(R.id.edit_dose);
editUnit=(Spinner)view.findViewById(R.id.select_unit);
editInstruction=(RadioGroup)view.findViewById(R.id.instruction);
editRemark=(EditText)view.findViewById(R.id.remark);
return view;


}
public void onClick(View v)
{
ImageView medicineImage=null;
String medicineName = editMedicineName.getText().toString().trim();
String prescribedBy = editPrescribedBy.getText().toString().trim();
String dose=editDose.getText().toString().trim()+" "+editUnit.getSelectedItem().toString();
int selectedId = editInstruction.getCheckedRadioButtonId();

// find the radiobutton by returned id
instruction1 = (RadioButton) view.findViewById(selectedId);
String instruction=(String)instruction1.getText();
String remark=editRemark.getText().toString().trim();



// Creating new user node, which returns the unique key value
// new user node would be /users/$userid/
String medicineId = mDatabase.push().getKey();

// creating user object
Medicine medicine = new Medicine(medicineId,medicineImage,medicineName,prescribedBy,dose,instruction,remark);

// pushing user to 'users' node using the userId
mDatabase.child(medicineId).setValue(medicine);
Toast.makeText(getContext(),"Medicine Added",Toast.LENGTH_SHORT);
fragmentTransaction = getFragmentManager().beginTransaction();
fragment = new Alarm();//the fragment you want to show
fragmentTransaction.replace(R.id.content_frame, fragment);//R.id.content_frame is the layout you want to replace
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}


}
32 changes: 32 additions & 0 deletions app/src/main/java/com/project/mednudge/Alarm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.project.mednudge;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


public class Alarm extends Fragment {
Toolbar toolbar;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view= inflater.inflate(R.layout.fragment_alarm, container, false);
toolbar=(Toolbar)view.findViewById(R.id.toolbar);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(toolbar);
activity.getSupportActionBar().setTitle("Alarm");
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(false);
return view;
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.project.mednudge;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
* Created by MEGHA on 24-10-2017.
*/

public class CustomFragmentPageAdapter extends FragmentPagerAdapter {
public CustomFragmentPageAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
switch (position){
case 0:
return new SignUpP();
case 1:
return new SignUpD();
}
return null;

}
@Override
public int getCount() {
return 2;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position){
case 0:
return "As Patient";
case 1:
return "As Doctor";

}
return null;
}
}

35 changes: 35 additions & 0 deletions app/src/main/java/com/project/mednudge/DoctorPatientSignup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.project.mednudge;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;



public class DoctorPatientSignup extends Fragment {

private TabLayout tabLayout;
private ViewPager viewPager;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_doctor_patient_signup, container, false);
tabLayout = (TabLayout)view.findViewById(R.id.tabs);
viewPager = (ViewPager)view.findViewById(R.id.view_pager);
viewPager.setAdapter(new CustomFragmentPageAdapter(getChildFragmentManager()));
tabLayout.setupWithViewPager(viewPager);


return view;

}
}

29 changes: 29 additions & 0 deletions app/src/main/java/com/project/mednudge/DoctorProfile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.project.mednudge;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


public class DoctorProfile extends Fragment {
Toolbar toolbar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_doctor_profile, container, false);
toolbar=(Toolbar)view.findViewById(R.id.toolbar);
AppCompatActivity activity = (AppCompatActivity) getActivity();
activity.setSupportActionBar(toolbar);
activity.getSupportActionBar().setTitle("MedNudge");
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(false);
return view;
}

}
Loading