134 Commits

Author SHA1 Message Date
Ramandeep
4db4918e39 Arresttb Model latest 2021-09-21 00:44:52 +05:30
Raman deep
35fbea548a Ragini Working Model 2021-09-15 12:11:31 +00:00
Ragini.N
05c5f3ed13 Upload New File 2021-07-02 18:23:44 +00:00
Ragini.N
1f5ff24a59 Delete arrest-tb-MAIN_1.ipynb 2021-07-02 18:22:37 +00:00
Ragini.N
d5e737683a Upload New File 2021-07-02 14:40:27 +00:00
Ragini.N
753bc8e509 Delete arrest-tb-main__1_.ipynb 2021-07-02 14:39:30 +00:00
Ragini.N
ec8eca030a Upload New File 2021-07-02 13:55:52 +00:00
Ragini.N
40b602c1be Delete arrest-tb-main.ipynb 2021-07-02 13:55:05 +00:00
Ragini.N
4753b35567 Upload New File 2021-07-02 07:51:32 +00:00
Ragini.N
efa2fa42fb Delete arrest-tb-main.ipynb 2021-07-02 07:51:03 +00:00
Ragini.N
24b156175d Upload New File 2021-06-16 11:18:32 +00:00
Ragini.N
96e5831170 Upload New File 2021-06-16 11:18:08 +00:00
developerraman
737e353454 Merge remote-tracking branch 'origin/master' 2021-05-23 02:47:49 +05:30
developerraman
d58fef2180 Added sharing and downloading button for previous results.
Date of birth format change from month-date-year to date-month-year
2021-05-23 02:47:03 +05:30
Ragini.N
4a4e7e244c Upload New File 2021-03-02 07:33:26 +00:00
Ragini.N
986530f6c7 Upload New File 2021-03-02 07:26:36 +00:00
Ragini.N
0138de0725 Delete converted_tflite_quantized_14-02-2021_.zip 2021-03-02 07:25:41 +00:00
Ragini.N
633a6d70df Delete converted_tflite_floating_14-02-2021_.zip 2021-03-02 07:25:23 +00:00
developerraman
52df04a5c9 Removed compulsion on Nikshay number,Added the calculation of age automatically,
character limit NIRT lab number and spin tube ID are 6 ,All the Automation Test Cases are edited ,About app Version Added ,Email ids for notify pipeline output are added.
2021-03-02 00:39:08 +05:30
Raman deep
9dfcad6a3b Update .gitlab-ci.yml 2021-03-01 18:18:44 +00:00
Raman deep
a2b3c78860 Updated the gitlab-ci.yml yaml file, character limit NIRT lab number and spin tube ID are 6 ,All the Automation Test Cases are edited ,About app Version Added ,Email ids for notify pipeline output are added. 2021-03-01 17:50:13 +00:00
developerraman
dfa6f947eb Removed compulsion on Nikshay number,Added the calculation of age automatically,
character limit NIRT lab number and spin tube ID are 6 ,All the Automation Test Cases are edited ,About app Version Added ,Email ids for notify pipeline output are added.
2021-03-01 22:50:21 +05:30
developerraman
a3b0c19e3f Complete Automation Test Cases 2021-02-18 05:08:50 +05:30
Raman deep
31fa1afd13 Update .gitlab-ci.yml 2021-02-17 18:24:49 +00:00
Raman deep
e89127ead5 Update .gitlab-ci.yml 2021-02-17 18:19:49 +00:00
Raman deep
4367114a2c Update .gitlab-ci.yml 2021-02-17 18:18:18 +00:00
Raman deep
311eb73524 Update .gitlab-ci.yml 2021-02-17 18:17:59 +00:00
Raman deep
cc4169e606 Update .gitlab-ci.yml 2021-02-17 18:17:04 +00:00
Raman deep
1eb16401d1 Update .gitlab-ci.yml 2021-02-17 18:15:27 +00:00
Raman deep
b4cd61fce1 Update .gitlab-ci.yml 2021-02-17 18:14:20 +00:00
Raman deep
0661f98401 Update .gitlab-ci.yml 2021-02-17 18:06:20 +00:00
Raman deep
46a6d34ee2 Update .gitlab-ci.yml 2021-02-17 17:47:34 +00:00
Raman deep
307f364be9 Update .gitlab-ci.yml 2021-02-17 17:40:10 +00:00
Raman deep
591bb08ad1 Update .gitlab-ci.yml 2021-02-17 17:34:14 +00:00
Raman deep
ca2f5f0e17 Update .gitlab-ci.yml 2021-02-17 17:31:47 +00:00
Raman deep
b97e9b7f58 Update .gitlab-ci.yml 2021-02-17 17:30:55 +00:00
Raman deep
306df95ad2 Update .gitlab-ci.yml 2021-02-17 16:14:34 +00:00
Raman deep
6eccef7b8b Update .gitlab-ci.yml 2021-02-17 16:10:34 +00:00
Raman deep
3d6685d360 Update .gitlab-ci.yml 2021-02-17 16:07:52 +00:00
Raman deep
eaf74de979 Update .gitlab-ci.yml 2021-01-31 18:25:15 +00:00
Raman deep
ea3dc78def Update .gitlab-ci.yml 2021-01-31 18:16:40 +00:00
Raman deep
416fc5c940 Update .gitlab-ci.yml 2021-01-31 18:03:14 +00:00
Raman deep
9c1d75df57 Update .gitlab-ci.yml 2021-01-31 18:02:50 +00:00
Raman deep
94c40b0bec Update .gitlab-ci.yml 2021-01-31 17:45:48 +00:00
Raman deep
6b33b3bda7 Update .gitlab-ci.yml 2021-01-31 17:37:30 +00:00
Raman deep
e213796b6a Update .gitlab-ci.yml 2021-01-31 17:34:04 +00:00
Raman deep
ca17445075 Update .gitlab-ci.yml 2021-01-31 17:27:09 +00:00
Raman deep
4685984be6 Update .gitlab-ci.yml 2021-01-31 17:08:03 +00:00
Raman deep
03bbb3ac68 Update .gitlab-ci.yml 2021-01-31 16:48:02 +00:00
Raman deep
0dd79fcc63 Update .gitlab-ci.yml 2021-01-31 14:22:33 +00:00
Raman deep
c38287d5b1 Update .gitlab-ci.yml 2021-01-31 14:18:09 +00:00
Raman deep
83fcdda9f6 Update .gitlab-ci.yml 2021-01-31 14:11:01 +00:00
Raman deep
ee1cc63d67 Update .gitlab-ci.yml 2021-01-31 14:10:18 +00:00
Raman deep
288e90d19b Update .gitlab-ci.yml 2021-01-31 14:07:20 +00:00
Raman deep
bb74bcd88f Update .gitlab-ci.yml 2021-01-31 14:01:15 +00:00
Raman deep
2b73023ea5 Update .gitlab-ci.yml 2021-01-30 05:51:14 +00:00
Raman deep
ceda32d254 Update .gitlab-ci.yml 2021-01-30 05:47:38 +00:00
Raman deep
1ec4e2d664 Update .gitlab-ci.yml 2021-01-30 05:41:02 +00:00
Raman deep
bab757388b Update .gitlab-ci.yml 2021-01-30 05:38:55 +00:00
Raman deep
43c335f944 Update .gitlab-ci.yml 2021-01-29 08:52:37 +00:00
Raman deep
c37b044b98 Update .gitlab-ci.yml 2021-01-29 08:48:01 +00:00
Raman deep
104e076f4c Update .gitlab-ci.yml 2021-01-29 08:28:23 +00:00
Raman deep
d04f1d990a Update .gitlab-ci.yml 2021-01-29 08:07:34 +00:00
Raman deep
ac9d2e053e Update .gitlab-ci.yml 2021-01-29 07:49:33 +00:00
Raman deep
43b5eea6de Update .gitlab-ci.yml 2021-01-29 07:34:48 +00:00
Raman deep
dedc6b169b Update .gitlab-ci.yml file 2021-01-28 19:54:38 +00:00
Raman deep
ab496a2300 Update .gitlab-ci.yml file 2021-01-28 19:54:33 +00:00
Raman deep
954ca843fc Update .gitlab-ci.yml 2021-01-28 19:49:39 +00:00
Raman deep
6cd0f3d7bf Update .gitlab-ci.yml 2021-01-28 19:41:32 +00:00
Raman deep
e40827a466 Update .gitlab-ci.yml 2021-01-28 19:16:11 +00:00
Raman deep
196bd680f7 Update .gitlab-ci.yml 2021-01-28 19:07:47 +00:00
Raman deep
25b512e6c7 Update .gitlab-ci.yml 2021-01-28 18:48:11 +00:00
Raman deep
3d41ad20c8 Update .gitlab-ci.yml 2021-01-28 18:27:32 +00:00
Raman deep
d126f52f9d Update .gitlab-ci.yml 2021-01-28 18:21:14 +00:00
Raman deep
3087197ccd Update .gitlab-ci.yml 2021-01-28 18:20:14 +00:00
Raman deep
cdd3690d9d Update .gitlab-ci.yml 2021-01-28 18:08:05 +00:00
Raman deep
0ceca45b67 Update .gitlab-ci.yml 2021-01-28 17:54:13 +00:00
Raman deep
a651c7ed84 Update .gitlab-ci.yml 2021-01-28 17:31:27 +00:00
developerraman
6a80fc19f0 Merge remote-tracking branch 'origin/master' 2021-01-28 22:59:02 +05:30
developerraman
0b523696c3 Espresso Test Check 2021-01-28 22:54:33 +05:30
Raman deep
b8eb32e7b3 Add .gitlab-ci.yml 2021-01-28 17:21:52 +00:00
Raman deep
bb00b599b3 Delete .gitlab-ci.yml 2021-01-28 16:59:40 +00:00
developerraman
719c0137fb Espresso Login Activity Test Cases 2021-01-28 17:46:04 +05:30
developerraman
ce49e907a2 Permission handling Library ,Crashlytics Library ,Espresso Library and Patient Details and Test Details Data added 2021-01-28 17:09:06 +05:30
developerraman
46feddd88f Permission handling Library ,Espresso and Validation Attributes Added 2021-01-28 16:39:46 +05:30
Ragini.N
f97f15309f Delete e_images_10.jpg 2021-01-27 10:55:54 +00:00
Ragini.N
7540512743 Upload New File(s) 2021-01-27 10:55:36 +00:00
Ragini.N
acac7bcdf2 Delete converted_saved_quantized.zip 2021-01-27 10:29:13 +00:00
Ragini.N
d47bf48b9d Delete converted_saved_float.zip 2021-01-27 10:29:03 +00:00
Ragini.N
aad1235860 Upload New File 2021-01-27 10:28:39 +00:00
Ragini.N
f4cf663505 Upload New File 2021-01-27 10:28:06 +00:00
developerraman
e8b755ef68 App Build Check 1 2020-12-14 18:54:13 +05:30
developerraman
ac0adddfd9 Location Tracker 2020-12-14 14:02:48 +05:30
developerraman
c3573aac6c Ci /cd integration 2020-12-14 13:16:06 +05:30
developerraman
d9c861b4a0 Updated Project 2020-11-19 04:58:04 -08:00
Raman deep
0f2d73f612 Delete Patient_Detail.java 2020-11-19 12:23:11 +00:00
Raman deep
2ed9c2350c Delete Navigation_Top.java 2020-11-19 12:22:52 +00:00
Raman deep
444a9f048d Delete Login_Screen.java 2020-11-19 12:22:35 +00:00
Raman deep
b5cb41989e Delete Splash_Screen.java 2020-11-19 12:22:20 +00:00
Raman deep
304f742863 Delete Test_details.java 2020-11-19 12:22:07 +00:00
Raman deep
023e8ecc62 Delete Font_Awesome.java 2020-11-19 12:21:53 +00:00
Raman deep
468cf4931f Delete Camera_Guide.java 2020-11-19 12:21:39 +00:00
Raman deep
8bde81093c Delete Add_Image.java 2020-11-19 12:21:21 +00:00
Ragini.N
08bac1c0ba Upload New File 2020-11-18 10:39:55 +00:00
Ragini.N
3b70d1a5d9 Upload New File 2020-11-18 10:39:31 +00:00
Ragini.N
04bb2539ef Delete converted_tflite_quantized.zip 2020-11-18 10:37:56 +00:00
Ragini.N
1771684c0c Delete converted_mymodel_tflite.zip 2020-11-18 10:37:46 +00:00
Ragini.N
9f23abcf82 Upload New File 2020-11-09 06:05:51 +00:00
Ragini.N
0ac631bc87 Upload New File 2020-11-09 06:05:00 +00:00
Raman deep
640db03785 Delete ExampleUnitTest.java 2020-10-28 05:48:08 +00:00
Raman deep
1be84c74eb Delete ExampleInstrumentedTest.java 2020-10-28 05:46:37 +00:00
Raman deep
98a7156503 Delete home.java 2020-10-28 05:45:25 +00:00
Raman deep
ecbfc1dd3e Delete Test_details.java 2020-10-28 05:45:16 +00:00
Raman deep
39f7b82aeb Delete Report.java 2020-10-28 05:45:07 +00:00
Raman deep
64c428171e Delete Patient_detail.java 2020-10-28 05:44:56 +00:00
Raman deep
6565de722e Delete Navigation_Top.java 2020-10-28 05:44:47 +00:00
Raman deep
6da7db72f4 Delete Login_Screen.java 2020-10-28 05:44:37 +00:00
Raman deep
6aa0991b6f Delete FontAwesome.java 2020-10-28 05:44:27 +00:00
Raman deep
df89dcb445 Delete Camera_Guide.java 2020-10-28 05:44:05 +00:00
Raman deep
3e0a0f9498 Delete AddImage.java 2020-10-28 05:43:53 +00:00
Raman deep
cbdbb6c773 Delete About.java 2020-10-28 05:43:42 +00:00
Raman deep
e672fa9234 Delete splash_screen.java 2020-10-28 05:42:22 +00:00
developerraman
8792ac30ae Merge branch 'master' of gitlab.com:smileomi18/arrest-tb
 Conflicts:
	app/build.gradle
	app/src/main/AndroidManifest.xml
	app/src/main/res/layout/activity_home.xml
	app/src/main/res/layout/head.xml
	app/src/main/res/menu/menu.xml
2020-10-27 21:33:32 -07:00
developerraman
8f2c272dc3 updated About Page 2020-10-27 11:05:48 -07:00
developerraman
8fefe6c149 updated About Page 2020-10-27 11:05:47 -07:00
developerraman
d30d218fb3 First Commit 2020-10-27 11:05:47 -07:00
developerraman
94cc6c6593 First Commit 2020-10-27 11:05:46 -07:00
developerraman
f57f5fae63 First Commit 2020-10-27 11:05:46 -07:00
developerraman
4cd4d841a1 Initial commit 2020-10-27 11:05:44 -07:00
Ragini.N
c397b929c3 Upload New File 2020-10-27 04:35:01 +00:00
Ragini.N
bd46b9ab2e Delete lables.txt 2020-10-27 04:34:38 +00:00
Ragini.N
28ed4cd619 Upload New File 2020-10-27 04:33:55 +00:00
Ragini.N
33668ae12f Upload New File 2020-10-22 09:50:14 +00:00
Ragini.N
fbc50fea40 Upload New File 2020-10-22 09:48:02 +00:00
135 changed files with 8521 additions and 608 deletions

119
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,119 @@
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
image: openjdk:8-jdk
variables:
# ANDROID_COMPILE_SDK is the version of Android you're compiling with.
# It should match compileSdkVersion.
ANDROID_COMPILE_SDK: "29"
# ANDROID_BUILD_TOOLS is the version of the Android build tools you are using.
# It should match buildToolsVersion.
ANDROID_BUILD_TOOLS: "29.0.3"
# It's what version of the command line tools we're going to download from the official site.
# Official Site-> https://developer.android.com/studio/index.html
# There, look down below at the cli tools only, sdk tools package is of format:
# commandlinetools-os_type-ANDROID_SDK_TOOLS_latest.zip
# when the script was last modified for latest compileSdkVersion, it was which is written down below
ANDROID_SDK_TOOLS: "6514223"
# Packages installation before running script
stages:
- build
- test
# Packages installation before running script
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
# Setup path as android_home for moving/exporting the downloaded sdk into it
- export ANDROID_HOME="${PWD}/android-home"
# Create a new directory at specified location
- install -d $ANDROID_HOME
# Here we are installing androidSDK tools from official source,
# (the key thing here is the url from where you are downloading these sdk tool for command line, so please do note this url pattern there and here as well)
# after that unzipping those tools and
# then running a series of SDK manager commands to install necessary android SDK packages that'll allow the app to build
- wget --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
# move to the archive at ANDROID_HOME
- pushd $ANDROID_HOME
- unzip -d cmdline-tools cmdline-tools.zip
- popd
- export PATH=$PATH:${ANDROID_HOME}/cmdline-tools/tools/bin/
# Nothing fancy here, just checking sdkManager version
- sdkmanager --version
# use yes to accept all licenses
- yes | sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true
- sdkmanager --sdk_root=${ANDROID_HOME} "platforms;android-${ANDROID_COMPILE_SDK}"
- sdkmanager --sdk_root=${ANDROID_HOME} "platform-tools"
- sdkmanager --sdk_root=${ANDROID_HOME} "build-tools;${ANDROID_BUILD_TOOLS}"
# Not necessary, but just for surity
- chmod +x ./gradlew
# Basic android and gradle stuff
# Check linting
build_debug:
stage: build
script:
- ./gradlew assembleDebug
- ./gradlew assembleDebugAndroidTest
artifacts:
paths:
- app/build/outputs/
.test_lab_template: &test_lab_template_def
stage: test
before_script:
# Install Google Cloud SDK
- wget --quiet --output-document=/tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
- mkdir -p /opt
- tar zxf /tmp/google-cloud-sdk.tar.gz --directory /opt
- /opt/google-cloud-sdk/install.sh --quiet
- source /opt/google-cloud-sdk/path.bash.inc
# Setup and configure the project
- gcloud components update
- echo $GCLOUD_PROJECT_ID
- gcloud config set project $GCLOUD_PROJECT_ID
# Activate cloud credentials
- echo $SERVICE_ACCOUNT > /tmp/service-account.json
- gcloud auth activate-service-account --key-file /tmp/service-account.json
# List available options for logging purpose only (so that we can review available options)
- gcloud firebase test android models list
- gcloud firebase test android versions list
after_script:
- source /opt/google-cloud-sdk/path.bash.inc
# Iterate up to 10 possible test lab configurations and create CLI tool options
- for i in `seq 1 10`; do export CONFIG="TEST_LAB_DEVICE_CONFIGURATION_$i"; if [ -n "${!CONFIG}" ]; then export TEST_LAB_DEVICE_CONFIGURATIONS="$TEST_LAB_DEVICE_CONFIGURATIONS --device model=${!CONFIG} "; fi; done
# Output for debug logging purpose only
- echo $TEST_LAB_DEVICE_CONFIGURATIONS
# Warn if there were no configurations
- if [ -n "$TEST_LAB_DEVICE_CONFIGURATIONS" ]; then gcloud firebase test android run --type robo --app app.apk $TEST_LAB_DEVICE_CONFIGURATIONS --timeout 90s; fi
# Warn if there were no configurations
- if [ -z "$TEST_LAB_DEVICE_CONFIGURATIONS" ]; then echo "NO FIREBASE TESTLAB CONFIGURATIONS!!!"; fi
test_lab_debug:
<<: *test_lab_template_def
script:
- cp app/build/outputs/apk/debug/app-debug.apk ./app.apk
- cp app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk ./app-test.apk
- gcloud firebase test android run --type instrumentation --app app.apk --test app-test.apk --device model=Nexus6P,version=26,locale=en,orientation=portrait
dependencies:
- build_debug

2
.idea/.name generated
View File

@@ -1 +1 @@
Spin Tube App
arrest_tb

6
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>

2
.idea/gradle.xml generated
View File

@@ -4,10 +4,10 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="false" />
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

View File

@@ -21,5 +21,10 @@
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://jitpack.io" />
</remote-repository>
</component>
</project>

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

48
.idea/modules/app/google-services.json generated Normal file
View File

@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "903475317641",
"firebase_url": "https://arresttb-aead0.firebaseio.com",
"project_id": "arresttb-aead0",
"storage_bucket": "arresttb-aead0.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:903475317641:android:444c2967176c6135eeaf58",
"android_client_info": {
"package_name": "in.sminnovations.arrest_tb"
}
},
"oauth_client": [
{
"client_id": "903475317641-hsfvg2fhlgt43g6tnv54fb4191hguqaa.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "in.sminnovations.arrest_tb",
"certificate_hash": "8aeffda288dd8e59580e114a5fe8178766f53ad1"
}
},
{
"client_id": "903475317641-k1mctjrq1d9f8i23lbr4nova31g2o387.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDD31gjK4qOIKlEgB5Nz5KO_aOH782B8WQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "903475317641-k1mctjrq1d9f8i23lbr4nova31g2o387.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@@ -3,6 +3,7 @@
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />

View File

@@ -1,34 +1,80 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.ShanMukhaInnovations.ArrestTB"
applicationId "in.sminnovations.arrest_tb"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled true
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
}
aaptOptions {
noCompress "tflite"
noCompress "lite"
}
}
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.chaos.view:pinview:1.4.3'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.firebaseui:firebase-ui-database:7.1.1'
implementation 'org.tensorflow:tensorflow-lite:+'
implementation 'androidx.browser:browser:1.2.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.hbb20:ccp:2.4.0'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-config:20.0.0'
implementation 'com.google.firebase:firebase-auth:20.0.1'
implementation 'com.google.firebase:firebase-database:19.5.1'
implementation 'com.google.firebase:firebase-storage:19.2.0'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-location:17.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
implementation 'com.google.firebase:firebase-perf:19.0.11'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.karumi:dexter:6.2.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

48
app/google-services.json Normal file
View File

@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "903475317641",
"firebase_url": "https://arresttb-aead0.firebaseio.com",
"project_id": "arresttb-aead0",
"storage_bucket": "arresttb-aead0.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:903475317641:android:444c2967176c6135eeaf58",
"android_client_info": {
"package_name": "in.sminnovations.arrest_tb"
}
},
"oauth_client": [
{
"client_id": "903475317641-hsfvg2fhlgt43g6tnv54fb4191hguqaa.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "in.sminnovations.arrest_tb",
"certificate_hash": "8aeffda288dd8e59580e114a5fe8178766f53ad1"
}
},
{
"client_id": "903475317641-k1mctjrq1d9f8i23lbr4nova31g2o387.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDD31gjK4qOIKlEgB5Nz5KO_aOH782B8WQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "903475317641-k1mctjrq1d9f8i23lbr4nova31g2o387.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@@ -1,27 +0,0 @@
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 <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.ShanMukhaInnovations.ArrestTB", appContext.getPackageName());
}
}

View File

@@ -0,0 +1,138 @@
package in.sminnovations.arrest_tb;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class LoginActivity {
@Rule
public ActivityTestRule<LoginScreen> mActivityTestRule = new ActivityTestRule<>(LoginScreen.class);
@Test
public void LoginSuccess_2() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(replaceText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
try {
Thread.sleep(160);
} catch (InterruptedException e) {
e.printStackTrace();
}
// onView(withText("logged in Successfully...")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void LoginInvalidNumber_3() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("977905"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
try {
Thread.sleep(160);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("No such user exists")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void LoginWrongPassword_4() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep1"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
try {
Thread.sleep(160);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Wrong Password")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void EmptyPassword_5() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
try {
Thread.sleep(160);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Please enter all the required fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void EmptyNumber_6() {
// Type text and then press the button.
onView(withId(R.id.password))
.perform(typeText("Deep1"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
try {
Thread.sleep(160);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Please enter all the required fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
}

View File

@@ -0,0 +1,634 @@
package in.sminnovations.arrest_tb;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.test.espresso.contrib.DrawerActions;
import androidx.test.espresso.contrib.NavigationViewActions;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.contrib.DrawerMatchers.isClosed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class Navigationdrawer {
@Rule
public ActivityTestRule<LoginScreen> mActivityTestRule2 = new ActivityTestRule<>(LoginScreen.class);
/*@Before
public void stubCameraIntent() {
Instrumentation.ActivityResult result = createImageCaptureActivityResultStub();
// Stub the Intent.
intending(hasAction(MediaStore.ACTION_IMAGE_CAPTURE)).respondWith(result);
}
*/
/* private Instrumentation.ActivityResult createImageCaptureActivityResultStub() {
Bundle bundle = new Bundle();
bundle.putParcelable(AddImage., BitmapFactory.decodeResource(
mActivityTestRule2.getActivity().getResources(), R.drawable.ic_launcher_background));
// Create the Intent that will include the bundle.
Intent resultData = new Intent();
resultData.putExtras(bundle);
// Create the ActivityResult with the Intent.
return new ActivityResult(Activity.RESULT_OK, resultData);
}
*/
@Test
public void NavAddTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(replaceText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_add_Test));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavPositiveTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(replaceText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_positive));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavHomeTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(replaceText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_home));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavNegativeTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(replaceText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_negative));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavResultTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_results));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavAboutTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_contact_us));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavLogoutTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.navigation))
.perform(NavigationViewActions.navigateTo(R.id.nav_logout));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavUserNameTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.text))
.check(
matches(withText("Ramandeep")));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void NavPhoneTest() {
// Type text and then press the button.
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
/*ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Open navigation drawer"),
childAtPosition(
allOf(withId(R.id.tollbar),
childAtPosition(
withId(R.id.line),
0)),
1),
isDisplayed()));
appCompatImageButton2.perform(click());
ViewInteraction navigationMenuItemView2 = onView(
allOf(childAtPosition(
allOf(withId(R.id.design_navigation_view),
childAtPosition(
withId(R.id.navigation),
0)),
2),
isDisplayed()));
navigationMenuItemView2.perform(click());*/
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.Drawer))
.check(matches(isClosed(Gravity.LEFT))) // Left Drawer should be closed.
.perform(DrawerActions.open()); // Open Drawer
// Start the screen of your activity.
onView(withId(R.id.not_sign_in))
.check(
matches(withText("9779057263")));
// Check that you Activity was opened.
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
private static Matcher<View> childAtPosition(
final Matcher<View> parentMatcher, final int position) {
return new TypeSafeMatcher<View>() {
@Override
public void describeTo(Description description) {
description.appendText("Child at position " + position + " in parent ");
parentMatcher.describeTo(description);
}
@Override
public boolean matchesSafely(View view) {
ViewParent parent = view.getParent();
return parent instanceof ViewGroup && parentMatcher.matches(parent)
&& view.equals(((ViewGroup) parent).getChildAt(position));
}
};
// Check that the text was changed.
}
}

View File

@@ -0,0 +1,292 @@
package in.sminnovations.arrest_tb;
import androidx.test.espresso.Espresso;
import androidx.test.espresso.ViewInteraction;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.rule.GrantPermissionRule;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.action.ViewActions.scrollTo;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class PatientDetails {
@Rule
public GrantPermissionRule mGrantPermissionRule =
GrantPermissionRule.grant(
"android.permission.ACCESS_FINE_LOCATION",
"android.permission.READ_EXTERNAL_STORAGE",
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.ACCESS_COARSE_LOCATION"
);
@Rule
public ActivityTestRule<PatientDetail> mActivityTestRule = new ActivityTestRule<>(PatientDetail.class);
@Test
public void PatientIdDigitOnly() {
onView(withId(R.id.patientid))
.perform(typeText("12345"), closeSoftKeyboard());
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("77"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("777777777"), closeSoftKeyboard());
onView(withId(R.id.next))
.perform(scrollTo())
.perform(click());
onView(withText("Patient Id must be alphanumeric")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void PatientIdwrongchar() {
onView(withId(R.id.patientid))
.perform(typeText("A23"), closeSoftKeyboard());
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("77"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("777777777"), closeSoftKeyboard());
onView(withId(R.id.next))
.perform(scrollTo())
.perform(click());
onView(withText("Patient Id must be 5 characters")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void PatientIdAlphabetOnly() {
onView(withId(R.id.patientid))
.perform(typeText("ABCDE"), closeSoftKeyboard());
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("77"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("777777777"), closeSoftKeyboard());
onView(withId(R.id.next))
.perform(scrollTo())
.perform(click());
onView(withText("Patient Id must be alphanumeric")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void PatientGenderValidation() {
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
}
@Test
public void PatientAgeLess() {
onView(withId(R.id.patientid))
.perform(typeText("A2345"), closeSoftKeyboard());
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("0"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("777777777"), closeSoftKeyboard());
onView(withId(R.id.next))
.perform(scrollTo())
.perform(click());
onView(withText("Enter a valid Age")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void PatientAgeMore() {
onView(withId(R.id.patientid))
.perform(typeText("A2345"), closeSoftKeyboard());
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("123"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("777777777"), closeSoftKeyboard());
onView(withId(R.id.next))
.perform(scrollTo())
.perform(click());
onView(withText("Enter a valid Age")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void LeaveAge() {
onView(withId(R.id.patientid))
.perform(typeText("A2345"), closeSoftKeyboard());
onView(withId(R.id.patientid))
.check(matches(withText("A2345")));
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A77777777"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A77777777")));
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.next),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("Please fill all fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void LeaveNikshayId() {
onView(withId(R.id.patientid))
.perform(typeText("A2345"), closeSoftKeyboard());
onView(withId(R.id.patientid))
.check(matches(withText("A2345")));
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("77"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("77")));
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.next),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
// onView(withText("Please fill all fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void LeavePatientId() {
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("77"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("77")));
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("A77777777"), closeSoftKeyboard());
appCompatEditText4.check(
matches(withText("A77777777")));
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.next),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("Please fill all fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void PatientNikshayIdValidation() {
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("7777777777777"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("777777777")));
}
@Test
public void AllData() {
onView(withId(R.id.patientid))
.perform(typeText("A2345"), closeSoftKeyboard());
onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.age),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("77"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.NikshayID),
isDisplayed()));
appCompatEditText4.perform(scrollTo(), replaceText("777777777"), closeSoftKeyboard());
onView(withId(R.id.next))
.perform(scrollTo())
.perform(click());
/*ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.next),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());*/
}
/* onView(withId(R.id.))
.perform(typeText("123456789"), closeSoftKeyboard());
*/
/*onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
*/
// Type text and then press the button.
// Check that the text was changed.
}

View File

@@ -0,0 +1,259 @@
package in.sminnovations.arrest_tb;
import androidx.test.espresso.ViewInteraction;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.action.ViewActions.scrollTo;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class RegisterActivity {
@Rule
public ActivityTestRule<Register> mActivityTestRule = new ActivityTestRule<>(Register.class);
/* @Test
public void loginactivityv() {
// Type text and then press the button.
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.register_user),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("Ramandeep Bains ............"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("123456")));
// Check that the text was changed.
}*/
@Test
public void RegisterEmptyName() {
// Type text and then press the button.
ViewInteraction appCompatEditText6 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText6.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText31 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText31.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("9779057833"), closeSoftKeyboard());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.buttonContinue),
isDisplayed()));
appCompatEditText3.perform(click());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Please enter all the required fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void RegisterEmptyNumber() {
// Type text and then press the button.
ViewInteraction appCompatEditText6 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText6.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText31 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText31.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("Ramandeep"), closeSoftKeyboard());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.buttonContinue),
isDisplayed()));
appCompatEditText3.perform(click());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Please enter all the required fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void RegisterDigitLess() {
// Type text and then press the button.
ViewInteraction appCompatEditText6 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText6.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), closeSoftKeyboard());
appCompatEditText3.perform(scrollTo(), replaceText("98760"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("Ramandeep"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.buttonContinue),
isDisplayed()));
appCompatEditText4.perform(click());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Enter a valid Phone")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
@Test
public void RegisterDigitMore() {
// Type text and then press the button.
ViewInteraction appCompatEditText6 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText6.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText7 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText7.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), replaceText("9876007249123"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("Ramandeep"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.buttonContinue),
isDisplayed()));
appCompatEditText4.perform(click());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("Enter a valid Phone")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
/* @Test
public void RegisterNumberExist() {
// Type text and then press the button.
*//* ViewInteraction appCompatEditText678 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText678.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText679 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText679.perform(scrollTo(), closeSoftKeyboard());
*//*
ViewInteraction appCompatEditText113 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText113.perform(scrollTo(), replaceText("9779057263"), closeSoftKeyboard());
ViewInteraction appCompatEditText112 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText112.perform(scrollTo(), replaceText("Ramandeep"), closeSoftKeyboard());
ViewInteraction appCompatEditText411 = onView(
allOf(withId(R.id.buttonContinue),
isDisplayed()));
appCompatEditText411.perform(click());
onView(withText("User Already Exist")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
*/
/* @Test
public void RegisterNumberExist1() {
// Type text and then press the button.
ViewInteraction appCompatEditText6 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText6.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText7 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText7.perform(scrollTo(), closeSoftKeyboard());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.editTextMobile),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), replaceText("9779057263"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.editTextName),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("Ramandeep"), closeSoftKeyboard());
ViewInteraction appCompatEditText4 = onView(
allOf(withId(R.id.buttonContinue),
isDisplayed()));
appCompatEditText4.perform(click());
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withText("User Already Exist")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
// Check that the text was changed.
}
*/
}

View File

@@ -0,0 +1,74 @@
package in.sminnovations.arrest_tb;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class SearchOperation {
@Rule
public ActivityTestRule<LoginScreen> mActivityTestRule = new ActivityTestRule<>(LoginScreen.class);
@Test
public void SearchData() {
onView(withId(R.id.contactnumber))
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.search))
.perform(typeText("34"), closeSoftKeyboard());
// onView(withText("12345")).perform(click());
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
onView(withId(R.id.recycler_view))
.perform(actionOnItemAtPosition(0, click()));
/* onView(withId(R.id.textToBeChanged))
.check(matches(withText("12345")));*/
// Type text and then press the button.
// onView(withId(R.id.search)).perform(click());
/* onView(withId(R.id.search)).p
.perform(typeText("9779057263"), closeSoftKeyboard());
onView(withId(R.id.password))
.perform(typeText("Deep"), closeSoftKeyboard());
onView(withId(R.id.showpassword)).perform(click());
onView(withId(R.id.login)).perform(click());
*/
// Check that the text was changed.
}
}

View File

@@ -0,0 +1,32 @@
package in.sminnovations.arrest_tb;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class SplashActivity {
@Rule
public ActivityTestRule<SplashScreen> mActivityTestRule = new ActivityTestRule<>(SplashScreen.class);
@Test
public void SplashActivity_1() {
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,294 @@
package in.sminnovations.arrest_tb;
import androidx.test.espresso.Espresso;
import androidx.test.espresso.ViewInteraction;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.rule.GrantPermissionRule;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.action.ViewActions.scrollTo;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class TestDetail_Data {
@Rule
public GrantPermissionRule mGrantPermissionRule =
GrantPermissionRule.grant(
"android.permission.ACCESS_FINE_LOCATION",
"android.permission.READ_EXTERNAL_STORAGE",
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.ACCESS_COARSE_LOCATION"
);
@Rule
public ActivityTestRule<TestResult> mActivityTestRule = new ActivityTestRule<>(TestResult.class);
@Test
public void NIRTLabDigitOnly() {
onView(withId(R.id.NIRTLab))
.perform(typeText("123456789"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345678"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A12345")));
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("NIRT Lab Number must be alphanumeric")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void NIRTLabAlphabetOnly() {
onView(withId(R.id.NIRTLab))
.perform(typeText("ABCDEFGH"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345678"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A12345")));
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("NIRT Lab Number must be alphanumeric")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void NIRTLabInvalidChar() {
onView(withId(R.id.NIRTLab))
.perform(typeText("A1222"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345"), closeSoftKeyboard());
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("NIRT Lab Number must be 6 characters")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void SampleValidation() {
onView(withId(R.id.spinner_sample)).perform(scrollTo(), closeSoftKeyboard());
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
}
@Test
public void TubeValidation() {
onView(withId(R.id.spinner_validity)).perform(scrollTo(), closeSoftKeyboard());
onView(withId(R.id.spinner_validity)).perform(scrollTo(), click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(scrollTo(), click());
}
@Test
public void SPINTubeIdValidation(){
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345678"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A12345")));
}
@Test
public void LeaveSpinTubeId() {
onView(withId(R.id.NIRTLab))
.perform(typeText("A12345"), closeSoftKeyboard());
onView(withId(R.id.NIRTLab))
.check(matches(withText("A12345")));
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("Please fill all required fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void LeaveNirtLab() {
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345678"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A12345")));
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("Please fill all required fields")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
/*@Test
public void AllDataTest() {
onView(withId(R.id.NIRTLab))
.perform(typeText("A12345678"), closeSoftKeyboard());
onView(withId(R.id.NIRTLab))
.check(matches(withText("A12345")));
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345678"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A12345")));
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
}
*/
@Test
public void SpinTubeInvalidChar() {
onView(withId(R.id.NIRTLab))
.perform(typeText("A12345"), closeSoftKeyboard());
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A123"), closeSoftKeyboard());
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("Spin Tube ID must be 6 characters")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
public void SpinTubeDigitOnly() {
onView(withId(R.id.NIRTLab))
.perform(typeText("A12345678"), closeSoftKeyboard());
onView(withId(R.id.NIRTLab))
.check(matches(withText("A123456")));
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("123456"), closeSoftKeyboard());
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
onView(withText("Spin Tube ID must be alphanumeric")).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
public void SpinTubeNumericOnly() {
onView(withId(R.id.NIRTLab))
.perform(typeText("A12345678"), closeSoftKeyboard());
onView(withId(R.id.NIRTLab))
.check(matches(withText("A123456")));
ViewInteraction appCompatEditText2 = onView(
allOf(withId(R.id.SPINTubeID),
isDisplayed()));
appCompatEditText2.perform(scrollTo(), replaceText("A12345678"), closeSoftKeyboard());
appCompatEditText2.check(
matches(withText("A12345")));
onView(withId(R.id.spinner_sample)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Culture"))).perform(click());
onView(withId(R.id.spinner_validity)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Valid"))).perform(click());
ViewInteraction appCompatEditText3 = onView(
allOf(withId(R.id.startTest),
isDisplayed()));
appCompatEditText3.perform(scrollTo(), click());
}
/* onView(withId(R.id.))
.perform(typeText("123456789"), closeSoftKeyboard());
*/
/*onView(withId(R.id.spinner_gender)).perform(click());
Espresso.onData(allOf(is(instanceOf(String.class)), is("Female"))).perform(click());
*/
// Type text and then press the button.
// Check that the text was changed.
}

View File

@@ -0,0 +1,30 @@
package in.sminnovations.arrest_tb;
import android.os.IBinder;
import android.view.WindowManager;
import androidx.test.espresso.Root;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
public class ToastMatcher extends TypeSafeMatcher<Root> {
@Override
public void describeTo(Description description) {
description.appendText("is toast");
}
@Override
public boolean matchesSafely(Root root) {
int type = root.getWindowLayoutParams().get().type;
if ((type == WindowManager.LayoutParams.TYPE_TOAST)) {
IBinder windowToken = root.getDecorView().getWindowToken();
IBinder appToken = root.getDecorView().getApplicationWindowToken();
if (windowToken == appToken) {
return true;
}
}
return false;
}
}

View File

@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ShanMukhaInnovations.ArrestTB">
package="in.sminnovations.arrest_tb">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -9,11 +12,11 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
@@ -23,34 +26,73 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path" />
</provider>
<activity android:name=".Report">
</activity>
<activity android:name=".AddImage"></activity>
<activity android:name=".Camera_Guide"></activity>
<activity android:name=".About" />
<activity android:name=".Test_details" />
<activity android:name=".splash_screen">
<activity
android:name=".NegativeResults"
android:screenOrientation="portrait" />
<activity
android:name=".PositiveResult"
android:screenOrientation="portrait" />
<activity
android:name=".TestDetails"
android:screenOrientation="portrait" />
<activity
android:name=".Register"
android:screenOrientation="portrait" />
<activity
android:name=".ForgetPassword"
android:screenOrientation="portrait" />
<activity
android:name=".CreatePassword"
android:screenOrientation="portrait" />
<activity
android:name=".Home"
android:screenOrientation="portrait" />
<activity
android:name=".VerifyOTP.VerifyOtp"
android:screenOrientation="portrait" />
<activity
android:name=".ForgetPasswordReset"
android:screenOrientation="portrait" />
<activity
android:name=".VerifyOTP.VerifyOtpForgetPassword"
android:screenOrientation="portrait" />
<activity
android:name=".SplashScreen"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Patient_detail" >
</activity>
<activity android:name=".home" />
<activity android:name=".Navigation_Top" />
<activity android:name=".Login_Screen">
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".Report"
android:screenOrientation="portrait"></activity>
<activity
android:name=".NavigationTop"
android:screenOrientation="portrait" />
<activity
android:name=".LoginScreen"
android:screenOrientation="portrait" />
<activity
android:name=".AddImage"
android:screenOrientation="portrait" />
<activity
android:name=".CameraGuide"
android:screenOrientation="portrait" />
<activity
android:name=".About"
android:screenOrientation="portrait" />
<activity
android:name=".PatientDetail"
android:screenOrientation="portrait" />
<activity
android:name=".TestResult"
android:screenOrientation="portrait" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" />

View File

@@ -0,0 +1,2 @@
0 positive
1 negative

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -1,92 +0,0 @@
package com.ShanMukhaInnovations.ArrestTB;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.theartofdev.edmodo.cropper.CropImage;
import com.theartofdev.edmodo.cropper.CropImageView;
public class AddImage extends Navigation_Top {
de.hdodenhof.circleimageview.CircleImageView circle_image;
Button selection_image,report1;
private static final int PERMISSION_FILE=23;
String Data_report,patientid,patientdob,patientage,patientnikshayid;
@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_add_image, null, false);
draw.addView(contentView, 0);
// setContentView(R.layout.activity_add_image);
circle_image=findViewById(R.id.circle_image);
patientdob= getIntent().getStringExtra("dob_report");
patientid=getIntent().getStringExtra("id_report");
patientage=getIntent().getStringExtra("age_report");
patientnikshayid=getIntent().getStringExtra("nikshay_report");
report1=findViewById(R.id.report);
report1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(AddImage.this, Report.class);
startActivity(intent);
}
});
if(ContextCompat.checkSelfPermission(AddImage.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(AddImage.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},PERMISSION_FILE);
}
else
{
//startCropImageActivity();
CropImage.activity()
.setGuidelines(CropImageView.Guidelines.ON)
.setCropShape(CropImageView.CropShape.OVAL)
.start(AddImage.this);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, 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 resultUri = result.getUri();
circle_image.setImageURI(resultUri);
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
Exception error = result.getError();
}
}
}
}

View File

@@ -1,70 +0,0 @@
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, home.class);
startActivity(intent);
} else {
Toast.makeText(Login_Screen.this, "Invalid Credentials ", Toast.LENGTH_SHORT).show();
}
}
});
}
}

View File

@@ -1,159 +0,0 @@
package com.ShanMukhaInnovations.ArrestTB;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import java.util.Calendar;
public class Patient_detail extends Navigation_Top implements AdapterView.OnItemSelectedListener {
private Button next_act;
private DatePickerDialog.OnDateSetListener mDateSetListener;
String patientid,patientdob,patientage,patientnikshayid;
String gender;
private EditText mDisplayDate,patient_ID,Age,NikshayId;
@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_detail, null, false);
draw.addView(contentView, 0);
Spinner Spinner_gender = findViewById(R.id.spinner_gender);
mDisplayDate=findViewById(R.id.dob);
patient_ID=findViewById(R.id.patientid);
Age=findViewById(R.id.age);
NikshayId=findViewById(R.id.NikshayID);
/* patient_ID.addTextChangedListener(loginTextWatcher);
Age.addTextChangedListener(loginTextWatcher);
NikshayId.addTextChangedListener(loginTextWatcher);
*/
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.Gender, android.R.layout.simple_spinner_item);
mDisplayDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mDisplayDate.setEnabled(true);
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dialog = new DatePickerDialog(
Patient_detail.this,
android.R.style.Theme_Holo_Light_Dialog_MinWidth,
mDateSetListener,
year,month,day);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
});
mDateSetListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int year, int month, int day) {
month = month + 1;
String date = month + "/" + day + "/" + year;
mDisplayDate.setText(date);
patientdob=date;
}
};
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
Spinner_gender.setAdapter(adapter);
Spinner_gender.setOnItemSelectedListener(this);
// setContentView(R.layout.activity_patient_detail);
next_act=findViewById(R.id.next);
next_act.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
patientid = patient_ID.getText().toString();
patientage = Age.getText().toString();
patientnikshayid = NikshayId.getText().toString();
if (patientid.equals("") || patientage.equals("") || patientnikshayid.equals("")) {
Toast.makeText(Patient_detail.this, "Please fill all fields", Toast.LENGTH_SHORT).show();
} else {
SharedPreferences preferences = getSharedPreferences("PhoneBook", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
// editor.putString(Name, phonenum);
editor.putString("gender", gender);
editor.putString("patientid", patientid);
editor.putString("patientage", patientage);
editor.putString("patientnikshayid", patientnikshayid);
editor.putString("dob", patientdob);
editor.commit();
Intent intent = new Intent(Patient_detail.this, Test_details.class);
startActivity(intent);
}
}
});
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(parent.getId() == R.id.spinner_gender)
{
gender = parent.getItemAtPosition(position).toString();
//do this
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
/*private TextWatcher loginTextWatcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
next_act.setEnabled(!patientid.isEmpty() && !patientage.isEmpty() && !patientnikshayid.isEmpty());
}
@Override
public void afterTextChanged(Editable s) {
}
};*/
}

View File

@@ -1,27 +0,0 @@
package com.ShanMukhaInnovations.ArrestTB;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class splash_screen extends AppCompatActivity {
private static int SPLASH_TIME_OUT=3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent home = new Intent(splash_screen.this, Login_Screen.class);
startActivity(home);
finish();
}
}, SPLASH_TIME_OUT);
}
}

View File

@@ -1,19 +1,17 @@
package com.ShanMukhaInnovations.ArrestTB;
package in.sminnovations.arrest_tb;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
public class About extends Navigation_Top {
public class About extends NavigationTop {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
.getSystemService(LAYOUT_INFLATER_SERVICE);
View contentView = inflater.inflate(R.layout.activity_about, null, false);
draw.addView(contentView, 0);

View File

@@ -0,0 +1,497 @@
package in.sminnovations.arrest_tb;
import android.Manifest;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.google.android.gms.tasks.Continuation;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.DatabaseReference;
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.theartofdev.edmodo.cropper.CropImage;
import com.theartofdev.edmodo.cropper.CropImageView;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import de.hdodenhof.circleimageview.CircleImageView;
public class AddImage extends NavigationTop {
String string1,string2,string3,string4,string5,string6,string7,string8,string9,number,logi,lati;
private Button nosave;
String address;
CircleImageView circle_image;
Button report1;
private Uri ImageUri1;
private String TestRandomKey, downloadImageUrl1,saveCurrentDate, saveCurrentTime;
private StorageReference TestImagesRef;
private DatabaseReference TestRef;
private ProgressDialog loadingBar;
int j=0;
private static final int PERMISSION_FILE=23;
String patientid,patientdob,patientage,patientnikshayid;
private static final String MODEL_PATH = "model.tflite";
private static final String LABEL_PATH = "labels.txt";
private static final int INPUT_SIZE = 224;
String testdta;
TextView text;
private Classifier classifier;
private Executor executor = Executors.newSingleThreadExecutor();
@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_add_image, null, false);
draw.addView(contentView, 0);
SharedPreferences preferences6 = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
number = preferences6.getString("Phone", null);
Log.e("main", "error "+number);
TestImagesRef = FirebaseStorage.getInstance().getReference().child("Test_Images");
TestRef = FirebaseDatabase.getInstance().getReference().child("Test_Data").child(number);
loadingBar = new ProgressDialog(this);
// setContentView(R.layout.activity_add_image);
circle_image=findViewById(R.id.circle_image);
patientdob= getIntent().getStringExtra("dob_report");
patientid=getIntent().getStringExtra("id_report");
patientage=getIntent().getStringExtra("age_report");
patientnikshayid=getIntent().getStringExtra("nikshay_report");
report1=findViewById(R.id.report);
text=findViewById(R.id.selection_image);
SharedPreferences preferences=getSharedPreferences("PhoneBook",MODE_PRIVATE);
string1 = preferences.getString("gender", null);
string2 = preferences.getString("patientid", null);
string3 = preferences.getString("patientage", null);
string4 = preferences.getString("patientnikshayid", null);
string5 = preferences.getString("dob", null);
lati=preferences.getString("latitude", null);
logi=preferences.getString("longitude", null);
address="latitude "+lati+" longitude "+logi;
Log.e("main", "error "+address);
if (string5== null ) {
string5="-";
}
SharedPreferences preferences1=getSharedPreferences("PhoneBook1",MODE_PRIVATE);
string6 = preferences1.getString("NIRTLabde", null);
string7 = preferences1.getString("SPINTubeIDde", null);
string8 = preferences1.getString("sample", null);
string9 = preferences1.getString("validity", null);
SharedPreferences preferences3=getSharedPreferences("PhoneBook1",MODE_PRIVATE);
string6 = preferences1.getString("NIRTLabde", null);
string7 = preferences1.getString("SPINTubeIDde", null);
string8 = preferences1.getString("sample", null);
string9 = preferences1.getString("validity", null);
SharedPreferences preferences4=getSharedPreferences("PhoneBook3",MODE_PRIVATE);
// string10 = preferences4.getString("uri", null);
// Log.e("main", "error "+resulturiset);
Log.e("main", "error "+ImageUri1);
Log.e("main", "string10 "+ImageUri1);
report1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ValidateProductData();
/* Intent intent = new Intent(AddImage.this, Report.class);
startActivity(intent);*/
}
});
if(ContextCompat.checkSelfPermission(AddImage.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(AddImage.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},PERMISSION_FILE);
}
else
{
//startCropImageActivity();
CropImage.activity()
.setGuidelines(CropImageView.Guidelines.ON)
.setCropShape(CropImageView.CropShape.OVAL)
.start(AddImage.this);
}
initTensorFlowAndLoadModel();
}
@Override
protected void onDestroy() {
super.onDestroy();
executor.execute(new Runnable() {
@Override
public void run() {
classifier.close();
}
});
}
private void initTensorFlowAndLoadModel() {
executor.execute(new Runnable() {
@Override
public void run() {
try {
classifier = TensorFlowImageClassifier.create(
getAssets(),
MODEL_PATH,
LABEL_PATH,
INPUT_SIZE);
} catch (final Exception e) {
throw new RuntimeException("Error initializing TensorFlow!", e);
}
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, 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 resultUri = result.getUri();
ImageUri1=resultUri;
// String message = data.getStringExtra("message");
// resulturiset.equals(resultUri.toString());
data.putExtra("uri",resultUri.toString());//Put Message to pass over intent
SharedPreferences preferences = getSharedPreferences("PhoneBook3", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
// editor.putString(Name, phonenum);
editor.putString("uri", resultUri.toString());
editor.commit();
Log.e("main", "error "+resultUri);
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), resultUri);
bitmap = Bitmap.createScaledBitmap(bitmap, INPUT_SIZE, INPUT_SIZE, false);
circle_image.setImageBitmap(bitmap);
final List<Classifier.Recognition> results = classifier.recognizeImage(bitmap);
text.setText(results.toString());
testdta=results.toString();
testdta=testdta.replaceAll("[^a-zA-Z]","");
} catch (IOException e) {
e.printStackTrace();
}
// circle_image.setImageURI(resultUri);
} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
Exception error = result.getError();
}
}
nosave=findViewById(R.id.report2);
nosave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(AddImage.this, Report.class);
loadingBar.dismiss();
SharedPreferences preferences9=getSharedPreferences("PhoneBook_number7",MODE_PRIVATE);
SharedPreferences.Editor editor2=preferences9.edit();
// editor.putString(Name, phonenum);
editor2.putString("result",testdta);
editor2.commit();
startActivity(intent);
j=1;
}
});
}
private void ValidateProductData()
{
if (!isOnline()) {
//Create an alertdialog
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(AddImage.this);
Checkbuilder.setTitle("No Internet Connection !");
Checkbuilder.setMessage("Check Your Internet Connection.");
//Builder Retry Button
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
AlertDialog alert = Checkbuilder.create();
alert.show();
}
else {
StoreProductInformation();
}
}
private void StoreProductInformation()
{
loadingBar.setTitle("Add Test");
loadingBar.setMessage("Please wait while we are adding the Test Details .");
loadingBar.setCanceledOnTouchOutside(false);
loadingBar.show();
Calendar calendar = Calendar.getInstance();
SimpleDateFormat currentDate = new SimpleDateFormat("MMM dd, yyyy");
saveCurrentDate = currentDate.format(calendar.getTime());
saveCurrentDate = saveCurrentDate .replaceAll("[^A-Za-z0-9 ]","");
SimpleDateFormat currentTime = new SimpleDateFormat("h:mm a");
saveCurrentTime = currentTime.format(calendar.getTime());
TestRandomKey = saveCurrentDate + saveCurrentTime+number;
TestRandomKey = TestRandomKey .replaceAll("[^A-Za-z0-9 ]","");
final StorageReference filePath1 =TestImagesRef.child(ImageUri1.getLastPathSegment() + TestRandomKey + ".jpg");
final UploadTask uploadTask1 = filePath1.putFile(ImageUri1);
uploadTask1.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e)
{
String message = e.toString();
Toast.makeText(AddImage.this, "Error: " + message, Toast.LENGTH_SHORT).show();
loadingBar.dismiss();
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
{
// Toast.makeText(Farmer_add_new_Products.this, "Product Image uploaded Successfully...", Toast.LENGTH_SHORT).show();
Task<Uri> urlTask = uploadTask1.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception
{
if (!task.isSuccessful())
{
throw task.getException();
}
downloadImageUrl1= filePath1.getDownloadUrl().toString();
return filePath1.getDownloadUrl();
}
}).addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task)
{
if (task.isSuccessful()) {
downloadImageUrl1 = task.getResult().toString();
if (!isOnline()) {
//Create an alertdialog
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(AddImage.this);
Checkbuilder.setTitle("No Internet Connection !");
Checkbuilder.setMessage("Check Your Internet Connection.");
//Builder Retry Button
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
AlertDialog alert = Checkbuilder.create();
alert.show();
} else {
SaveProductInfoToDatabase();
}
}
}
});
}
});
}
private void SaveProductInfoToDatabase()
{
HashMap<String, Object> productMap = new HashMap<>();
productMap.put("Primary_Key",TestRandomKey);
productMap.put("Time", saveCurrentTime);
productMap.put("Image", downloadImageUrl1);
productMap.put("Result",testdta);
productMap.put("Gender", string1);
productMap.put("Patient_Id", string2.toLowerCase());
productMap.put("Patient_Age", string3);
productMap.put("Lab_Number", string6);
productMap.put("SPIN_Tube_ID", string7);
productMap.put("Sample_Type", string8);
productMap.put("Tube_Validity", string9);
productMap.put("National_Id", string4);
productMap.put("Dob", string5);
productMap.put("sdate",saveCurrentDate );
productMap.put("address",address );
TestRef.child(TestRandomKey).updateChildren(productMap)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task)
{
if (task.isSuccessful()) {
Intent intent = new Intent(AddImage.this, Report.class);
loadingBar.dismiss();
Toast.makeText(AddImage.this, "Test Details is added successfully ", Toast.LENGTH_SHORT).show();
SharedPreferences preferences9=getSharedPreferences("PhoneBook_number7",MODE_PRIVATE);
SharedPreferences.Editor editor2=preferences9.edit();
// editor.putString(Name, phonenum);
editor2.putString("result",testdta);
editor2.commit();
startActivity(intent);
j=1;
}
else
{
loadingBar.dismiss();
String message = task.getException().toString();
Toast.makeText(AddImage.this, "Error: " + message, Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
public void onBackPressed() {
Intent intent = new Intent(AddImage.this, TestResult.class);
startActivity(intent);
}
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
}

View File

@@ -1,23 +1,18 @@
package com.ShanMukhaInnovations.ArrestTB;
package in.sminnovations.arrest_tb;
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.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
public class Camera_Guide extends AppCompatActivity {
private Button Intro,report1;
String Data_report,patientid,patientgender,patientdob,patientage,patientnikshayid;
import androidx.appcompat.app.AppCompatActivity;
public class CameraGuide extends AppCompatActivity {
private Button Intro;
@Override
@@ -37,7 +32,7 @@ public class Camera_Guide extends AppCompatActivity {
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(),AddImage.class );
Intent intent = new Intent(getApplicationContext(), AddImage.class );
startActivity(intent);
savePrefsData();

View File

@@ -0,0 +1,61 @@
package in.sminnovations.arrest_tb;
import android.graphics.Bitmap;
import java.util.List;
public interface Classifier {
class Recognition {
private final String id;
private final String title;
private final Float confidence;
public Recognition(
final String id, final String title, final Float confidence) {
this.id = id;
this.title = title;
this.confidence = confidence;
}
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public Float getConfidence() {
return confidence;
}
@Override
public String toString() {
String resultString = "";
if (id != null) {
resultString += "[" + id + "] ";
}
if (title != null) {
resultString += title + " ";
}
if (confidence != null) {
resultString += String.format("(%.1f%%) ", confidence * 100.0f);
}
return resultString.trim();
}
}
List<Recognition> recognizeImage(Bitmap bitmap);
void close();
}

View File

@@ -0,0 +1,109 @@
package in.sminnovations.arrest_tb;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import in.sminnovations.arrest_tb.Model.RegisterHelper;
public class CreatePassword extends AppCompatActivity {
private Button next;
String name,phonenumber,num1,num2;
private EditText passworddata;
private EditText ConfirmPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create__password);
passworddata=findViewById(R.id.password);
ConfirmPassword=findViewById(R.id.confirmpassword);
next=findViewById(R.id.next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
num1 = ConfirmPassword.getText().toString();
num2 = passworddata.getText().toString();
if (!isOnline()) {
//Create an alertdialog
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(CreatePassword.this);
Checkbuilder.setTitle("No Internet Connection !");
Checkbuilder.setMessage("Check Your Internet Connection.");
//Builder Retry Button
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
AlertDialog alert = Checkbuilder.create();
alert.show();
} else {
if (num1.equals(num2)) {
Intent intent = new Intent(CreatePassword.this, LoginScreen.class);
name = getIntent().getStringExtra("username");
String phonenumberk = getIntent().getStringExtra("mobile");
phonenumber = phonenumberk;
FirebaseDatabase rootNode = FirebaseDatabase.getInstance();
DatabaseReference reference = rootNode.getReference("USERS");
RegisterHelper addNewUser = new RegisterHelper(name, phonenumber, num1);
reference.child(phonenumber).setValue(addNewUser);
intent.putExtra("mobile", phonenumber);
intent.putExtra("username", name);
Toast.makeText(CreatePassword.this, "You are Registered Successfully ", Toast.LENGTH_SHORT).show();
startActivity(intent);
} else {
ConfirmPassword.setError("Password does not match");
}
}
}
});
}
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
}

View File

@@ -1,4 +1,4 @@
package com.ShanMukhaInnovations.ArrestTB;
package in.sminnovations.arrest_tb;
import android.content.Context;

View File

@@ -0,0 +1,259 @@
package in.sminnovations.arrest_tb;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.chaos.view.PinView;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskExecutors;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthProvider;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import com.hbb20.CountryCodePicker;
import java.util.concurrent.TimeUnit;
import in.sminnovations.arrest_tb.VerifyOTP.VerifyOtpForgetPassword;
public class ForgetPassword extends AppCompatActivity {
private String verificationid;
private FirebaseAuth mAuth;
private int code = 91;
private Button nextactivity;
private ProgressBar progressBar;
CountryCodePicker ccp;
PinView pinFromUser;
String mobile;
private EditText editTextnumber;
String codeBySystem;
boolean exists;
String address,name, state , city ,pincode,phonenumber,password2,num1,phonenum;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forget__password);
editTextnumber=findViewById(R.id.editTextMobile);
ccp=findViewById(R.id.ccp);
ccp.registerCarrierNumberEditText(editTextnumber);
// nextactivity = findViewById(R.id.buttonSignIn);
mAuth = FirebaseAuth.getInstance();
findViewById(R.id.buttonSignIn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!isOnline()) {
//Create an alertdialog
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(ForgetPassword.this);
Checkbuilder.setTitle("No Internet Connection !");
Checkbuilder.setMessage("Check Your Internet Connection.");
//Builder Retry Button
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
/* //Restart The Activity
Intent intent = getIntent();
finish();
startActivity(intent);*/
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
AlertDialog alert = Checkbuilder.create();
alert.show();
} else {
mobile = editTextnumber.getText().toString().trim();
mobile = mobile.replaceAll("[^0-9]", "");
phonenum = ccp.getFullNumberWithPlus();
if(mobile.equals(""))
{
editTextnumber.setError("Enter the contact number");
}
Query chekuser = FirebaseDatabase.getInstance().getReference("USERS").orderByChild("number").equalTo(mobile);
chekuser.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
Intent intent = new Intent(ForgetPassword.this, VerifyOtpForgetPassword.class);
Toast.makeText(ForgetPassword.this, "We Have Sent the OTP to your mentioned Number", Toast.LENGTH_SHORT).show();
intent.putExtra("mobilecode", phonenum);
intent.putExtra("mobile", mobile);
startActivity(intent);
} else {
// Toast.makeText(ForgetPassword.this,phonenum,Toast.LENGTH_SHORT).show();
editTextnumber.setError("No Such User Exists");
// Toast.makeText(ForgetPassword.this,"NO such user exists",Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Log.e("Raman", "Received an exception check chexk " + databaseError.getMessage());
// Toast.makeText(ForgetPassword.this,databaseError.getMessage(),Toast.LENGTH_SHORT).show();
}
});
}
}
});
}
private void verifyCode(String code){
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationid, code);
signInWithCredential(credential);
}
private void signInWithCredential(PhoneAuthCredential credential) {
mAuth.signInWithCredential(credential)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Intent intent = new Intent(ForgetPassword.this, ForgetPasswordReset.class);
intent.putExtra("mobile", mobile);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
} else {
Toast.makeText(ForgetPassword.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
private void sendVerificationCode(String number){
PhoneAuthProvider.getInstance().verifyPhoneNumber(
number,
60,
TimeUnit.SECONDS,
(Activity) TaskExecutors.MAIN_THREAD,
mCallBack
);
}
private PhoneAuthProvider.OnVerificationStateChangedCallbacks
mCallBack = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
verificationid = s;
}
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
String code = phoneAuthCredential.getSmsCode();
if (code != null){
progressBar.setVisibility(View.VISIBLE);
pinFromUser.setText(code);
verifyCode(code);
}
}
@Override
public void onVerificationFailed(FirebaseException e) {
Toast.makeText(ForgetPassword.this, e.getMessage(),Toast.LENGTH_LONG).show();
}
};
private void checkuserexist(String number)
{
Query chekuser= FirebaseDatabase.getInstance().getReference("USERS").orderByChild("number").equalTo(number);
chekuser.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if(dataSnapshot.exists())
{
exists= true;
}
else
{
exists=false;
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Toast.makeText(ForgetPassword.this,databaseError.getMessage(),Toast.LENGTH_SHORT).show();
}
});
}
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
}

View File

@@ -0,0 +1,68 @@
package in.sminnovations.arrest_tb;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.hbb20.CountryCodePicker;
public class ForgetPasswordReset extends AppCompatActivity {
private Button next;
String phonenumber,num1,num2;
private EditText passworddata;
private EditText ConfirmPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create__password);
passworddata=findViewById(R.id.password);
ConfirmPassword=findViewById(R.id.confirmpassword);
next=findViewById(R.id.next);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
num1 = ConfirmPassword.getText().toString();
num2=passworddata.getText().toString();
if(num1.equals(num2)) {
Intent intent = new Intent(ForgetPasswordReset.this, LoginScreen.class);
String phonenumberk = getIntent().getStringExtra("mobile");
phonenumber = phonenumberk;
FirebaseDatabase rootNode = FirebaseDatabase.getInstance();
DatabaseReference reference = rootNode.getReference("USERS");
reference.child(phonenumber).child("password").setValue(num1);
Toast.makeText(ForgetPasswordReset.this, "Password Reset Successfully ", Toast.LENGTH_SHORT).show();
startActivity(intent);
}
else
{
ConfirmPassword.setError("Password does not match");
}
}
});
}
}

View File

@@ -0,0 +1,219 @@
package in.sminnovations.arrest_tb;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.IBinder;
import android.provider.Settings;
import android.util.Log;
import androidx.core.app.ActivityCompat;
class GpsTracker extends Service implements LocationListener {
private final Context mContext;
// flag for GPS status
boolean isGPSEnabled = false;
// flag for network status
boolean isNetworkEnabled = false;
// flag for GPS status
boolean canGetLocation = false;
Location location; // location
double latitude; // latitude
double longitude; // longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
// Declaring a Location Manager
protected LocationManager locationManager;
public GpsTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);
// getting GPS status
isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
// getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// no network provider is enabled
} else {
this.canGetLocation = true;
// First get location from Network Provider
if (isNetworkEnabled) {
//check the network permission
if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions((Activity) mContext, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 101);
}
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
// if GPS Enabled get lat/long using GPS Services
if (isGPSEnabled) {
if (location == null) {
//check the network permission
if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions((Activity) mContext, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 101);
}
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("GPS Enabled", "GPS Enabled");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app
* */
public void stopUsingGPS(){
if(locationManager != null){
locationManager.removeUpdates(GpsTracker.this);
}
}
/**
* Function to get latitude
* */
public double getLatitude(){
if(location != null){
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
* */
public double getLongitude(){
if(location != null){
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/wifi enabled
* @return boolean
* */
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog
* On pressing Settings button will lauch Settings Options
* */
public void showSettingsAlert(){
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("GPS is settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
// On pressing Settings button
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// on pressing cancel button
alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alertDialog.show();
}
@Override
public void onLocationChanged(Location location) {
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public IBinder onBind(Intent arg0) {
return null;
}
}

View File

@@ -1,21 +1,19 @@
package com.ShanMukhaInnovations.ArrestTB;
package in.sminnovations.arrest_tb;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
public class home extends Navigation_Top {
public class Home extends NavigationTop {
private Button add_patient,about;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
.getSystemService(LAYOUT_INFLATER_SERVICE);
View contentView = inflater.inflate(R.layout.activity_home, null, false);
draw.addView(contentView, 0);
add_patient=findViewById(R.id.register_user);
@@ -23,19 +21,18 @@ private Button add_patient,about;
add_patient.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent (home.this,Patient_detail.class);
Intent intent=new Intent (Home.this, PatientDetail.class);
startActivity(intent);
}
});
about.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent (home.this,About.class);
Intent intent=new Intent (Home.this, About.class);
startActivity(intent);
}
});
//setContentView(R.layout.activity_home);
}
}

View File

@@ -0,0 +1,9 @@
package in.sminnovations.arrest_tb.Interface;
import android.view.View;
public interface ItemClickListner
{
void onClick(View view, int position, boolean isLongClick);
}

View File

@@ -0,0 +1,245 @@
package in.sminnovations.arrest_tb;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatCheckBox;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
public class LoginScreen extends AppCompatActivity {
private TextView createaccount, forgetpassword;
private Button login;
private DatabaseReference databaseReference;
private EditText phonenumber, password;
String passworddata, phonenum, phonenumbers, name;
private ProgressDialog loadingBar;
public static final String Name = "nameKey";
public static final String Phone = "phoneKey";
private ImageButton close;
private AppCompatCheckBox checkbox;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login__screen);
createaccount = findViewById(R.id.createaccount);
phonenumber = findViewById(R.id.contactnumber);
checkbox = (AppCompatCheckBox) findViewById(R.id.showpassword);
password = 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());
}
}
});
// Paper.init(this);
loadingBar = new ProgressDialog(this);
// Paper.init(this);
login = findViewById(R.id.login);
forgetpassword = findViewById(R.id.forgetpassword);
forgetpassword.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(LoginScreen.this, ForgetPassword.class);
startActivity(intent);
}
});
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!isOnline()) {
//Create an alertdialog
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(LoginScreen.this);
Checkbuilder.setTitle("No Internet Connection !");
Checkbuilder.setMessage("Check Your Internet Connection.");
//Builder Retry Button
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
AlertDialog alert = Checkbuilder.create();
alert.show();
} else {
String mobile = phonenumber.getText().toString().trim();
phonenum = mobile;
final String passwordj = password.getText().toString().trim();
if (mobile.equals("") || passwordj.equals("")) {
Toast.makeText(LoginScreen.this, "Please enter all the required fields", Toast.LENGTH_SHORT).show();
} else if (!Patterns.PHONE.matcher(mobile).matches()) {
phonenumber.setError("Enter a valid number");
} else {
loadingBar.setTitle("Login Account");
loadingBar.setMessage("Please wait, while we are checking the credentials.");
loadingBar.setCanceledOnTouchOutside(false);
loadingBar.show();
Query chekuser = FirebaseDatabase.getInstance().getReference("USERS").orderByChild("number").equalTo(phonenum);
chekuser.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
String systempassword = dataSnapshot.child(phonenum).child("password").getValue(String.class);
if (systempassword.equals(passwordj)) {
Toast.makeText(LoginScreen.this, "logged in Successfully...", Toast.LENGTH_SHORT).show();
loadingBar.dismiss();
String name = dataSnapshot.child(phonenum).child("name").getValue(String.class);
SharedPreferences preferences = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
// editor.putString(Name, phonenum);
editor.putString("Phone", phonenum);
editor.putString("Name", name);
editor.commit();
Intent intent = new Intent(LoginScreen.this, MainActivity.class);
intent.putExtra("mobile", phonenum);
startActivity(intent);
} else {
loadingBar.dismiss();
Toast.makeText(LoginScreen.this, "Wrong Password", Toast.LENGTH_SHORT).show();
}
} else {
loadingBar.dismiss();
Toast.makeText(LoginScreen.this, "No such user exists", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Toast.makeText(LoginScreen.this, databaseError.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
}
});
createaccount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(LoginScreen.this, Register.class);
startActivity(intent);
}
});
}
private void finishQuiz() {
if (!isOnline()) {
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(LoginScreen.this);
Checkbuilder.setTitle("Error!");
Checkbuilder.setMessage("Enable your internet connection and Retry ");
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
}
);
AlertDialog alert = Checkbuilder.create();
alert.show();
}
}
@Override
public void onBackPressed() {
finishAffinity();
finish();
}
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
}

View File

@@ -0,0 +1,326 @@
package in.sminnovations.arrest_tb;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SearchView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.firebase.ui.database.FirebaseRecyclerOptions;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import in.sminnovations.arrest_tb.Model.Tests;
public class MainActivity extends NavigationTop {
private DatabaseReference TestRef;
private RecyclerView recyclerView;
private TextView info;
FloatingActionButton fasbs;
String number;
@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_main, null, false);
draw.addView(contentView, 0);
SharedPreferences preferences6 = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
number = preferences6.getString("Phone", null);
fasbs=findViewById(R.id.fab);
info=findViewById(R.id.info);
info.setVisibility(View.VISIBLE);
Log.e("main", "error "+number);
TestRef = FirebaseDatabase.getInstance().getReference().child("Test_Data").child(number);
recyclerView = findViewById(R.id.recycler_view);
fasbs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, PatientDetail.class);
startActivity(intent);
}
});
LinearLayoutManager layoutManager1=new LinearLayoutManager(this);
recyclerView.setLayoutManager(new GridLayoutManager(this, 1));
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels / 8;
int spaceInPixel = 4;
recyclerView.addItemDecoration(new SpaceDecoration(spaceInPixel));
}
@Override
protected void onStart()
{
super.onStart();
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(TestRef, Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull TestViewHolder holder, int position, @NonNull final Tests model)
{
if(model.getResult().contains("positive") || model.getResult().contains("negative"))
{
info.setVisibility(View.INVISIBLE);
}
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("Sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
if(model.getResult().contains("positive") )
{
holder.iconfinder.setBackgroundResource(R.drawable.green_circle);
holder.iconfinder.setText("P");
Log.e("main", "error id"+model.getPrimary_Key());
}
//holder.txtProductDescription.setText(model.getSample());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, TestDetails.class);
Log.e("main", "error id"+model.getPrimary_Key());
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
private void firebasesearch(String data)
{
{
Query firebaseSearchQuery = TestRef.orderByChild("Patient_Id").startAt(data).endAt(data + "\uf8ff");
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(firebaseSearchQuery, Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull final TestViewHolder holder, int position, @NonNull final Tests model)
{
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("Sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
if(model.getPatient_Id().isEmpty())
{
info.setVisibility(View.VISIBLE);
}
if(model.getResult().contains("positive"))
{
holder.iconfinder.setBackgroundResource(R.drawable.green_circle);
holder.iconfinder.setText("P");
Log.e("main", "error vvvvv id"+model.getSdate());
Log.e("main", "error id"+model.getPrimary_Key());
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("LOGCAT", "" + model.getPrimary_Key());
Intent intent=new Intent(MainActivity.this, TestDetails.class);
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
}
private void searchfilter(String data)
{
{
Query firebaseSearchQuery = TestRef.orderByChild("sample").startAt(data).endAt(data + "\uf8ff");
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(firebaseSearchQuery, Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull TestViewHolder holder, int position, @NonNull final Tests model)
{
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("Sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
if(model.getResult().contains("positive"))
{
holder.iconfinder.setBackgroundResource(R.drawable.green_circle);
holder.iconfinder.setText("P");
Log.e("main", "error id"+model.getPrimary_Key());
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, TestDetails.class);
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater=getMenuInflater();
inflater.inflate(R.menu.searchmenu,menu);
MenuItem item = menu.findItem(R.id.search);
SearchView searchView = (SearchView) item.getActionView();
//searchView.setIconified(false);
//searchView.setIconifiedByDefault(false);
searchView.setQueryHint("Search Patient ID");
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
query=query.toLowerCase();
firebasesearch(query);
// processsearch(query);
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
newText=newText.toLowerCase();
firebasesearch(newText);
// processsearch(query);
return false;
}
});
return super.onCreateOptionsMenu(menu);
}
private BottomNavigationView.OnNavigationItemSelectedListener navListener =
new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId())
{
case R.id.nav_home:
Intent intent=new Intent(MainActivity.this, MainActivity.class);
startActivity(intent);
break;
}
return true;
}
};
@Override
public void onBackPressed() {
finishAffinity();
finish();
}
}

View File

@@ -0,0 +1,39 @@
package in.sminnovations.arrest_tb.Model;
public class RegisterHelper {
String name, number, password;
public RegisterHelper(String name, String number, String password) {
this.name = name;
this.number = number;
this.password = password;
}
public RegisterHelper() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

View File

@@ -0,0 +1,160 @@
package in.sminnovations.arrest_tb.Model;
public class Tests {
private String Lab_Number, SPIN_Tube_ID, Dob, Gender, Image, Patient_Age, Patient_Id, National_Id, Primary_Key, Sample_Type, Tube_Validity, date, Time, Result,sdate ,address;
public Tests() {
}
public Tests(String lab_Number, String SPIN_Tube_ID, String dob, String gender, String image, String patient_Age, String patient_Id, String national_Id, String primary_Key, String sample_Type, String tube_Validity, String date, String time, String result, String sdate, String address) {
Lab_Number = lab_Number;
this.SPIN_Tube_ID = SPIN_Tube_ID;
Dob = dob;
Gender = gender;
Image = image;
Patient_Age = patient_Age;
Patient_Id = patient_Id;
National_Id = national_Id;
Primary_Key = primary_Key;
Sample_Type = sample_Type;
Tube_Validity = tube_Validity;
this.date = date;
Time = time;
Result = result;
this.sdate = sdate;
this.address = address;
}
public String getLab_Number() {
return Lab_Number;
}
public void setLab_Number(String lab_Number) {
Lab_Number = lab_Number;
}
public String getSPIN_Tube_ID() {
return SPIN_Tube_ID;
}
public void setSPIN_Tube_ID(String SPIN_Tube_ID) {
this.SPIN_Tube_ID = SPIN_Tube_ID;
}
public String getDob() {
return Dob;
}
public void setDob(String dob) {
Dob = dob;
}
public String getGender() {
return Gender;
}
public void setGender(String gender) {
Gender = gender;
}
public String getImage() {
return Image;
}
public void setImage(String image) {
Image = image;
}
public String getPatient_Age() {
return Patient_Age;
}
public void setPatient_Age(String patient_Age) {
Patient_Age = patient_Age;
}
public String getPatient_Id() {
return Patient_Id;
}
public void setPatient_Id(String patient_Id) {
Patient_Id = patient_Id;
}
public String getNational_Id() {
return National_Id;
}
public void setNational_Id(String national_Id) {
National_Id = national_Id;
}
public String getPrimary_Key() {
return Primary_Key;
}
public void setPrimary_Key(String primary_Key) {
Primary_Key = primary_Key;
}
public String getSample_Type() {
return Sample_Type;
}
public void setSample_Type(String sample_Type) {
Sample_Type = sample_Type;
}
public String getTube_Validity() {
return Tube_Validity;
}
public void setTube_Validity(String tube_Validity) {
Tube_Validity = tube_Validity;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getTime() {
return Time;
}
public void setTime(String time) {
Time = time;
}
public String getResult() {
return Result;
}
public void setResult(String result) {
Result = result;
}
public String getSdate() {
return sdate;
}
public void setSdate(String sdate) {
this.sdate = sdate;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}

View File

@@ -1,4 +1,4 @@
package com.ShanMukhaInnovations.ArrestTB;
package in.sminnovations.arrest_tb;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -18,7 +18,7 @@ import androidx.drawerlayout.widget.DrawerLayout;
import com.google.android.material.navigation.NavigationView;
public class Navigation_Top extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
public class NavigationTop extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
protected DrawerLayout draw;
private LinearLayout line;
@@ -28,14 +28,45 @@ public class Navigation_Top extends AppCompatActivity implements NavigationView.
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
switch (menuItem.getItemId())
{
case R.id.logout:
Intent intent=new Intent(this,Login_Screen.class);
startActivity(intent);
break;
case R.id.nav_contact_us:
Intent intent1=new Intent(this,About.class);
startActivity(intent1);
break;
case R.id.nav_home:
Intent intent2=new Intent(this, MainActivity.class);
startActivity(intent2);
break;
case R.id.nav_add_Test:
Intent intent3=new Intent(this, PatientDetail.class);
startActivity(intent3);
break;
case R.id.nav_results:
Intent intent6=new Intent(this, MainActivity.class);
startActivity(intent6);
break;
case R.id.nav_negative:
Intent intent4=new Intent(this, NegativeResults.class);
startActivity(intent4);
break;
case R.id.nav_positive:
Intent intent5=new Intent(this, PositiveResult.class);
startActivity(intent5);
break;
case R.id.nav_logout:
Intent intent8=new Intent(this, LoginScreen.class);
SharedPreferences preferences = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
// editor.putString(Name, phonenum);
editor.putString("Phone", null);
editor.putString("Name",null);
editor.commit();
startActivity(intent8);
break;
}
return true;
@@ -73,7 +104,15 @@ public class Navigation_Top extends AppCompatActivity implements NavigationView.
draw.addDrawerListener(toggle);
toggle.syncState();
View headerView = navigationView.getHeaderView(0);
TextView textView=headerView.findViewById(R.id.text);
TextView textView1=headerView.findViewById(R.id.not_sign_in);
SharedPreferences preferences=getSharedPreferences("PhoneBook_number",MODE_PRIVATE);
String string1 = preferences.getString("Phone", null);
String string2 = preferences.getString("Name", null);
textView.setText(string2);
textView1.setText(string1);
}
}

View File

@@ -0,0 +1,202 @@
package in.sminnovations.arrest_tb;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.firebase.ui.database.FirebaseRecyclerOptions;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import in.sminnovations.arrest_tb.Model.Tests;
public class NegativeResults extends NavigationTop {
private DatabaseReference TestRef;
private RecyclerView recyclerView;
private TextView info;
FloatingActionButton fasbs;
String number;
@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_main, null, false);
draw.addView(contentView, 0);
SharedPreferences preferences6 = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
number = preferences6.getString("Phone", null);
fasbs=findViewById(R.id.fab);
info=findViewById(R.id.info);
info.setText("Negative Test Results");
info.setVisibility(View.VISIBLE);
Log.e("main", "error "+number);
TestRef = FirebaseDatabase.getInstance().getReference().child("Test_Data").child(number);
recyclerView = findViewById(R.id.recycler_view);
DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
fasbs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(NegativeResults.this, PatientDetail.class);
startActivity(intent);
}
});
LinearLayoutManager layoutManager1=new LinearLayoutManager(this);
recyclerView.setLayoutManager(new GridLayoutManager(this, 1));
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels / 8;
int spaceInPixel = 4;
recyclerView.addItemDecoration(new SpaceDecoration(spaceInPixel));
}
@Override
protected void onStart()
{
super.onStart();
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(TestRef.orderByChild("Result").equalTo("negative"), Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull TestViewHolder holder, int position, @NonNull final Tests model)
{
// holder.txtProductName.setText(model.getPatientid());
if(model.getResult().contains("positive") || model.getResult().contains("negative"))
{
info.setVisibility(View.INVISIBLE);
}
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("Sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
Log.e("main", "error id"+model.getPrimary_Key());
//holder.txtProductDescription.setText(model.getSample());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(NegativeResults.this, TestDetails.class);
Log.e("main", "error id"+model.getPrimary_Key());
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
private void firebasesearch(String data)
{
{
Query firebaseSearchQuery = TestRef.orderByChild("Patient_Id").startAt(data).endAt(data + "\uf8ff") ;
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(firebaseSearchQuery, Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull final TestViewHolder holder, int position, @NonNull final Tests model)
{
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("Sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
holder.iconfinder.setBackgroundResource(R.drawable.green_circle);
holder.iconfinder.setText("P");
Log.e("main", "error id"+model.getPrimary_Key());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("LOGCAT", "" + model.getPrimary_Key());
Intent intent=new Intent(NegativeResults.this, TestDetails.class);
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
}
}

View File

@@ -0,0 +1,410 @@
package in.sminnovations.arrest_tb;
import android.Manifest;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.karumi.dexter.Dexter;
import com.karumi.dexter.MultiplePermissionsReport;
import com.karumi.dexter.PermissionToken;
import com.karumi.dexter.listener.PermissionRequest;
import com.karumi.dexter.listener.multi.MultiplePermissionsListener;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.Period;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
public class PatientDetail extends NavigationTop implements AdapterView.OnItemSelectedListener {
private Button next_act;
private DatePickerDialog.OnDateSetListener mDateSetListener;
String patientid,patientdob,patientage,patientnikshayid;
String gender;
private GpsTracker gpsTracker;
String lat,logi;
int diff1=0;
private EditText mDisplayDate,patient_ID,Age,NikshayId;
@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_detail, null, false);
draw.addView(contentView, 0);
Spinner Spinner_gender = findViewById(R.id.spinner_gender);
mDisplayDate=findViewById(R.id.dob);
patient_ID=findViewById(R.id.patientid);
Age=findViewById(R.id.age);
NikshayId=findViewById(R.id.NikshayID);
/*
mDisplayDate.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
if(mDisplayDate.getText()!=null)
{
Age.setText(String.valueOf(diff1));
}
}
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
if(mDisplayDate.getText()!=null)
{
Age.setText(String.valueOf(diff1));
}
}
public void onTextChanged(CharSequence s, int start,
int before, int count) {
if(mDisplayDate.getText()!=null)
{
Age.setText(String.valueOf(diff1));
}
}
});
*/
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.Gender, android.R.layout.simple_spinner_item);
mDisplayDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mDisplayDate.setEnabled(true);
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dialog = new DatePickerDialog(
PatientDetail.this,
android.R.style.Theme_Holo_Light_Dialog_MinWidth,
mDateSetListener,
year,month,day);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
});
mDateSetListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int year, int month, int day) {
month = month + 1;
String date = day + "-" + month + "-" + year;
mDisplayDate.setText(date);
patientdob=date;
/* int year1 = Calendar.getInstance().get(Calendar.YEAR);
Integer dateyear=year;
int diff=0;
if(dateyear!=0)
{
diff=year1-year;
diff1=diff;
}*/
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
Date date1 = null;
try {
date1 = formatter.parse(patientdob);
Instant instant = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
instant = date1.toInstant();
ZonedDateTime zone = instant.atZone(ZoneId.systemDefault());
LocalDate givenDate = zone.toLocalDate();
//Calculating the difference between given date to current date.
Period period = Period.between(givenDate, LocalDate.now());
diff1=period.getYears();
if(diff1>0 && diff1<=100) {
Age.setText(String.valueOf(diff1));
Age.setFocusable(false);
Age.setCursorVisible(false);
Age.setKeyListener(null);
}
if(diff1<=0 || diff1>100 ) {
Age.setText("");
Age.setFocusable(false);
Age.setCursorVisible(false);
Age.setKeyListener(null);
}
}
} catch (ParseException e) {
e.printStackTrace();
}
//Converting obtained Date object to LocalDate object
}
};
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
Spinner_gender.setAdapter(adapter);
Spinner_gender.setOnItemSelectedListener(this);
// setContentView(R.layout.activity_patient_detail);
next_act=findViewById(R.id.next);
next_act.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getLocation();
patientid = patient_ID.getText().toString();
patientage = Age.getText().toString();
patientnikshayid = NikshayId.getText().toString();
if (patientid.equals("") || patientage.equals("") ) {
Toast.makeText(PatientDetail.this, "Please fill all fields", Toast.LENGTH_SHORT).show();
}
else if (patientid.length()!=5 )
{
Toast.makeText(PatientDetail.this, "Patient Id must be 5 characters", Toast.LENGTH_SHORT).show();
}
else if (patientid.matches("^[a-zA-Z]*$") || patientid.matches("^[0-9]*$") )
{
Toast.makeText(PatientDetail.this, "Patient Id must be alphanumeric", Toast.LENGTH_SHORT).show();
}
/* else if ( patientagedigit>100)
{
Toast.makeText(PatientDetail.this, "Enter a valid Age", Toast.LENGTH_SHORT).show();
}*/
else if (diff1>100 && diff1<1)
{
Toast.makeText(PatientDetail.this, "Enter a valid Age", Toast.LENGTH_SHORT).show();
}
else if(Integer.parseInt(String.valueOf(Age.getText()))>100 || Integer.parseInt(String.valueOf(Age.getText()))<1) {
Toast.makeText(PatientDetail.this, "Enter a valid Age", Toast.LENGTH_SHORT).show();
}
else if ( patientnikshayid.length()<8 &&patientnikshayid.length()>=1 )
{
Toast.makeText(PatientDetail.this, "Nikshay Id must be 8 or 9 digit Number ", Toast.LENGTH_SHORT).show();
}
else if ( patientnikshayid.length()>9 &&patientnikshayid.length()>=1 )
{
Toast.makeText(PatientDetail.this, "Nikshay Id must be 8 or 9 digit Number ", Toast.LENGTH_SHORT).show();
}
else {
locationpermission();
getLocation();
SharedPreferences preferences = getSharedPreferences("PhoneBook", MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
// editor.putString(Name, phonenum);
editor.putString("gender", gender);
editor.putString("longitude", logi);
editor.putString("latitude", lat);
editor.putString("patientid", patientid);
editor.putString("patientage", patientage);
editor.putString("patientnikshayid", patientnikshayid);
editor.putString("dob", patientdob);
editor.commit();
Intent intent = new Intent(PatientDetail.this, TestResult.class);
startActivity(intent);
}
}
});
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(parent.getId() == R.id.spinner_gender)
{
gender = parent.getItemAtPosition(position).toString();
//do this
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
@Override
public void onBackPressed() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false);
builder.setMessage("Do you want to Exit ?");
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(PatientDetail.this, MainActivity.class);
finish();
startActivity(intent);
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
public void getLocation(){
gpsTracker = new GpsTracker(PatientDetail.this);
if(gpsTracker.canGetLocation()){
double latitude = gpsTracker.getLatitude();
lat=String.valueOf(latitude);
double longitude = gpsTracker.getLongitude();
logi=String.valueOf(longitude);
Log.e("main", "error "+latitude);
Log.e("main", "error "+longitude);
}else{
gpsTracker.showSettingsAlert();
}
}
private void locationpermission()
{
/* Dexter.withContext(this).withPermission(Manifest.permission.ACCESS_FINE_LOCATION).withListener(new PermissionListener() {
@Override
public void onPermissionGranted(PermissionGrantedResponse permissionGrantedResponse) {
getLocation();
}
@Override
public void onPermissionDenied(PermissionDeniedResponse permissionDeniedResponse) {
Intent intent=new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri =Uri.fromParts("package",getPackageName(),"");
intent.setData(uri);
startActivity(intent);
}
@Override
public void onPermissionRationaleShouldBeShown(PermissionRequest permissionRequest, PermissionToken permissionToken) {
permissionToken.continuePermissionRequest();
}
}).check();
*/
Dexter.withContext(this).withPermissions(Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION).withListener(new MultiplePermissionsListener() {
@Override
public void onPermissionsChecked(MultiplePermissionsReport multiplePermissionsReport) {
if(multiplePermissionsReport.areAllPermissionsGranted())
{
getLocation();
}
if(multiplePermissionsReport.isAnyPermissionPermanentlyDenied())
{
Intent intent=new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri =Uri.fromParts("package",getPackageName(),"");
intent.setData(uri);
startActivity(intent);
}
}
@Override
public void onPermissionRationaleShouldBeShown(List<PermissionRequest> list, PermissionToken permissionToken) {
permissionToken.continuePermissionRequest();
}
}).check();
}
}

View File

@@ -0,0 +1,206 @@
package in.sminnovations.arrest_tb;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.firebase.ui.database.FirebaseRecyclerOptions;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import in.sminnovations.arrest_tb.Model.Tests;
public class PositiveResult extends NavigationTop {
private DatabaseReference TestRef;
private RecyclerView recyclerView ;
FloatingActionButton fasbs;
private TextView info;
String number;
@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_main, null, false);
draw.addView(contentView, 0);
info=findViewById(R.id.info);
SharedPreferences preferences6 = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
info.setText("Positive Test Results");
info.setVisibility(View.VISIBLE);
number = preferences6.getString("Phone", null);
fasbs=findViewById(R.id.fab);
Log.e("main", "error "+number);
TestRef = FirebaseDatabase.getInstance().getReference().child("Test_Data").child(number);
recyclerView = findViewById(R.id.recycler_view);
fasbs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(PositiveResult.this, PatientDetail.class);
startActivity(intent);
}
});
LinearLayoutManager layoutManager1=new LinearLayoutManager(this);
/* layoutManager1.setOrientation(LinearLayoutManager.HORIZONTAL);
cA
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
*/ // recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new GridLayoutManager(this, 1));
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels / 8;
int spaceInPixel = 4;
recyclerView.addItemDecoration(new SpaceDecoration(spaceInPixel));
}
@Override
protected void onStart()
{
super.onStart();
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(TestRef.orderByChild("Result").equalTo("positive"), Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull TestViewHolder holder, int position, @NonNull final Tests model)
{
if(model.getResult().contains("positive") || model.getResult().contains("negative"))
{
info.setVisibility(View.INVISIBLE);
}
// holder.txtProductName.setText(model.getPatientid());
holder.iconfinder.setBackgroundResource(R.drawable.green_circle);
holder.iconfinder.setText("P");
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("Sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
Log.e("main", "error id"+model.getPrimary_Key());
//holder.txtProductDescription.setText(model.getSample());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(PositiveResult.this, TestDetails.class);
Log.e("main", "error id"+model.getPrimary_Key());
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
private void firebasesearch(String data)
{
{
Query firebaseSearchQuery = TestRef.orderByChild("Patient_Id").startAt(data).endAt(data + "\uf8ff") ;
FirebaseRecyclerOptions<Tests> options =
new FirebaseRecyclerOptions.Builder<Tests>()
.setQuery(firebaseSearchQuery, Tests.class)
.build();
FirebaseRecyclerAdapter<Tests, TestViewHolder> adapter =
new FirebaseRecyclerAdapter<Tests, TestViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull final TestViewHolder holder, int position, @NonNull final Tests model)
{
holder.txtpatientid.setText("Patient ID :"+model.getPatient_Id());
holder.txtsampletype.setText("sample Type :" +model.getSample_Type());
holder.nikshay.setText("National ID :"+model.getNational_Id());
holder.txttimestamp.setText(model.getSdate());
holder.iconfinder.setBackgroundResource(R.drawable.green_circle);
holder.iconfinder.setText("P");
Log.e("main", "error id"+model.getPrimary_Key());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("LOGCAT", "" + model.getPrimary_Key());
Intent intent=new Intent(PositiveResult.this, TestDetails.class);
intent.putExtra("pid",model.getPrimary_Key());
startActivity(intent);
}
});
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
{
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);
TestViewHolder holder = new TestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}
}
}

View File

@@ -0,0 +1,212 @@
package in.sminnovations.arrest_tb;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import com.hbb20.CountryCodePicker;
import in.sminnovations.arrest_tb.VerifyOTP.VerifyOtp;
public class Register extends AppCompatActivity {
String numberwithcode;
private Button next;
private EditText editTextMobile;
private ProgressDialog loadingBar;
private TextView login;
CountryCodePicker ccp;
String mobile,name;
private EditText editTextname;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
next=findViewById(R.id.buttonContinue);
editTextMobile = findViewById(R.id.editTextMobile);
ccp=findViewById(R.id.ccp);
ccp.registerCarrierNumberEditText(editTextMobile);
loadingBar = new ProgressDialog(this);
login=findViewById(R.id.login_account);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Register.this, LoginScreen.class);
startActivity(intent);
}
});
editTextname=findViewById(R.id.editTextName);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mobile = editTextMobile.getText().toString().trim();
mobile = mobile.replaceAll("[^0-9]", "");
name = editTextname.getText().toString().trim();
if (!isOnline()) {
//Create an alertdialog
AlertDialog.Builder Checkbuilder = new AlertDialog.Builder(Register.this);
Checkbuilder.setTitle("No Internet Connection !");
Checkbuilder.setMessage("Check Your Internet Connection.");
Checkbuilder.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
Checkbuilder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
AlertDialog alert = Checkbuilder.create();
alert.show();
}
else {
if (mobile.equals("") || name.equals("")) {
Toast.makeText(Register.this, "Please enter all the required fields", Toast.LENGTH_SHORT).show();
} else if (!Patterns.PHONE.matcher(mobile).matches()) {
Toast.makeText(Register.this, "Enter a valid Phone", Toast.LENGTH_SHORT).show();
// editTextMobile.setError("Enter a valid Phone");
// Toast.makeText(Consumer_register.this, "Please Enter a valid email", Toast.LENGTH_SHORT).show();
}
else if (mobile.length() <9 ) {
Toast.makeText(Register.this, "Enter a valid Phone", Toast.LENGTH_SHORT).show();
// Toast.makeText(Consumer_register.this, "Please Enter a valid email", Toast.LENGTH_SHORT).show();
}
else if (mobile.length() >=11 ) {
Toast.makeText(Register.this, "Enter a valid Phone", Toast.LENGTH_SHORT).show();
// Toast.makeText(Consumer_register.this, "Please Enter a valid email", Toast.LENGTH_SHORT).show();
}
else {
Query chekuser = FirebaseDatabase.getInstance().getReference("USERS").orderByChild("number").equalTo(mobile);
chekuser.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
Toast.makeText(Register.this, "User Already Exist", Toast.LENGTH_SHORT).show();
} else {
Intent intent = new Intent(Register.this, VerifyOtp.class);
Log.e("main", "error " + mobile);
numberwithcode = ccp.getFullNumberWithPlus();
Log.e("main", "error " + numberwithcode);
if (mobile.equals("") || name.equals("")) {
Toast.makeText(Register.this, "Please enter all the required fields", Toast.LENGTH_SHORT).show();
} else if (!Patterns.PHONE.matcher(mobile).matches()) {
editTextMobile.setError("Enter a valid Phone");
// Toast.makeText(Consumer_register.this, "Please Enter a valid email", Toast.LENGTH_SHORT).show();
} else {
loadingBar.setTitle("Create Account");
loadingBar.setMessage("Please wait ");
loadingBar.setCanceledOnTouchOutside(false);
loadingBar.show();
intent.putExtra("numberwithcode", numberwithcode);
intent.putExtra("mobile", mobile);
intent.putExtra("username", name);
startActivity(intent);
}
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Log.e("Raman", "Received an exception check chexk " + databaseError.getMessage());
// Toast.makeText(ForgetPassword.this,databaseError.getMessage(),Toast.LENGTH_SHORT).show();
}
});
}
}
}
});
}
@Override
public void onBackPressed() {
Intent intent = new Intent(Register.this, LoginScreen.class);
startActivity(intent);
}
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
}

View File

@@ -1,9 +1,4 @@
package com.ShanMukhaInnovations.ArrestTB;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
package in.sminnovations.arrest_tb;
import android.Manifest;
import android.content.Context;
@@ -20,11 +15,18 @@ import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -32,27 +34,29 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Report extends AppCompatActivity {
public class Report extends NavigationTop {
TextView patient_id,patient_dob,patientnikshayid,agepatient,patientgender,patientsample,validatyd,spintubeid,nirtlab,dated,timed,resultd;
ImageButton shared ,dowbloadd;
String string1,string2,string3,string4,string5,string6,string7,string8,string9,date,time;
File filePath=null;
String resultf;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_report);
/* super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_report);
LayoutInflater inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View contentView = inflater.inflate(R.layout.activity_report, null, false);
draw.addView(contentView, 0);
*/
setContentView(R.layout.activity_report);
// setContentView(R.layout.activity_report);
shared=findViewById(R.id.share);
dowbloadd=findViewById(R.id.downlaod);
patient_id=findViewById(R.id.patient_idr);
patient_dob=findViewById(R.id.patien_dobr);
@@ -72,7 +76,6 @@ public class Report extends AppCompatActivity {
dated=findViewById(R.id.dater);
dated.setText(date);
timed.setText(time);
resultd.setText("POSITIVE");
resultd.setTextColor(Color.RED);
@@ -83,6 +86,12 @@ public class Report extends AppCompatActivity {
string3 = preferences.getString("patientage", null);
string4 = preferences.getString("patientnikshayid", null);
string5 = preferences.getString("dob", null);
if (string5== null ) {
string5="-";
}
SharedPreferences preferences1=getSharedPreferences("PhoneBook1",MODE_PRIVATE);
@@ -92,6 +101,12 @@ public class Report extends AppCompatActivity {
string8 = preferences1.getString("sample", null);
string9 = preferences1.getString("validity", null);
SharedPreferences preferences15=getSharedPreferences("PhoneBook_number7",MODE_PRIVATE);
resultf= preferences15.getString("result", null);
resultd.setText(resultf);
shared.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -107,7 +122,7 @@ public class Report extends AppCompatActivity {
Intent intent=new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT,"Report");
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) {
Uri path= FileProvider.getUriForFile(Report.this,"com.ShanMukhaInnovations.ArrestTB.fileprovider",filePath);
Uri path= FileProvider.getUriForFile(Report.this,"in.sminnovations.arrest_tb.fileprovider",filePath);
intent.putExtra(Intent.EXTRA_STREAM,path);
}
else{
@@ -118,15 +133,10 @@ public class Report extends AppCompatActivity {
intent.setType("application/pdf");
startActivity(intent);
//startCropImageActivity();
// createPdf(editText.getText().toString());
}
//now for sharing file i need to create file provider for android version greater than noughat let's do it
//Everything WOrking
}
@@ -142,7 +152,6 @@ public class Report extends AppCompatActivity {
}
else
{
//startCropImageActivity();
createPdf();
Toast.makeText(Report.this, "File Downloaded", Toast.LENGTH_LONG).show();
@@ -174,18 +183,15 @@ validatyd.setText(string9);
}
private void createPdf(){
// create a new document
PdfDocument document = new PdfDocument();
// crate a page description
PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(1000, 2000, 1).create();
// start a page
PdfDocument.Page page = document.startPage(pageInfo);
Canvas canvas = page.getCanvas();
Paint paint = new Paint();
paint.setTextSize(80);
canvas.drawText("Arrest Tb",40,80,paint);
canvas.drawText("Arrest TB",40,80,paint);
paint.setTextSize(30);
canvas.drawText("ShanMukha Innovations Pvt Ltd",30,120,paint);
paint.setTextAlign(Paint.Align.RIGHT);
@@ -198,7 +204,7 @@ validatyd.setText(string9);
canvas.drawText("Result",50,285,paint);
// canvas.drawText("name 2",450,435,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText("POSITIVE",canvas.getWidth()-40,285,paint);
canvas.drawText(resultf,canvas.getWidth()-40,285,paint);
paint.setTextAlign(Paint.Align.LEFT);
@@ -265,18 +271,7 @@ validatyd.setText(string9);
// finish the page
document.finishPage(page);
/* File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),"Raman.pdf");
// write the document content
*//*String directory_path = Environment.getExternalStorageDirectory().getPath() + "/ArrestTb/";
File file = new File(directory_path);
if (!file.exists()) {
file.mkdirs();
}*//*
// String targetPdf = directory_path+"Report_"+string2+".pdf";
filePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),"Report_"+string2+".pdf");
*/
String directory_path = Environment.getExternalStorageDirectory().getPath() + "/ArrestTb/";
File file = new File(directory_path);
if (!file.exists()) {
@@ -290,13 +285,86 @@ validatyd.setText(string9);
} catch (IOException e) {
Log.e("main", "error "+e.toString());
}
// filePath= new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),"Report_"+string2+".pdf");
// close the document
document.close();
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater=getMenuInflater();
inflater.inflate(R.menu.download,menu);
MenuItem item = menu.findItem(R.id.share);
MenuItem item1=menu.findItem(R.id.download1);
item1.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if(ContextCompat.checkSelfPermission(Report.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(Report.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
}
else
{
//startCropImageActivity();
createPdf();
Toast.makeText(Report.this, "File Downloaded", Toast.LENGTH_LONG).show();
}
return true;
}
});
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if(ContextCompat.checkSelfPermission(Report.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(Report.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
}
else
{
createPdf();
Intent intent=new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT,"Report");
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) {
Uri path= FileProvider.getUriForFile(Report.this,"in.sminnovations.arrest_tb.fileprovider",filePath);
intent.putExtra(Intent.EXTRA_STREAM,path);
}
else{
intent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(filePath));
}
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("application/pdf");
startActivity(intent);
//startCropImageActivity();
// createPdf(editText.getText().toString());
}
return true;
}
});
return super.onCreateOptionsMenu(menu);
}
@Override
public void onBackPressed() {
Intent intent = new Intent(Report.this, MainActivity.class);
startActivity(intent);
}
}

View File

@@ -0,0 +1,20 @@
package in.sminnovations.arrest_tb;
import android.graphics.Rect;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class SpaceDecoration extends RecyclerView.ItemDecoration {
private int space;
public SpaceDecoration(int space) {
this.space = space;
}
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
outRect.left=outRect.bottom=outRect.right=outRect.top=space;
}
}

View File

@@ -0,0 +1,44 @@
package in.sminnovations.arrest_tb;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
public class SplashScreen extends AppCompatActivity {
private static int SPLASH_TIME_OUT=3000;
String number;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
SharedPreferences preferences6 = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
number = preferences6.getString("Phone", null);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (number == null ) {
Intent home = new Intent(SplashScreen.this, LoginScreen.class);
startActivity(home);
finish();
}
else
{
Intent home1 = new Intent(SplashScreen.this, MainActivity.class);
startActivity(home1);
finish();
}
}
}, SPLASH_TIME_OUT);
}
}

View File

@@ -0,0 +1,146 @@
package in.sminnovations.arrest_tb;
import android.annotation.SuppressLint;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import org.tensorflow.lite.Interpreter;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
public class TensorFlowImageClassifier implements Classifier {
private static final int MAX_RESULTS = 1;
private static final int BATCH_SIZE = 1;
private static final int PIXEL_SIZE = 3;
private static final float THRESHOLD = 0.1f;
private static final int IMAGE_MEAN = 128;
private static final float IMAGE_STD = 128.0f;
private Interpreter interpreter;
private int inputSize;
private List<String> labelList;
private boolean quant;
private TensorFlowImageClassifier() {
}
static Classifier create(AssetManager assetManager,
String modelPath,
String labelPath,
int inputSize) throws IOException {
TensorFlowImageClassifier classifier = new TensorFlowImageClassifier();
classifier.interpreter = new Interpreter(classifier.loadModelFile(assetManager, modelPath));
classifier.labelList = classifier.loadLabelList(assetManager, labelPath);
classifier.inputSize = inputSize;
return classifier;
}
@Override
public List<Recognition> recognizeImage(Bitmap bitmap) {
ByteBuffer byteBuffer = convertBitmapToByteBuffer(bitmap);
/* ByteBuffer byteBuffer = convertBitmapToByteBuffer(bitmap);
byte[][] result = new byte[1][labelList.size()];
interpreter.run(byteBuffer, result);
return getSortedResult(result);*/
float [][] result = new float[1][labelList.size()];
interpreter.run(byteBuffer, result);
return getSortedResultFloat(result);
}
@Override
public void close() {
interpreter.close();
interpreter = null;
}
private MappedByteBuffer loadModelFile(AssetManager assetManager, String modelPath) throws IOException {
AssetFileDescriptor fileDescriptor = assetManager.openFd(modelPath);
FileInputStream inputStream = new FileInputStream(fileDescriptor.getFileDescriptor());
FileChannel fileChannel = inputStream.getChannel();
long startOffset = fileDescriptor.getStartOffset();
long declaredLength = fileDescriptor.getDeclaredLength();
return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength);
}
private List<String> loadLabelList(AssetManager assetManager, String labelPath) throws IOException {
List<String> labelList = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(assetManager.open(labelPath)));
String line;
while ((line = reader.readLine()) != null) {
labelList.add(line);
}
reader.close();
return labelList;
}
private ByteBuffer convertBitmapToByteBuffer(Bitmap bitmap) {
ByteBuffer byteBuffer = ByteBuffer.allocateDirect(4 * BATCH_SIZE * inputSize * inputSize * PIXEL_SIZE);
byteBuffer.order(ByteOrder.nativeOrder());
int[] intValues = new int[inputSize * inputSize];
bitmap.getPixels(intValues, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
int pixel = 0;
for (int i = 0; i < inputSize; ++i) {
for (int j = 0; j < inputSize; ++j) {
final int val = intValues[pixel++];
byteBuffer.putFloat((((val >> 16) & 0xFF)-IMAGE_MEAN)/IMAGE_STD);
byteBuffer.putFloat((((val >> 8) & 0xFF)-IMAGE_MEAN)/IMAGE_STD);
byteBuffer.putFloat((((val) & 0xFF)-IMAGE_MEAN)/IMAGE_STD);
}
}
return byteBuffer;
}
@SuppressLint("DefaultLocale")
private List<Recognition> getSortedResultFloat(float[][] labelProbArray) {
PriorityQueue<Recognition> pq =
new PriorityQueue<>(
MAX_RESULTS,
new Comparator<Recognition>() {
@Override
public int compare(Recognition lhs, Recognition rhs) {
return Float.compare(rhs.getConfidence(), lhs.getConfidence());
}
});
for (int i = 0; i < labelList.size(); ++i) {
float confidence = labelProbArray[0][i];
if (confidence > THRESHOLD) {
pq.add(new Recognition("" + i,
labelList.size() > i ? labelList.get(i) : "unknown",
confidence));
}
}
final ArrayList<Recognition> recognitions = new ArrayList<>();
int recognitionsSize = Math.min(pq.size(), MAX_RESULTS);
for (int i = 0; i < recognitionsSize; ++i) {
recognitions.add(pq.poll());
}
return recognitions;
}
}

View File

@@ -0,0 +1,393 @@
package in.sminnovations.arrest_tb;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.pdf.PdfDocument;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import com.bumptech.glide.Glide;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import in.sminnovations.arrest_tb.Model.Tests;
public class TestDetails extends NavigationTop {
private ImageView Imageview1;
TextView patient_id,patient_dob,patientnikshayid,agepatient,patientgender,patientsample,validatyd,spintubeid,nirtlab,dated,timed,resultd;
String date,time,number;
private String TestID = "";
ImageButton shared ,dowbloadd;
File filePath=null;
@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_spin__test, null, false);
draw.addView(contentView, 0);
shared=findViewById(R.id.share);
dowbloadd=findViewById(R.id.downlaod);
patient_id=findViewById(R.id.patient_idr);
patient_dob=findViewById(R.id.patien_dobr);
patientnikshayid=findViewById(R.id.patient_nikshayidr);
SharedPreferences preferences6 = getSharedPreferences("PhoneBook_number", MODE_PRIVATE);
number = preferences6.getString("Phone", null);
agepatient=findViewById(R.id.patient_ager);
date = String.valueOf(android.text.format.DateFormat.format("dd-MM-yyyy", new java.util.Date()));
DateFormat df = new SimpleDateFormat("h:mm a");
time = df.format(Calendar.getInstance().getTime());
patientgender=findViewById(R.id.patient_genderr);
patientsample=findViewById(R.id.patient_typesampler);
validatyd=findViewById(R.id.patient_tubevisibler);
spintubeid=findViewById(R.id.patient_spintuber);
nirtlab=findViewById(R.id.patient_nirtr);
timed=findViewById(R.id.timer);
resultd=findViewById(R.id.patient_resultr);
dated=findViewById(R.id.dater);
Imageview1=findViewById(R.id.circle_image);
TestID = getIntent().getStringExtra("pid");
Log.e("main", "error id "+TestID);
getTestDetails(TestID);
shared.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(ContextCompat.checkSelfPermission(TestDetails.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(TestDetails.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
}
else
{
createPdf();
Intent intent=new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT,"Report");
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) {
Uri path= FileProvider.getUriForFile(TestDetails.this,"in.sminnovations.arrest_tb.fileprovider",filePath);
intent.putExtra(Intent.EXTRA_STREAM,path);
}
else{
intent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(filePath));
}
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("application/pdf");
startActivity(intent);
}
}
});
dowbloadd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(ContextCompat.checkSelfPermission(TestDetails.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(TestDetails.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
}
else
{
createPdf();
Toast.makeText(TestDetails.this, "File Downloaded", Toast.LENGTH_LONG).show();
}
}
});
}
private void getTestDetails(String TestID)
{
DatabaseReference productsRef = FirebaseDatabase.getInstance().getReference().child("Test_Data").child(number);
productsRef.child(TestID).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
if (dataSnapshot.exists())
{
Tests products = dataSnapshot.getValue(Tests.class);
Glide.with(TestDetails.this).load(products.getImage()).into(Imageview1);
patient_id.setText(products.getPatient_Id());
patient_dob.setText(products.getDob());
patientnikshayid.setText(products.getNational_Id());
validatyd.setText(products.getTube_Validity());
agepatient.setText(products.getPatient_Age());
dated.setText(products.getSdate());
spintubeid.setText(products.getSPIN_Tube_ID());
nirtlab.setText(products.getLab_Number());
timed.setText(products.getTime());
patientgender.setText(products.getGender());
resultd.setText(products.getResult());
agepatient.setText(products.getPatient_Age());
patientsample.setText(products.getSample_Type());
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void createPdf(){
PdfDocument document = new PdfDocument();
PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(1000, 2000, 1).create();
PdfDocument.Page page = document.startPage(pageInfo);
Canvas canvas = page.getCanvas();
Paint paint = new Paint();
paint.setTextSize(80);
canvas.drawText("Arrest TB",40,80,paint);
paint.setTextSize(30);
canvas.drawText("ShanMukha Innovations Pvt Ltd",30,120,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText(dated.getText().toString(),canvas.getWidth()-40,40,paint);
canvas.drawText(timed.getText().toString(),canvas.getWidth()-40,80,paint);
paint.setTextAlign(Paint.Align.LEFT);
paint.setColor(Color.rgb(150,150,150));
canvas.drawRect(30,250,canvas.getWidth()-30,300,paint);
paint.setColor(Color.WHITE);
canvas.drawText("Result",50,285,paint);
// canvas.drawText("name 2",450,435,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText(resultd.getText().toString(),canvas.getWidth()-40,285,paint);
paint.setTextAlign(Paint.Align.LEFT);
paint.setColor(Color.rgb(150,150,150));
// canvas.drawRect(30,150,canvas.getWidth()-30,160,paint);
canvas.drawRect(30,400,canvas.getWidth()-30,450,paint);
paint.setColor(Color.WHITE);
canvas.drawText("Patient ID",50,435,paint);
canvas.drawText("Patient Gender",450,435,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText("Date of Birth",canvas.getWidth()-40,435,paint);
paint.setTextAlign(Paint.Align.LEFT);
paint.setColor(Color.BLACK);
canvas.drawText(patient_id.getText().toString(),50,480,paint);
canvas.drawText(patientgender.getText().toString(),450,480,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText(patient_dob.getText().toString()+".",canvas.getWidth()-40,480,paint);
paint.setTextAlign(Paint.Align.RIGHT);
paint.setColor(Color.rgb(150,150,150));
// canvas.drawRect(30,150,canvas.getWidth()-30,160,paint);
// canvas.drawRect(30,550,canvas.getWidth()-30,560,paint);
canvas.drawRect(30,570,canvas.getWidth()-30,620,paint);
paint.setColor(Color.WHITE);
canvas.drawText("Age",100,605,paint);
canvas.drawText("Nikshay ID ",540,605,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText("NIRT Lab Number",canvas.getWidth()-40,605,paint);
paint.setTextAlign(Paint.Align.LEFT);
paint.setColor(Color.BLACK);
canvas.drawText(agepatient.getText().toString(),50,650,paint);
canvas.drawText(patientnikshayid.getText().toString(),440,650,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText(nirtlab.getText().toString(),canvas.getWidth()-40,650,paint);
paint.setTextAlign(Paint.Align.RIGHT);
paint.setColor(Color.rgb(150,150,150));
canvas.drawRect(30,740,canvas.getWidth()-30,790,paint);
paint.setColor(Color.WHITE);
canvas.drawText("SPIN Tube ID",220,775,paint);
canvas.drawText("Type of Sample",540,775,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText("Tube Validity",canvas.getWidth()-40,775,paint);
paint.setTextAlign(Paint.Align.LEFT);
paint.setColor(Color.BLACK);
canvas.drawText(spintubeid.getText().toString(),50,820,paint);
canvas.drawText(patientsample.getText().toString(),440,820,paint);
paint.setTextAlign(Paint.Align.RIGHT);
canvas.drawText(validatyd.getText().toString(),canvas.getWidth()-40,820,paint);
paint.setTextAlign(Paint.Align.RIGHT);
paint.setColor(Color.rgb(150,150,150));
// finish the page
document.finishPage(page);
String directory_path = Environment.getExternalStorageDirectory().getPath() + "/ArrestTb/";
File file = new File(directory_path);
if (!file.exists()) {
file.mkdirs();
}
String targetPdf = directory_path+"Report_"+patient_id.getText().toString()+".pdf";
filePath = new File(targetPdf);
try {
document.writeTo(new FileOutputStream(filePath));
} catch (IOException e) {
Log.e("main", "error "+e.toString());
}
document.close();
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater=getMenuInflater();
inflater.inflate(R.menu.download,menu);
MenuItem item = menu.findItem(R.id.share);
MenuItem item1=menu.findItem(R.id.download1);
item1.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if(ContextCompat.checkSelfPermission(TestDetails.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(TestDetails.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
}
else
{
//startCropImageActivity();
createPdf();
Toast.makeText(TestDetails.this, "File Downloaded", Toast.LENGTH_LONG).show();
}
return true;
}
});
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if(ContextCompat.checkSelfPermission(TestDetails.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(TestDetails.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
}
else
{
createPdf();
Intent intent=new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT,"Report");
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) {
Uri path= FileProvider.getUriForFile(TestDetails.this,"in.sminnovations.arrest_tb.fileprovider",filePath);
intent.putExtra(Intent.EXTRA_STREAM,path);
}
else{
intent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(filePath));
}
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("application/pdf");
startActivity(intent);
//startCropImageActivity();
// createPdf(editText.getText().toString());
}
return true;
}
});
return super.onCreateOptionsMenu(menu);
}
}

View File

@@ -1,16 +1,10 @@
package com.ShanMukhaInnovations.ArrestTB;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
package in.sminnovations.arrest_tb;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
@@ -20,23 +14,26 @@ import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
public class Test_details extends Navigation_Top implements AdapterView.OnItemSelectedListener {
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
public class TestResult extends NavigationTop implements AdapterView.OnItemSelectedListener {
Button btnTest;
EditText NIRTLabd,SPINTubeIDd;
String NIRTLabde,SPINTubeIDde,validatyd,sampled;
int PERMISSION_ALL = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
.getSystemService(LAYOUT_INFLATER_SERVICE);
View contentView = inflater.inflate(R.layout.activity_test_details, null, false);
draw.addView(contentView, 0);
Spinner Spinner_sample = findViewById(R.id.spinner_sample);
// editor.putString(Name, phonenum);
NIRTLabd=findViewById(R.id.NIRTLab);
SPINTubeIDd=findViewById(R.id.SPINTubeID);
@@ -51,16 +48,40 @@ public class Test_details extends Navigation_Top implements AdapterView.OnItemSe
NIRTLabde = NIRTLabd.getText().toString();
SPINTubeIDde = SPINTubeIDd.getText().toString();
if (NIRTLabde.equals("") || SPINTubeIDde.equals("") || sampled.equals("")) {
Toast.makeText(Test_details.this, "Please fill all fields", Toast.LENGTH_SHORT).show();
Toast.makeText(TestResult.this, "Please fill all required fields", Toast.LENGTH_SHORT).show();
} else {
if(ContextCompat.checkSelfPermission(Test_details.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
}
else if ( NIRTLabde.length()!=6 )
{
Toast.makeText(TestResult.this, "NIRT Lab Number must be 6 characters", Toast.LENGTH_SHORT).show();
}
else if (NIRTLabde.matches("^[a-zA-Z]*$") || NIRTLabde.matches("^[0-9]*$") )
{
Toast.makeText(TestResult.this, "NIRT Lab Number must be alphanumeric", Toast.LENGTH_SHORT).show();
}
else if (SPINTubeIDde.length()!=6 )
{
Toast.makeText(TestResult.this, "Spin Tube ID must be 6 characters", Toast.LENGTH_SHORT).show();
}
else if (SPINTubeIDde.matches("^[a-zA-Z]*$") || SPINTubeIDde.matches("^[0-9]*$") )
{
Toast.makeText(TestResult.this, "Spin Tube ID must be alphanumeric", Toast.LENGTH_SHORT).show();
}
else {
if(ContextCompat.checkSelfPermission(TestResult.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(Test_details.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant
ActivityCompat.requestPermissions(TestResult.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},23);
return;
}
@@ -92,7 +113,7 @@ public class Test_details extends Navigation_Top implements AdapterView.OnItemSe
} else {
Intent intent = new Intent(getApplicationContext(), Camera_Guide.class);
Intent intent = new Intent(getApplicationContext(), CameraGuide.class);
startActivity(intent);
finish();

View File

@@ -0,0 +1,47 @@
package in.sminnovations.arrest_tb;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import in.sminnovations.arrest_tb.Interface.ItemClickListner;
public class TestViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
{
public TextView txtpatientid, txttimestamp,nikshay,iconfinder,txtsampletype;
public ImageView imageView;
public ItemClickListner listner;
public TestViewHolder(View itemView)
{
super(itemView);
imageView = (ImageView) itemView.findViewById(R.id.icon_profile);
iconfinder=(TextView) itemView.findViewById(R.id.icon_text);
txtpatientid = (TextView) itemView.findViewById(R.id.patient_Id);
txtsampletype = (TextView) itemView.findViewById(R.id.sample_type);
txttimestamp=itemView.findViewById(R.id.timestamp);
nikshay=itemView.findViewById(R.id.nikshayid);
//txtProductDescription= (TextView) itemView.findViewById(R.id.switch_toggle);
}
public void setItemClickListner(ItemClickListner listner)
{
this.listner = listner;
}
@Override
public void onClick(View view)
{
listner.onClick(view, getAdapterPosition(), false);
}
}

View File

@@ -0,0 +1,166 @@
package in.sminnovations.arrest_tb.VerifyOTP;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.chaos.view.PinView;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskExecutors;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthOptions;
import com.google.firebase.auth.PhoneAuthProvider;
import java.util.concurrent.TimeUnit;
import in.sminnovations.arrest_tb.CreatePassword;
import in.sminnovations.arrest_tb.R;
import in.sminnovations.arrest_tb.Register;
public class VerifyOtp extends AppCompatActivity {
private String verificationid;
private FirebaseAuth mAuth;
private Button nextactivity;
PinView pinFromUser;
private EditText editText;
String codeBySystem;
String address,name, state , city ,pincode,phonenumber,password2,num1,phonenumberke;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verify__o_t_p);
pinFromUser = findViewById(R.id.firstPinView);
nextactivity = findViewById(R.id.buttonSignIn);
mAuth = FirebaseAuth.getInstance();
// mAuth = FirebaseAuth.getInstance().getFirebaseAuthSettings().forceRecaptchaFlowForTesting();
String phonenumberk = getIntent().getStringExtra("numberwithcode");
phonenumberke = getIntent().getStringExtra("mobile");
phonenumber = phonenumberk;
name = getIntent().getStringExtra("username");
sendVerificationCode(phonenumber);
findViewById(R.id.buttonSignIn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String code = pinFromUser.getText().toString().trim();
if ((code.isEmpty() || code.length() < 6)) {
editText.setError("Enter code...");
editText.requestFocus();
return;
}
verifyCode(code);
}
});
}
private void verifyCode(String code){
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationid, code);
signInWithCredential(credential);
}
private void signInWithCredential(PhoneAuthCredential credential) {
mAuth.signInWithCredential(credential)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Intent intent = new Intent(VerifyOtp.this, CreatePassword.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.putExtra("mobile", phonenumberke);
intent.putExtra("username", name);
startActivity(intent);
} else {
Log.e("main", "error " + task.getException().getMessage());
// Toast.makeText(VerifyOtp.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
private void sendVerificationCode(String number){
PhoneAuthOptions options =
PhoneAuthOptions.newBuilder(mAuth)
.setPhoneNumber(number) // Phone number to verify
.setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit
.setActivity(this) // Activity (for callback binding)
.setCallbacks(mCallBack) // OnVerificationStateChangedCallbacks
.build();
PhoneAuthProvider.verifyPhoneNumber(options);
}
private PhoneAuthProvider.OnVerificationStateChangedCallbacks
mCallBack = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
verificationid = s;
}
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
String code = phoneAuthCredential.getSmsCode();
if (code != null){
// progressBar.setVisibility(View.VISIBLE);
pinFromUser.setText(code);
verifyCode(code);
}
}
@Override
public void onVerificationFailed(FirebaseException e) {
Toast.makeText(VerifyOtp.this, e.getMessage(),Toast.LENGTH_LONG).show();
Log.e("main", "error " + e.getMessage());
}
};
@Override
public void onBackPressed() {
Intent intent = new Intent(VerifyOtp.this, Register.class);
startActivity(intent);
}
}

View File

@@ -0,0 +1,156 @@
package in.sminnovations.arrest_tb.VerifyOTP;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.chaos.view.PinView;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskExecutors;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthOptions;
import com.google.firebase.auth.PhoneAuthProvider;
import java.util.concurrent.TimeUnit;
import in.sminnovations.arrest_tb.ForgetPasswordReset;
import in.sminnovations.arrest_tb.ForgetPassword;
import in.sminnovations.arrest_tb.R;
public class VerifyOtpForgetPassword extends AppCompatActivity {
private String verificationid;
private FirebaseAuth mAuth;
private Button nextactivity;
private ProgressBar progressBar;
PinView pinFromUser;
private EditText editText;
String codeBySystem;
String address,name, state , city ,pincode,phonenumber,password2,num1,mobile;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verify__o_t_p);
pinFromUser = findViewById(R.id.firstPinView);
nextactivity = findViewById(R.id.buttonSignIn);
mAuth = FirebaseAuth.getInstance();
String phonenumberk = getIntent().getStringExtra("mobilecode");
phonenumber = phonenumberk;
mobile= getIntent().getStringExtra("mobile");
sendVerificationCode(phonenumber);
findViewById(R.id.buttonSignIn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String code = pinFromUser.getText().toString().trim();
if ((code.isEmpty() || code.length() < 6)) {
editText.setError("Enter code...");
editText.requestFocus();
return;
}
verifyCode(code);
}
});
}
private void verifyCode(String code){
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationid, code);
signInWithCredential(credential);
}
private void signInWithCredential(PhoneAuthCredential credential) {
mAuth.signInWithCredential(credential)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Intent intent = new Intent(VerifyOtpForgetPassword.this, ForgetPasswordReset.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.putExtra("mobile", mobile);
startActivity(intent);
} else {
Toast.makeText(VerifyOtpForgetPassword.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
private void sendVerificationCode(String number){
PhoneAuthOptions options =
PhoneAuthOptions.newBuilder(mAuth)
.setPhoneNumber(number) // Phone number to verify
.setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit
.setActivity(this) // Activity (for callback binding)
.setCallbacks(mCallBack) // OnVerificationStateChangedCallbacks
.build();
PhoneAuthProvider.verifyPhoneNumber(options);
}
private PhoneAuthProvider.OnVerificationStateChangedCallbacks
mCallBack = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
verificationid = s;
}
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
String code = phoneAuthCredential.getSmsCode();
if (code != null){
// progressBar.setVisibility(View.VISIBLE);
pinFromUser.setText(code);
verifyCode(code);
}
}
@Override
public void onVerificationFailed(FirebaseException e) {
// Toast.makeText(VerifyOtpForgetPassword.this, e.getMessage(),Toast.LENGTH_LONG).show();
Log.e("main", "error " + e.getMessage());
}
};
@Override
public void onBackPressed() {
Intent intent = new Intent(VerifyOtpForgetPassword.this, ForgetPassword.class);
startActivity(intent);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -4,17 +4,13 @@
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<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="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
@@ -28,7 +24,7 @@
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@android:color/holo_green_dark"/>
<size
android:width="120dp"
android:height="120dp"/>
</shape>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@android:color/holo_red_dark"/>
<size
android:width="120dp"
android:height="120dp"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/row_activated" android:state_activated="true" />
<item android:drawable="@android:color/transparent" />
</selector>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@android:color/holo_green_dark"/>
<size
android:width="120dp"
android:height="120dp"/>
</shape>

View File

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#fff" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#fff" android:pathData="M20,12l-1.41,-1.41L13,16.17V4h-2v12.17l-5.58,-5.59L4,12l8,8 8,-8z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#fff" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#fff" android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
</vector>

View File

@@ -0,0 +1,34 @@
<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:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
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="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

View File

@@ -32,7 +32,7 @@
android:textStyle="bold">
</ImageView>
<TextView
<!-- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
@@ -43,7 +43,46 @@
android:textSize="@dimen/heading_size"
android:textStyle="bold">
</TextView>-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/shanmukha_logo_small"
android:text="SpinTube App 1.0.0"
android:textColor="#131313"
android:textSize="@dimen/heading_size"
android:textStyle="bold">
</TextView>
<View
android:layout_margin="20dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#EEE" />
<TextView
android:padding="20dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:textSize="@dimen/small_text_size"
android:lineSpacingExtra="2sp"
android:layout_height="wrap_content"
android:fontFamily="@font/fontstyle"
android:text="The ARREST-TB project aims to develop a suite of technologies to rapidly, accurately and economically detect, report and monitor TB and MDR TB, and monitor response to anti-TB treatments."
android:gravity="left" />
<View
android:layout_margin="20dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#EEE" />
<TextView
android:padding="20dp"
android:textStyle="bold"
@@ -56,10 +95,11 @@
android:fontFamily="@font/fontstyle"
android:text="At Shanmukha Innovations
we are striving to develop affordable point-of-care diagnostic solutions. We undertake custom instrumentation development to support bespoke needs of our Research and Industrial customers.The ARREST-TB project aims to develop a suite of technologies to rapidly, accurately and economically detect, report and monitor TB and MDR TB, and monitor response to anti-TB treatments."
we are striving to develop affordable point-of-care diagnostic solutions. We undertake custom instrumentation development to support bespoke needs of our Research and Industrial customers."
android:gravity="left" />
<View
android:layout_margin="20dp"
android:layout_width="fill_parent"
@@ -72,7 +112,6 @@ we are striving to develop affordable point-of-care diagnostic solutions. We und
android:layout_width="wrap_content"
android:textSize="@dimen/small_text_size"
android:textStyle="bold"
android:fontFamily="@font/fontstyle"
android:layout_height="wrap_content"
android:text="Tel: +91 9742255674"
@@ -88,6 +127,8 @@ we are striving to develop affordable point-of-care diagnostic solutions. We und
android:layout_width="wrap_content"
android:textSize="@dimen/small_text_size"
android:textStyle="bold"
android:layout_marginBottom="30dp"
android:fontFamily="@font/fontstyle"
android:layout_height="wrap_content"
android:text="Email : info@sminnovations.in"

View File

@@ -35,7 +35,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text=" Test Result: Positive"
android:text=" Test Result:"
android:textSize="@dimen/heading_size" />
<Button
@@ -50,10 +50,32 @@
android:layout_marginStart="100dp"
android:layout_marginEnd="100dp"
android:textColor="@android:color/white"
android:text="Get Report "
android:layout_marginBottom="20dp"
android:textAllCaps="false"
android:textSize="20sp" />
<Button
android:id="@+id/report2"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:visibility="gone"
android:background="@drawable/buttonshape"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:layout_marginEnd="100dp"
android:textColor="@android:color/white"
android:text="Get Report"
android:layout_marginBottom="60dp"
android:layout_marginBottom="20dp"
android:textAllCaps="false"
@@ -61,6 +83,7 @@
android:textSize="20sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="match_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_marginTop="@android:dimen/app_icon_size"
android:background="#fff"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="40dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textSize="28sp"
android:fontFamily="@font/fontstyle"
android:textStyle="bold"
android:textAlignment="center"
android:textColor="#131313"
android:text="Create Password "
>
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginTop="-23dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
//second linear
//third linear
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/password"
android:background="@drawable/text_back"
android:padding="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:hint="Password *"
android:inputType="textPassword"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:singleLine="true" />
<EditText
android:id="@+id/confirmpassword"
android:padding="12dp"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:background="@drawable/text_back"
android:hint="Confirm Password *"
android:maxLines="1"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:singleLine="true" />
<EditText
android:id="@+id/Email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Email"
android:maxLines="1"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:singleLine="true"
android:visibility="gone" />
<Button
android:id="@+id/next"
android:layout_width="match_parent"
android:layout_marginTop="50dp"
android:background="@drawable/buttonshape"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:layout_marginBottom="200dp"
android:layout_marginEnd="100dp"
android:textColor="@android:color/white"
android:text="Next"
android:textAllCaps="false"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -0,0 +1,206 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="match_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_marginTop="@android:dimen/app_icon_size"
android:background="#fff"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="40dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textSize="28sp"
android:fontFamily="@font/fontstyle"
android:textStyle="bold"
android:textAlignment="center"
android:text="Reset Password "
android:textColor="#131313"
>
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginTop="-23dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
//second linear
//third linear
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center_vertical">
<com.hbb20.CountryCodePicker
android:id="@+id/ccp"
app:ccp_showFlag="false"
android:layout_marginStart="20sp"
android:layout_marginTop="18dp"
android:background="@drawable/text_back"
app:ccpDialog_showFlag="false"
android:padding="3.5dp" android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/editTextMobile"
android:layout_width="match_parent"
android:textColorHint="@android:color/darker_gray"
android:layout_height="wrap_content"
android:layout_marginStart="20sp"
android:layout_marginTop="18dp"
android:background="@drawable/text_back"
android:layout_marginEnd="20sp"
android:ems="10"
android:hint=" Contact Number :"
android:padding="12dp"/>
</LinearLayout>
<!--
<EditText
android:id="@id/editTextMobile"
android:padding="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:background="@drawable/text_back"
android:hint="Contact Number "
android:maxLines="1"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:singleLine="true" />
-->
<EditText
android:id="@+id/Email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Email"
android:maxLines="1"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:singleLine="true"
android:visibility="gone" />
<Button
android:id="@+id/buttonSignIn"
android:layout_width="match_parent"
android:layout_marginTop="50dp"
android:background="@drawable/buttonshape"
android:layout_height="wrap_content"
android:layout_marginStart="100dp"
android:layout_marginBottom="200dp"
android:layout_marginEnd="100dp"
android:textColor="@android:color/white"
android:text="Next"
android:textAllCaps="false"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -70,7 +70,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ShanMukhaInnovations.ArrestTB.FontAwesome
<in.sminnovations.arrest_tb.FontAwesome
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
@@ -81,7 +81,7 @@
android:textStyle="normal"
android:fontFamily="sans-serif"
></com.ShanMukhaInnovations.ArrestTB.FontAwesome>
></in.sminnovations.arrest_tb.FontAwesome>
<TextView
@@ -119,7 +119,7 @@ android:fontFamily="@font/fontstyle"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ShanMukhaInnovations.ArrestTB.FontAwesome
<in.sminnovations.arrest_tb.FontAwesome
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
@@ -130,7 +130,7 @@ android:fontFamily="@font/fontstyle"
android:id="@+id/patient_details"
></com.ShanMukhaInnovations.ArrestTB.FontAwesome>
></in.sminnovations.arrest_tb.FontAwesome>
<TextView
android:textSize="14sp"
@@ -173,7 +173,7 @@ android:fontFamily="@font/fontstyle"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ShanMukhaInnovations.ArrestTB.FontAwesome
<in.sminnovations.arrest_tb.FontAwesome
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
@@ -184,7 +184,7 @@ android:fontFamily="@font/fontstyle"
android:textSize="40dp"
></com.ShanMukhaInnovations.ArrestTB.FontAwesome>
></in.sminnovations.arrest_tb.FontAwesome>
<TextView
android:textSize="14sp"
@@ -219,7 +219,7 @@ android:fontFamily="@font/fontstyle"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ShanMukhaInnovations.ArrestTB.FontAwesome
<in.sminnovations.arrest_tb.FontAwesome
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
@@ -230,7 +230,7 @@ android:fontFamily="@font/fontstyle"
android:text="&#xf05a;"
></com.ShanMukhaInnovations.ArrestTB.FontAwesome>
></in.sminnovations.arrest_tb.FontAwesome>
<TextView
android:textSize="14sp"

View File

@@ -40,7 +40,7 @@
android:layout_height="@android:dimen/app_icon_size"
android:contentDescription="TODO"
android:layout_marginTop="15dp"
android:textSize="@dimen/heading_size"
android:textSize="28sp"
android:fontFamily="@font/fontstyle"
android:textStyle="bold"
@@ -58,11 +58,13 @@
android:paddingLeft="10dp"
android:layout_marginTop="15dp"
android:id="@+id/sign_in_text"
android:textSize="@dimen/heading_size"
android:textSize="28sp"
android:textStyle="bold"
/>
<EditText
android:id="@+id/username"
android:id="@+id/contactnumber"
android:layout_width="match_parent"
android:layout_marginTop="40dp"
android:background="@drawable/text_back"
@@ -70,7 +72,7 @@
android:layout_marginStart="20sp"
android:layout_marginEnd="20sp"
android:ems="10"
android:hint="User Name :"
android:hint="Contact Number :"
android:inputType="textEmailAddress"
android:padding="12dp"
/>
@@ -103,7 +105,7 @@
android:padding="20dp"
android:textColor="#131313"
android:textColorHint="#ffffff"
android:text="Show password"
android:text="Show Password"
/>
<LinearLayout
android:layout_width="match_parent"
@@ -120,7 +122,7 @@
android:layout_marginStart="10dp"
android:padding="10dp"
android:text="Forgot Password?"
android:textColor="#4285f4"
android:textColor="@android:color/holo_blue_dark"
android:textStyle="bold"
android:layout_marginLeft="10dp" />
@@ -132,7 +134,7 @@
android:layout_marginHorizontal="25dp"
android:background="#4285f4" />
android:background="@android:color/holo_blue_dark" />
<TextView
android:id="@+id/createaccount"
@@ -140,11 +142,11 @@
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:textColor="@android:color/holo_blue_dark"
android:layout_marginTop="1dp"
android:padding="10dp"
android:text="Register here"
android:textColor="#4285f4"
android:textStyle="bold" />

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:fitsSystemWindows="true"
>
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
/>
</com.google.android.material.appbar.AppBarLayout>
<TextView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:textSize="@dimen/heading_size"
android:layout_gravity="center"
android:text="Tap on Plus Button to take a new test."
/>
<include layout="@layout/content_main" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="120dp"
android:layout_marginRight="30dp"
android:backgroundTint="@android:color/holo_blue_dark"
app:srcCompat="@drawable/ic_baseline_add_24"
tools:ignore="VectorDrawableCompat" />
<!-- <com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:id="@+id/bottom_Navigation"
app:menu="@menu/bottom"
android:layout_marginBottom="40dp"
></com.google.android.material.bottomnavigation.BottomNavigationView>
-->
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -30,6 +30,7 @@
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" >
</androidx.appcompat.widget.Toolbar>
</LinearLayout>

View File

@@ -101,12 +101,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginLeft="10dp"
android:fontFamily="@font/fontstyle"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:id="@+id/gender"
android:textSize="@dimen/small_text_size"
android:textSize="@dimen/default_text_size"
android:text="Patient Gender *"
@@ -175,7 +176,7 @@
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/fontstyle"
android:hint="Nikshay ID *"
android:hint="National ID [Eg: Nikshay ID] *"
android:inputType="number"
android:maxLines="1"

View File

@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="70dp"
android:contentDescription="TODO"
android:layout_marginTop="15dp"
android:src="@drawable/logo_app"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/titleapp"
android:layout_width="match_parent"
android:layout_height="@android:dimen/app_icon_size"
android:contentDescription="TODO"
android:layout_marginTop="15dp"
android:textSize="28sp"
android:fontFamily="@font/fontstyle"
android:textStyle="bold"
android:textAlignment="center"
android:textColor="#131313"
android:text="Spin Tube App"
android:gravity="center_horizontal" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Register"
android:textColor="#131313"
android:fontFamily="@font/fontstyle"
android:paddingLeft="10dp"
android:layout_marginTop="15dp"
android:id="@+id/sign_in_text"
android:textSize="28sp"
android:textStyle="bold"
/>
<EditText
android:id="@+id/editTextName"
android:layout_width="match_parent"
android:layout_marginTop="40dp"
android:background="@drawable/text_back"
android:layout_height="wrap_content"
android:layout_marginStart="20sp"
android:layout_marginEnd="20sp"
android:fontFamily="@font/fontstyle"
android:ems="10"
android:hint="User Name :"
android:padding="12dp"
/>
<!-- <EditText
android:id="@+id/editTextMobile"
android:layout_width="match_parent"
android:textColorHint="@android:color/darker_gray"
android:layout_height="wrap_content"
android:layout_marginStart="20sp"
android:layout_marginTop="18dp"
android:background="@drawable/text_back"
android:layout_marginEnd="20sp"
android:ems="10"
android:hint="Contact Number :"
android:padding="12dp"/>
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center_vertical">
<com.hbb20.CountryCodePicker
android:id="@+id/ccp"
app:ccp_showFlag="false"
android:layout_marginStart="20sp"
android:layout_marginTop="18dp"
android:background="@drawable/text_back"
android:fontFamily="@font/fontstyle"
app:ccpDialog_showFlag="false"
android:padding="3.5dp" android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/editTextMobile"
android:layout_width="match_parent"
android:textColorHint="@android:color/darker_gray"
android:layout_height="wrap_content"
android:layout_marginStart="20sp"
android:layout_marginTop="18dp"
android:fontFamily="@font/fontstyle"
android:background="@drawable/text_back"
android:layout_marginEnd="20sp"
android:ems="10"
android:hint="Contact Number :"
android:padding="12dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="40dp"
android:orientation="horizontal">
<TextView
android:id="@+id/login_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="16sp"
android:fontFamily="@font/fontstyle"
android:text="Do you have a Account ?"
android:textColor="@android:color/holo_blue_dark"
android:textStyle="bold"
/>
/>
</LinearLayout>
<Button
android:layout_marginTop="50dp"
android:id="@+id/buttonContinue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAllCaps="false"
android:fontFamily="@font/fontstyle"
android:text="Sign UP"
android:layout_marginBottom="30dp"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:background="@android:color/holo_blue_dark"
android:textColor="@android:color/white"
android:textSize="20sp"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -388,7 +388,7 @@
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="Nikshay ID :"
android:text="National ID :"
android:textSize="@dimen/small_text_size"
/>
@@ -428,7 +428,7 @@
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="NIRT Lab Number :"
android:text="Lab Number :"
android:textSize="@dimen/small_text_size"
/>

View File

@@ -0,0 +1,598 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:background="@android:color/holo_blue_light"
android:layout_height="@android:dimen/app_icon_size"
android:orientation="vertical">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="@android:dimen/app_icon_size"
android:id="@+id/share"
android:tint="@android:color/white"
android:layout_alignParentEnd="true"
android:backgroundTint="@android:color/transparent"
android:src="@android:drawable/ic_menu_share"
android:layout_alignParentRight="true" />
<ImageButton
android:id="@+id/downlaod"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginHorizontal="50dp"
android:backgroundTint="@android:color/transparent"
android:src="@android:drawable/stat_sys_download"
android:tint="@android:color/white" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="center"
android:orientation="vertical">
<!-- <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="Test Report"
android:textColor="#131313"
android:textSize="@dimen/heading_size"
android:textStyle="bold">
</TextView>
-->
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/circle_image"
android:layout_width="300dp"
android:layout_height="300dp"
app:civ_border_width="3dp"
android:src="@android:drawable/ic_menu_gallery"
/>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:text="Date : "
android:textSize="@dimen/small_text_size"
android:lines="2"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/dater"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:text="Time : "
android:textSize="@dimen/small_text_size"
android:lines="2"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/timer"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:text="Patient ID : "
android:textSize="@dimen/small_text_size"
android:lines="2"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_idr"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="Patient Gender :"
android:textSize="@dimen/small_text_size"
/>
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_genderr"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="Date of Birth :"
android:textSize="@dimen/small_text_size" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patien_dobr"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="Age :"
android:textSize="@dimen/small_text_size"
/>
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_ager"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="Result :"
android:textSize="@dimen/small_text_size"
/>
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_resultr"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="National ID :"
android:textSize="@dimen/small_text_size"
/>
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_nikshayidr"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="5"
android:lines="2"
android:text="Lab Number :"
android:textSize="@dimen/small_text_size"
/>
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_nirtr"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:text="SPIN Tube ID :"
android:textSize="@dimen/small_text_size"
android:lines="2"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_spintuber"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:text="Type of Sample :"
android:textSize="@dimen/small_text_size"
android:lines="2"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_typesampler"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:padding="15dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="10"
>
<TextView
android:text="Tube Validity :"
android:textSize="@dimen/small_text_size"
android:lines="2"
android:layout_weight="5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextView
android:layout_width="0dp"
android:textSize="@dimen/small_text_size"
android:id="@+id/patient_tubevisibler"
android:layout_weight="5"
android:layout_height="wrap_content" />
</TableRow>
<View
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#eee" />
</TableLayout>
</TableLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -73,13 +73,13 @@
<EditText
android:id="@+id/NIRTLab"
android:layout_width="match_parent"
android:maxLength="7"
android:maxLength="6"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:hint="NIRT Lab Number *"
android:hint="Lab Number [Eg: NIRT Lab No] *"
android:maxLines="1"
android:paddingStart="5dp"
android:paddingLeft="5dp"
@@ -118,7 +118,7 @@
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:text="Type of Sample *"
android:textSize="@dimen/small_text_size"
android:textSize="@dimen/default_text_size"
android:textColor="@android:color/darker_gray"
/>
@@ -150,7 +150,7 @@ android:textSize="@dimen/small_text_size"
android:layout_marginLeft="10dp"
android:paddingStart="5dp"
android:paddingLeft="5dp"
android:textSize="@dimen/small_text_size"
android:textSize="@dimen/default_text_size"
android:text="Tube Validity * "

View File

@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/wvHelp1"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_height="0dp"
android:layout_weight="0.1" >
<!-- <ImageView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"
android:src="@drawable/logo"
></ImageView>
-->
</RelativeLayout>
<RelativeLayout
android:id="@+id/wvHelp3"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="0dp"
android:layout_weight="0.2" >
<TextView
android:id="@+id/textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:textAlignment="center"
android:text="Verify OTP "
android:textSize="30sp"
android:gravity="center_horizontal" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/wvHelp"
android:layout_width="match_parent"
android:orientation="vertical"
android:textAlignment="center"
android:layout_height="0dp"
android:layout_weight="0.6"
android:gravity="center_horizontal">
<!-- <EditText
android:id="@+id/editTextCode"
android:layout_width="280dp"
android:textAlignment="center"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:paddingLeft="2dp"
android:drawablePadding="5dp"
android:layout_marginBottom="20dp"
android:layout_centerHorizontal="true"
android:background="#ffffff"
android:textColorHint="@color/colorPrimary"
android:hint="Enter OTP"/>
-->
<com.chaos.view.PinView
android:id="@+id/firstPinView"
style="@style/PinWidget.PinView"
android:layout_width="wrap_content"
android:textColor="@android:color/holo_blue_dark"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:cursorVisible="true"
android:hint="1"
android:inputType="text"
android:padding="14dp"
android:textAlignment="center"
android:textSize="18sp"
android:textStyle="bold"
app:cursorColor="@color/colorAccent"
app:cursorWidth="2dp"
app:hideLineWhenFilled="true"
app:itemCount="6"
app:itemHeight="50dp"
app:itemRadius="4dp"
app:itemWidth="50dp"
app:lineWidth="6dp"
app:viewType="rectangle" />
<ProgressBar
android:id="@+id/progressbar"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonSignIn"
android:layout_height="wrap_content"
android:layout_width="206dp"
android:layout_centerHorizontal="true"
android:background="@drawable/buttonshape"
android:layout_below="@id/firstPinView"
android:layout_marginTop="20dp"
android:textColor="#ffffff"
android:text="Verify"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/wvHelpj"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="0dp"
android:layout_weight="0.2" >
</RelativeLayout>
</LinearLayout>

View File

@@ -0,0 +1,20 @@
<?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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_marginBottom="30dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/bg_list_row"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingBottom="@dimen/padding_list_row"
android:paddingLeft="?listPreferredItemPaddingLeft"
android:paddingRight="?listPreferredItemPaddingRight"
android:paddingTop="@dimen/padding_list_row">
<LinearLayout
android:id="@+id/message_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:orientation="vertical"
android:paddingLeft="72dp"
android:paddingRight="@dimen/padding_list_row">
<TextView
android:id="@+id/patient_Id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/fontstyle"
android:lines="1"
android:textColor="@color/from"
android:textSize="@dimen/msg_text_primary"
android:textStyle="bold"
tools:text="Sender name"/>
<TextView
android:id="@+id/sample_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:fontFamily="@font/fontstyle"
android:textColor="@color/subject"
android:textSize="@dimen/msg_text_secondary"
android:textStyle="bold"
tools:text="This is the subject of the email"/>
<TextView
android:id="@+id/nikshayid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/fontstyle"
android:lines="1"
android:layout_marginBottom="23dp"
android:textColor="@color/message"
android:textSize="@dimen/msg_text_secondary"
tools:text="This is the body of the email"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/icon_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/icon_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</RelativeLayout>
<RelativeLayout
android:id="@+id/icon_front"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/icon_profile"
android:layout_width="@dimen/icon_width_height"
android:layout_height="@dimen/icon_width_height" />
<TextView
android:id="@+id/icon_text"
android:text="N"
android:gravity="center"
android:layout_width="45dp"
android:layout_height="45dp"
android:background="@drawable/bg_circle"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:textSize="@dimen/icon_text" />
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:fontFamily="@font/fontstyle"
android:textColor="@color/timestamp"
android:textSize="@dimen/timestamp"
android:textStyle="bold"
tools:text="9:00 AM"/>
<!-- <ImageView
android:id="@+id/icon_star"
android:background="@android:drawable/ic_menu_share"
android:layout_width="@dimen/icon_star"
android:layout_height="@dimen/icon_star"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
app:tint="@color/icon_tint_normal" />-->
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:layout_alignParentBottom="true"
android:background="#EEE" />
</RelativeLayout>

View File

@@ -1,5 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="230dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/head">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="matrix"
android:src="@color/colorPrimary"
></ImageView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<in.sminnovations.arrest_tb.FontAwesome
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50dp"
android:text="&#xf2bd;"
android:padding="20dp"
android:layout_marginTop="30dp"
android:id="@+id/image"
android:textColor="@android:color/white"
></in.sminnovations.arrest_tb.FontAwesome>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Not Signed In"
android:layout_below="@id/image"
android:padding="10dp"
android:textColor="@android:color/white"
android:id="@+id/not_sign_in"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name"
android:layout_below="@id/not_sign_in"
android:padding="10dp"
android:textColor="@android:color/white"
android:id="@+id/text"></TextView>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!--
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="180dp"
@@ -18,7 +71,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ShanMukhaInnovations.ArrestTB.FontAwesome
<com.shanmukhainnovations.spintubetest.Font_Awesome
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50dp"
@@ -27,7 +80,7 @@
android:layout_marginTop="30dp"
android:id="@+id/image"
android:textColor="@android:color/white"
></com.ShanMukhaInnovations.ArrestTB.FontAwesome>
></com.shanmukhainnovations.spintubetest.Font_Awesome>
<TextView
android:layout_width="wrap_content"
@@ -41,4 +94,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>-->

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/bg_list_row"
android:orientation="vertical"
android:paddingBottom="@dimen/padding_list_row"
android:paddingLeft="?listPreferredItemPaddingLeft"
android:paddingRight="?listPreferredItemPaddingRight"
android:paddingTop="@dimen/padding_list_row">
<LinearLayout
android:id="@+id/message_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="72dp"
android:paddingRight="@dimen/padding_list_row">
<TextView
android:id="@+id/patient_Id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/fontstyle"
android:lines="1"
android:textColor="@color/from"
android:textSize="@dimen/msg_text_primary"
android:textStyle="bold"
tools:text="Sender name"/>
<TextView
android:id="@+id/sample_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lines="1"
android:fontFamily="@font/fontstyle"
android:textColor="@color/subject"
android:textSize="@dimen/msg_text_secondary"
android:textStyle="bold"
tools:text="This is the subject of the email"/>
<TextView
android:id="@+id/nikshayid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/fontstyle"
android:lines="1"
android:paddingBottom="5dp"
android:textColor="@color/message"
android:textSize="@dimen/msg_text_secondary"
tools:text="This is the body of the email"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/icon_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/icon_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</RelativeLayout>
<RelativeLayout
android:id="@+id/icon_front"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/icon_profile"
android:layout_width="@dimen/icon_width_height"
android:layout_height="@dimen/icon_width_height" />
<TextView
android:id="@+id/icon_text"
android:text="N"
android:gravity="center"
android:layout_width="45dp"
android:layout_height="45dp"
android:background="@drawable/bg_circle"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:textSize="@dimen/icon_text" />
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:fontFamily="@font/fontstyle"
android:textColor="@color/timestamp"
android:textSize="@dimen/timestamp"
android:textStyle="bold"
tools:text="9:00 AM"/>
<!-- <ImageView
android:id="@+id/icon_star"
android:background="@android:drawable/ic_menu_share"
android:layout_width="@dimen/icon_star"
android:layout_height="@dimen/icon_star"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
app:tint="@color/icon_tint_normal" />-->
</RelativeLayout>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/download1"
android:icon="@drawable/ic_baseline_arrow_downward_24"
android:title="Download Data"
app:showAsAction="always"
/>
<item android:id="@+id/share"
android:icon="@drawable/ic_baseline_share_24"
android:title="Share Data"
app:showAsAction="always"
/>
</menu>

View File

@@ -6,25 +6,33 @@
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_profile"
android:id="@+id/nav_home"
android:title="Your Profile" />
android:title="Home" />
<item
android:id="@+id/nav_details"
android:title="Patient Details" />
android:id="@+id/nav_add_Test"
android:title="Add Test" />
<item
android:id="@+id/nav_results"
android:title="Results" />
<item
android:id="@+id/nav_positive"
android:title="Positive Results" />
<item
android:id="@+id/nav_negative"
android:title="Negative Results " />
<item
android:id="@+id/nav_contact_us"
android:title="About" />
<item
android:id="@+id/logout"
android:id="@+id/nav_logout"
android:title="Logout" />
</group>
</menu>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/search"
android:icon="@drawable/ic_baseline_search_24"
android:title="Search Data"
app:showAsAction="always"
app:actionViewClass="android.widget.SearchView" />
</menu>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More