Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
659d56123e | ||
|
|
1413145976 | ||
|
|
7cfbc5bb68 |
138
app/build.gradle
Normal file
@@ -0,0 +1,138 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.firebase.appdistribution'
|
||||
id 'com.google.gms.google-services'
|
||||
id 'androidx.navigation.safeargs.kotlin'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.google.firebase.crashlytics'
|
||||
id 'dagger.hilt.android.plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.smi.counselling"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.smi.counselling"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
}
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
buildConfig = true
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
packagingOptions {
|
||||
exclude 'mockito-extensions/org.mockito.plugins.MockMaker'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.google.dagger:hilt-android:2.46"
|
||||
kapt "com.google.dagger:hilt-android-compiler:2.46"
|
||||
implementation 'com.google.dagger:hilt-android:2.46'
|
||||
kapt 'com.google.dagger:hilt-android-compiler:2.46'
|
||||
implementation 'androidx.core:core-ktx:1.12.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.6.2'
|
||||
|
||||
//firebase
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
implementation("com.google.firebase:firebase-perf-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation 'com.google.firebase:firebase-firestore-ktx'
|
||||
implementation 'com.google.firebase:firebase-auth-ktx'
|
||||
implementation 'com.google.firebase:firebase-storage-ktx'
|
||||
implementation 'com.firebaseui:firebase-ui-firestore:8.0.2'
|
||||
implementation 'com.google.android.gms:play-services-auth:20.7.0'
|
||||
implementation 'com.google.android.gms:play-services-location:21.0.1'
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
||||
implementation 'com.google.android.things:androidthings:1.0'
|
||||
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta11'
|
||||
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta11")
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
|
||||
|
||||
// Testing
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
// Mockito dependencies
|
||||
testImplementation 'org.mockito:mockito-core:3.12.4'
|
||||
androidTestImplementation 'org.mockito:mockito-android:3.12.4'
|
||||
androidTestImplementation 'org.mockito:mockito-inline:3.12.4'
|
||||
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
|
||||
|
||||
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
|
||||
implementation 'com.opencsv:opencsv:5.5'
|
||||
|
||||
implementation "androidx.fragment:fragment-ktx:1.6.2"
|
||||
|
||||
// Barcode scanner
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||
|
||||
// Google ML Kit usign play services
|
||||
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
||||
|
||||
//Room
|
||||
implementation "androidx.room:room-ktx:2.6.1"
|
||||
implementation "androidx.room:room-runtime:2.6.1"
|
||||
kapt ("androidx.room:room-compiler:2.6.1")
|
||||
|
||||
//image
|
||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||||
|
||||
// Navigation Component
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:2.7.6"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:2.7.6"
|
||||
|
||||
//Dagger - Hilt
|
||||
implementation "com.google.dagger:hilt-android:2.46"
|
||||
kapt "com.google.dagger:hilt-android-compiler:2.46"
|
||||
kapt "androidx.hilt:hilt-compiler:1.1.0"
|
||||
|
||||
// Retrofit + GSON
|
||||
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
||||
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
|
||||
|
||||
implementation "androidx.preference:preference-ktx:1.2.1"
|
||||
// Add Hilt dependencies
|
||||
|
||||
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.smi.counselling"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.smi.counselling"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = "1.4.3"
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation("androidx.core:core-ktx:1.9.0")
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
|
||||
implementation("androidx.activity:activity-compose:1.8.0")
|
||||
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
|
||||
implementation("androidx.compose.ui:ui")
|
||||
implementation("androidx.compose.ui:ui-graphics")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview")
|
||||
implementation("androidx.compose.material3:material3")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
||||
}
|
||||
208
app/google-services.json
Normal file
@@ -0,0 +1,208 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "650071678820",
|
||||
"project_id": "hpos-af3cc",
|
||||
"storage_bucket": "hpos-af3cc.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:650071678820:android:f1435a1c07f710036c6471",
|
||||
"android_client_info": {
|
||||
"package_name": "com.example.hposconsentform"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:650071678820:android:7865bef608cdee6f6c6471",
|
||||
"android_client_info": {
|
||||
"package_name": "com.smi.counselling"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:650071678820:android:2925e9ce3417d2386c6471",
|
||||
"android_client_info": {
|
||||
"package_name": "in.sminnovations.hemocube"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-srhm9spm9hjn4frcd3r6o02gdhdbtd15.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "in.sminnovations.hemocube",
|
||||
"certificate_hash": "7714b9268a81d0cf0fb178b0af8dbb630f8fc70a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:650071678820:android:7569c1cad4fc99916c6471",
|
||||
"android_client_info": {
|
||||
"package_name": "in.sminnovations.hposregistration"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-70kp5jvjda4r5diqch2kn4lc40p4f42g.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "in.sminnovations.hposregistration",
|
||||
"certificate_hash": "7714b9268a81d0cf0fb178b0af8dbb630f8fc70a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:650071678820:android:f96be19e5d43102b6c6471",
|
||||
"android_client_info": {
|
||||
"package_name": "in.sminnovations.hpostesting"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-l87dnr0bdj95get0khgnvfv2an1k6ogq.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "in.sminnovations.hpostesting",
|
||||
"certificate_hash": "7714b9268a81d0cf0fb178b0af8dbb630f8fc70a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:650071678820:android:a53292637abb7c0d6c6471",
|
||||
"android_client_info": {
|
||||
"package_name": "in.sminnovations.hpostesting.dev"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -2,7 +2,27 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission
|
||||
android:name="android.permission.BATTERY_STATS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<uses-feature android:name="android.hardware.usb.host" />
|
||||
|
||||
<uses-permission android:name="android.permission.USB_PERMISSION" />
|
||||
|
||||
<application
|
||||
android:name="com.smi.counselling.HPOSCounsellingApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
@@ -13,16 +33,21 @@
|
||||
android:theme="@style/Theme.HPOSCounselling"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:name="com.smi.counselling.data.dashboard.DigitalCardActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".data.dashboard.DashboardActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.HPOSCounselling">
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
app/src/main/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
@@ -0,0 +1,29 @@
|
||||
package com.smi.counselling
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.example.hpostesting.data.dao.MyDatabase
|
||||
import com.google.android.datatransport.runtime.dagger.Provides
|
||||
import com.google.firebase.firestore.FirebaseFirestore
|
||||
import com.google.firebase.firestore.FirebaseFirestoreSettings
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import javax.inject.Singleton
|
||||
@HiltAndroidApp
|
||||
class HPOSCounsellingApplication: Application() {
|
||||
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
val firestoreSettings = FirebaseFirestoreSettings.Builder()
|
||||
.setPersistenceEnabled(true) // Enable offline persistence if needed
|
||||
.build()
|
||||
|
||||
val firestore = FirebaseFirestore.getInstance()
|
||||
firestore.firestoreSettings = firestoreSettings
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package com.smi.counselling
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.smi.counselling.ui.theme.HPOSCounsellingTheme
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
HPOSCounsellingTheme {
|
||||
// A surface container using the 'background' color from the theme
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = MaterialTheme.colorScheme.background
|
||||
) {
|
||||
HomeScreen("Home")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun HomeScreen(name: String, modifier: Modifier = Modifier) {
|
||||
var userId1 by remember { mutableStateOf("") }
|
||||
var userId2 by remember { mutableStateOf("") }
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.SpaceBetween,
|
||||
modifier = Modifier.background(Color.White)
|
||||
) {
|
||||
Text(
|
||||
text = "Digital Counselling",
|
||||
modifier = modifier
|
||||
)
|
||||
TextField(
|
||||
value = userId1, onValueChange = { userId1 = it },
|
||||
modifier = Modifier
|
||||
.width(240.dp).height(30.dp)
|
||||
.padding(start = 15.dp, top = 10.dp, bottom = 10.dp, end = 15.dp)
|
||||
.background(Color.Gray, RoundedCornerShape(5.dp)),
|
||||
)
|
||||
|
||||
Text("Score: 75%",
|
||||
style = TextStyle(
|
||||
fontSize = 28.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
textAlign = TextAlign.Center,
|
||||
),
|
||||
modifier = Modifier
|
||||
.padding(10.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun HomeScreenPreview() {
|
||||
HPOSCounsellingTheme {
|
||||
HomeScreen("Home")
|
||||
}
|
||||
}
|
||||
28
app/src/main/java/com/smi/counselling/data/DataHolder.kt
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.smi.counselling.data
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
object DataHolder {
|
||||
|
||||
|
||||
val usbConnected = MutableLiveData(true)
|
||||
var mobileUniqueId: String? = null
|
||||
var isAppFolderCreated = false
|
||||
var appFolderPath = ""
|
||||
var isReferenceTaken = false
|
||||
var sampleReadCounter = 0
|
||||
|
||||
|
||||
var deviceSerialNumber: String = "ABCD"
|
||||
val deviceType = MutableLiveData<String>()
|
||||
val wavelengthToPixelArray = ArrayList<Double>()
|
||||
val intensityReferenceArray = ArrayList<Double>()
|
||||
var selectedTest: UserData? = null
|
||||
var hemoCubeTestData: HemoCubeTestData? = null
|
||||
var kitSerial: String = ""
|
||||
var location: UserData.Location? = null
|
||||
var testExp: Boolean = true
|
||||
var hemocubeResult: Double? = null
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.smi.counselling.data
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.Network
|
||||
import android.net.NetworkCapabilities
|
||||
import android.net.NetworkRequest
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.lifecycle.LiveData
|
||||
|
||||
class NetworkStatusLiveData(context: Context) : LiveData<Boolean>() {
|
||||
|
||||
private val connectivityManager: ConnectivityManager =
|
||||
context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
|
||||
private val networkCallback = object : ConnectivityManager.NetworkCallback() {
|
||||
override fun onAvailable(network: Network) {
|
||||
postValue(true)
|
||||
}
|
||||
|
||||
override fun onLost(network: Network) {
|
||||
postValue(false)
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
override fun onActive() {
|
||||
super.onActive()
|
||||
postValue(isNetworkAvailable())
|
||||
registerNetworkCallback()
|
||||
}
|
||||
|
||||
override fun onInactive() {
|
||||
super.onInactive()
|
||||
unregisterNetworkCallback()
|
||||
}
|
||||
|
||||
private fun registerNetworkCallback() {
|
||||
val networkRequest = NetworkRequest.Builder()
|
||||
.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
|
||||
.addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
|
||||
.addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET)
|
||||
.build()
|
||||
|
||||
connectivityManager.registerNetworkCallback(networkRequest, networkCallback)
|
||||
}
|
||||
|
||||
private fun unregisterNetworkCallback() {
|
||||
connectivityManager.unregisterNetworkCallback(networkCallback)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private fun isNetworkAvailable(): Boolean {
|
||||
val network = connectivityManager.activeNetwork
|
||||
val networkCapabilities = connectivityManager.getNetworkCapabilities(network)
|
||||
return networkCapabilities != null &&
|
||||
networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
|
||||
networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
|
||||
}
|
||||
}
|
||||
381
app/src/main/java/com/smi/counselling/data/constant/Constants.kt
Normal file
@@ -0,0 +1,381 @@
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
object Constants {
|
||||
const val ACTION_USB_PERMISSION = "shanmukha.in.sickle_cell.USB_PERMISSION"
|
||||
const val HOMOCUBE_USB_PERMISSION = "shanmukha.in.sickle_cell_homocube.USB_PERMISSION"
|
||||
|
||||
const val ABHA_APP_PACKAGE = "in.ndhm.phr"
|
||||
|
||||
const val WRITE_TIMEOUT_MILLIS = 30000 // 30 sec
|
||||
const val READ_TIMEOUT_MILLIS = 60000 // 1 min
|
||||
const val DELAY_BETWEEN_COMMANDS: Long = 1000
|
||||
|
||||
const val TEST_RIGHT_TOTAL_PIXEL = 3694
|
||||
|
||||
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE = 40
|
||||
|
||||
const val RANGE_IN_RESULT_CALCULATIONS = 10
|
||||
|
||||
const val WAVELENGTH_OF_INTEREST_ONE = 427
|
||||
const val WAVELENGTH_OF_INTEREST_TWO = 555
|
||||
|
||||
const val MIN_WAVELENGTH_RANGE_TO_RECORD = 350
|
||||
const val MAX_WAVELENGTH_RANGE_TO_RECORD = 750
|
||||
|
||||
const val DEVICE_PRODUCT_ID = 24597
|
||||
const val DEVICE_TYPE_HOMOCUBE = "HOMOCUBE"
|
||||
const val DEVICE_TYPE_TEST_RIGHT = "TEST_RIGHT"
|
||||
|
||||
const val DEVICE_VENDOR_ID = 1027
|
||||
const val HOMO_CUBE_ID = 29987
|
||||
const val VENDOR_ID = 6790
|
||||
const val HEMO_CUBE_V2_PRODUCT_ID = 24577
|
||||
const val HEMO_CUBE_V2_VENDOR_ID = 1027
|
||||
|
||||
const val ERROR_NORMAL = 400
|
||||
const val ERROR_CRITICAL = 401
|
||||
|
||||
const val NO_OF_TIMES_TO_RUN_SAMPLE = 1
|
||||
|
||||
const val USER_ID = "usernameId"
|
||||
|
||||
val STATICID = listOf(
|
||||
"ADMIN",
|
||||
"VIZ-1000-0004",
|
||||
"VIZ-1000-0005",
|
||||
"VIZ-1000-0006",
|
||||
"HC-V1-001",
|
||||
"HC-V1-002",
|
||||
"HC-V1-003",
|
||||
"HC-V1-004",
|
||||
"HC-V1-005",
|
||||
"HC-V1-006",
|
||||
"HC-V1-007",
|
||||
"HC-V1-008",
|
||||
"HC-V1-009",
|
||||
"HC-V1-010",
|
||||
"HC-V1-011",
|
||||
"HC-V1-012",
|
||||
"HC-V1-013",
|
||||
"HC-V1-014",
|
||||
"HC-V1-015",
|
||||
"HC-V1-016",
|
||||
"HC-V1-017",
|
||||
"HC-V1-018",
|
||||
"HC-V1-019",
|
||||
"HC-V1-020",
|
||||
"HCV-000-3001",
|
||||
"HCV-000-3002",
|
||||
"HCV-000-3003",
|
||||
"HCV-000-3004",
|
||||
"HCV-000-3005",
|
||||
"HCV-000-3006",
|
||||
"HCV-000-3007",
|
||||
"HCV-000-3008",
|
||||
"HCV-000-3009",
|
||||
"HCV-000-3010",
|
||||
"HCV-000-3011",
|
||||
"HCV-000-3012",
|
||||
"HCV-000-3013",
|
||||
"HCV-000-3014",
|
||||
"HCV-000-3015",
|
||||
"HCV-000-3016",
|
||||
"HCV-000-3017",
|
||||
"HCV-000-3018",
|
||||
"HCV-000-3019",
|
||||
"HCV-000-3020"
|
||||
)
|
||||
|
||||
const val password = "SMI@12345"
|
||||
|
||||
const val KIT_NUMBER = "KitNumber"
|
||||
const val KIT_COUNT = "KitCount"
|
||||
const val BUFFER_VALUE_1 = "BufferValue1"
|
||||
const val BUFFER_VALUE_2 = "BufferValue2"
|
||||
const val BUFFER_VALUE_3 = "BufferValue3"
|
||||
const val BUFFER_VALUE_4 = "BufferValue4"
|
||||
const val DEVICE_ID = "DEVICE_ID"
|
||||
|
||||
const val BUFFER_LED_LOWER_BOUND = 21000
|
||||
const val BUFFER_LED_UPPER_BOUND = 24500
|
||||
|
||||
const val TEST_STATUS_CODE_TEST_STARTED = 1.0
|
||||
const val TEST_STATUS_CODE_CONFIG_STARTED = 2.0
|
||||
const val TEST_STATUS_CODE_CONFIG_COMPLETED = 3.0
|
||||
const val TEST_STATUS_CODE_BUFFER_STARTED = 4.0
|
||||
const val TEST_STATUS_CODE_BUFFER_COMPLETED = 5.0
|
||||
const val TEST_STATUS_CODE_BUFFER_PRINT_STARTED = 6.0
|
||||
const val TEST_STATUS_CODE_BUFFER_PRINT_COMPLETED = 7.0
|
||||
const val TEST_STATUS_CODE_SAMPLE_STARTED = 8.0
|
||||
const val TEST_STATUS_CODE_SAMPLE_COMPLETED = 9.0
|
||||
const val TEST_STATUS_CODE_SAMPLE_PRINT_STARTED = 10.0
|
||||
const val TEST_STATUS_CODE_SAMPLE_PRINT_COMPLETED = 11.0
|
||||
const val TEST_STATUS_CODE_FIRST_GAIN_STARTED = 12.0
|
||||
const val TEST_STATUS_CODE_FIRST_GAIN_COMPLETED = 13.0
|
||||
const val TEST_STATUS_CODE_FIRST_GAIN_PRINT_STARTED = 14.0
|
||||
const val TEST_STATUS_CODE_FIRST_GAIN_PRINT_COMPLETED = 15.0
|
||||
const val TEST_STATUS_CODE_SECOND_GAIN_STARTED = 16.0
|
||||
const val TEST_STATUS_CODE_SECOND_GAIN_COMPLETED = 17.0
|
||||
const val TEST_STATUS_CODE_SECOND_GAIN_PRINT_STARTED = 18.0
|
||||
const val TEST_STATUS_CODE_SECOND_GAIN_PRINT_COMPLETED = 19.0
|
||||
const val TEST_STATUS_CODE_THIRD_GAIN_STARTED = 20.0
|
||||
const val TEST_STATUS_CODE_THIRD_GAIN_COMPLETED = 21.0
|
||||
const val TEST_STATUS_CODE_THIRD_GAIN_PRINT_STARTED = 22.0
|
||||
const val TEST_STATUS_CODE_THIRD_GAIN_PRINT_COMPLETED = 23.0
|
||||
const val TEST_STATUS_CODE_FORTH_GAIN_STARTED = 24.0
|
||||
const val TEST_STATUS_CODE_FORTH_GAIN_COMPLETED = 25.0
|
||||
const val TEST_STATUS_CODE_FORTH_GAIN_PRINT_STARTED = 26.0
|
||||
const val TEST_STATUS_CODE_FORTH_GAIN_PRINT_COMPLETED = 27.0
|
||||
const val TEST_STATUS_CODE_TEST_COMPLETED = 30.0
|
||||
|
||||
val DEVICE_CONFIGURATION: Map<String, List<List<Double>>> = mapOf<String, List<List<Double>>>(
|
||||
"HCV-000-3001" to listOf(
|
||||
listOf(1.313, -0.89), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2012, 0.0092), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3002" to listOf(
|
||||
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3003" to listOf(
|
||||
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3004" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3005" to listOf(
|
||||
listOf(1.3801, -0.372), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.4565, -0.0371), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3006" to listOf(
|
||||
listOf(1.3801, -0.372), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.4565, -0.0371), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3007" to listOf(
|
||||
listOf(1.8445, -0.8213), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.4613, -0.0831), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3008" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3009" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3010" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3011" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3012" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3013" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3014" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3015" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3016" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3017" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3018" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3019" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3020" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
)
|
||||
|
||||
const val INCUBATION_TIME_MIN = 0
|
||||
const val INCUBATION_TIME_MAX = 1400
|
||||
const val BATTERY_LEVEL_MIN = 0
|
||||
const val READINGS_PER_SAMPLE = 3
|
||||
|
||||
val BUFFER_INTENSITY_THRESHOLDS: Map<String, List<List<Int>>> = mapOf<String, List<List<Int>>>(
|
||||
"HCV-000-3001" to listOf(
|
||||
listOf(20000, 25074),
|
||||
listOf(20000, 24596),
|
||||
listOf(20000, 26065),
|
||||
listOf(20000, 27093),
|
||||
),
|
||||
"HCV-000-3002" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3003" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3004" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3005" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3006" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3007" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3008" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3009" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3010" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3011" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3012" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3013" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3014" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3015" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3016" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3017" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3018" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3019" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3020" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
enum class HemoCubeCommands(val command: String) {
|
||||
startBuffer("B\r"),
|
||||
AUTO_DAC_COMMAND("C\r"),
|
||||
runDiagnostics("D\r"),
|
||||
startSample("S\r"),
|
||||
PRINT_COMMAND("P\r"),
|
||||
getDeviceId("I\r"),
|
||||
FIRST_GAIN_COMMAND("T\r"),
|
||||
SECOND_GAIN_COMMAND("U\r"),
|
||||
THIRD_GAIN_COMMAND("V\r"),
|
||||
FORTH_GAIN_COMMAND("W\r"),
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import java.util.Locale
|
||||
|
||||
object LanguageManager {
|
||||
private const val LANGUAGE_PREF_KEY = "language_pref"
|
||||
|
||||
fun setLocale(context: Context, languageCode: String) {
|
||||
val locale = Locale(languageCode)
|
||||
Locale.setDefault(locale)
|
||||
|
||||
val resources = context.resources
|
||||
val configuration = resources.configuration
|
||||
configuration.setLocale(locale)
|
||||
|
||||
context.createConfigurationContext(configuration)
|
||||
}
|
||||
|
||||
fun persistLanguagePreference(context: Context, languageCode: String) {
|
||||
val prefs: SharedPreferences = context.getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
|
||||
prefs.edit().putString(LANGUAGE_PREF_KEY, languageCode).apply()
|
||||
}
|
||||
|
||||
fun getSavedLanguage(context: Context): String {
|
||||
val prefs: SharedPreferences = context.getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
|
||||
return prefs.getString(LANGUAGE_PREF_KEY, "en") ?: "en"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
enum class TestRightCommands(val command: String) {
|
||||
led2Set50("led2 50\r"),
|
||||
led2Set100("led2 100\r"),
|
||||
read("read\r"),
|
||||
autoset("autoset\r"),
|
||||
run("run\r"),
|
||||
printInRange("print 239 339\r"),
|
||||
printAll("print\r"),
|
||||
testByEnter("\n\r")
|
||||
}
|
||||
38
app/src/main/java/com/smi/counselling/data/dao/Converters.kt
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
import com.google.common.reflect.TypeToken
|
||||
import com.google.gson.Gson
|
||||
|
||||
class Converters {
|
||||
private val gson = Gson()
|
||||
|
||||
@TypeConverter
|
||||
fun fromString(value: String?): UserData.Location? {
|
||||
return if (value != null) {
|
||||
gson.fromJson(value, UserData.Location::class.java)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
@TypeConverter
|
||||
fun toString(location: UserData.Location?): String? {
|
||||
return if (location != null) {
|
||||
gson.toJson(location)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun fromList(list: List<Double>): String {
|
||||
return Gson().toJson(list)
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun toList(json: String): List<Double> {
|
||||
val type = object : TypeToken<List<Double>>() {}.type
|
||||
return Gson().fromJson(json, type)
|
||||
}
|
||||
}
|
||||
24
app/src/main/java/com/smi/counselling/data/dao/DeviceDao.kt
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
@Dao
|
||||
interface DeviceDao {
|
||||
@Query("SELECT * from device_table")
|
||||
fun getAll(): LiveData<List<HemoCubeTestData>>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertAll(deviceData: DeviceData)
|
||||
|
||||
@Query("SELECT * FROM device_table WHERE deviceId = :id")
|
||||
suspend fun getUserByID(id: String): HemoCubeTestData
|
||||
|
||||
@Query("DELETE FROM device_table WHERE deviceId = :id")
|
||||
suspend fun deleteById(id: String)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
import com.google.android.datatransport.runtime.dagger.Module
|
||||
|
||||
@Dao
|
||||
@Module
|
||||
interface HemoCubeDao {
|
||||
@Query("SELECT * from hemo_cube_test_table")
|
||||
fun getAll(): LiveData<List<HemoCubeTestData>>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertAll(hemoCubeTestData: HemoCubeTestData)
|
||||
|
||||
@Query("SELECT * FROM hemo_cube_test_table WHERE _id = :id")
|
||||
suspend fun getUserByID(id: String): HemoCubeTestData
|
||||
|
||||
@Query("DELETE FROM hemo_cube_test_table WHERE _id = :id")
|
||||
suspend fun deleteById(id: String)
|
||||
|
||||
@Query("UPDATE hemo_cube_test_table SET localFlag = :newValue WHERE _id = :id")
|
||||
suspend fun updateFieldById(id: String, newValue: Boolean)
|
||||
}
|
||||
16
app/src/main/java/com/smi/counselling/data/dao/MyDataBase.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.TypeConverters
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 1, exportSchema = false)
|
||||
@TypeConverters(Converters::class)
|
||||
abstract class MyDatabase : RoomDatabase() {
|
||||
abstract fun userDao(): UserDao
|
||||
abstract fun hemoCubeDao(): HemoCubeDao
|
||||
|
||||
}
|
||||
23
app/src/main/java/com/smi/counselling/data/dao/UserDao.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@Dao
|
||||
interface UserDao {
|
||||
@Query("SELECT * from user_table")
|
||||
fun getAll(): LiveData<List<UserData>>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertAll(userData: UserData)
|
||||
|
||||
@Query("SELECT * FROM user_table WHERE _id = :id")
|
||||
suspend fun getUserByID(id: String): UserData
|
||||
|
||||
@Query("DELETE FROM user_table WHERE _id = :id")
|
||||
suspend fun deleteById(id: String)
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.smi.counselling.data.dashboard
|
||||
|
||||
import android.content.Context
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import androidx.navigation.ui.AppBarConfiguration
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.smi.counselling.R
|
||||
import com.smi.counselling.databinding.ActivityDashboardBinding
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DashboardActivity : AppCompatActivity() {
|
||||
private lateinit var appBarConfiguration: AppBarConfiguration
|
||||
private lateinit var binding: ActivityDashboardBinding
|
||||
|
||||
override fun attachBaseContext(newBase: Context?) {
|
||||
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||
LanguageManager.setLocale(newBase, languageCode)
|
||||
super.attachBaseContext(newBase)
|
||||
}
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityDashboardBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
moveToNext()
|
||||
}
|
||||
|
||||
|
||||
private fun moveToNext() {
|
||||
if (supportFragmentManager.isDestroyed) return
|
||||
supportFragmentManager.beginTransaction().replace(binding.fghemocube.id, HomeFragment())
|
||||
.commit()
|
||||
}
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.smi.counselling.data.dashboard
|
||||
|
||||
import android.content.Context
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.smi.counselling.databinding.ActivityDigitalCardBinding
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DigitalCardActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityDigitalCardBinding
|
||||
|
||||
override fun attachBaseContext(newBase: Context?) {
|
||||
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||
LanguageManager.setLocale(newBase, languageCode)
|
||||
super.attachBaseContext(newBase)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityDigitalCardBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
moveToNext()
|
||||
}
|
||||
|
||||
|
||||
private fun moveToNext() {
|
||||
if (supportFragmentManager.isDestroyed) return
|
||||
supportFragmentManager.beginTransaction().replace(binding.fghemocube.id, DigitalCardFragment())
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
package com.smi.counselling.data.dashboard
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.Log
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.firestore.ktx.firestore
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import com.smi.counselling.R
|
||||
import com.smi.counselling.data.DataHolder
|
||||
import com.smi.counselling.databinding.FragmentDigitalCardBinding
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DigitalCardFragment : Fragment() {
|
||||
private lateinit var binding: FragmentDigitalCardBinding
|
||||
private val hemoCubeViewModel: HomeViewModel by activityViewModels()
|
||||
private lateinit var sharedPreferences: SharedPreferences
|
||||
private val testDetails = DataHolder.selectedTest?.toHemoCubeTestData()
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||
): View {
|
||||
binding = FragmentDigitalCardBinding.inflate(inflater, container, false)
|
||||
sharedPreferences =
|
||||
requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
||||
initViews()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initViews() {
|
||||
|
||||
|
||||
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isConnected ->
|
||||
if (isConnected) {
|
||||
loadUserData()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun loadUserData() {
|
||||
val AbhaIdList = mutableListOf<String>() // Declare it outside the try block
|
||||
|
||||
try {
|
||||
val query = Firebase.firestore.collection("patientData")
|
||||
|
||||
query.get().addOnSuccessListener { documents ->
|
||||
for (document in documents) {
|
||||
val abhaId = document.getString("abhaId")
|
||||
|
||||
if (abhaId != null) {
|
||||
AbhaIdList.add(abhaId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
activity?.runOnUiThread {
|
||||
val adapter =
|
||||
ArrayAdapter(requireContext(), R.layout.dropdown_item, AbhaIdList)
|
||||
binding.abhaidtext.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
before: Int,
|
||||
count: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
if (s?.length == 10) {
|
||||
binding.abhaidtext.setAdapter(adapter)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
binding.abhaidtext.setOnItemClickListener { _, _, position, _ ->
|
||||
val selectedAbhaId = adapter.getItem(position).toString()
|
||||
loadUserDetails(selectedAbhaId)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// Handle exceptions
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SuspiciousIndentation")
|
||||
private fun loadUserDetails(selectedAbhaId: String) {
|
||||
try {
|
||||
val patientQuery = Firebase.firestore.collection("patientData")
|
||||
.whereEqualTo("abhaId", selectedAbhaId)
|
||||
|
||||
patientQuery.get().addOnSuccessListener { patientDocuments ->
|
||||
if (!patientDocuments.isEmpty) {
|
||||
val patientDocument = patientDocuments.documents[0]
|
||||
val commonId = patientDocument.getString("_id")
|
||||
|
||||
val testQuery = Firebase.firestore.collection("testData")
|
||||
.whereEqualTo("_id", commonId)
|
||||
|
||||
testQuery.get().addOnSuccessListener { testDocuments ->
|
||||
if (!testDocuments.isEmpty) {
|
||||
val testDocument = testDocuments.documents[0]
|
||||
val hemoCubeTestData = testDocument.toObject(HemoCubeTestData::class.java)
|
||||
updateCategory(hemoCubeTestData)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateCategory(hemoCubeTestData: HemoCubeTestData?) {
|
||||
binding.abhaid.visibility = View.GONE
|
||||
binding.digitalcard.visibility = View.VISIBLE
|
||||
binding.userCard.visibility = View.VISIBLE
|
||||
|
||||
|
||||
activity?.runOnUiThread {
|
||||
binding.name.text = "Name: ${hemoCubeTestData?.name ?: "N/A"}"
|
||||
binding.dob.text = "DOB: ${hemoCubeTestData?.birthYear ?: "N/A"}"
|
||||
binding.gender.text = "Gender: ${hemoCubeTestData?.gender ?: "N/A"}"
|
||||
binding.State.text = "State: ${hemoCubeTestData?.state ?: "N/A"}"
|
||||
binding.abhaid1.text = "ABHA ID: ${hemoCubeTestData?.abhaId ?: "N/A"}"
|
||||
binding.blood.text = "Blood Group: ${hemoCubeTestData?.bloodGroup?: "N/A"}"
|
||||
binding.sicklecell.text = "Sickle-Cell: ${hemoCubeTestData?.prdClassification ?: "N/A"}"
|
||||
|
||||
Log.d("DigitalCardFragment", "State: ${hemoCubeTestData?.state}")
|
||||
Log.d("DigitalCardFragment", "Blood Group: ${hemoCubeTestData?.bloodGroup}")
|
||||
|
||||
}
|
||||
// Update the UI with the fetched details
|
||||
val originalDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
||||
val originalDate: Date? = originalDateFormat.parse(SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||
).format(Calendar.getInstance().time))
|
||||
|
||||
val desiredDateFormat = SimpleDateFormat("MMM dd, yyyy", Locale.getDefault())
|
||||
val formattedDate: String = originalDate?.let { desiredDateFormat.format(it) } ?: "N/A"
|
||||
activity?.runOnUiThread {
|
||||
binding.issueDate.text = "Issue Date: ${formattedDate}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,383 @@
|
||||
package com.smi.counselling.data.dashboard
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
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.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.bumptech.glide.Glide
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.firestore.ktx.firestore
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import com.smi.counselling.R
|
||||
import com.smi.counselling.data.DataHolder
|
||||
import com.smi.counselling.databinding.FragmentHomeBinding
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import java.util.Locale
|
||||
data class ClassificationResult(val imageResource: Int, val text: String,val imageResource1: Int)
|
||||
@AndroidEntryPoint
|
||||
class HomeFragment : Fragment() {
|
||||
private var _binding: FragmentHomeBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
private val hemoCubeViewModel: HomeViewModel by activityViewModels()
|
||||
private lateinit var sharedPreference: SharedPreferences
|
||||
private var maleresult: String = ""
|
||||
private var femaleresult: String = ""
|
||||
private val testDetails = DataHolder.selectedTest?.toHemoCubeTestData()
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
_binding = FragmentHomeBinding.inflate(inflater, container, false)
|
||||
|
||||
// Check if _binding is null
|
||||
if (_binding == null) {
|
||||
// Handle the case where binding could not be initialized
|
||||
// You may want to log an error or return a default view in this case
|
||||
return super.onCreateView(inflater, container, savedInstanceState)
|
||||
}
|
||||
|
||||
sharedPreference =
|
||||
requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
|
||||
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isConnected ->
|
||||
if (isConnected) {
|
||||
loadUserData()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
binding.btnDigital.setOnClickListener {
|
||||
val i = Intent(
|
||||
requireContext().applicationContext, DigitalCardActivity::class.java
|
||||
)
|
||||
startActivity(i)
|
||||
}
|
||||
|
||||
|
||||
activity?.runOnUiThread {
|
||||
binding.btnSubmit.setOnClickListener {
|
||||
when {
|
||||
binding.maledetails.visibility == View.VISIBLE && binding.femaledetails.visibility == View.VISIBLE -> {
|
||||
binding.btnSubmit.visibility = View.GONE
|
||||
binding.resultImage.visibility = View.VISIBLE
|
||||
classifyAndDisplay(testDetails, binding.resultImage,binding.result,binding.resultratioimg)
|
||||
}
|
||||
|
||||
|
||||
else -> {
|
||||
// Handle the case where neither male nor female details are visible
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun loadUserData() {
|
||||
try {
|
||||
val query = Firebase.firestore.collection("patientData")
|
||||
|
||||
query.get().addOnSuccessListener { documents ->
|
||||
val maleAbhaIdList = mutableListOf<String>()
|
||||
val femaleAbhaIdList = mutableListOf<String>()
|
||||
|
||||
for (document in documents) {
|
||||
val abhaId = document.getString("abhaId")
|
||||
val gender = document.getString("gender")
|
||||
|
||||
if (abhaId != null && gender != null) {
|
||||
when (gender.lowercase(Locale.getDefault())) {
|
||||
"male" -> maleAbhaIdList.add(abhaId)
|
||||
"female" -> femaleAbhaIdList.add(abhaId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val femaleAdapter =
|
||||
ArrayAdapter(requireContext(), R.layout.dropdown_item, femaleAbhaIdList)
|
||||
|
||||
val maleAdapter =
|
||||
ArrayAdapter(requireContext(), R.layout.dropdown_item, maleAbhaIdList)
|
||||
|
||||
activity?.runOnUiThread {
|
||||
|
||||
binding.abhaidtext.addTextChangedListener(object : TextWatcher{
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
before: Int,
|
||||
count: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
if (s?.length == 10) {
|
||||
binding.abhaidtext.setAdapter(maleAdapter)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
binding.abhaidtextfemale.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
before: Int,
|
||||
count: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
if (s?.length == 10) {
|
||||
binding.abhaidtextfemale.setAdapter(femaleAdapter)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
binding.abhaidtext.setOnItemClickListener { _, _, position, _ ->
|
||||
val selectedAbhaId = maleAdapter.getItem(position).toString()
|
||||
loadUserDetails(selectedAbhaId)
|
||||
binding.abhaidtext.setAdapter(null)
|
||||
}
|
||||
|
||||
binding.abhaidtextfemale.setOnItemClickListener { _, _, position, _ ->
|
||||
val selectedAbhaId = femaleAdapter.getItem(position).toString()
|
||||
loadUserDetails(selectedAbhaId)
|
||||
binding.abhaidtextfemale.setAdapter(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// Handle exceptions
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadUserDetails(selectedAbhaId: String) {
|
||||
try {
|
||||
binding.abhaidtext.text = null
|
||||
binding.abhaidtextfemale.text = null
|
||||
val patientQuery = Firebase.firestore.collection("patientData")
|
||||
.whereEqualTo("abhaId", selectedAbhaId)
|
||||
|
||||
patientQuery.get().addOnSuccessListener { patientDocuments ->
|
||||
if (!patientDocuments.isEmpty) {
|
||||
val patientDocument = patientDocuments.documents[0]
|
||||
val commonId = patientDocument.getString("_id")
|
||||
|
||||
val testQuery = Firebase.firestore.collection("testData")
|
||||
.whereEqualTo("_id", commonId)
|
||||
|
||||
testQuery.get().addOnSuccessListener { testDocuments ->
|
||||
if (!testDocuments.isEmpty) {
|
||||
val testDocument = testDocuments.documents[0]
|
||||
val hemoCubeTestData =
|
||||
testDocument.toObject(HemoCubeTestData::class.java)
|
||||
|
||||
if (hemoCubeTestData?.gender.equals("male", ignoreCase = true)) {
|
||||
updateMaleCategory(hemoCubeTestData)
|
||||
} else if (hemoCubeTestData?.gender.equals(
|
||||
"female",
|
||||
ignoreCase = true
|
||||
)
|
||||
) {
|
||||
updateFemaleCategory(hemoCubeTestData)
|
||||
}
|
||||
if (binding.maledetails.visibility == View.VISIBLE && binding.femaledetails.visibility == View.VISIBLE) {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnSubmit.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateMaleCategory(hemoCubeTestData: HemoCubeTestData?) {
|
||||
binding.maledetails.visibility = View.VISIBLE
|
||||
|
||||
binding.userid.text = "userId: ${hemoCubeTestData?._id ?: "N/A"}"
|
||||
binding.gender.text = "gender: ${hemoCubeTestData?.gender ?: "N/A"}"
|
||||
binding.username.text = "Name: ${hemoCubeTestData?.name ?: "N/A"}"
|
||||
maleresult = hemoCubeTestData?.prdClassification.toString()
|
||||
Log.e("result", maleresult)
|
||||
// binding.State.text = "Result: $maleresult"
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateFemaleCategory(hemoCubeTestData: HemoCubeTestData?) {
|
||||
binding.femaledetails.visibility = View.VISIBLE
|
||||
|
||||
binding.userid1.text = "userId: ${hemoCubeTestData?._id ?: "N/A"}"
|
||||
binding.gender1.text = "gender: ${hemoCubeTestData?.gender ?: "N/A"}"
|
||||
binding.username1.text = "Name: ${hemoCubeTestData?.name ?: "N/A"}"
|
||||
femaleresult = hemoCubeTestData?.prdClassification.toString()
|
||||
Log.e("result", maleresult)
|
||||
// binding.State1.text = "Result: $femaleresult"
|
||||
}
|
||||
|
||||
|
||||
private fun classifyAndDisplay(
|
||||
hemoCubeTestData: HemoCubeTestData?,
|
||||
imageView: ImageView,
|
||||
textView: TextView,
|
||||
imageView1: ImageView
|
||||
) {
|
||||
activity?.runOnUiThread {
|
||||
binding.resultImage.visibility = View.VISIBLE
|
||||
binding.result.visibility = View.VISIBLE
|
||||
binding.resultratioimg.visibility = View.VISIBLE
|
||||
binding.maledetails.visibility = View.GONE
|
||||
binding.femaledetails.visibility = View.GONE
|
||||
val parent1Classification = maleresult
|
||||
val parent2Classification = femaleresult
|
||||
|
||||
Log.e("Result", "Parent 1 Classification: $parent1Classification")
|
||||
Log.e("Result", "Parent 2 Classification: $parent2Classification")
|
||||
|
||||
val classificationResult = classifyChild(parent1Classification, parent2Classification)
|
||||
Glide.with(this)
|
||||
.load(classificationResult.imageResource)
|
||||
.into(imageView)
|
||||
textView.text = classificationResult.text
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun classifyChild(
|
||||
parent1Classification: String,
|
||||
parent2Classification: String
|
||||
): ClassificationResult {
|
||||
val parent1 = parent1Classification.trim().lowercase(Locale.getDefault())
|
||||
val parent2 = parent2Classification.trim().lowercase(Locale.getDefault())
|
||||
|
||||
return when {
|
||||
parent1 == "sickle cell disease" && parent2 == "sickle cell disease" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_1,
|
||||
"If both parents have sickle cell disease, there is a 100% chance that their children will be born with the disease",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "sickle cell trait" && parent2 == "sickle cell disease" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_2,"If one parent has sickle cell trait and the other has sickle cell disease, then children have a 50% chance of being diseased and 50% of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "sickle cell disease" && parent2 == "sickle cell trait" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_2,"If one parent has sickle cell trait and the other has sickle cell disease, then children have a 50% chance of being diseased and 50% of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "normal" && parent2 == "sickle cell disease" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_3,"if one parent is normal and the other has sickle cell disease, then children have a 100% chance of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "sickle cell disease" && parent2 == "normal" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_3,"if one parent is normal and the other has sickle cell disease, then children have a 100% chance of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "sickle cell trait" && parent2 == "sickle cell trait" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_4,"if both parents have sickle cell trait, their children have a 25% chance of being diseased, a 25% chance of being normal, \n" +
|
||||
"and a 50% chance of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "sickle cell trait" && parent2 == "normal" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_5,"If one parent has sickle cell trait and the other is normal, then children have a 50% chance of being normal and 50% \n" +
|
||||
"chance of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
parent1 == "normal" && parent2 == "sickle cell trait" -> {
|
||||
ClassificationResult(
|
||||
R.drawable.sicklecell_5,"If one parent has sickle cell trait and the other is normal, then children have a 50% chance of being normal and 50% \n" +
|
||||
"chance of being carriers",R.drawable.sicklecell_6
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
ClassificationResult(R.drawable.sickle_cell_gov_logo, "No Match found",R.drawable.sicklecell_6)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
|
||||
private fun setImageResource(context: Context, imageResource: Int) {
|
||||
when (context) {
|
||||
is Fragment -> {
|
||||
val imageView = context.view?.findViewById<ImageView>(R.id.resultImage)
|
||||
imageView?.setImageResource(imageResource)
|
||||
}
|
||||
else -> throw IllegalArgumentException("Unsupported context type")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.smi.counselling.data.dashboard
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||
import com.example.hpostesting.data.dao.UserDao
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.smi.counselling.data.NetworkStatusLiveData
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
@HiltViewModel
|
||||
class HomeViewModel @Inject constructor(
|
||||
private val hemoCubeDao: HemoCubeDao,
|
||||
private val userdao: UserDao,
|
||||
context: Context,
|
||||
) : ViewModel() {
|
||||
private val sharedPreference: SharedPreferences =
|
||||
context.getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
|
||||
|
||||
// Get the device ID of the device you want to retrieve data for (e.g., the first device in the list)
|
||||
|
||||
private val _networkStatusLiveData = NetworkStatusLiveData(context)
|
||||
val allUserData = hemoCubeDao.getAll()
|
||||
val deviceData = MutableLiveData<DeviceData?>()
|
||||
val networkStatusLiveData: LiveData<Boolean>
|
||||
get() = _networkStatusLiveData
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.smi.counselling.data.domain
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||
import com.example.hpostesting.data.dao.MyDatabase
|
||||
import com.example.hpostesting.data.dao.UserDao
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
object AppModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideMyDatabase(@ApplicationContext context: Context): MyDatabase {
|
||||
return Room.databaseBuilder(
|
||||
context, MyDatabase::class.java, "my_database"
|
||||
)
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideMyDao(myDatabase: MyDatabase): UserDao {
|
||||
return myDatabase.userDao()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideMyHemo(myDatabase: MyDatabase): HemoCubeDao {
|
||||
return myDatabase.hemoCubeDao()
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideContext(application: Application): Context {
|
||||
return application.applicationContext
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.google.firebase.firestore.PropertyName
|
||||
|
||||
@Entity(tableName = "device_table")
|
||||
data class DeviceData(
|
||||
@PrimaryKey
|
||||
var _id: String = "",
|
||||
@get:PropertyName("deviceId") @set:PropertyName("deviceId")
|
||||
var deviceId: String = "",
|
||||
@get:PropertyName("deviceType") @set:PropertyName("deviceType")
|
||||
var deviceType: String = "",
|
||||
@get:PropertyName("coefficients") @set:PropertyName("coefficients")
|
||||
var coefficients: List<Double> = emptyList(),
|
||||
@get:PropertyName("calibratedAt") @set:PropertyName("calibratedAt")
|
||||
var calibratedAt: String = ""
|
||||
)
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "hemo_cube_test_table")
|
||||
data class HemoCubeTestData(
|
||||
@PrimaryKey
|
||||
var _id: String = "",
|
||||
var name: String = "",
|
||||
var incubationTime: String = "",
|
||||
var bloodGroup: String = "",
|
||||
var birthYear: String = "",
|
||||
var state: String = "",
|
||||
var abhaId: String = "",
|
||||
var userImageURL: String = "",
|
||||
var location: UserData.Location? = null,
|
||||
var reportUploadTime: String? = "",
|
||||
var testType: String? = "HEMOCUBE",
|
||||
var testTime: String? = "",
|
||||
var testStatus: Boolean? = false,
|
||||
var gender: String = "",
|
||||
var localFlag: Boolean = false,
|
||||
var deviceId: String? = "",
|
||||
var appVersion:String? = "",
|
||||
var deviceSerialNumber: String = "",
|
||||
var deviceType: String = "HEMOCUBE",
|
||||
var kitSerial: String = "",
|
||||
var resultData: String = "",
|
||||
var led1Buffer: Double? = null,
|
||||
var led2Buffer: Double? = null,
|
||||
var led3Buffer: Double? = null,
|
||||
var led4Buffer: Double? = null,
|
||||
var led1Sample: Double? = null,
|
||||
var led2Sample: Double? = null,
|
||||
var led3Sample: Double? = null,
|
||||
var led4Sample: Double? = null,
|
||||
var led1Average: Double? = null,
|
||||
var led2Average: Double? = null,
|
||||
var led3Average: Double? = null,
|
||||
var led4Average: Double? = null,
|
||||
var abs1: Double? = null,
|
||||
var abs2: Double? = null,
|
||||
var abs3: Double? = null,
|
||||
var abs4: Double? = null,
|
||||
var led1Gain1: Double? = null,
|
||||
var led2Gain1: Double? = null,
|
||||
var led3Gain1: Double? = null,
|
||||
var led4Gain1: Double? = null,
|
||||
var led1Gain2: Double? = null,
|
||||
var led2Gain2: Double? = null,
|
||||
var led3Gain2: Double? = null,
|
||||
var led4Gain2: Double? = null,
|
||||
var led1Gain3: Double? = null,
|
||||
var led2Gain3: Double? = null,
|
||||
var led3Gain3: Double? = null,
|
||||
var led4Gain3: Double? = null,
|
||||
var led1Gain4: Double? = null,
|
||||
var led2Gain4: Double? = null,
|
||||
var led3Gain4: Double? = null,
|
||||
var led4Gain4: Double? = null,
|
||||
var deviceRatio: Double? = null,
|
||||
var calculatedRatio: Double? = null,
|
||||
var predictedDenovixRatio: Double? = null,
|
||||
var slopeRatio: Double? = null,
|
||||
var coefficients: String? = "",
|
||||
var classificationResult: String = "",
|
||||
var prdClassification: String = "",
|
||||
var deviceRatioClass: String = "",
|
||||
var slopeRatioClass: String = "",
|
||||
var errorMessages: String = "",
|
||||
var batteryLevel: String = "",
|
||||
var batteryCapacity: String = "",
|
||||
var batteryMaxCapacity: String = "",
|
||||
var batteryTemperature: String = "",
|
||||
var batteryVoltage: String = "",
|
||||
)
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import java.util.Date
|
||||
|
||||
data class PatientDetails(
|
||||
var id: String,
|
||||
var isIdABHA: Boolean,
|
||||
var name: String?,
|
||||
var yob: Int?,
|
||||
var gender: Gender?,
|
||||
var mobile: String?,
|
||||
var isUnderMedication: Boolean?,
|
||||
var isUnderTransfusion: Boolean?,
|
||||
val photoUrl: String?,
|
||||
var careOf: String?,
|
||||
var isMarried: Boolean?,
|
||||
var bloodGroup: String?,
|
||||
var address: Address?,
|
||||
var category: Category?,
|
||||
var registerDate: Date?,
|
||||
var uploadDate: Date?
|
||||
) {
|
||||
constructor() : this(
|
||||
"",
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
enum class Gender {
|
||||
MALE,
|
||||
FEMALE,
|
||||
OTHER
|
||||
}
|
||||
|
||||
|
||||
data class Address(
|
||||
var house: String?,
|
||||
val street: String?,
|
||||
var city: String?,
|
||||
val landMark: String?,
|
||||
var postOffice: String?,
|
||||
var district: String?,
|
||||
val subDistrict: String?,
|
||||
var state: String?,
|
||||
val vtc: String?,
|
||||
var pinCode: Int?,
|
||||
) {
|
||||
constructor() : this(null, null, null, null, null, null, null, null, null, null)
|
||||
}
|
||||
|
||||
enum class Category {
|
||||
GENERAL,
|
||||
OBC,
|
||||
SC,
|
||||
ST,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
|
||||
@Entity(tableName = "user_table")
|
||||
data class UserData(
|
||||
@PrimaryKey
|
||||
var _id: String = "",
|
||||
var name: String = "",
|
||||
var incubationTime: String = "",
|
||||
var birthYear: String = "",
|
||||
var abhaId: String = "",
|
||||
var bloodGroup: String = "",
|
||||
var userImageURL: String = "",
|
||||
var gender: String ="",
|
||||
var location: Location? = null,
|
||||
var createdBy: String? = "",
|
||||
var reportUploadTime: String? = "",
|
||||
var testTime: String? = "",
|
||||
var testStatus: Boolean? = false,
|
||||
var mobileId: String = "",
|
||||
var deviceId: String = "",
|
||||
var state: String = "",
|
||||
var deviceSerialNumber: String = "",
|
||||
var kitSerial: String = "",
|
||||
var csvPath: String = "",
|
||||
var reportPath: String = "",
|
||||
var resultRatio: Double? = null,
|
||||
var prdClassification: String = ""
|
||||
) {
|
||||
enum class Gender {
|
||||
MALE,
|
||||
FEMALE,
|
||||
OTHER
|
||||
}
|
||||
|
||||
data class Location(
|
||||
var latitude: Double? = null,
|
||||
var longitude: Double? = null
|
||||
)
|
||||
}
|
||||
|
||||
fun UserData.toHemoCubeTestData() = HemoCubeTestData(
|
||||
_id = _id,
|
||||
name = name,
|
||||
birthYear = birthYear,
|
||||
userImageURL = userImageURL,
|
||||
testStatus = testStatus,
|
||||
location = location,
|
||||
gender = gender,
|
||||
state = state,
|
||||
abhaId = abhaId,
|
||||
bloodGroup = bloodGroup,
|
||||
prdClassification = prdClassification,
|
||||
testTime = testTime
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.smi.counselling.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val Purple80 = Color(0xFFD0BCFF)
|
||||
val PurpleGrey80 = Color(0xFFCCC2DC)
|
||||
val Pink80 = Color(0xFFEFB8C8)
|
||||
|
||||
val Purple40 = Color(0xFF6650a4)
|
||||
val PurpleGrey40 = Color(0xFF625b71)
|
||||
val Pink40 = Color(0xFF7D5260)
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.smi.counselling.ui.theme
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.core.view.WindowCompat
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = Purple80,
|
||||
secondary = PurpleGrey80,
|
||||
tertiary = Pink80
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = Purple40,
|
||||
secondary = PurpleGrey40,
|
||||
tertiary = Pink40
|
||||
|
||||
/* Other default colors to override
|
||||
background = Color(0xFFFFFBFE),
|
||||
surface = Color(0xFFFFFBFE),
|
||||
onPrimary = Color.White,
|
||||
onSecondary = Color.White,
|
||||
onTertiary = Color.White,
|
||||
onBackground = Color(0xFF1C1B1F),
|
||||
onSurface = Color(0xFF1C1B1F),
|
||||
*/
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun HPOSCounsellingTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
// Dynamic color is available on Android 12+
|
||||
dynamicColor: Boolean = true,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
|
||||
darkTheme -> DarkColorScheme
|
||||
else -> LightColorScheme
|
||||
}
|
||||
val view = LocalView.current
|
||||
if (!view.isInEditMode) {
|
||||
SideEffect {
|
||||
val window = (view.context as Activity).window
|
||||
window.statusBarColor = colorScheme.primary.toArgb()
|
||||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
|
||||
}
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.smi.counselling.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
/* Other default text styles to override
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 22.sp,
|
||||
lineHeight = 28.sp,
|
||||
letterSpacing = 0.sp
|
||||
),
|
||||
labelSmall = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 11.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
*/
|
||||
)
|
||||
BIN
app/src/main/res/drawable/indianoil.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/karnataka.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
27
app/src/main/res/drawable/progressbar_drawable.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="4000"
|
||||
android:fromDegrees="0"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:toDegrees="360">
|
||||
|
||||
<shape
|
||||
android:innerRadius="20dp"
|
||||
android:shape="ring"
|
||||
android:thickness="4dp"
|
||||
android:useLevel="false">
|
||||
<size
|
||||
android:width="54dp"
|
||||
android:height="54dp" />
|
||||
|
||||
<gradient
|
||||
android:centerColor="#0288D1"
|
||||
android:centerY="0.5"
|
||||
android:endColor="#01579B"
|
||||
android:startColor="#00ec7e2a"
|
||||
android:type="sweep"
|
||||
android:useLevel="false" />
|
||||
</shape>
|
||||
|
||||
</rotate>
|
||||
BIN
app/src/main/res/drawable/sickle_cell_gov_logo.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/sicklecell_1.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
app/src/main/res/drawable/sicklecell_2.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/sicklecell_3.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/sicklecell_4.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
app/src/main/res/drawable/sicklecell_5.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/sicklecell_6.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
37
app/src/main/res/layout/activity_dashboard.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:visibility="gone"
|
||||
android:id="@+id/my_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fghemocube"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/my_toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- NavHostFragment for navigation -->
|
||||
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
37
app/src/main/res/layout/activity_digital_card.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:visibility="gone"
|
||||
android:id="@+id/my_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fghemocube"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/my_toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- NavHostFragment for navigation -->
|
||||
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
12
app/src/main/res/layout/dropdown_item.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<!-- res/layout/dropdown_item.xml -->
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
270
app/src/main/res/layout/fragment_digital_card.xml
Normal file
@@ -0,0 +1,270 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
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"
|
||||
tools:context="com.smi.counselling.data.dashboard.DigitalCardFragment">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/abhaid"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/abhaidtext"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Select Abha Id"
|
||||
android:inputType="text"
|
||||
android:labelFor="@id/abhaid" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:visibility="gone"
|
||||
android:id="@+id/userCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="350dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cardBackgroundColor="#C0C0C0"
|
||||
app:cardCornerRadius="25dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/background_light"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="22dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userImage"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/karnataka" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:layout_constraintTop_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/userImage"
|
||||
app:layout_constraintTop_toTopOf="@+id/userImage"
|
||||
android:src="@drawable/sickle_cell_gov_logo"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userImage3"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/userName"
|
||||
app:layout_constraintTop_toTopOf="@+id/userName"
|
||||
android:src="@drawable/indianoil"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/userdetails"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage"
|
||||
app:cardElevation="0dp"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage"
|
||||
android:text="name: Mariya" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dob"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="30dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/name"
|
||||
app:layout_constraintTop_toBottomOf="@id/name"
|
||||
android:text="DOB: 1998" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gender"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="50dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/dob"
|
||||
app:layout_constraintTop_toBottomOf="@id/dob"
|
||||
android:text="gender: female" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/State"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="20dp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="70dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/gender"
|
||||
app:layout_constraintTop_toBottomOf="@id/gender"
|
||||
android:text="State: Kerala" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/userdetails2"
|
||||
android:layout_width="150dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||
app:layout_constraintStart_toEndOf="@+id/userdetails"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/abhaid1"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="start"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||
android:text="ABHA-ID: XXXX-8734" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blood"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="start"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||
android:text="Blood Group: O +ve" />
|
||||
<TextView
|
||||
android:id="@+id/sicklecell"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:gravity="start"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||
android:text="Sickle-Cell: Normal (HbA)" />
|
||||
<TextView
|
||||
android:id="@+id/issueDate"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:gravity="start"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||
android:text="Issue Date: Oct 2,2023" />
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/digitalcard"
|
||||
android:backgroundTint="#00008B"
|
||||
app:cardBackgroundColor="#00008B"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/digital_card"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userdetails" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:elevation="12dp"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateDrawable="@drawable/progressbar_drawable"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
275
app/src/main/res/layout/fragment_home.xml
Normal file
@@ -0,0 +1,275 @@
|
||||
<?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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/counsellingcard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/blue_app"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="Counselling Card" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/abhaid"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="40dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/counsellingcard">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/abhaidtext"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Select Abha Id for Male"
|
||||
android:inputType="text"
|
||||
android:labelFor="@id/abhaid" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/abhaidfemale"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaid">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/abhaidtextfemale"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Select Abha Id for Female"
|
||||
android:inputType="text"
|
||||
android:labelFor="@id/abhaid" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/maledetails"
|
||||
android:visibility="gone"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaidfemale"
|
||||
app:cardElevation="0dp"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaid"
|
||||
android:text="userId: 1233" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaid"
|
||||
android:text="Name: Mariya" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gender"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="60dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/userid"
|
||||
app:layout_constraintTop_toBottomOf="@id/userid"
|
||||
android:text="gender: male" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/State"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="20dp"
|
||||
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="80dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/gender"
|
||||
app:layout_constraintTop_toBottomOf="@id/gender"
|
||||
android:text="" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:background="@color/blue_app"
|
||||
android:id="@+id/femaledetails"
|
||||
android:visibility="gone"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaidfemale"
|
||||
app:layout_constraintStart_toEndOf="@+id/maledetails"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userid1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaid"
|
||||
android:text="userId: 1233" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/abhaidfemale"
|
||||
android:text="Name: Mariya" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gender1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="60dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/userid"
|
||||
app:layout_constraintTop_toBottomOf="@id/userid"
|
||||
android:text="gender: Female" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/State1"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="20dp"
|
||||
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="80dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/gender"
|
||||
app:layout_constraintTop_toBottomOf="@id/gender"
|
||||
android:text="" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<Button
|
||||
android:visibility="gone"
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="Submit"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/maledetails" />
|
||||
|
||||
<!-- ... Other views ... -->
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/red"
|
||||
android:textStyle="bold"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/resultImage"
|
||||
android:text="Sicklecell: normal" />
|
||||
<ImageView
|
||||
android:id="@+id/resultImage"
|
||||
android:visibility="invisible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/resultratioimg"
|
||||
app:srcCompat="@drawable/sicklecell_6"/>
|
||||
<ImageView
|
||||
android:id="@+id/resultratioimg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit"
|
||||
app:srcCompat="@drawable/sicklecell_6" />
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_digital"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="view Digital Card"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
14
app/src/main/res/menu/my_menu.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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/action_usb"
|
||||
android:checkable="false"
|
||||
android:enabled="true"
|
||||
android:title="@string/usb_connection"
|
||||
android:visible="true"
|
||||
app:showAsAction="always" />
|
||||
|
||||
|
||||
</menu>
|
||||
@@ -1,6 +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" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,6 +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" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 7.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 13 KiB |
@@ -7,4 +7,17 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="gray">#808080</color>
|
||||
|
||||
<color name="blue_app">#4daaff</color>
|
||||
<color name="blue_app_dark">#005db3</color>
|
||||
<color name="blue_app_light">#e5f3ff</color>
|
||||
|
||||
|
||||
<color name="primary">#4daaff</color>
|
||||
<color name="primary_dark">#005db3</color>
|
||||
<color name="primary_light">#e5f3ff</color>
|
||||
<color name="red">#FF0000</color>
|
||||
|
||||
|
||||
</resources>
|
||||
4
app/src/main/res/values/ic_launcher_background.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -1,3 +1,266 @@
|
||||
<resources>
|
||||
<string name="app_name">HPOS Counselling</string>
|
||||
<string name="app_name">Counselling App</string>
|
||||
|
||||
<string-array name="instrument">
|
||||
<item>TestRight</item>
|
||||
<item>Denovix</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="gender">
|
||||
<item>Male</item>
|
||||
<item>Female</item>
|
||||
<item>Other</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="yes_no">
|
||||
<item>Yes</item>
|
||||
<item>No</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="category">
|
||||
<item>GEN</item>
|
||||
<item>OBC</item>
|
||||
<item>SC</item>
|
||||
<item>ST</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="blood_group">
|
||||
<item>O+ve</item>
|
||||
<item>O-ve</item>
|
||||
<item>A+ve</item>
|
||||
<item>A-ve</item>
|
||||
<item>B+ve</item>
|
||||
<item>B-ve</item>
|
||||
<item>AB+ve</item>
|
||||
<item>AB-ve</item>
|
||||
</string-array>
|
||||
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="select_the_test">Select the Test</string>
|
||||
<string name="set_reference">Set Reference</string>
|
||||
|
||||
<!-- Alert Dialog -->
|
||||
<string name="have_you_placed">Have you placed the cuvette containing reference sample?</string>
|
||||
<string name="please_place">Please place the cuvette containing sample for reference before running</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="noo"></string>
|
||||
|
||||
|
||||
<string name="connect">Connect</string>
|
||||
<string name="connected">Connected</string>
|
||||
<string name="read">Read</string>
|
||||
<string name="update_reference">Update Reference</string>
|
||||
|
||||
|
||||
<string name="have_you_placed_sample">Have you placed the cuvette with sample?</string>
|
||||
<string name="please_place_sample">Please place the cuvette containing sample before running</string>
|
||||
<string name="yes_and_run">Yes, Run</string>
|
||||
|
||||
|
||||
<!-- Instructions Text -->
|
||||
<string name="Instructions">Testing Instructions</string>
|
||||
<string name="step1"><b><u>Step 1</u> : </b> Place the cuvette containing reference/baseline sample for referencing.</string>
|
||||
<string name="step2"><b><u>Step 2</u> : </b> Press the button below to start the device reading values.</string>
|
||||
|
||||
<string name="step3"><b><u>Step 1</u> : </b> Enter the sample details to start.</string>
|
||||
<!-- <string name="step4"><b><u>Step 1</u> : </b> Place the cuvette containing sample for experiment.</string>-->
|
||||
<string name="step4"><b><u>Step 1</u> : </b> Place the cuvette containing blood sample mixed with kit solution.</string>
|
||||
<string name="step5"><b><u>Step 2</u> : </b> Press the button below to start the device reading values.</string>
|
||||
<string name="login_id">Login ID</string>
|
||||
<string name="password">Password</string>
|
||||
<string name="login">Login</string>
|
||||
<string name="acquire">Acquire</string>
|
||||
<string name="enter_patient_details">Enter Patient Details</string>
|
||||
<string name="patient_name">Patient Name</string>
|
||||
<string name="age">Age in years</string>
|
||||
<string name="gender">Gender</string>
|
||||
<string name="name_error">Name can\'t be empty</string>
|
||||
<string name="age_error">Age can\'t be empty</string>
|
||||
<string name="gender_error">Gender can\'t be empty</string>
|
||||
<string name="age_error_out_of_bound">Age should be valid</string>
|
||||
<string name="yob_error">Year of birth can\'t be empty</string>
|
||||
<string name="yob_error_2">Invalid Year of Birth</string>
|
||||
<string name="mobile_error">Mobile Number can\'t be empty</string>
|
||||
<string name="mobile_error_invalid">Mobile Number is invalid (Enter 10 Digits)</string>
|
||||
<string name="this_error">This can\'t be empty</string>
|
||||
<!-- <string name="this_error">This can\'t be empty</string>-->
|
||||
|
||||
<string name="test_results">Test Results</string>
|
||||
<string name="name_in_textview"><b>Name</b> : %1$s</string>
|
||||
<string name="gender_in_textview"><b>Gender</b> : %1$s</string>
|
||||
<string name="age_in_textview"><b>Age</b> : %1$s years</string>
|
||||
<string name="results_in_textview"><b>Results</b> :</string>
|
||||
<string name="negative">Negative\ \ </string>
|
||||
<string name="download_report">Download\nReport</string>
|
||||
<string name="home">Home</string>
|
||||
<string name="new_test">New Test</string>
|
||||
<string name="start_now">Start Now</string>
|
||||
<string name="hemo_cube">Hemo Cube</string>
|
||||
<string name="hb">Hb</string>
|
||||
<string name="normal">Normal\ \ </string>
|
||||
<string name="sickle_cell_disease">Sickle Cell Disease\ \ </string>
|
||||
<string name="sickle_cell_trait">Sickle Cell Trait\ \ </string>
|
||||
<string name="undefined">Undefined\ \ </string>
|
||||
<string name="sicklecell_nconfirmatory">Sicklecell\nConfirmatory</string>
|
||||
<string name="sicklecell_screening">Sicklecell Screening</string>
|
||||
<string name="thalassemia">Thalassemia</string>
|
||||
<string name="usb_connection">USB Connection</string>
|
||||
<string name="high_performance_optical_spectroscopy">High Performance\nOptical Spectroscopy</string>
|
||||
<string name="sickle_cert">Sickle Cert</string>
|
||||
<string name="sickle_find">Sickle Find</string>
|
||||
<string name="submit">Submit</string>
|
||||
<string name="diagnostics">Device Diagnostics</string>
|
||||
<string name="auto_dac">Auto DAC</string>
|
||||
<string name="calibration">Calibration</string>
|
||||
<string name="place_buffer">Start</string>
|
||||
<string name="Start_Sample">Start Sample</string>
|
||||
<string name="new_kit">New Kit</string>
|
||||
<string name="new_buffer">New Buffer</string>
|
||||
<string name="name_error_2">Invalid character, Allowed characters are Letters, Numbers and ( ) _ - , . only</string>
|
||||
<string name="recommended">\*Result to be confirmed with laboratory test</string>
|
||||
<string name="recommended_age">\*Result to be confirmed with laboratory test as age of the patient is less than 5 years</string>
|
||||
<string name="positive_borderline">Positive Borderline</string>
|
||||
<string name="negative_borderline">Negative Borderline, Repeat Test</string>
|
||||
<string name="is_patient_under_any_medication">Is Patient under any medication or treatment?</string>
|
||||
<string name="is_patient_undergoing_any_blood_transfusion">Is Patient undergoing any blood transfusion?</string>
|
||||
<string name="scan_aadhaar_card">Scan Aadhaar\nCard</string>
|
||||
<string name="patient_details">Patient Details</string>
|
||||
<string name="or">OR</string>
|
||||
<string name="scan_abha_card">Scan ABHA\nCard</string>
|
||||
<string name="list_of_patients">List Of Patients</string>
|
||||
<string name="no_patient_records_found_to_test_please_add_one_from_below">No Patient Records \nFound to Test. \nPlease Add one from below.</string>
|
||||
<string name="add">Add</string>
|
||||
<string name="test">Test</string>
|
||||
<string name="pending">Pending</string>
|
||||
<string name="scan_patient_abha_id_card">Scan Patient ABHA ID Card</string>
|
||||
<string name="scan_now">Scan Now</string>
|
||||
<string name="enter_abha_number_manualy">Enter ABHA number manualy</string>
|
||||
<string name="abha_id">ABHA ID</string>
|
||||
<string name="patient_id_in_tv"><b>User ID</b> : %1$s</string>
|
||||
<string name="go">GO</string>
|
||||
<string name="click_here">Click Here</string>
|
||||
<string name="title_activity_dashboard">DashboardActivity</string>
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
<string name="nav_header_title">HPOS</string>
|
||||
<string name="nav_header_subtitle">sminnovations.in</string>
|
||||
<string name="nav_header_desc">Navigation header</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="menu_home">Home</string>
|
||||
<string name="show_hemocube_result">Show Result</string>
|
||||
<string name="menu_gallery">Gallery</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
<string name="profile">Panel</string>
|
||||
<string name="year_of_birth">Year of Birth</string>
|
||||
<string name="father_s_name_husband_s_name">Father\'s Name / Husband\'s Name</string>
|
||||
<string name="is_patient_married_yes_no">Is Patient Married? (Yes/No)</string>
|
||||
<string name="category">Category</string>
|
||||
<string name="blood_group">Blood Group</string>
|
||||
<string name="add_blood_group">Add Blood Group</string>
|
||||
<string name="digital_card">Digital Counselling Card</string>
|
||||
<string name="patient_medical_records">Patient Medical Records</string>
|
||||
<string name="patient_address_details">Patient Address Details</string>
|
||||
<string name="district">District</string>
|
||||
<string name="city_town">City / Town</string>
|
||||
<string name="state">State</string>
|
||||
<string name="pincode">Pincode</string>
|
||||
<string name="threedots">...</string>
|
||||
<string name="create_abha_id_card">Create ABHA ID Card</string>
|
||||
<string name="official_abha_app">Official ABHA App</string>
|
||||
<string name="scan_patient_aadhaar_card">Scan Patient Aadhaar Card</string>
|
||||
<string name="enter_aadhaar_number_manualy">Enter Aadhaar number manualy</string>
|
||||
<string name="aadhaar_number">Aadhaar Number</string>
|
||||
<string name="aadhaar_in_tv"><b>Aadhaar Number</b></string>
|
||||
<string name="please_use_official_abha_app_to_create_abha_id_and_come_back">Please use “Official ABHA App" to create ABHA ID, and come back.</string>
|
||||
<string name="please_enter_aadhaar">Please Enter Aadhaar Number to continue</string>
|
||||
<string name="scan_qr_code_of_the_kit">Scan QR Code of the KIT</string>
|
||||
<string name="enter_kit_serial_number_manually">Enter KIT Serial Number manually</string>
|
||||
<string name="serial_number">Serial Number</string>
|
||||
<string name="set_baseline_reference_again">Set Baseline/Reference again?</string>
|
||||
<string name="baseline_instruction">Baseline Instruction</string>
|
||||
<string name="to_be_launched_in_next_version_of_the_app">To be launched in next version of the app</string>
|
||||
<string name="invalid_kit">Invalid Kit Serial Number, correct example, SMI/SC/019/01/001</string>
|
||||
<string name="user_list">User List</string>
|
||||
<string name="user_id">User ID</string>
|
||||
<string name="aadhar_id">Aadhar ID</string>
|
||||
<string name="internet_not_available_please_enter_the_user_id_manually">Internet not available, please enter the user ID and blood group manually</string>
|
||||
<string name="user_id_error_message">User ID should be 18 digits and please select the blood group</string>
|
||||
<string name="upload_db_registration_title">Upload DB Tests</string>
|
||||
<string name="upload_db_registration_message">Do you want to upload the local DB tests to the cloud?</string>
|
||||
<string name="upload">Upload</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="upload_success_message">Upload done successfully</string>
|
||||
<string name="test_completed">Test Completed</string>
|
||||
<string name="select_blood_group">Select Blood Group</string>
|
||||
<string name="all_registered_user_are_tested_successfully">All registered user are tested successfully</string>
|
||||
<string name="start_incubation">Incubate</string>
|
||||
<string name="check_buffer">Check Buffer</string>
|
||||
<string name="low_battery_warning">Battery level is low than 40%, please charge the device to continue testing</string>
|
||||
<string name="test_already_conducted">Test has been already conducted for this user</string>
|
||||
<string name="incubation_not_completed">Incubation has not completed 15 minutes</string>
|
||||
<string name="incubation_crossed_30_minutes">Incubation crossed 30 minutes, need to repeat the incubation</string>
|
||||
<string name="incubation_not_started">Incubation not started for this user</string>
|
||||
<string name="test_concluded">Test concluded</string>
|
||||
<string name="test_pending">Test is Pending</string>
|
||||
<string name="blood_group_error">Please enter your blood group</string>
|
||||
<string name="blood_group_toast">Please enter your blood group</string>
|
||||
<string name="blood_group_updated_successfully">Blood group updated successfully</string>
|
||||
<string name="failed_to_update_blood_group">Failed to update blood group: %1$s</string>
|
||||
<string name="no_user_data_found">No user data found for the specified ID</string>
|
||||
<string name="device_disconnected">Device is Disconnected</string>
|
||||
<string name="no_device_found">No device found</string>
|
||||
<string name="invalid_kit_number">Invalid KIT Number</string>
|
||||
<string name="internt_not">Internet is Not Available</string>
|
||||
<string name="internt_not_local">Internet not available, test details stored locally</string>
|
||||
<string name="error_local">Error uploading data, test details stored locally</string>
|
||||
<string name="error_exist">error while getting existing buffer</string>
|
||||
<string name="do_exist">Do you want to continue with existing buffer?</string>
|
||||
<string name="kit_uploaded">Kit result uploaded successfully</string>
|
||||
<string name="kit_upload_failed">Kit result uploading failed, note it down manually</string>
|
||||
<string name="test_ongoing">test is going on</string>
|
||||
<string name="test_go_noback">test is going on, can\'t go back</string>
|
||||
<string name="error_classification">error while performing classification</string>
|
||||
<string name="test_upload">Test Results Uploaded Successfully</string>
|
||||
<string name="test_upload_failed">Test Results Upload Failed</string>
|
||||
<string name="log_out">LOG OUT</string>
|
||||
<string name="do_log_out">Do you want to LogOut the Application?</string>
|
||||
<string name="cancelled_unable_scan">Cancelled: Unable to scan, Try Again!!</string>
|
||||
<string name="kit_updated">Kit number is updated, Please Select user before starting test</string>
|
||||
<string name="select_patient">Please Select patient before starting test</string>
|
||||
<string name="enable_location">Please enable location services</string>
|
||||
<string name="location_denied">Fine location permission denied</string>
|
||||
<string name="coarse_location_denied">Coarse location permission denied</string>
|
||||
<string name="permission_grant">You must grant permission to access all files to use the app</string>
|
||||
<string name="permission_required">All permissions are required to use the app.</string>
|
||||
<string name="device_not">Device Not Connected.</string>
|
||||
<string name="enter_proper_login_id">Please enter a proper Login ID</string>
|
||||
<string name="enter_proper_password">Please enter a proper password</string>
|
||||
<string name="wrong_password">Wrong Password</string>
|
||||
<string name="wrong_user_id">Wrong UserID</string>
|
||||
<string name="error_invalid_test">Invalid Test. Problem with de-oxygenation</string>
|
||||
<string name="error_negative_abs">Error: Negative Abs. Retake Blank Reading</string>
|
||||
<string name="error_improper_buffer_high">Error: Invalid Test. Improper buffer reading (high)</string>
|
||||
<string name="error_improper_buffer_low">Error: Invalid Test. Improper buffer reading (low)</string>
|
||||
<string name="error_processing_device_data">error while processing device data</string>
|
||||
<string name="error_repeat_test_lower_volume">Inconclusive. Repeat with test with lower volume of blood</string>
|
||||
<string name="error_repeat_test_higher_volume">Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume</string>
|
||||
<string name="positive_for_sickle_cell">Positive for Sickle Cell. HPLC for Confirmation</string>
|
||||
<string name="something_wrong_with_device">Something is wrong with the device, please disconnect and reconnect the device and test the user again</string>
|
||||
<string name="processing_result">processing result</string>
|
||||
<string name="data_collected_processing_data">Data collected, Processing data</string>
|
||||
<string name="sample_completed">Sample Completed</string>
|
||||
<string name="gathering_data">Gathering data</string>
|
||||
<string name="sample_started">Sample Started</string>
|
||||
<string name="buffer_completed">Buffer Completed</string>
|
||||
<string name="buffer_started">Buffer Started</string>
|
||||
<string name="power_bank">Connect with Power Bank</string>
|
||||
<string name="start">Start</string>
|
||||
<string name="place_sample">Place Sample</string>
|
||||
<string name="invalid">Invalid</string>
|
||||
<string name="error">Error</string>
|
||||
<string name="language_update">Language updated successfully</string>
|
||||
<string name="select_language">Select your preferred language</string>
|
||||
<string name="app_language">App Language</string>
|
||||
<string name="ok">OK</string>
|
||||
</resources>
|
||||
55
app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme.NoActionBar" parent="Theme.MaterialComponents.Light">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar">
|
||||
<item name="colorControlNormal">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="title1">
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:letterSpacing">-0.01</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<!-- <item name="fontFamily">@font/poppins_bold</item>-->
|
||||
<item name="android:translationY">-0.62sp</item>
|
||||
</style>
|
||||
|
||||
<style name="title1_1">
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:letterSpacing">-0.01</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<!-- <item name="fontFamily">@font/poppins_semi_bold</item>-->
|
||||
<item name="android:translationY">-0.62sp</item>
|
||||
</style>
|
||||
|
||||
<style name="title1_2">
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:letterSpacing">-0.01</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<!-- <item name="fontFamily">@font/poppins_medium</item>-->
|
||||
<item name="android:translationY">-0.62sp</item>
|
||||
</style>
|
||||
|
||||
<style name="title2">
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:letterSpacing">-0.01</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<!-- <item name="fontFamily">@font/poppins_regular</item>-->
|
||||
<item name="android:translationY">-0.62sp</item>
|
||||
</style>
|
||||
|
||||
<style name="title2_5">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:letterSpacing">-0.01</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<!-- <item name="fontFamily">@font/poppins_light</item>-->
|
||||
<item name="android:translationY">-0.62sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="Theme.HPOSCounselling" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<!-- <style name="Theme.RefactoredApp" parent="Theme.MaterialComponents.Light.DarkActionBar">-->
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/blue_app</item>
|
||||
<!-- <item name="colorPrimaryVariant">@color/purple_700</item>-->
|
||||
<item name="colorPrimaryVariant">@color/blue_app_dark</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.HPOSCounselling.ActionBar" parent="Theme.MaterialComponents.Light.DarkActionBar">
|
||||
<!-- <style name="Theme.RefactoredApp" parent="Theme.MaterialComponents.Light.DarkActionBar">-->
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/blue_app</item>
|
||||
<!-- <item name="colorPrimaryVariant">@color/purple_700</item>-->
|
||||
<item name="colorPrimaryVariant">@color/blue_app_dark</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.HPOSCounselling.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.HPOSTesting" parent="Theme.MaterialComponents.Light">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryVariant">@color/black</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" >@color/white</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.HPOS.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="Theme.HPOS.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<style name="Theme.HPOSCounselling" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
</resources>
|
||||
29
build.gradle
Normal file
@@ -0,0 +1,29 @@
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.8.21'
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.1.1'
|
||||
classpath 'com.google.gms:google-services:4.4.0'
|
||||
classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.1'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.2' apply false
|
||||
id 'com.android.library' version '7.4.2' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.8.21' apply false
|
||||
id 'androidx.navigation.safeargs' version '2.7.0-beta01' apply false
|
||||
id 'com.google.dagger.hilt.android' version '2.46' apply false
|
||||
id "com.google.gms.google-services" version "4.3.15" apply false
|
||||
id 'com.google.firebase.crashlytics' version "2.9.8" apply false
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id("com.android.application") version "8.1.3" apply false
|
||||
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
|
||||
}
|
||||