diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..603b140 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.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 diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..348a07e --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Spin Tube App \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..d291b3d --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ba388bb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..f55135b --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,31 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + defaultConfig { + applicationId "com.ShanMukhaInnovations.ArrestTB" + minSdkVersion 16 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.12' + implementation 'com.google.android.material:material:1.0.0' + + androidTestImplementation 'androidx.test.ext:junit:1.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/src/androidTest/java/com/ShanMukhaInnovations/ArrestTB/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/ShanMukhaInnovations/ArrestTB/ExampleInstrumentedTest.java new file mode 100644 index 0000000..70da2c8 --- /dev/null +++ b/app/src/androidTest/java/com/ShanMukhaInnovations/ArrestTB/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.ShanMukhaInnovations.ArrestTB; + +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 Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("com.ShanMukhaInnovations.ArrestTB", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b1e495b --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/fa-regular-400.ttf b/app/src/main/assets/fa-regular-400.ttf new file mode 100644 index 0000000..42a04fd Binary files /dev/null and b/app/src/main/assets/fa-regular-400.ttf differ diff --git a/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/FontAwesome.java b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/FontAwesome.java new file mode 100644 index 0000000..d462343 --- /dev/null +++ b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/FontAwesome.java @@ -0,0 +1,36 @@ +package com.ShanMukhaInnovations.ArrestTB; + + +import android.content.Context; +import android.graphics.Typeface; +import android.util.AttributeSet; + +import androidx.appcompat.widget.AppCompatTextView; + +public class FontAwesome extends AppCompatTextView { + + + public FontAwesome(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + init(); + } + + public FontAwesome(Context context, AttributeSet attrs) { + super(context, attrs); + init(); + } + + public FontAwesome(Context context) { + super(context); + init(); + } + + private void init() { + + //Font name should not contain "/". + Typeface tf = Typeface.createFromAsset(getContext().getAssets(), + "fa-regular-400.ttf"); + setTypeface(tf); + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Login_Screen.java b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Login_Screen.java new file mode 100644 index 0000000..2f7d7c7 --- /dev/null +++ b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Login_Screen.java @@ -0,0 +1,70 @@ +package com.ShanMukhaInnovations.ArrestTB; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.AppCompatCheckBox; + +import android.content.Intent; +import android.os.Bundle; +import android.text.method.HideReturnsTransformationMethod; +import android.text.method.PasswordTransformationMethod; +import android.view.View; +import android.widget.Button; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.Toast; + + +public class Login_Screen extends AppCompatActivity { + + private EditText Username; + private Button login; + private android.widget.EditText Password; + private AppCompatCheckBox checkbox; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login__screen); + Username=findViewById(R.id.username); + Password=findViewById(R.id.password); + login=findViewById(R.id.login); + checkbox = (AppCompatCheckBox) findViewById(R.id.showpassword); + Password = (EditText) findViewById(R.id.password); + checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { + if (isChecked) { + // show password + Password.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); + } else { + // hide password + Password.setTransformationMethod(PasswordTransformationMethod.getInstance()); + } + } + }); + login.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String username = Username.getText().toString(); + String password = Password.getText().toString(); + if(username.length()==0 || password.length()==0) + { + Toast.makeText(Login_Screen.this, "Please Fill all the fields", Toast.LENGTH_SHORT).show(); + + } + + else if (username.equals("Arresttb") && password.equals("tb123")) { + Intent intent = new Intent(Login_Screen.this, Patient_Details.class); + startActivity(intent); + + } else { + Toast.makeText(Login_Screen.this, "Invalid Credentials ", Toast.LENGTH_SHORT).show(); + + } + } + }); + + + } +} diff --git a/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/MainActivity.java b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/MainActivity.java new file mode 100644 index 0000000..7d6fa82 --- /dev/null +++ b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/MainActivity.java @@ -0,0 +1,14 @@ +package com.ShanMukhaInnovations.ArrestTB; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} diff --git a/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Navigation_Top.java b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Navigation_Top.java new file mode 100644 index 0000000..84698af --- /dev/null +++ b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Navigation_Top.java @@ -0,0 +1,74 @@ +package com.ShanMukhaInnovations.ArrestTB; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.MenuItem; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.drawerlayout.widget.DrawerLayout; + +import com.google.android.material.navigation.NavigationView; + +public class Navigation_Top extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { + + protected DrawerLayout draw; + private LinearLayout line; + private Toolbar tool; + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { + switch (menuItem.getItemId()) + { + case R.id.logout: + Intent farmer_sale=new Intent(this,Login_Screen.class); + startActivity(farmer_sale); + break; + + } + return true; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_navigation__top); + + + draw = findViewById(R.id.Drawer); + line = findViewById(R.id.line); + tool = findViewById(R.id.tollbar); + NavigationView navigationView = findViewById(R.id.navigation); + navigationView.setNavigationItemSelectedListener(this); + + setSupportActionBar(tool); + + Window window = getWindow(); + window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); + + + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, draw, tool, R.string.open_navigation_drawer, R.string.close_navigation_drawer) { + @Override + public void onDrawerSlide(View drawerView, float slideOffset) { + super.onDrawerSlide(drawerView, slideOffset); + float sidebar = drawerView.getWidth() * slideOffset; + line.setTranslationX(sidebar); + } + }; + + draw.addDrawerListener(toggle); + toggle.syncState(); + View headerView = navigationView.getHeaderView(0); + + + } +} + diff --git a/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Patient_Details.java b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Patient_Details.java new file mode 100644 index 0000000..4ea007c --- /dev/null +++ b/app/src/main/java/com/ShanMukhaInnovations/ArrestTB/Patient_Details.java @@ -0,0 +1,160 @@ +package com.ShanMukhaInnovations.ArrestTB; + +import androidx.appcompat.app.AppCompatActivity; + +import android.app.DatePickerDialog; +import android.app.TimePickerDialog; +import android.content.Context; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.DatePicker; +import android.widget.EditText; +import android.widget.Spinner; +import android.widget.TextView; +import android.widget.TimePicker; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +public class Patient_Details extends Navigation_Top { + EditText date_data1,time_data1,Dob; + TextView Gender; + private int mHour, mMinute; + + + DatePickerDialog datepicker; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + LayoutInflater inflater = (LayoutInflater) this + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View contentView = inflater.inflate(R.layout.activity_patient__details, null, false); + draw.addView(contentView, 0); + + // setContentView(R.layout.activity_patient__details); + Date date = new Date(); + DateFormat TimeFormat = new SimpleDateFormat("hh:mm a"); + DateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy"); + + String stringTime = TimeFormat.format(new Date()).toString(); + String stringDate = dateFormat.format(new Date()).toString(); + Gender=findViewById(R.id.gender); + + + + + + date_data1=findViewById(R.id.date_data); + time_data1=findViewById(R.id.time_data); + Dob=findViewById(R.id.dob); + time_data1.setText("Time :"+stringTime); + + date_data1.setText(stringDate); + time_data1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + final Calendar c = Calendar.getInstance(); + mHour = c.get(Calendar.HOUR_OF_DAY); + mMinute = c.get(Calendar.MINUTE); + + + // Launch Time Picker Dialog + TimePickerDialog timePickerDialog = new TimePickerDialog(Patient_Details.this, + new TimePickerDialog.OnTimeSetListener() { + + @Override + public void onTimeSet(TimePicker view, int hourOfDay, + int minute) { + + time_data1.setText("Time :"+hourOfDay + ":" + minute); + } + }, mHour, mMinute, false); + timePickerDialog.show(); + + + } + }); + date_data1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + final Calendar cldr = Calendar.getInstance(); + int day = cldr.get(Calendar.DAY_OF_MONTH); + int month = cldr.get(Calendar.MONTH); + int year = cldr.get(Calendar.YEAR); + // date picker dialog + datepicker = new DatePickerDialog(Patient_Details.this, + new DatePickerDialog.OnDateSetListener() { + @Override + public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { + date_data1.setText(dayOfMonth + "/" + (monthOfYear + 1) + "/" + year); + } + }, year, month, day); + datepicker.show(); + } + }); + + Dob.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + final Calendar cldr = Calendar.getInstance(); + int day = cldr.get(Calendar.DAY_OF_MONTH); + int month = cldr.get(Calendar.MONTH); + int year = cldr.get(Calendar.YEAR); + // date picker dialog + datepicker = new DatePickerDialog(Patient_Details.this, + new DatePickerDialog.OnDateSetListener() { + @Override + public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { + Dob.setText(dayOfMonth + "/" + (monthOfYear + 1) + "/" + year); + } + }, year, month, day); + datepicker.show(); + } + }); + + + + Spinner Spinner_gender = findViewById(R.id.spinner_gender); + + ArrayAdapter adapter = ArrayAdapter.createFromResource(this, + R.array.Gender, android.R.layout.simple_spinner_item); + + adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + Spinner_gender.setAdapter(adapter); + + Spinner Spinner_sample = findViewById(R.id.spinner_sample); + ArrayAdapter sample_adapter = ArrayAdapter.createFromResource(this, + R.array.Type_Of_Sample, android.R.layout.simple_spinner_item); + + sample_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + Spinner_sample.setAdapter(sample_adapter); + + + Spinner Spinner_validity = findViewById(R.id.spinner_validity); + + ArrayAdapter Validity_adapter = ArrayAdapter.createFromResource(this, + R.array.Validity, android.R.layout.simple_spinner_item); + + Validity_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + Spinner_validity.setAdapter(Validity_adapter); + + + + + + + + + } + + + + + +} diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/text_back.xml b/app/src/main/res/drawable/text_back.xml new file mode 100644 index 0000000..b155c77 --- /dev/null +++ b/app/src/main/res/drawable/text_back.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/font/fontstyle.ttf b/app/src/main/res/font/fontstyle.ttf new file mode 100644 index 0000000..0ac5e51 Binary files /dev/null and b/app/src/main/res/font/fontstyle.ttf differ diff --git a/app/src/main/res/layout/activity_login__screen.xml b/app/src/main/res/layout/activity_login__screen.xml new file mode 100644 index 0000000..48ee0cf --- /dev/null +++ b/app/src/main/res/layout/activity_login__screen.xml @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + /> + + + + +