2 Commits

23 changed files with 279 additions and 453 deletions

View File

@@ -1,88 +0,0 @@
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Android.gitlab-ci.yml
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
image: eclipse-temurin:17-jdk-jammy
variables:
# ANDROID_COMPILE_SDK is the version of Android you're compiling with.
# It should match compileSdkVersion.
ANDROID_COMPILE_SDK: "34"
# ANDROID_BUILD_TOOLS is the version of the Android build tools you are using.
# It should match buildToolsVersion.
ANDROID_BUILD_TOOLS: "33.0.2"
# It's what version of the command line tools we're going to download from the official site.
# Official Site-> https://developer.android.com/studio/index.html
# There, look down below at the cli tools only, sdk tools package is of format:
# commandlinetools-os_type-ANDROID_SDK_TOOLS_latest.zip
# when the script was last modified for latest compileSdkVersion, it was which is written down below
ANDROID_SDK_TOOLS: "9477386"
# Packages installation before running script
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget unzip
# Setup path as android_home for moving/exporting the downloaded sdk into it
- export ANDROID_HOME="${PWD}/android-sdk-root"
# Create a new directory at specified location
- install -d $ANDROID_HOME
# Here we are installing androidSDK tools from official source,
# (the key thing here is the url from where you are downloading these sdk tool for command line, so please do note this url pattern there and here as well)
# after that unzipping those tools and
# then running a series of SDK manager commands to install necessary android SDK packages that'll allow the app to build
- wget --no-verbose --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
- unzip -q -d "$ANDROID_HOME/cmdline-tools" "$ANDROID_HOME/cmdline-tools.zip"
- mv -T "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/tools"
- export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/cmdline-tools/tools/bin
# Nothing fancy here, just checking sdkManager version
- sdkmanager --version
# use yes to accept all licenses
- yes | sdkmanager --licenses > /dev/null || true
- sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
- sdkmanager "platform-tools"
- sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
# Not necessary, but just for surity
- chmod +x ./gradlew
# Basic android and gradle stuff
# Check linting
lintDebug:
interruptible: true
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
artifacts:
paths:
- app/lint/reports/lint-results-debug.html
expose_as: "lint-report"
when: always
# Make Project
assembleDebug:
interruptible: true
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/
# Run all tests, if any fails, interrupt the pipeline(fail it)
debugTests:
needs: [lintDebug, assembleDebug]
interruptible: true
stage: test
script:
- ./gradlew -Pci --console=plain :app:testDebug

5
.idea/gradle.xml generated
View File

@@ -4,16 +4,17 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/andriod studio gradle/gradle-7.3" /> <option name="gradleHome" value="$USER_HOME$/andriod studio gradle/gradle-7.3" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> <option name="gradleJvm" value="jbr-17" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
</set> </set>
</option> </option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>

3
app/.gitignore vendored
View File

@@ -1,2 +1 @@
/build /build
/google-services*

View File

@@ -13,11 +13,11 @@ android {
compileSdk 34 compileSdk 34
defaultConfig { defaultConfig {
applicationId "in.sminnovations.hposregistration.iocl" applicationId "in.sminnovations.hposregistration"
minSdk 26 minSdk 26
targetSdk 34 targetSdk 34
versionCode 8 versionCode 1
versionName "1.0.8" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
@@ -59,8 +59,6 @@ dependencies {
implementation 'com.google.firebase:firebase-storage-ktx' implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.firebaseui:firebase-ui-firestore:8.0.2' 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.6.0'
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta10'
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta10")
// Coroutines // Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'

View File

@@ -1,64 +1,110 @@
{ {
"project_info": { "project_info": {
"project_number": "243503501547", "project_number": "650071678820",
"project_id": "iocl-iisc-hpos", "project_id": "hpos-af3cc",
"storage_bucket": "iocl-iisc-hpos.appspot.com" "storage_bucket": "hpos-af3cc.appspot.com"
}, },
"client": [ "client": [
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:243503501547:android:f17de652a3524d047feeae", "mobilesdk_app_id": "1:650071678820:android:f1435a1c07f710036c6471",
"android_client_info": { "android_client_info": {
"package_name": "com.iocl_iisc.hposqc" "package_name": "com.example.hposconsentform"
} }
}, },
"oauth_client": [], "oauth_client": [
{
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [ "api_key": [
{ {
"current_key": "AIzaSyBPxgcDkZfZMr8cFrkMWkVf1a-MstzWC1k" "current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [] "other_platform_oauth_client": [
{
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
"client_type": 3
}
]
} }
} }
}, },
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:243503501547:android:e1bb0f338c8448dd7feeae", "mobilesdk_app_id": "1:650071678820:android:7569c1cad4fc99916c6471",
"android_client_info": { "android_client_info": {
"package_name": "in.sminnovations.hposregistration.iocl" "package_name": "in.sminnovations.hposregistration"
} }
}, },
"oauth_client": [], "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": [ "api_key": [
{ {
"current_key": "AIzaSyBPxgcDkZfZMr8cFrkMWkVf1a-MstzWC1k" "current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [] "other_platform_oauth_client": [
{
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
"client_type": 3
}
]
} }
} }
}, },
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:243503501547:android:18b8b33b2dc3776d7feeae", "mobilesdk_app_id": "1:650071678820:android:f96be19e5d43102b6c6471",
"android_client_info": { "android_client_info": {
"package_name": "in.sminnovations.hpostesting.iocl" "package_name": "in.sminnovations.hpostesting"
} }
}, },
"oauth_client": [], "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": [ "api_key": [
{ {
"current_key": "AIzaSyBPxgcDkZfZMr8cFrkMWkVf1a-MstzWC1k" "current_key": "AIzaSyAVdNGCev_AFX0qmuZJF6kxzRzXUTeAW5I"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [] "other_platform_oauth_client": [
{
"client_id": "650071678820-to41afi9f0gi5r3k6v7pe1e5p96nupcs.apps.googleusercontent.com",
"client_type": 3
}
]
} }
} }
} }

View File

@@ -41,9 +41,8 @@ class UserListOfflineAdapter(private val view: View) : RecyclerView.Adapter<User
override fun onBindViewHolder(holder: CompanyViewHolder, position: Int) { override fun onBindViewHolder(holder: CompanyViewHolder, position: Int) {
val userList = differ.currentList[position] val userList = differ.currentList[position]
holder.binding.apply { holder.binding.apply {
userName.text = "Name: ${userList.name}" userName.text = userList.name
userId.text = "Sample ID: ${userList._id}" userId.text = userList._id
timeCreated.text = "Time Created: ${userList.createdAt}"
Glide.with(view).load(userList.userImageURL).into(userImage) Glide.with(view).load(userList.userImageURL).into(userImage)
} }
} }

View File

@@ -28,8 +28,7 @@ class UserListOnlineAdapter(options: FirestoreRecyclerOptions<UserData>, private
override fun onBindViewHolder(holder: OrderItemViewHolder, position: Int, model: UserData) { override fun onBindViewHolder(holder: OrderItemViewHolder, position: Int, model: UserData) {
holder.binding.apply { holder.binding.apply {
userName.text = "Name: ${model.name}" userName.text = "Name: ${model.name}"
userId.text = "Sample ID: ${model._id}" userId.text = "User ID: ${model._id}"
timeCreated.text = "Time Created: ${model.createdAt}"
Glide.with(view).load(model.userImageURL).into(userImage) Glide.with(view).load(model.userImageURL).into(userImage)
} }
} }

View File

@@ -22,9 +22,6 @@ object Constant {
const val USER_ID = "usernameId" const val USER_ID = "usernameId"
val STATICID = listOf( val STATICID = listOf(
"SMIMYSURU",
"SMIKODAGU",
"SMICHAMARAJA",
"SMIREG1", "SMIREG1",
"SMIREG2", "SMIREG2",
"SMIREG3", "SMIREG3",

View File

@@ -7,11 +7,8 @@ import androidx.room.PrimaryKey
data class UserData( data class UserData(
@PrimaryKey @PrimaryKey
var _id: String = "", var _id: String = "",
var _idSearch: String = "",
var abhaId: String = "", var abhaId: String = "",
var abhaIdSearch: String = "",
var aadharId: String = "", var aadharId: String = "",
var aadharIdSearch: String = "",
var name: String = "", var name: String = "",
var birthYear: String = "", var birthYear: String = "",
var gender: String = "", var gender: String = "",

View File

@@ -2,10 +2,6 @@ package com.example.hposregistration.ui.activities
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.widget.Toast
import com.google.firebase.appdistribution.FirebaseAppDistribution
import com.google.firebase.appdistribution.FirebaseAppDistributionException
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import `in`.sminnovations.hposregistration.databinding.ActivityMainBinding import `in`.sminnovations.hposregistration.databinding.ActivityMainBinding
@@ -20,44 +16,4 @@ class MainActivity : AppCompatActivity() {
setContentView(binding.root) 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()
// }
}
} }

View File

@@ -8,7 +8,7 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.SearchView import android.widget.Button
import android.widget.Toast import android.widget.Toast
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
@@ -18,23 +18,18 @@ import com.example.hposregistration.data.Constant
import com.example.hposregistration.data.user.UserData import com.example.hposregistration.data.user.UserData
import com.example.hposregistration.ui.viewmodels.RegistrationViewModel import com.example.hposregistration.ui.viewmodels.RegistrationViewModel
import com.firebase.ui.firestore.FirestoreRecyclerOptions import com.firebase.ui.firestore.FirestoreRecyclerOptions
import com.google.firebase.firestore.Query
import com.google.firebase.firestore.ktx.firestore import com.google.firebase.firestore.ktx.firestore
import com.google.firebase.ktx.Firebase import com.google.firebase.ktx.Firebase
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import `in`.sminnovations.hposregistration.R import `in`.sminnovations.hposregistration.R
import `in`.sminnovations.hposregistration.databinding.FragmentUserListBinding import `in`.sminnovations.hposregistration.databinding.FragmentUserListBinding
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
@AndroidEntryPoint @AndroidEntryPoint
class UserListFragment : BaseFragment() { class UserListFragment : BaseFragment() {
private lateinit var userId:String
private var district:String ="Mysuru"
private var _binding: FragmentUserListBinding? = null private var _binding: FragmentUserListBinding? = null
private val binding get() = _binding!! private val binding get() = _binding!!
private lateinit var offlineAdapter:UserListOfflineAdapter
private val viewModel by viewModels<RegistrationViewModel>() private val viewModel by viewModels<RegistrationViewModel>()
private var isOnline = false private var isOnline = false
@@ -46,14 +41,6 @@ class UserListFragment : BaseFragment() {
): View { ): View {
_binding = FragmentUserListBinding.inflate(inflater, container, false) _binding = FragmentUserListBinding.inflate(inflater, container, false)
sharedPreference = requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE) sharedPreference = requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
userId = sharedPreference.getString(Constant.USER_ID, "").toString()
if(userId=="SMIMYSURU"){
district = "Mysuru"
}else if(userId=="SMIKODAGU"){
district = "Kodagu"
}else if(userId=="SMICHAMARAJA"){
district = "Chamarajanagar"
}
setupViews() setupViews()
return binding.root return binding.root
} }
@@ -69,23 +56,15 @@ class UserListFragment : BaseFragment() {
} }
private fun setupViews() { private fun setupViews() {
val pInfo = requireActivity().packageManager.getPackageInfo(
requireActivity().packageName, 0
)
val version = pInfo.versionName
binding.appVersion.text = version
binding.btnRegisterUser.setOnClickListener { binding.btnRegisterUser.setOnClickListener {
findNavController().navigate(R.id.action_userListFragment_to_registrationFragment) findNavController().navigate(R.id.action_userListFragment_to_registrationFragment)
} }
binding.btnLogout.setOnClickListener { binding.btnLogout.setOnClickListener {
logoutUser(requireContext()) logoutUser(requireContext())
} }
} }
private fun init() { private fun init() {
binding.searchUser.isIconified = false
viewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable -> viewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable ->
if (isNetworkAvailable) { if (isNetworkAvailable) {
isOnline = isNetworkAvailable isOnline = isNetworkAvailable
@@ -97,28 +76,6 @@ class UserListFragment : BaseFragment() {
} }
} }
binding.searchUser.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean {
// Perform the final search
if(isOnline){
fetchFromServer(query)
}else{
filterList(query)
}
return true
}
override fun onQueryTextChange(newText: String?): Boolean {
// Perform search as the user types
if(isOnline){
fetchFromServer(newText)
}else{
filterList(newText)
}
return true
}
})
binding.uploadData.setOnClickListener { binding.uploadData.setOnClickListener {
showUploadDialog(requireContext()) showUploadDialog(requireContext())
} }
@@ -127,12 +84,6 @@ class UserListFragment : BaseFragment() {
deteleIncompleteRegistration(userDataList) deteleIncompleteRegistration(userDataList)
} }
} }
private fun filterList(query: String?) {
val filteredList = viewModel.allUserData.value?.filter { userData ->
userData.name.contains(query ?: "", ignoreCase = true)
}
offlineAdapter.differ.submitList(filteredList)
}
private fun logoutUser(context: Context) { private fun logoutUser(context: Context) {
val builder = AlertDialog.Builder(context) val builder = AlertDialog.Builder(context)
@@ -205,89 +156,19 @@ class UserListFragment : BaseFragment() {
} }
} }
} }
// private fun fetchFromServer(searchTerm: String? = null) {
// binding.noList.visibility = View.GONE
// binding.rvOrder.visibility = View.VISIBLE
// val dateFormat = SimpleDateFormat("yyyy-MM-dd")
// val currentDate = Date()
// val today = dateFormat.format(currentDate)
//
// // Base query to fetch patient data created today
// var query = Firebase.firestore.collection("patientData")
// .whereGreaterThanOrEqualTo("createdAt", today)
// .orderBy("createdAt", Query.Direction.DESCENDING)
//
// // If a search term is provided, add it to the query
// if (!searchTerm.isNullOrEmpty()) {
// query = query.whereEqualTo("aadharId", searchTerm)
// }
//
// query.get().addOnSuccessListener {
// if (it.documents.isEmpty() && isOnline) {
// binding.emptyRegistrations.visibility = View.VISIBLE
// }
// }
//
// val recyclerViewOptions =
// FirestoreRecyclerOptions.Builder<UserData>().setQuery(query, UserData::class.java)
// .build()
// val adapter = UserListOnlineAdapter(recyclerViewOptions, binding.root)
// binding.rvOrder.adapter = adapter
// adapter.startListening()
// }
private fun fetchFromServer(searchTerm: String? = null) {
binding.noList.visibility = View.GONE
binding.rvOrder.visibility = View.VISIBLE
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
val currentDate = Date()
val today = dateFormat.format(currentDate)
// Base query to fetch patient data created today and from the specified district private fun fetchFromServer() {
var query = Firebase.firestore.collection("patientData") binding.noList.visibility = View.GONE
// .whereGreaterThanOrEqualTo("createdAt", today) binding.rvOrder.visibility = View.VISIBLE
.whereEqualTo("district", district) val query = Firebase.firestore.collection("patientData")
.orderBy("createdAt", Query.Direction.DESCENDING) val recyclerViewOptions =
FirestoreRecyclerOptions.Builder<UserData>().setQuery(query, UserData::class.java)
// If a search term is provided, add it to the query .build()
if (!searchTerm.isNullOrEmpty()) { val adapter = UserListOnlineAdapter(recyclerViewOptions, binding.root)
query = query.whereEqualTo("_id", searchTerm) binding.rvOrder.adapter = adapter
adapter.startListening()
} }
query.get().addOnSuccessListener {
if (it.documents.isEmpty() && isOnline) {
binding.emptyRegistrations.visibility = View.VISIBLE
}
}
val recyclerViewOptions =
FirestoreRecyclerOptions.Builder<UserData>().setQuery(query, UserData::class.java)
.build()
val adapter = UserListOnlineAdapter(recyclerViewOptions, binding.root)
binding.rvOrder.adapter = adapter
adapter.startListening()
}
// 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()
// val adapter = UserListOnlineAdapter(recyclerViewOptions, binding.root)
// binding.rvOrder.adapter = adapter
// adapter.startListening()
// }
private fun fetchFromLocalDB() { private fun fetchFromLocalDB() {
binding.uploadData.visibility = View.GONE binding.uploadData.visibility = View.GONE
viewModel.allUserData.observe(viewLifecycleOwner) { userDataList -> viewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
@@ -295,7 +176,6 @@ private fun fetchFromServer(searchTerm: String? = null) {
binding.noList.visibility = View.GONE binding.noList.visibility = View.GONE
binding.rvOrder.visibility = View.VISIBLE binding.rvOrder.visibility = View.VISIBLE
} else { } else {
binding.emptyRegistrations.visibility = View.GONE
if (userDataList.isEmpty()) { if (userDataList.isEmpty()) {
binding.noList.visibility = View.VISIBLE binding.noList.visibility = View.VISIBLE
binding.rvOrder.visibility = View.GONE binding.rvOrder.visibility = View.GONE
@@ -303,9 +183,9 @@ private fun fetchFromServer(searchTerm: String? = null) {
binding.noList.visibility = View.GONE binding.noList.visibility = View.GONE
binding.rvOrder.visibility = View.VISIBLE binding.rvOrder.visibility = View.VISIBLE
deteleIncompleteRegistration(userDataList) deteleIncompleteRegistration(userDataList)
offlineAdapter = UserListOfflineAdapter(binding.root) val adapter = UserListOfflineAdapter(binding.root)
offlineAdapter.differ.submitList(userDataList) adapter.differ.submitList(userDataList)
binding.rvOrder.adapter = offlineAdapter binding.rvOrder.adapter = adapter
} }
} }
} }

View File

@@ -1,7 +1,5 @@
package com.example.hposregistration.ui.fragments.registration package com.example.hposregistration.ui.fragments.registration
import android.content.Context
import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@@ -21,15 +19,11 @@ import com.journeyapps.barcodescanner.ScanIntentResult
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import `in`.sminnovations.hposregistration.databinding.FragmentAbhaRegistrationBinding import `in`.sminnovations.hposregistration.databinding.FragmentAbhaRegistrationBinding
import org.json.JSONObject import org.json.JSONObject
import java.time.Instant
import java.util.Random
@AndroidEntryPoint @AndroidEntryPoint
class AbhaRegistrationFragment : BaseFragment() { class AbhaRegistrationFragment : BaseFragment() {
private var _binding: FragmentAbhaRegistrationBinding? = null private var _binding: FragmentAbhaRegistrationBinding? = null
private lateinit var sharedPreference: SharedPreferences
private val binding get() = _binding!! private val binding get() = _binding!!
private val viewModel by viewModels<RegistrationViewModel>() private val viewModel by viewModels<RegistrationViewModel>()
@@ -51,8 +45,6 @@ class AbhaRegistrationFragment : BaseFragment() {
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View { ): View {
_binding = FragmentAbhaRegistrationBinding.inflate(inflater, container, false) _binding = FragmentAbhaRegistrationBinding.inflate(inflater, container, false)
sharedPreference =
requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
return binding.root return binding.root
} }
@@ -86,30 +78,22 @@ class AbhaRegistrationFragment : BaseFragment() {
val userName = binding.etName.text.toString() val userName = binding.etName.text.toString()
val aadharIdInput = binding.aadharID.text.toString() val aadharIdInput = binding.aadharID.text.toString()
val centerName = binding.centerName.text.toString() val centerName = binding.centerName.text.toString()
val currentUnixTime = Instant.now().epochSecond
if (validateInputs(abhaIdInput, aadharIdInput, userName, centerName)) { if (validateInputs(abhaIdInput, aadharIdInput, userName, centerName)) {
userData.apply { userData.apply {
name = userName.lowercase() name = userName
aadharId = aadharIdInput aadharId = aadharIdInput
abhaId = abhaIdInput abhaId = abhaIdInput
registrationCenterName = centerName registrationCenterName = centerName
// _id = centerName.substring(0, 3).uppercase() + name.substring(0, 4) + _id = aadharId + userName.substring(0, 3).uppercase() + centerName.substring(0, 3).uppercase()
_id = userName.substring(0, 3).uppercase() + generateFourDigitNumber() +centerName.substring(0, 3).uppercase()
} }
viewModel.insert(userData) viewModel.insert(userData)
Toast.makeText(requireActivity(),"ID"+userData._id,Toast.LENGTH_SHORT).show()
navigateToUserDetailsFragment(userData._id) navigateToUserDetailsFragment(userData._id)
} }
} }
} }
private fun generateFourDigitNumber(): String {
val random = Random()
val number: Int = 1000 + random.nextInt(9000) // Ensures a 4-digit number
return number.toString()
}
private fun processScannedData(contents: String) { private fun processScannedData(contents: String) {
try { try {
@@ -183,14 +167,14 @@ class AbhaRegistrationFragment : BaseFragment() {
abhaId: String, aadharId: String, userName: String, centerName: String abhaId: String, aadharId: String, userName: String, centerName: String
): Boolean { ): Boolean {
with(binding) { with(binding) {
// if (!checkAbhaIDNumber(abhaId)) { if (!checkAbhaIDNumber(abhaId)) {
// etAbhaId.error = "Invalid Abha ID" etAbhaId.error = "Invalid Abha ID"
// return false return false
// } }
// if (!checkAadharIDNumber(aadharId)) { if (!checkAadharIDNumber(aadharId)) {
// aadharID.error = "Invalid Aadhar ID" aadharID.error = "Invalid Aadhar ID"
// return false return false
// } }
if (!checkUserName(userName)) { if (!checkUserName(userName)) {
etName.error = "Name field can't be empty or less than 3 characters" etName.error = "Name field can't be empty or less than 3 characters"
return false return false

View File

@@ -111,7 +111,7 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
requireContext().getString(R.string.abha_number, userData.abhaId) requireContext().getString(R.string.abha_number, userData.abhaId)
binding.tvAadharId.text = binding.tvAadharId.text =
requireContext().getString(R.string.aadhar_number_details, userData.aadharId) requireContext().getString(R.string.aadhar_number_details, userData.aadharId)
binding.tvUserName.text = requireContext().getString(R.string.user_name, userData.name.lowercase()) binding.tvUserName.text = requireContext().getString(R.string.user_name, userData.name)
binding.tvBirthYear.text = binding.tvBirthYear.text =
requireContext().getString(R.string.birth_year_details, userData.birthYear) requireContext().getString(R.string.birth_year_details, userData.birthYear)
binding.tvGender.text = binding.tvGender.text =

View File

@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
@@ -42,6 +43,25 @@ class UserDetailsRegistrationFragment : Fragment() {
private fun init() { private fun init() {
setupViewModel() setupViewModel()
setupSubmitButton() setupSubmitButton()
binding.etCategory.setOnItemClickListener { parent, view, position, id ->
if (parent.getItemAtPosition(position).toString().equals("OTHER", ignoreCase = true)) {
binding.tilOther.visibility = View.VISIBLE
} else {
binding.tilOther.visibility = View.GONE
}
}
binding.etCaste.setOnItemClickListener { parent, view, position, id ->
if (parent.getItemAtPosition(position).toString().equals("OTHER", ignoreCase = true)) {
binding.tilOthercaste.visibility = View.VISIBLE
} else {
binding.tilOthercaste.visibility = View.GONE
}
}
} }
private fun setupViewModel() { private fun setupViewModel() {
@@ -59,24 +79,26 @@ class UserDetailsRegistrationFragment : Fragment() {
when (it) { when (it) {
"Male" -> { "Male" -> {
male.isChecked = true male.isChecked = true
binding.tilOthergender.visibility = View.GONE
} }
"Female" -> { "Female" -> {
female.isChecked = true female.isChecked = true
binding.tilOthergender.visibility = View.GONE
} }
else -> { else -> {
other.isChecked = true other.isChecked = true
binding.tilOthergender.visibility = View.VISIBLE
} }
} }
} }
user.phoneNumber.let { etMobile.setText(it) } user.phoneNumber.let { etMobile.setText(it) }
user.careOf.let { etCareof.setText(it) } user.careOf.let { etCareof.setText(it) }
user.maritalStatus.let { etIsMarried.setText(it, false) } user.maritalStatus.let { etIsMarried.setText(it, false) }
user.caste.let { etCaste.setText(it) }
user.category.let { etCategory.setText(it, false) }
user.subCaste.let { etSubCaste.setText(it) } user.subCaste.let { etSubCaste.setText(it) }
user.house.let { etHouse.setText(it) } user.house.let { etHouse.setText(it) }
user.city.let { etCity.setText(it) } user.city.let { etCity.setText(it) }
user.district.let { etDistrict.setText(it, false) } user.district.let { etDistrict.setText(it) }
user.state.let { etState.setText(it) }
user.pinCode.let { etPincode.setText(it) } user.pinCode.let { etPincode.setText(it) }
user.isUnderMedication.let { user.isUnderMedication.let {
if (it != null) { if (it != null) {
@@ -93,6 +115,12 @@ class UserDetailsRegistrationFragment : Fragment() {
yes1history.isChecked = true yes1history.isChecked = true
} }
} }
user.category.let {
etCategory.setText(it, false)
}
user.caste.let {
etCaste.setText(it, false)
}
if (yes1history.isChecked) { if (yes1history.isChecked) {
if (binding.yes1history.isChecked) View.VISIBLE else View.GONE if (binding.yes1history.isChecked) View.VISIBLE else View.GONE
@@ -111,6 +139,35 @@ class UserDetailsRegistrationFragment : Fragment() {
if (binding.no1history.isChecked) View.GONE else View.VISIBLE if (binding.no1history.isChecked) View.GONE else View.VISIBLE
} }
if(other.isChecked){
user.gender.let { etOthergender.setText(it) }
}
binding.male.setOnClickListener {
binding.tilOthergender.visibility = View.GONE
}
binding.female.setOnClickListener {
binding.tilOthergender.visibility = View.GONE
}
binding.other.setOnClickListener {
binding.tilOthergender.visibility = View.VISIBLE
}
if (binding.etCategory.text.toString().equals("OTHER", ignoreCase = true)) {
binding.tilOther.visibility = View.VISIBLE
binding.etOther.visibility = View.VISIBLE
} else {
binding.tilOther.visibility = View.GONE
}
if (binding.etCaste.text.toString().equals("OTHER", ignoreCase = true)) {
binding.tilOthercaste.visibility = View.VISIBLE
binding.etOthercaste.visibility = View.VISIBLE
} else {
binding.tilOthercaste.visibility = View.GONE
}
} }
} }
@@ -136,29 +193,36 @@ class UserDetailsRegistrationFragment : Fragment() {
private fun verifyUserDetails(): Boolean { private fun verifyUserDetails(): Boolean {
with(binding) { with(binding) {
val yob = etYob.text.toString() val yob = etYob.text.toString()
if (yob.isEmpty() || yob.toInt() <= 1900 || yob.toInt() > 2020) { if (yob.isEmpty() || yob.toInt() <= 1900 || yob.toInt() > 2023) {
etYob.error = "Please enter a valid birth year between 1900 and 2020" etYob.error = "Please enter a valid birth year between 1900 and 2023"
return false return false
} else { } else {
userData.birthYear = yob userData.birthYear = yob
} }
if (male.isChecked) { if (male.isChecked) {
binding.tilOthergender.visibility = View.GONE
userData.gender = "Male" userData.gender = "Male"
} else if (female.isChecked) { } else if (female.isChecked) {
binding.tilOthergender.visibility = View.GONE
userData.gender = "Female" userData.gender = "Female"
} else { } else if(other.isChecked) {
userData.gender = "Other" binding.tilOthergender.visibility = View.VISIBLE
val genderother= binding.etOthergender.text.toString()
userData.gender = genderother
if (genderother.isEmpty()) {
etOthergender.error = "Please fill the field"
return false
}
} }
val mobile = etMobile.text.toString() val mobile = etMobile.text.toString()
userData.phoneNumber = mobile if (mobile.isEmpty() || mobile.length != 10) {
// if (mobile.isEmpty() || mobile.length != 10) { etMobile.error = "Please enter a valid 10-digit mobile number"
// etMobile.error = "Please enter a valid 10-digit mobile number" return false
// return false } else {
// } else { userData.phoneNumber = mobile
// userData.phoneNumber = mobile }
// }
val careOf = etCareof.text.toString() val careOf = etCareof.text.toString()
if (careOf.isEmpty()) { if (careOf.isEmpty()) {
@@ -177,21 +241,28 @@ class UserDetailsRegistrationFragment : Fragment() {
} }
val category = etCategory.text.toString() val category = etCategory.text.toString()
val other = etOther.text.toString()
if (category.isEmpty()) { if (category.isEmpty()) {
etCategory.error = "Please enter your category" etCategory.error = "Please enter your category"
return false return false
} else if (category == "OTHER" && tilOther.isVisible) {
userData.category = other
} else { } else {
userData.category = category userData.category = category
} }
val caste = etCaste.text.toString() val caste = etCaste.text.toString()
val othercaste = etOthercaste.text.toString()
if (caste.isEmpty()) { if (caste.isEmpty()) {
etCaste.error = "Please enter your caste" etCaste.error = "Please enter your caste"
return false return false
} else if (caste == "OTHER" && tilOthercaste.isVisible) {
userData.caste = othercaste
} else { } else {
userData.caste = caste userData.caste = caste
} }
val subCaste = etSubCaste.text.toString() val subCaste = etSubCaste.text.toString()
if (subCaste.isNotEmpty()) { if (subCaste.isNotEmpty()) {
userData.subCaste = subCaste userData.subCaste = subCaste
@@ -257,6 +328,8 @@ class UserDetailsRegistrationFragment : Fragment() {
return true return true
} }
} }

View File

@@ -13,10 +13,6 @@ import com.example.hposregistration.data.user.UserData
import com.google.firebase.storage.FirebaseStorage import com.google.firebase.storage.FirebaseStorage
import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
@HiltViewModel @HiltViewModel
@@ -67,15 +63,6 @@ class RegistrationViewModel @Inject constructor(
get() = _networkStatusLiveData get() = _networkStatusLiveData
fun insert(userData: UserData) = viewModelScope.launch { fun insert(userData: UserData) = viewModelScope.launch {
val currentDate = Date()
val dateFormat = SimpleDateFormat("yyyyMMdd")
val partition = dateFormat.format(currentDate)
userData._idSearch = partition + userData._id
userData.abhaIdSearch = partition + userData.abhaId
userData.aadharIdSearch = partition + userData.aadharId
userData.createdAt = SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
).format(Calendar.getInstance().time)
mainRepository.insert(userData) mainRepository.insert(userData)
} }

View File

@@ -18,7 +18,6 @@
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/title1" style="@style/title1"
android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
@@ -32,7 +31,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/scan_now" android:text="@string/scan_now"
android:visibility="gone"
android:textColor="@color/black" android:textColor="@color/black"
app:backgroundTint="@color/primary_light" app:backgroundTint="@color/primary_light"
app:cornerRadius="100dp" app:cornerRadius="100dp"
@@ -47,7 +45,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_scan_now"> app:layout_constraintTop_toBottomOf="@id/btn_scan_now">
@@ -96,7 +93,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:text="Enter Details to proceed\n(ABHA and Aadhar are optional)" android:text="@string/enter_abha_number_manualy"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/seperator1" /> app:layout_constraintTop_toBottomOf="@id/seperator1" />
@@ -114,7 +111,6 @@
android:id="@+id/et_name" android:id="@+id/et_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLength="24"
android:hint="@string/person_s_name" /> android:hint="@string/person_s_name" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@@ -172,7 +168,6 @@
android:id="@+id/centerName" android:id="@+id/centerName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLength="24"
android:hint="@string/center_name" android:hint="@string/center_name"
android:inputType="text" /> android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@@ -194,7 +189,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/proceed" android:text="@string/proceed"
android:textColor="@color/white"
app:cornerRadius="16dp" app:cornerRadius="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@@ -206,7 +200,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnProceed"> app:layout_constraintTop_toBottomOf="@id/btnProceed">
@@ -253,7 +246,6 @@
style="@style/title1" style="@style/title1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:text="@string/create_abha_id_card" android:text="@string/create_abha_id_card"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@@ -262,7 +254,6 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btn_click_here" android:id="@+id/btn_click_here"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/click_here" android:text="@string/click_here"

View File

@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="24dp"> android:padding="24dp"
tools:context=".ui.fragments.registration.CaptureUserImageFragment">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"

View File

@@ -63,7 +63,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:checked="true"
android:text="@string/male" android:text="@string/male"
android:textSize="16sp" /> android:textSize="16sp" />
@@ -83,7 +82,8 @@
</RadioGroup> </RadioGroup>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_mobile" android:visibility="gone"
android:id="@+id/til_othergender"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -93,6 +93,28 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gender"> app:layout_constraintTop_toBottomOf="@id/gender">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_othergender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Other"
android:inputType="text"
android:maxLength="10" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_mobile"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_othergender">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_mobile" android:id="@+id/et_mobile"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -160,30 +182,74 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/category" android:hint="@string/category"
android:inputType="none" android:inputType="text"
android:labelFor="@id/til_is_married" android:labelFor="@id/til_is_married"
app:simpleItems="@array/category" /> app:simpleItems="@array/category" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_caste" android:visibility="gone"
android:id="@+id/til_other"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
android:layout_marginTop="16dp" android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_category"> app:layout_constraintTop_toBottomOf="@id/til_category">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_other"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Other Category"
android:inputType="text"
android:maxLength="10" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_caste"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_other">
<AutoCompleteTextView
android:id="@+id/et_Caste" android:id="@+id/et_Caste"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/caste" /> android:hint="@string/caste"
android:inputType="text"
android:labelFor="@id/til_is_married"
app:simpleItems="@array/caste" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:visibility="gone"
android:id="@+id/til_othercaste"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_caste">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_othercaste"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Other Caste"
android:inputType="text"
android:maxLength="10" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_subCaste" android:id="@+id/til_subCaste"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
@@ -193,7 +259,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_caste"> app:layout_constraintTop_toBottomOf="@id/til_othercaste">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_subCaste" android:id="@+id/et_subCaste"
@@ -230,7 +296,7 @@
android:id="@+id/et_house" android:id="@+id/et_house"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="Address" /> android:hint="@string/house" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@@ -252,25 +318,23 @@
android:hint="@string/city_town" /> android:hint="@string/city_town" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_district" android:id="@+id/til_district"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp" android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_city"> app:layout_constraintTop_toBottomOf="@id/til_city">
<AutoCompleteTextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_district" android:id="@+id/et_district"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/district" android:hint="@string/district" />
android:inputType="none"
android:labelFor="@id/til_district"
app:simpleItems="@array/district" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@@ -289,7 +353,6 @@
android:id="@+id/et_state" android:id="@+id/et_state"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Karnataka"
android:hint="@string/state" /> android:hint="@string/state" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View File

@@ -16,20 +16,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/app_version"
style="@style/title2"
android:layout_width="57dp"
android:layout_height="15dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:text="1.0.4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.017"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/title1" style="@style/title1"
@@ -40,20 +26,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/emptyRegistrations"
style="@style/title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/empty_registrations"
android:textColor="@color/black"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/noList" android:id="@+id/noList"
style="@style/title1" style="@style/title1"
@@ -89,15 +61,6 @@
app:layout_constraintEnd_toStartOf="@+id/uploadData" app:layout_constraintEnd_toStartOf="@+id/uploadData"
app:layout_constraintTop_toTopOf="@+id/tv_title" /> app:layout_constraintTop_toTopOf="@+id/tv_title" />
<SearchView
android:id="@+id/searchUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_title"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_order" android:id="@+id/rv_order"
android:layout_width="0dp" android:layout_width="0dp"
@@ -106,7 +69,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchUser" app:layout_constraintTop_toBottomOf="@+id/tv_title"
tools:listitem="@layout/user_item_view" /> tools:listitem="@layout/user_item_view" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton

View File

@@ -56,20 +56,6 @@
app:layout_constraintStart_toEndOf="@+id/userImage" app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toBottomOf="@id/userName" app:layout_constraintTop_toBottomOf="@id/userName"
tools:text="UserID: MohamedKaif" /> tools:text="UserID: MohamedKaif" />
<TextView
android:id="@+id/timeCreated"
style="@style/title1_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:gravity="start"
android:textColor="@color/black"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toBottomOf="@id/userId"
tools:text="time" />
<TextView <TextView
android:id="@+id/teststatus" android:id="@+id/teststatus"
@@ -83,7 +69,7 @@
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/userImage" app:layout_constraintStart_toEndOf="@+id/userImage"
app:layout_constraintTop_toBottomOf="@id/timeCreated" app:layout_constraintTop_toBottomOf="@id/userId"
tools:text="Test Status: Completed"/> tools:text="Test Status: Completed"/>

View File

@@ -48,14 +48,13 @@
<string name="register_user">Register User</string> <string name="register_user">Register User</string>
<string name="is_user_having_any_family_history_for_sickle_cell">Is user having any family history for Sickle Cell</string> <string name="is_user_having_any_family_history_for_sickle_cell">Is user having any family history for Sickle Cell</string>
<string name="family_history_of_sickle_cell">Family History of Sickle Cell</string> <string name="family_history_of_sickle_cell">Family History of Sickle Cell</string>
<string name="mobile_number_10_digits">Mobile Number(Optional)</string> <string name="mobile_number_10_digits">Mobile Number (10 digits)</string>
<string name="sub_caste">Sub Caste</string> <string name="sub_caste">Sub Caste</string>
<string name="capture_user_image">Capture User Image</string> <string name="capture_user_image">Capture User Image</string>
<string name="mobile_number">Mobile Number</string> <string name="mobile_number">Mobile Number</string>
<string name="edit">Edit</string> <string name="edit">Edit</string>
<string name="user_details">User Details</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">Internet is not available and there is no Data available in Local DB</string>
<string name="empty_registrations">No registrations are available for display</string>
<string name="user_id">User ID: %1$s</string> <string name="user_id">User ID: %1$s</string>
<string name="abha_number">Abha Number: %1$s</string> <string name="abha_number">Abha Number: %1$s</string>
<string name="aadhar_number_details">Aadhar Number: %1$s</string> <string name="aadhar_number_details">Aadhar Number: %1$s</string>
@@ -156,10 +155,5 @@
<item>Female</item> <item>Female</item>
<item>Other</item> <item>Other</item>
</string-array> </string-array>
<string-array name="district">
<item>Mysuru</item>
<item>Kodagu</item>
<item>Chamarajanagar</item>
</string-array>
</resources> </resources>

View File

@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins { plugins {
id 'com.android.application' version '8.4.0' apply false id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.4.0' apply false id 'com.android.library' version '8.0.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
id 'androidx.navigation.safeargs' version '2.7.0-beta02' apply false id 'androidx.navigation.safeargs' version '2.7.0-beta02' apply false
id 'com.google.dagger.hilt.android' version '2.46' apply false id 'com.google.dagger.hilt.android' version '2.46' apply false

View File

@@ -1,6 +1,6 @@
#Wed Jul 12 14:05:11 IST 2023 #Wed Jul 12 14:05:11 IST 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists