Compare commits
37 Commits
main
...
Export_reg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b46af0bb1 | ||
|
|
1e587b01d5 | ||
|
|
b5cf8586b4 | ||
|
|
2b8edbc23c | ||
|
|
e21afcf87d | ||
|
|
505bed89a1 | ||
|
|
7c7ed3b314 | ||
|
|
e764e69420 | ||
|
|
378db4492e | ||
|
|
e5a27a0eca | ||
|
|
ba981e2b82 | ||
|
|
83dbadef00 | ||
|
|
c0782b85a0 | ||
|
|
aeb70990fb | ||
|
|
5d42da889f | ||
|
|
ae2608e6da | ||
|
|
23850d4bfe | ||
|
|
4e5df74cea | ||
|
|
1dcfe2a34f | ||
|
|
8c1e30764c | ||
|
|
4b74277bd3 | ||
|
|
4e213f4920 | ||
|
|
425bc61a50 | ||
|
|
2e824c1bed | ||
|
|
73597b9cf4 | ||
|
|
b1e828c51a | ||
|
|
8a0c0f326b | ||
|
|
ff972759f5 | ||
|
|
610e206f27 | ||
|
|
d24578cc1c | ||
|
|
6835068f13 | ||
|
|
ccc50108d3 | ||
|
|
2bd6495612 | ||
|
|
143d90b028 | ||
|
|
3bda3f0d51 | ||
|
|
b6a03e2ebf | ||
|
|
eec8867ddc |
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
4
.idea/shelf/Changes.xml
generated
Normal file
4
.idea/shelf/Changes.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<changelist name="Changes" date="1696578975861" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Changes" />
|
||||
</changelist>
|
||||
232
.idea/shelf/Changes/shelved.patch
generated
Normal file
232
.idea/shelf/Changes/shelved.patch
generated
Normal file
File diff suppressed because one or more lines are too long
4
.idea/shelf/Changes1.xml
generated
Normal file
4
.idea/shelf/Changes1.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<changelist name="Changes1" date="1701673804446" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes1/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Changes" />
|
||||
</changelist>
|
||||
709
.idea/shelf/Changes1/shelved.patch
generated
Normal file
709
.idea/shelf/Changes1/shelved.patch
generated
Normal file
File diff suppressed because one or more lines are too long
4
.idea/shelf/Changes2.xml
generated
Normal file
4
.idea/shelf/Changes2.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<changelist name="Changes2" date="1701681731623" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes2/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Changes" />
|
||||
</changelist>
|
||||
21
.idea/shelf/Changes2/shelved.patch
generated
Normal file
21
.idea/shelf/Changes2/shelved.patch
generated
Normal file
@@ -0,0 +1,21 @@
|
||||
Index: app/src/main/java/com/example/hposregistration/adapters/UserListOnlineAdapter.kt
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
||||
<+>package com.example.hposregistration.adapters\r\n\r\nimport android.annotation.SuppressLint\r\nimport android.view.LayoutInflater\r\nimport android.view.View\r\nimport android.view.ViewGroup\r\nimport androidx.recyclerview.widget.RecyclerView\r\nimport com.bumptech.glide.Glide\r\nimport com.example.hposregistration.data.user.UserData\r\nimport com.firebase.ui.firestore.FirestoreRecyclerAdapter\r\nimport com.firebase.ui.firestore.FirestoreRecyclerOptions\r\nimport `in`.sminnovations.hposregistration.R\r\nimport `in`.sminnovations.hposregistration.databinding.UserItemViewBinding\r\n\r\nclass UserListOnlineAdapter(options: FirestoreRecyclerOptions<UserData>, private val view: View) :\r\n FirestoreRecyclerAdapter<UserData, UserListOnlineAdapter.OrderItemViewHolder>(options) {\r\n\r\n class OrderItemViewHolder(val binding: UserItemViewBinding) :\r\n RecyclerView.ViewHolder(binding.root)\r\n\r\n override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OrderItemViewHolder {\r\n return OrderItemViewHolder(\r\n UserItemViewBinding\r\n .inflate(LayoutInflater.from(parent.context), parent, false)\r\n )\r\n }\r\n\r\n @SuppressLint(\"SetTextI18n\")\r\n override fun onBindViewHolder(holder: OrderItemViewHolder, position: Int, model: UserData) {\r\n holder.binding.apply {\r\n userName.text = view.context.getString(R.string.name) + \": ${model.name}\"\r\n userId.text = view.context.getString(R.string.userid) + \": ${model._id}\"\r\n Glide.with(view).load(model.userImageURL).into(userImage)\r\n }\r\n }\r\n}
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/app/src/main/java/com/example/hposregistration/adapters/UserListOnlineAdapter.kt b/app/src/main/java/com/example/hposregistration/adapters/UserListOnlineAdapter.kt
|
||||
--- a/app/src/main/java/com/example/hposregistration/adapters/UserListOnlineAdapter.kt (revision 610e206f27d8ce39c57e9e76b95bfdb7b6047307)
|
||||
+++ b/app/src/main/java/com/example/hposregistration/adapters/UserListOnlineAdapter.kt (date 1701681731375)
|
||||
@@ -28,8 +28,8 @@
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: OrderItemViewHolder, position: Int, model: UserData) {
|
||||
holder.binding.apply {
|
||||
- userName.text = view.context.getString(R.string.name) + ": ${model.name}"
|
||||
- userId.text = view.context.getString(R.string.userid) + ": ${model._id}"
|
||||
+ userName.text = view.context.getString(R.string.name) + " : ${model.name}"
|
||||
+ userId.text = view.context.getString(R.string.userid) + " : ${model._id}"
|
||||
Glide.with(view).load(model.userImageURL).into(userImage)
|
||||
}
|
||||
}
|
||||
4
.idea/shelf/Changes3.xml
generated
Normal file
4
.idea/shelf/Changes3.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<changelist name="Changes3" date="1701681803133" recycled="false">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes3/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Changes" />
|
||||
</changelist>
|
||||
0
.idea/shelf/Changes3/shelved.patch
generated
Normal file
0
.idea/shelf/Changes3/shelved.patch
generated
Normal file
0
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_16_pm_[Changes]/shelved.patch
generated
Normal file
0
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_16_pm_[Changes]/shelved.patch
generated
Normal file
4
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_16_pm__Changes_.xml
generated
Normal file
4
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_16_pm__Changes_.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<changelist name="Uncommitted_changes_before_Checkout_at_04-12-2023_01_16_pm_[Changes]" date="1701676341703" recycled="true">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_16_pm_[Changes]/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 04-12-2023 01:16 pm [Changes]" />
|
||||
</changelist>
|
||||
995
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_38_pm_[Changes]/shelved.patch
generated
Normal file
995
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_38_pm_[Changes]/shelved.patch
generated
Normal file
File diff suppressed because one or more lines are too long
4
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_38_pm__Changes_.xml
generated
Normal file
4
.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_38_pm__Changes_.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<changelist name="Uncommitted_changes_before_Checkout_at_04-12-2023_01_38_pm_[Changes]" date="1701677677817" recycled="true">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_01_38_pm_[Changes]/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 04-12-2023 01:38 pm [Changes]" />
|
||||
</changelist>
|
||||
3
app/.gitignore
vendored
3
app/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/build
|
||||
/build
|
||||
/google-services*
|
||||
@@ -16,8 +16,8 @@ android {
|
||||
applicationId "in.sminnovations.hposregistration"
|
||||
minSdk 26
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode 13
|
||||
versionName "1.0.13"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -42,10 +42,12 @@ android {
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.10.1'
|
||||
implementation 'androidx.core:core-ktx:1.12.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.games:games-activity:2.0.2'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
@@ -58,24 +60,26 @@ dependencies {
|
||||
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.6.0'
|
||||
implementation 'com.google.android.gms:play-services-auth:20.7.0'
|
||||
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta11'
|
||||
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta11")
|
||||
|
||||
// Coroutines
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
|
||||
|
||||
// Coroutine Lifecycle Scopes
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
|
||||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
|
||||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.2"
|
||||
|
||||
//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.0.0"
|
||||
kapt "androidx.hilt:hilt-compiler:1.1.0"
|
||||
|
||||
// Navigation Component
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:2.7.0"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:2.7.0"
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:2.7.6"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:2.7.6"
|
||||
|
||||
// Retrofit + GSON
|
||||
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
||||
@@ -85,16 +89,18 @@ dependencies {
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
|
||||
// Activity KTX for viewModels()
|
||||
implementation "androidx.activity:activity-ktx:1.7.2"
|
||||
implementation "androidx.activity:activity-ktx:1.8.2"
|
||||
|
||||
//image
|
||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||||
|
||||
implementation 'com.opencsv:opencsv:5.5'
|
||||
|
||||
//Room
|
||||
implementation "androidx.room:room-ktx:2.6.0-alpha03"
|
||||
implementation "androidx.room:room-runtime:2.6.0-alpha03"
|
||||
kapt ("androidx.room:room-compiler:2.6.0-alpha03")
|
||||
implementation "androidx.room:room-ktx:2.6.1"
|
||||
implementation "androidx.room:room-runtime:2.6.1"
|
||||
kapt ("androidx.room:room-compiler:2.6.1")
|
||||
|
||||
// Barcode scanner
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
{
|
||||
"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: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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -7,7 +7,10 @@
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
@@ -43,7 +46,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:screenOrientation="fullSensor"
|
||||
android:stateNotNeeded="true"
|
||||
tools:replace="android:screenOrientation" />
|
||||
</application>
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.bumptech.glide.Glide
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
import com.firebase.ui.firestore.FirestoreRecyclerAdapter
|
||||
import com.firebase.ui.firestore.FirestoreRecyclerOptions
|
||||
import `in`.sminnovations.hposregistration.R
|
||||
import `in`.sminnovations.hposregistration.databinding.UserItemViewBinding
|
||||
|
||||
class UserListOnlineAdapter(options: FirestoreRecyclerOptions<UserData>, private val view: View) :
|
||||
@@ -27,8 +28,8 @@ class UserListOnlineAdapter(options: FirestoreRecyclerOptions<UserData>, private
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: OrderItemViewHolder, position: Int, model: UserData) {
|
||||
holder.binding.apply {
|
||||
userName.text = "Name: ${model.name}"
|
||||
userId.text = "User ID: ${model._id}"
|
||||
userName.text = view.context.getString(R.string.name) + " : ${model.name}"
|
||||
userId.text = view.context.getString(R.string.userid) + " : ${model._id}"
|
||||
Glide.with(view).load(model.userImageURL).into(userImage)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,36 @@
|
||||
package com.example.hposregistration.dao
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.TypeConverters
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
|
||||
@Database(entities = [UserData::class], version = 1, exportSchema = false)
|
||||
@Database(entities = [UserData::class], version = 4, exportSchema = false)
|
||||
abstract class MyDatabase : RoomDatabase() {
|
||||
|
||||
abstract fun userDao(): UserDao
|
||||
}
|
||||
|
||||
companion object {
|
||||
val MIGRATION_2_3: Migration = object : Migration(2, 3) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
// Define the necessary SQL statements for migration from version 2 to 3
|
||||
// For example, you can alter tables or create new ones
|
||||
database.execSQL("ALTER TABLE user_table ADD COLUMN aadharIdSearch TEXT")
|
||||
}
|
||||
}
|
||||
|
||||
fun getInstance(context: Context): MyDatabase {
|
||||
return Room.databaseBuilder(
|
||||
context.applicationContext,
|
||||
MyDatabase::class.java,
|
||||
"my_database"
|
||||
)
|
||||
.addMigrations(MIGRATION_2_3)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
|
||||
@Dao
|
||||
@@ -20,4 +21,11 @@ interface UserDao {
|
||||
|
||||
@Query("DELETE FROM user_table WHERE _id = :id")
|
||||
suspend fun deleteById(id: String)
|
||||
|
||||
@Query("UPDATE user_table SET isCSVCreated = :newValue WHERE _id = :id")
|
||||
suspend fun updateCSVFieldById(id: String, newValue: Boolean)
|
||||
|
||||
@Update
|
||||
suspend fun updateUserData(userData: List<UserData>)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.example.hposregistration.data
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.example.hposregistration.data
|
||||
import androidx.lifecycle.LiveData
|
||||
import com.example.hposregistration.dao.UserDao
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -30,4 +32,10 @@ class MainRepository @Inject constructor(
|
||||
return userFireBaseDao.addUserToDatabase(userData)
|
||||
}
|
||||
|
||||
suspend fun updateCSVFieldById(id: String, isCSVCreated: Boolean) {
|
||||
userDao.updateCSVFieldById(id, isCSVCreated)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.example.hposregistration.data.datasource
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import android.util.Log
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
|
||||
import com.opencsv.CSVWriter
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.FileWriter
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.net.URL
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
class LocalFileDataSource {
|
||||
|
||||
fun saveCsvToDisk(filepath: String, contents: ArrayList<Array<String>>){
|
||||
val writer = CSVWriter(FileWriter(filepath))
|
||||
writer.writeAll(contents) // data is adding to csv
|
||||
writer.close()
|
||||
}
|
||||
|
||||
fun saveTextToDisk(filepath: String, contents: String){
|
||||
val writer = FileWriter(File(filepath))
|
||||
|
||||
writer.append(contents)
|
||||
writer.flush()
|
||||
writer.close()
|
||||
}
|
||||
|
||||
|
||||
fun exportDataToCSV(
|
||||
fileName: String, dataList: List<UserData>
|
||||
): Boolean {
|
||||
try {
|
||||
val formattedFileName = fileName.replace(Regex("[^a-zA-Z0-9.-]"), "_")
|
||||
val csvFilePath = File(getExternalStorageDirectory(), formattedFileName)
|
||||
val csvWriter = CSVWriter(FileWriter(csvFilePath))
|
||||
// Write CSV header
|
||||
val header = arrayOf(
|
||||
"_id",
|
||||
"name",
|
||||
"bloodGroup",
|
||||
"birthYear",
|
||||
"state",
|
||||
"abhaId",
|
||||
"testStatus", // Assuming testStatus is a boolean field
|
||||
"gender",
|
||||
"appVersion",
|
||||
"phoneNumber",
|
||||
"careOf",
|
||||
"maritalStatus",
|
||||
"category",
|
||||
"caste",
|
||||
"subCaste",
|
||||
"house",
|
||||
"city",
|
||||
"district",
|
||||
"state",
|
||||
"pinCode",
|
||||
"isUnderMedication",
|
||||
"isUnderTransfusion",
|
||||
"sickleCellHistory",
|
||||
"registeredBy",
|
||||
"createdAt",
|
||||
"registrationCenterName",
|
||||
"userImageURL"
|
||||
)
|
||||
csvWriter.writeNext(header)
|
||||
val imagesFolder = File(getExternalStorageDirectory(), "images${getCurrentDateTime()}")
|
||||
// val imagesFolder = File(getExternalStorageDirectory(), "Images")
|
||||
if (!imagesFolder.exists()) {
|
||||
if (!imagesFolder.mkdirs()) {
|
||||
Log.e("DirectoryCreation", "Error creating images folder: ${imagesFolder.absolutePath}")
|
||||
}
|
||||
}
|
||||
|
||||
// Write data rows
|
||||
for (data in dataList) {
|
||||
// Download and save the user image
|
||||
val imageUrl = data.userImageURL
|
||||
val localImageFile = downloadImage(imagesFolder, data._id, imageUrl)
|
||||
|
||||
val row = arrayOf(
|
||||
data._id,
|
||||
data.name,
|
||||
data.bloodGroup,
|
||||
data.birthYear,
|
||||
data.state,
|
||||
data.abhaId,
|
||||
data.testStatus?.toString() ?: "",
|
||||
data.gender,
|
||||
data.appVersion ?: "",
|
||||
data.phoneNumber,
|
||||
data.careOf,
|
||||
data.maritalStatus,
|
||||
data.category,
|
||||
data.caste,
|
||||
data.subCaste ?: "",
|
||||
data.house,
|
||||
data.city,
|
||||
data.district,
|
||||
data.state,
|
||||
data.pinCode,
|
||||
data.isUnderMedication?.toString() ?: "",
|
||||
data.isUnderTransfusion?.toString() ?: "",
|
||||
data.sickleCellHistory ?: "",
|
||||
data.registeredBy ?: "",
|
||||
data.createdAt ?: "",
|
||||
data.registrationCenterName ?: "",
|
||||
localImageFile?.absolutePath ?: "" // Use the local image file path in the CSV
|
||||
)
|
||||
csvWriter.writeNext(row)
|
||||
}
|
||||
csvWriter.close()
|
||||
return true
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
Log.e("CSVExport", "Error exporting data to CSV: ${e.message}")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private fun downloadImage(folder: File, userId: String, imageUrl: String): File? {
|
||||
return try {
|
||||
val url = URL(imageUrl)
|
||||
val connection = url.openConnection()
|
||||
|
||||
val inputStream: InputStream = connection.inputStream
|
||||
val localImageFile = File(folder, "$userId.jpg")
|
||||
val outputStream = FileOutputStream(localImageFile)
|
||||
|
||||
inputStream.use { input ->
|
||||
outputStream.use { fileOut ->
|
||||
input.copyTo(fileOut)
|
||||
}
|
||||
}
|
||||
|
||||
localImageFile
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Log.e("ImageDownloader", "Error downloading image: ${e.message}")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private fun getExternalStorageDirectory(): File {
|
||||
val folder = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "HposRegistration")
|
||||
|
||||
if (!folder.exists()) {
|
||||
folder.mkdirs()
|
||||
}
|
||||
|
||||
return folder
|
||||
}
|
||||
private fun getCurrentDateTime(): String {
|
||||
val dateFormat = SimpleDateFormat("dd_MM_yy", Locale.getDefault())
|
||||
val currentDateTime = Date()
|
||||
return dateFormat.format(currentDateTime)
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,11 @@ import androidx.room.PrimaryKey
|
||||
data class UserData(
|
||||
@PrimaryKey
|
||||
var _id: String = "",
|
||||
var _idSearch: String = "",
|
||||
var abhaId: String = "",
|
||||
var abhaIdSearch: String = "",
|
||||
var aadharId: String = "",
|
||||
var aadharIdSearch: String = "",
|
||||
var name: String = "",
|
||||
var birthYear: String = "",
|
||||
var gender: String = "",
|
||||
@@ -32,7 +35,9 @@ data class UserData(
|
||||
var registeredBy: String? = "",
|
||||
var createdAt: String? = "",
|
||||
var registrationCenterName: String? = "",
|
||||
var testStatus: Boolean = false
|
||||
var testStatus: Boolean = false,
|
||||
var isCSVCreated: Boolean = false,
|
||||
var localFlag: Boolean = false,
|
||||
){
|
||||
enum class Gender {
|
||||
MALE,
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.example.hposregistration.dao.MyDatabase
|
||||
import com.example.hposregistration.dao.UserDao
|
||||
import com.example.hposregistration.data.datasource.LocalFileDataSource
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
@@ -41,4 +42,10 @@ object AppModule {
|
||||
fun provideContext(application: Application): Context {
|
||||
return application.applicationContext
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideLocalFileDataSource(): LocalFileDataSource {
|
||||
return LocalFileDataSource()
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.example.hposregistration.network
|
||||
|
||||
import androidx.room.Query
|
||||
import com.example.hposregistration.data.Response
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
import com.google.firebase.firestore.FirebaseFirestore
|
||||
@@ -24,7 +25,12 @@ class UserDao {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// suspend fun getPatientList(): List<UserData> {
|
||||
// return patientCollection.get().await().toObjects(UserData::class.java)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.example.hposregistration.ui.activities
|
||||
|
||||
import android.content.Context
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import com.example.hposregistration.data.LanguageManager
|
||||
import com.google.firebase.appdistribution.FirebaseAppDistribution
|
||||
import com.google.firebase.appdistribution.FirebaseAppDistributionException
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import `in`.sminnovations.hposregistration.databinding.ActivityMainBinding
|
||||
|
||||
@@ -10,10 +16,57 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
|
||||
|
||||
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 = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
val firebaseAppDistribution = FirebaseAppDistribution.getInstance()
|
||||
firebaseAppDistribution.updateIfNewReleaseAvailable()
|
||||
.addOnProgressListener { updateProgress ->
|
||||
|
||||
if (updateProgress.apkBytesDownloaded > 0) {
|
||||
Toast.makeText(
|
||||
this,
|
||||
"${updateProgress.updateStatus}. ${updateProgress.apkBytesDownloaded / 1048576} /${updateProgress.apkFileTotalBytes / 1048576} MB",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
.addOnFailureListener { e ->
|
||||
// (Optional) Handle errors.
|
||||
if (e is FirebaseAppDistributionException) {
|
||||
when (e.errorCode) {
|
||||
FirebaseAppDistributionException.Status.NOT_IMPLEMENTED -> {
|
||||
// SDK did nothing. This is expected when building for Play.
|
||||
}
|
||||
|
||||
else -> {
|
||||
// Handle other errors.
|
||||
Toast.makeText(
|
||||
this,
|
||||
"AppDistribution error, status: ${e.errorCode}",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
FirebaseCrashlytics.getInstance().recordException(e)
|
||||
}
|
||||
}
|
||||
.addOnSuccessListener {
|
||||
// Toast.makeText(this, "App Update: Success!", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.example.hposregistration.ui.fragments
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
|
||||
import android.widget.Toast
|
||||
import com.example.hposregistration.data.LanguageManager
|
||||
import `in`.sminnovations.hposregistration.R
|
||||
|
||||
private var isLanguageChanged = false
|
||||
class LanguageSettingsFragment : PreferenceFragmentCompat() {
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
val preferenceScreen = preferenceManager.createPreferenceScreen(requireContext())
|
||||
|
||||
val languagePreference = androidx.preference.ListPreference(requireContext())
|
||||
languagePreference.key = "language_preference"
|
||||
languagePreference.title = getString(R.string.app_language)
|
||||
languagePreference.summary = getString(R.string.select_language)
|
||||
languagePreference.entries = arrayOf("English", "Kannada", "Hindi")
|
||||
languagePreference.entryValues = arrayOf("en", "kn", "hi")
|
||||
languagePreference.setDefaultValue("en")
|
||||
|
||||
languagePreference.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _, newValue ->
|
||||
val languageCode = newValue as String
|
||||
updateLanguage(requireContext(), languageCode)
|
||||
true
|
||||
}
|
||||
|
||||
preferenceScreen.addPreference(languagePreference)
|
||||
setPreferenceScreen(preferenceScreen)
|
||||
|
||||
// App Version Preference
|
||||
val appVersionPreference = Preference(requireContext())
|
||||
appVersionPreference.title = "App Version"
|
||||
appVersionPreference.summary = getAppVersion(requireContext())
|
||||
|
||||
preferenceScreen.addPreference(languagePreference)
|
||||
preferenceScreen.addPreference(appVersionPreference)
|
||||
setPreferenceScreen(preferenceScreen)
|
||||
|
||||
if (isLanguageChanged) {
|
||||
Toast.makeText(requireContext(), R.string.language_update, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateLanguage(context: Context, languageCode: String) {
|
||||
LanguageManager.persistLanguagePreference(context, languageCode)
|
||||
LanguageManager.setLocale(context, languageCode)
|
||||
requireActivity().recreate() // Recreate activity to apply language changes
|
||||
isLanguageChanged = true
|
||||
}
|
||||
|
||||
private fun getAppVersion(context: Context): String {
|
||||
return try {
|
||||
val pInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||
pInfo.versionName
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
"N/A"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,10 +47,10 @@ class LoginFragment : Fragment() {
|
||||
performLogin(loginId, password)
|
||||
} else {
|
||||
if (loginId.isBlank()) {
|
||||
binding.loginId.error = R.string.enter_proper_login_id.toString()
|
||||
binding.loginId.error = getString(R.string.enter_proper_login_id)
|
||||
}
|
||||
if (password.isBlank()) {
|
||||
binding.password.error = R.string.enter_proper_password.toString()
|
||||
binding.password.error = getString(R.string.enter_proper_password)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
package com.example.hposregistration.ui.fragments
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.media.audiofx.BassBoost
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.example.hposregistration.adapters.UserListOfflineAdapter
|
||||
@@ -18,11 +26,16 @@ import com.example.hposregistration.data.Constant
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
import com.example.hposregistration.ui.viewmodels.RegistrationViewModel
|
||||
import com.firebase.ui.firestore.FirestoreRecyclerOptions
|
||||
import com.google.androidgamesdk.gametextinput.Settings
|
||||
import com.google.firebase.firestore.Query
|
||||
import com.google.firebase.firestore.ktx.firestore
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import `in`.sminnovations.hposregistration.R
|
||||
import `in`.sminnovations.hposregistration.databinding.FragmentUserListBinding
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
|
||||
@AndroidEntryPoint
|
||||
class UserListFragment : BaseFragment() {
|
||||
@@ -30,11 +43,13 @@ class UserListFragment : BaseFragment() {
|
||||
private var _binding: FragmentUserListBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private val viewModel by viewModels<RegistrationViewModel>()
|
||||
private val viewModel:RegistrationViewModel by activityViewModels()
|
||||
|
||||
private var isOnline = false
|
||||
|
||||
private lateinit var sharedPreference: SharedPreferences
|
||||
private val REQUEST_CODE_MANAGE_EXTERNAL_STORAGE = 123
|
||||
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
@@ -42,7 +57,20 @@ class UserListFragment : BaseFragment() {
|
||||
_binding = FragmentUserListBinding.inflate(inflater, container, false)
|
||||
sharedPreference = requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
|
||||
setupViews()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
if (!Environment.isExternalStorageManager()) {
|
||||
val intent = Intent(android.provider.Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
|
||||
|
||||
intent.data = Uri.parse("package:" + requireContext().packageName)
|
||||
startActivityForResult(intent, REQUEST_CODE_MANAGE_EXTERNAL_STORAGE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return binding.root
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
@@ -68,8 +96,9 @@ class UserListFragment : BaseFragment() {
|
||||
viewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable ->
|
||||
if (isNetworkAvailable) {
|
||||
isOnline = isNetworkAvailable
|
||||
fetchFromServer()
|
||||
checkForLocalDBData()
|
||||
fetchFromLocalDB()
|
||||
// fetchFromServer()
|
||||
// checkForLocalDBData()
|
||||
} else {
|
||||
isOnline = isNetworkAvailable
|
||||
fetchFromLocalDB()
|
||||
@@ -80,6 +109,32 @@ class UserListFragment : BaseFragment() {
|
||||
showUploadDialog(requireContext())
|
||||
}
|
||||
|
||||
viewModel.allUserData.observe(viewLifecycleOwner) { userData ->
|
||||
|
||||
val btnSaveLocalVisibility =
|
||||
if (userData.isNotEmpty()) View.VISIBLE else View.GONE
|
||||
|
||||
binding.btnSaveLocal.visibility = btnSaveLocalVisibility
|
||||
|
||||
binding.btnSaveLocal.setOnClickListener {
|
||||
if (btnSaveLocalVisibility == View.VISIBLE) {
|
||||
// Execute the action when the button is visible (testStatus is true for at least one user)
|
||||
showDownloadDialog(requireContext())
|
||||
} else {
|
||||
// Handle the case when the button is not visible
|
||||
Toast.makeText(
|
||||
requireContext(),
|
||||
"No test details stored locally",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.btnsettings.setOnClickListener{
|
||||
findNavController().navigate(R.id.action_userListFragment_to_languageSettingsFragment)
|
||||
|
||||
}
|
||||
viewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||
deteleIncompleteRegistration(userDataList)
|
||||
}
|
||||
@@ -91,14 +146,14 @@ class UserListFragment : BaseFragment() {
|
||||
builder.setMessage(R.string.do_log_out)
|
||||
|
||||
// Positive button
|
||||
builder.setPositiveButton("Yes") { dialog, _ ->
|
||||
builder.setPositiveButton(R.string.yes) { dialog, _ ->
|
||||
saveUserId()
|
||||
findNavController().navigate(R.id.action_userListFragment_to_loginFragment)
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
// Negative button
|
||||
builder.setNegativeButton("No") { dialog, _ ->
|
||||
builder.setNegativeButton(R.string.no) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
@@ -160,7 +215,17 @@ class UserListFragment : BaseFragment() {
|
||||
private fun fetchFromServer() {
|
||||
binding.noList.visibility = View.GONE
|
||||
binding.rvOrder.visibility = View.VISIBLE
|
||||
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
|
||||
val currentDate = Date()
|
||||
val today = dateFormat.format(currentDate)
|
||||
val query = Firebase.firestore.collection("patientData")
|
||||
.whereGreaterThanOrEqualTo("createdAt", today)
|
||||
.orderBy("createdAt", Query.Direction.DESCENDING)
|
||||
query.get().addOnSuccessListener {
|
||||
// if (it.documents.isEmpty() && isOnline) {
|
||||
// binding.emptyRegistrations.visibility = View.VISIBLE
|
||||
// }
|
||||
}
|
||||
val recyclerViewOptions =
|
||||
FirestoreRecyclerOptions.Builder<UserData>().setQuery(query, UserData::class.java)
|
||||
.build()
|
||||
@@ -169,13 +234,32 @@ class UserListFragment : BaseFragment() {
|
||||
adapter.startListening()
|
||||
}
|
||||
|
||||
|
||||
private fun showDownloadDialog(context: Context) {
|
||||
val builder = AlertDialog.Builder(context)
|
||||
builder.setTitle(R.string.download_db_registration_title)
|
||||
builder.setMessage(R.string.download_db_registration_message)
|
||||
|
||||
builder.setPositiveButton(R.string.downloadcsv) { dialog, _ ->
|
||||
downloadLocalDBData(dialog)
|
||||
}
|
||||
|
||||
builder.setNegativeButton(R.string.cancel) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
|
||||
val dialog = builder.create()
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
|
||||
private fun fetchFromLocalDB() {
|
||||
binding.uploadData.visibility = View.GONE
|
||||
viewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||
if (isOnline) {
|
||||
binding.noList.visibility = View.GONE
|
||||
binding.rvOrder.visibility = View.VISIBLE
|
||||
} else {
|
||||
// if (isOnline) {
|
||||
// binding.noList.visibility = View.GONE
|
||||
// binding.rvOrder.visibility = View.VISIBLE
|
||||
// } else {
|
||||
if (userDataList.isEmpty()) {
|
||||
binding.noList.visibility = View.VISIBLE
|
||||
binding.rvOrder.visibility = View.GONE
|
||||
@@ -187,10 +271,58 @@ class UserListFragment : BaseFragment() {
|
||||
adapter.differ.submitList(userDataList)
|
||||
binding.rvOrder.adapter = adapter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("LogNotTimber")
|
||||
private fun downloadLocalDBData(dialog: DialogInterface) {
|
||||
var csvDownloaded = false
|
||||
viewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||
try {
|
||||
if (!csvDownloaded) {
|
||||
|
||||
val downloadList = mutableListOf<UserData>()
|
||||
|
||||
userDataList.forEach { userData ->
|
||||
Log.d(
|
||||
"DownloadDebug",
|
||||
"userData: $userData, isCSVCreated: ${userData.isCSVCreated}"
|
||||
)
|
||||
// if (!userData.isCSVCreated) {
|
||||
// userData.isCSVCreated = false
|
||||
downloadList.add(userData)
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// Log the size of downloadList for debugging
|
||||
Log.d("DownloadDebug", "downloadList size: ${downloadList.size}")
|
||||
|
||||
if (downloadList.isNotEmpty()) {
|
||||
// Call ViewModel function to create CSV with filtered data
|
||||
viewModel.createCSV(downloadList, requireContext())
|
||||
csvDownloaded = true
|
||||
Toast.makeText(
|
||||
requireContext(),
|
||||
"CSV file downloaded successfully",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else {
|
||||
Toast.makeText(requireContext(), "No data to download", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Toast.makeText(requireContext(), "Error downloading CSV file", Toast.LENGTH_SHORT).show()
|
||||
} finally {
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun deteleIncompleteRegistration(userDataList: List<UserData>) {
|
||||
userDataList.forEach {
|
||||
if (it.userImageURL.isEmpty()) {
|
||||
@@ -198,4 +330,5 @@ class UserListFragment : BaseFragment() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
import `in`.sminnovations.hposregistration.R
|
||||
import `in`.sminnovations.hposregistration.databinding.FragmentAbhaRegistrationBinding
|
||||
import org.json.JSONObject
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
|
||||
@AndroidEntryPoint
|
||||
class AbhaRegistrationFragment : BaseFragment() {
|
||||
@@ -93,6 +96,7 @@ class AbhaRegistrationFragment : BaseFragment() {
|
||||
|
||||
navigateToUserDetailsFragment(userData._id)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +148,7 @@ class AbhaRegistrationFragment : BaseFragment() {
|
||||
private fun saveUserDataAsPerAbhaId() {
|
||||
with(binding) {
|
||||
tvScanMessage.visibility = View.VISIBLE
|
||||
tvScanMessage.text = R.string.enter_aadhar_manually.toString()
|
||||
tvScanMessage.text = getString(R.string.enter_aadhar_manually)
|
||||
etAbhaId.setText(userData.abhaId)
|
||||
etName.setText(userData.name)
|
||||
}
|
||||
@@ -156,7 +160,7 @@ class AbhaRegistrationFragment : BaseFragment() {
|
||||
private fun saveUserDataAsPerAadharId() {
|
||||
with(binding) {
|
||||
tvScanMessage.text =
|
||||
R.string.scanned_aadhar_id.toString()
|
||||
getString(R.string.scanned_aadhar_id)
|
||||
etName.setText(userData.name)
|
||||
}
|
||||
Toast.makeText(
|
||||
@@ -169,19 +173,19 @@ class AbhaRegistrationFragment : BaseFragment() {
|
||||
): Boolean {
|
||||
with(binding) {
|
||||
if (!checkAbhaIDNumber(abhaId)) {
|
||||
etAbhaId.error = R.string.invalid_abha_id.toString()
|
||||
etAbhaId.error = getString(R.string.invalid_abha_id)
|
||||
return false
|
||||
}
|
||||
if (!checkAadharIDNumber(aadharId)) {
|
||||
aadharID.error = R.string.invalid_aadhar_id.toString()
|
||||
aadharID.error = getString(R.string.invalid_aadhar_id)
|
||||
return false
|
||||
}
|
||||
if (!checkUserName(userName)) {
|
||||
etName.error = R.string.name_field_error.toString()
|
||||
etName.error = getString(R.string.name_field_error)
|
||||
return false
|
||||
}
|
||||
if (!checkCenterName(centerName)) {
|
||||
etCenterName.error = R.string.center_name_error.toString()
|
||||
etCenterName.error = getString(R.string.center_name_error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,12 +62,18 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
|
||||
|
||||
binding.btnSubmit.setOnClickListener {
|
||||
if (isOnline) {
|
||||
showProgressBar(binding.progressBarCL)
|
||||
addDataToFirebase()
|
||||
// showProgressBar(binding.progressBarCL)
|
||||
// addDataToFirebase()
|
||||
Toast.makeText(
|
||||
requireContext(),
|
||||
R.string.local,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
navigateToUserListFragment()
|
||||
} else {
|
||||
Toast.makeText(
|
||||
requireContext(),
|
||||
R.string.internt_not_local,
|
||||
R.string.local,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
navigateToUserListFragment()
|
||||
@@ -177,6 +183,11 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
|
||||
val version = pInfo.versionName
|
||||
userData.appVersion = version
|
||||
|
||||
userData.createdAt = SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||
).format(Calendar.getInstance().time)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ import com.example.hposregistration.ui.viewmodels.RegistrationViewModel
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import `in`.sminnovations.hposregistration.R
|
||||
import `in`.sminnovations.hposregistration.databinding.FragmentUserDetailsRegistrationBinding
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
@AndroidEntryPoint
|
||||
@@ -179,7 +182,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
viewModel.insert(userData)
|
||||
navigateToCaptureUserImageFragment()
|
||||
} else {
|
||||
showToast(R.string.enter_details_properly.toString())
|
||||
showToast(getString(R.string.enter_details_properly))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,7 +197,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
with(binding) {
|
||||
val yob = etYob.text.toString()
|
||||
if (yob.isEmpty() || yob.toInt() <= 1900 || yob.toInt() > 2023) {
|
||||
etYob.error = R.string.enter_valid_birth_year.toString()
|
||||
etYob.error = getString(R.string.enter_valid_birth_year)
|
||||
return false
|
||||
} else {
|
||||
userData.birthYear = yob
|
||||
@@ -211,7 +214,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
val genderother= binding.etOthergender.text.toString()
|
||||
userData.gender = genderother
|
||||
if (genderother.isEmpty()) {
|
||||
etOthergender.error = R.string.fill_field.toString()
|
||||
etOthergender.error = getString(R.string.fill_field)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -225,7 +228,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val mobile = etMobile.text.toString()
|
||||
if (mobile.isEmpty() || mobile.length != 10) {
|
||||
etMobile.error = R.string.valid_mobile_number.toString()
|
||||
etMobile.error = getString(R.string.valid_mobile_number)
|
||||
return false
|
||||
} else {
|
||||
userData.phoneNumber = mobile
|
||||
@@ -233,7 +236,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val careOf = etCareof.text.toString()
|
||||
if (careOf.isEmpty()) {
|
||||
etCareof.error = R.string.enter_father_husband_name.toString()
|
||||
etCareof.error = getString(R.string.enter_father_husband_name)
|
||||
return false
|
||||
} else {
|
||||
userData.careOf = careOf
|
||||
@@ -241,7 +244,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val maritalStatus = etIsMarried.text.toString()
|
||||
if (maritalStatus.isEmpty()) {
|
||||
etIsMarried.error = R.string.enter_marital_status.toString()
|
||||
etIsMarried.error = getString(R.string.enter_marital_status)
|
||||
return false
|
||||
} else {
|
||||
userData.maritalStatus = maritalStatus
|
||||
@@ -250,7 +253,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
val category = etCategory.text.toString()
|
||||
val other = etOther.text.toString()
|
||||
if (category.isEmpty()) {
|
||||
etCategory.error = R.string.enter_category.toString()
|
||||
etCategory.error = getString(R.string.enter_category)
|
||||
return false
|
||||
} else if (category == "OTHER" && tilOther.isVisible) {
|
||||
userData.category = other
|
||||
@@ -261,7 +264,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
val caste = etCaste.text.toString()
|
||||
val othercaste = etOthercaste.text.toString()
|
||||
if (caste.isEmpty()) {
|
||||
etCaste.error = R.string.enter_caste.toString()
|
||||
etCaste.error = getString(R.string.enter_caste)
|
||||
return false
|
||||
} else if (caste == "OTHER" && tilOthercaste.isVisible) {
|
||||
userData.caste = othercaste
|
||||
@@ -277,7 +280,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val house = etHouse.text.toString()
|
||||
if (house.isEmpty()) {
|
||||
etHouse.error = R.string.enter_house_address.toString()
|
||||
etHouse.error = getString(R.string.enter_house_address)
|
||||
return false
|
||||
} else {
|
||||
userData.house = house
|
||||
@@ -285,7 +288,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val city = etCity.text.toString()
|
||||
if (city.isEmpty()) {
|
||||
etCity.error = R.string.enter_city.toString()
|
||||
etCity.error = getString(R.string.enter_city)
|
||||
return false
|
||||
} else {
|
||||
userData.city = city
|
||||
@@ -293,7 +296,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val district = etDistrict.text.toString()
|
||||
if (district.isEmpty()) {
|
||||
etDistrict.error = R.string.enter_district.toString()
|
||||
etDistrict.error = getString(R.string.enter_district)
|
||||
return false
|
||||
} else {
|
||||
userData.district = district
|
||||
@@ -301,7 +304,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val state = etState.text.toString()
|
||||
if (state.isEmpty()) {
|
||||
etState.error = R.string.enter_state.toString()
|
||||
etState.error = getString(R.string.enter_state)
|
||||
return false
|
||||
} else {
|
||||
userData.state = state
|
||||
@@ -309,7 +312,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
val pincode = etPincode.text.toString()
|
||||
if (pincode.isEmpty() || pincode.length != 6) {
|
||||
etPincode.error = R.string.enter_pincode.toString()
|
||||
etPincode.error = getString(R.string.enter_pincode)
|
||||
return false
|
||||
} else {
|
||||
userData.pinCode = pincode
|
||||
@@ -322,7 +325,7 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
if (yes1history.isChecked) {
|
||||
val familyHistory = etFamilyHistory.text.toString()
|
||||
if (familyHistory.isEmpty()) {
|
||||
etFamilyHistory.error = R.string.enter_family_history.toString()
|
||||
etFamilyHistory.error = getString(R.string.enter_family_history)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -333,10 +336,12 @@ class UserDetailsRegistrationFragment : Fragment() {
|
||||
|
||||
}
|
||||
|
||||
userData.createdAt = SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||
).format(Calendar.getInstance().time)
|
||||
|
||||
return true
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.example.hposregistration.ui.viewmodels
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
@@ -10,20 +11,27 @@ import com.example.hposregistration.data.MainRepository
|
||||
import com.example.hposregistration.data.NetworkStatusLiveData
|
||||
import com.example.hposregistration.data.Response
|
||||
import com.example.hposregistration.data.user.UserData
|
||||
import com.example.hposregistration.dao.UserDao
|
||||
import com.example.hposregistration.data.datasource.LocalFileDataSource
|
||||
import com.google.firebase.storage.FirebaseStorage
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.launch
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class RegistrationViewModel @Inject constructor(
|
||||
private val mainRepository: MainRepository,
|
||||
private val userdao: UserDao,
|
||||
private val localFileDataSource: LocalFileDataSource,
|
||||
context: Context
|
||||
) : ViewModel() {
|
||||
|
||||
val userData = MutableLiveData<UserData>()
|
||||
|
||||
val allUserData = mainRepository.allUsers
|
||||
val allUserData = userdao.getAll()
|
||||
|
||||
val fireBaseUpload = MutableLiveData<String>()
|
||||
|
||||
@@ -73,4 +81,25 @@ class RegistrationViewModel @Inject constructor(
|
||||
fun deleteById(userId: String) = viewModelScope.launch {
|
||||
mainRepository.deleteById(id = userId)
|
||||
}
|
||||
|
||||
fun createCSV(userData: List<UserData>, context: Context) =
|
||||
viewModelScope.launch {
|
||||
val fileName = "hpos${getCurrentDate()}.csv"
|
||||
if (localFileDataSource.exportDataToCSV(fileName, userData)) {
|
||||
userData.forEach { data ->
|
||||
data.localFlag = true
|
||||
mainRepository.updateCSVFieldById(
|
||||
data._id,
|
||||
true)
|
||||
// data.isCSVCreated = false
|
||||
Log.d("DownloadDebugcsv", "Setting isCSVCreated to false for ${data._id}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getCurrentDate(): String {
|
||||
val dateFormat = SimpleDateFormat("dd_MM_yy", Locale.getDefault())
|
||||
val currentDate = Date()
|
||||
return dateFormat.format(currentDate)
|
||||
}
|
||||
}
|
||||
5
app/src/main/res/drawable/baseline_settings_24.xml
Normal file
5
app/src/main/res/drawable/baseline_settings_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/downloads.xml
Normal file
5
app/src/main/res/drawable/downloads.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="@color/primary"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/primary" android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
||||
</vector>
|
||||
13
app/src/main/res/layout/fragment_language_settings.xml
Normal file
13
app/src/main/res/layout/fragment_language_settings.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.hposregistration.ui.fragments.LanguageSettingsFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -16,6 +16,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/btnsettings"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@drawable/baseline_settings_24"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title" />
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
style="@style/title1"
|
||||
@@ -26,6 +34,8 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noList"
|
||||
style="@style/title1"
|
||||
@@ -72,6 +82,16 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
tools:listitem="@layout/user_item_view" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnSaveLocal"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@drawable/downloads"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rv_order"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/btnRegisterUser"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
app:destination="@id/loginFragment"
|
||||
app:popUpTo="@id/main_nav_graph"
|
||||
app:popUpToInclusive="true"/>
|
||||
<action
|
||||
android:id="@+id/action_userListFragment_to_languageSettingsFragment"
|
||||
app:destination="@id/languageSettingsFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/profileFragment"
|
||||
@@ -93,4 +96,16 @@
|
||||
app:popUpTo="@id/main_nav_graph"
|
||||
app:popUpToInclusive="true"/>
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/languageSettingsFragment"
|
||||
android:name="com.example.hposregistration.ui.fragments.LanguageSettingsFragment"
|
||||
android:label="fragment_language_settings"
|
||||
tools:layout="@layout/fragment_language_settings">
|
||||
|
||||
<action
|
||||
android:id="@+id/action_userListFragment_to_languageSettingsFragment"
|
||||
app:destination="@id/languageSettingsFragment"
|
||||
app:popUpTo="@id/main_nav_graph"
|
||||
app:popUpToInclusive="true"/>
|
||||
</fragment>
|
||||
</navigation>
|
||||
@@ -115,12 +115,14 @@
|
||||
<string name="enter_father_husband_name">पिता / पति का नाम दर्ज करें</string>
|
||||
<string name="do_log_out">क्या आप ऐप्लिकेशन से लॉग आउट करना चाहते हैं?</string>
|
||||
<string name="log_out">लॉग आउट</string>
|
||||
<string name="local">साक्षात्कार विवरण स्थानीय रूप से सहेजे गए हैं</string>
|
||||
|
||||
<string name="no_data_available">स्थानीय डेटाबेस में कोई डेटा उपलब्ध नहीं है</string>
|
||||
<string name="upload_db_registration">डीबी पंजीकरण अपलोड करें</string>
|
||||
<string name="upload_local_db_to_cloud">क्या आप स्थानीय डीबी को क्लाउड पर अपलोड करना चाहते हैं?</string>
|
||||
<string name="upload">अपलोड</string>
|
||||
<string name="upload_done_successfully">अपलोड सफलतापूर्वक हुआ</string>
|
||||
|
||||
<string name="empty_registrations">प्रदर्शन के लिए कोई पंजीकरण उपलब्ध नहीं है</string>
|
||||
<string name="enter_proper_login_id">कृपया सही लॉगिन आईडी दर्ज करें</string>
|
||||
<string name="enter_proper_password">कृपया सही पासवर्ड दर्ज करें</string>
|
||||
<string name="wrong_password">गलत पासवर्ड</string>
|
||||
@@ -128,7 +130,16 @@
|
||||
<string name="scanned_aadhar_id">आपने आधार आईडी स्कैन की है, कृपया आधार आईडी नंबर और अभा आईडी को मैन्युअली दर्ज करें</string>
|
||||
<string name="scanned_abha_id">आपने आभा आईडी स्कैन की है</string>
|
||||
<string name="scanned_aadharid">आपने आधार आईडी स्कैन की है</string>
|
||||
<string name="language_update">भाषा सफलतापूर्वक अपडेट की गई है</string>
|
||||
<string name="select_language">अपनी पसंदीदा भाषा का चयन करें</string>
|
||||
<string name="app_language">ऐप भाषा</string>
|
||||
<string name="add_blood_group">रक्त समूह जोड़ें</string>
|
||||
<string name="ok">ठीक है</string>
|
||||
<string name="userid">उपयोगकर्ता आईडी</string>
|
||||
|
||||
<string name="yes">हाँ</string>
|
||||
<string name="no">नहीं</string>
|
||||
<string name="name">नाम</string>
|
||||
<string-array name="category">
|
||||
<item>NT-A</item>
|
||||
<item>NT-B</item>
|
||||
|
||||
@@ -6,15 +6,16 @@
|
||||
<string name="retry">ಮರುಪ್ರಯಾಸ</string>
|
||||
<string name="failed_to_connect">ಸಂಪರ್ಕ ಸಾಧಿಸಲಾಗಿಲ್ಲ</string>
|
||||
<string name="cancel">ರದ್ದು ಮಾಡಿ</string>
|
||||
<string name="local">ಟೆಸ್ಟ್ ವಿವರಗಳನ್ನು ಸ್ಥಳೀಯವಾಗಿ ಉಳಿಸಲಾಗಿದೆ</string>
|
||||
|
||||
|
||||
//Registration Screens
|
||||
<string name="scan_person_abha_id_card">ವ್ಯಕ್ತಿಯ ಏಬಿಎ ಐಡಿ / ಆಧಾರ್ ಐಡಿ ಕಾರ್ಡ್ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||
<string name="scan_now">ಈಗ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||
<string name="or">ಅಥವಾ</string>
|
||||
<string name="enter_abha_number_manualy">ಏಬಿಎ ಮತ್ತು ಆಧಾರ್ ಸಂಖ್ಯೆಗಳನ್ನು ಕೈಮಾಡಿ</string>
|
||||
<string name="abha_id">ಏಬಿಎ ಸಂಖ್ಯೆ</string>
|
||||
<string name="create_abha_id_card">ಏಬಿಎ ಐಡಿ ಕಾರ್ಡ್ ರಚಿಸಿ</string>
|
||||
<string name="enter_abha_number_manualy">ಅಭಾ ಮತ್ತು ಆಧಾರ್ ಸಂಖ್ಯೆಯನ್ನು ನಮೂದಿಸಿ</string>
|
||||
<string name="abha_id">ಅಭಾ ಸಂಖ್ಯೆ</string>
|
||||
<string name="create_abha_id_card">ಅಭಾ ಐಡಿ ಕಾರ್ಡ್ ರಚಿಸಿ</string>
|
||||
<string name="click_here">ಇಲ್ಲಿ ಕ್ಲಿಕ್ ಮಾಡಿ</string>
|
||||
<string name="scan_person_s_aadhaar_card">ವ್ಯಕ್ತಿಯ ಆಧಾರ್ ಕಾರ್ಡ್ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||
<string name="proceed">ಮುಂದುವರಿಸಿ</string>
|
||||
@@ -57,7 +58,7 @@
|
||||
<string name="user_details">ಬಳಕೆದಾರ ವಿವರಗಳು</string>
|
||||
<string name="internet_is_not_available_and_there_is_no_data_available_in_local_db">ಇಂಟರ್ನೆಟ್ ಲಭ್ಯವಿಲ್ಲ ಮತ್ತು ಸ್ಥಳಿಯ ಡಿಬಿಯಲ್ಲಿ ಯಾವುದೇ ಡೇಟಾ ಲಭ್ಯವಿಲ್ಲ</string>
|
||||
<string name="user_id">ಬಳಕೆದಾರ ಐಡಿ: %1$s</string>
|
||||
<string name="abha_number">ಆಭಾ ಸಂಖ್ಯೆ: %1$s</string>
|
||||
<string name="abha_number">ಅಭಾ ಸಂಖ್ಯೆ: %1$s</string>
|
||||
<string name="aadhar_number_details">ಆಧಾರ ಸಂಖ್ಯೆ: %1$s</string>
|
||||
<string name="user_name">ವ್ಯಕ್ತಿಯ ಹೆಸರು: %1$s</string>
|
||||
<string name="birth_year_details">ಹುಟ್ಟಿದ ವರ್ಷ: %1$s</string>
|
||||
@@ -92,10 +93,10 @@
|
||||
|
||||
|
||||
<string name="cancelled_unable_scan">ರದ್ದು ಮಾಡಲಾಗಿದೆ: ಸ್ಕ್ಯಾನ್ ಮಾಡಲು ಸಾಧ್ಯವಿಲ್ಲ, ಮತ್ತೊಮ್ಮೆ ಪ್ರಯಾಸಿಸಿ!!</string>
|
||||
<string name="scan_abha_card">ದಯವಿಟ್ಟು ಆಭಾ ಐಡಿ / ಆಧಾರ್ ಐಡಿ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||
<string name="scan_abha_card">ದಯವಿಟ್ಟು ಅಭಾ ಐಡಿ/ಆಧಾರ್ ಐಡಿಯನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||
<string name="invalid_qr_code">ನೀವು ಸ್ಕ್ಯಾನ್ ಮಾಡಿದ QR ಕೋಡ್ ಮಾನ್ಯವಿಲ್ಲ, ದಯವಿಟ್ಟು ಮಾಹಿತಿಯನ್ನು ಕೈಮಾಡಿ ನಮೂದಿಸಿ</string>
|
||||
<string name="enter_aadhar_manually">ನೀವು ಅಬ ಹಾ ಐಡಿ ಸ್ಕ್ಯಾನ್ ಮಾಡಿದ್ದೀರಿ, ಆಧಾರ್ ಐಡಿ ಅನ್ನು ಕೈಮಾತ್ರ ನಮೂದಿಸಿ</string>
|
||||
<string name="invalid_abha_id">ಅಮಾನ್ಯವಾದ ಅಬ ಹಾ ಐಡಿ</string>
|
||||
<string name="invalid_abha_id">ಅಮಾನ್ಯ ಅಭಾ ಐಡಿ</string>
|
||||
<string name="invalid_aadhar_id">ಅಮಾನ್ಯವಾದ ಆಧಾರ್ ಐಡಿ</string>
|
||||
<string name="name_field_error">ಹೆಸರು ಕ್ಷೇತ್ರವು ಖಾಲಿ ಇರಲಾರದು ಅಥವಾ 3 ಅಕ್ಷರಗಳಿಂದ ಕಡಿಮೆ ಇರಲಾರದು</string>
|
||||
<string name="center_name_error">ಕೇಂದ್ರದ ಹೆಸರು ಖಾಲಿ ಇರಲಾರದು ಅಥವಾ 3 ಅಕ್ಷರಗಳಿಂದ ಕಡಿಮೆ ಇರಲಾರದು</string>
|
||||
@@ -119,6 +120,7 @@
|
||||
<string name="enter_father_husband_name">ದಯವಿಟ್ಟು ನಿಮ್ಮ ತಂದೆ / ಗಂಡನ ಹೆಸರನ್ನು ನಮೂದಿಸಿ</string>
|
||||
<string name="do_log_out">ನೀವು ಅಪ್ಲಿಕೇಶನ್ ನಿಂದ ಲಾಗೌಟ್ ಮಾಡಲು ಇಚ್ಛಿಸುತ್ತೀರಾ?</string>
|
||||
<string name="log_out">ಲಾಗೌಟ್</string>
|
||||
<string name="no_data_available">ಸ್ಥಾನಿಕ ಡೇಟಾಬೇಸ್ನಲ್ಲಿ ಯಾವುದೇ ಡೇಟಾ ಲಭ್ಯವಿಲ್ಲ</string>
|
||||
|
||||
<string name="upload_db_registration">ಡಿಬಿ ನೋಂದಾಯಿಸುವ ಕೊರಕು</string>
|
||||
<string name="upload_local_db_to_cloud">ನೀವು ಲೋಕಲ್ ಡಿಬಿ ನೋಂದಾಯಿಸನ್ನು ಮೇಘಮಾರ್ಗಕ್ಕೆ ಅಪ್ಲೋಡ್ ಮಾಡಲು ಇಚ್ಛಿಸುವಿರಾ?</string>
|
||||
@@ -129,11 +131,19 @@
|
||||
<string name="wrong_password">ತಪ್ಪಾದ ಪಾಸ್ವರ್ಡ್</string>
|
||||
<string name="wrong_user_id">ತಪ್ಪಾದ ಬಳಕೆದಾರ ಐಡಿ</string>
|
||||
<string name="scanned_aadhar_id">ನೀವು ಆಧಾರ್ ಐಡನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿದ್ದೀರಿ, ದಯವಿಟ್ಟು ಆಧಾರ್ ಐಡನ್ನು ನೀವು ಸ್ಕ್ಯಾನ್ ಮಾಡಿದ ಮತ್ತು ಅಭಾ ಐಡನ್ನು ಕೈಯಾರೆ ನಮೂದಿಸಿ</string>
|
||||
<string name="empty_registrations">ಪ್ರದರ್ಶಿಸಲಿರುವ ಯಾವ ನೋಂದಾಯಿಗಳೂ ಲಭ್ಯವಿಲ್ಲ</string>
|
||||
|
||||
<string name="scanned_abha_id">ನೀವು ಅಭಾ ಐಡನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿದಿರಿ</string>
|
||||
<string name="scanned_abha_id">ನೀವು ಅಭಾ ಐಡಿಯನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿದ್ದೀರಿ</string>
|
||||
<string name="scanned_aadharid">ನೀವು ಆಧಾರ್ ಐಡನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿದಿರಿ</string>
|
||||
|
||||
|
||||
<string name="language_update">ಭಾಷೆ ಯಶಸ್ವಿಯಾಗಿ ನವೀಕರಿಸಲಾಗಿದೆ</string>
|
||||
<string name="select_language">ನಿಮ್ಮ ಆದರಿತ ಭಾಷೆಯನ್ನು ಆಯ್ಕೆ ಮಾಡಿ</string>
|
||||
<string name="app_language">ಅಪ್ಲಿಕೇಶನ್ ಭಾಷೆ</string>
|
||||
<string name="add_blood_group">ರಕ್ತ ಗುಂಡನ್ನು ಸೇರಿಸಿ</string>
|
||||
<string name="userid">ಬಳಕೆದಾರ ಐಡಿ</string>
|
||||
<string name="ok">ಸರಿ</string>
|
||||
<string name="yes">ಹೌದು</string>
|
||||
<string name="no">ಇಲ್ಲ</string>
|
||||
<string name="name">ಹೆಸರು</string>
|
||||
<string-array name="yes_no">
|
||||
<item>ಹೌದು</item>
|
||||
<item>ಇಲ್ಲ</item>
|
||||
@@ -7,7 +7,8 @@
|
||||
<string name="retry">Retry</string>
|
||||
<string name="failed_to_connect">Failed to connect</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string-array name="yes_no">
|
||||
<item>Yes</item>
|
||||
<item>No</item>
|
||||
@@ -59,7 +60,7 @@
|
||||
<string name="mobile_number">Mobile Number</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="user_details">User Details</string>
|
||||
<string name="internet_is_not_available_and_there_is_no_data_available_in_local_db">Internet is not available and there is no Data available in Local DB</string>
|
||||
<string name="internet_is_not_available_and_there_is_no_data_available_in_local_db">there is no Data available in Local DB</string>
|
||||
<string name="user_id">User ID: %1$s</string>
|
||||
<string name="abha_number">Abha Number: %1$s</string>
|
||||
<string name="aadhar_number_details">Aadhar Number: %1$s</string>
|
||||
@@ -103,6 +104,9 @@
|
||||
<string name="center_name_error">Center name can\'t be empty or less than 3 characters</string>
|
||||
<string name="registration_success">Registration Done Successfully</string>
|
||||
<string name="internt_not_local">Internet not available, test details stored locally</string>
|
||||
<string name="local">details stored locally</string>
|
||||
<string name="no_data_available">No data available in the local database</string>
|
||||
|
||||
<string name="enter_details_properly">Please enter all the details properly</string>
|
||||
<string name="enter_valid_birth_year">Please enter a valid birth year between 1900 and 2023</string>
|
||||
<string name="fill_field">Please fill the field</string>
|
||||
@@ -125,16 +129,28 @@
|
||||
<string name="upload_local_db_to_cloud">Do you want to upload the local DB Registration to the cloud?</string>
|
||||
<string name="upload">Upload</string>
|
||||
<string name="upload_done_successfully">Upload done successfully</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="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="userid">User Id</string>
|
||||
<string name="name">Name</string>
|
||||
<string name="ok">OK</string>
|
||||
|
||||
<string name="empty_registrations">No registrations available for display</string>
|
||||
|
||||
|
||||
<string name="add_blood_group">Add Blood Group</string>
|
||||
<string name="scanned_aadhar_id">You have scanned the Aadhar ID, need to enter Aadhar ID number you have scanned and Abha ID manually</string>
|
||||
<string name="scanned_abha_id">You have scanned the Abha ID</string>
|
||||
<string name="scanned_aadharid">You have scanned the Aadhar ID</string>
|
||||
|
||||
<string name="downloadcsv">Download CSV</string>
|
||||
<string name="download_db_registration_title">Download DB Registartion Data</string>
|
||||
<string name="download_db_registration_message">Do you want to download the local DB Registrations in CSV format?</string>
|
||||
<string name="upload_success_message">Upload done successfully</string>
|
||||
<string-array name="category">
|
||||
<item>NT-A</item>
|
||||
<item>NT-B</item>
|
||||
|
||||
Reference in New Issue
Block a user