2 Commits

Author SHA1 Message Date
Pritimay Sarkar
b10350f993 Merge branch 'LanguageTranslation' into 'main'
Merge multi-lingual support in app

See merge request sminnovations/hpos-registration-app!1
2023-11-30 09:04:42 +00:00
Shanmukha Innovations
8df17e8e19 Initial commit 2023-06-19 10:50:24 +00:00
34 changed files with 138 additions and 2253 deletions

3
.idea/.gitignore generated vendored
View File

@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

3
.idea/gradle.xml generated
View File

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

10
.idea/migrations.xml generated
View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

View File

@@ -1,4 +0,0 @@
<changelist name="Changes" date="1696578975861" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes/shelved.patch" />
<option name="DESCRIPTION" value="Changes" />
</changelist>

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
<changelist name="Changes1" date="1701673804446" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes1/shelved.patch" />
<option name="DESCRIPTION" value="Changes" />
</changelist>

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
<changelist name="Changes2" date="1701681731623" recycled="false">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Changes2/shelved.patch" />
<option name="DESCRIPTION" value="Changes" />
</changelist>

View File

@@ -1,21 +0,0 @@
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)
}
}

View File

View File

@@ -1,4 +0,0 @@
<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>

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
<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>

View File

@@ -1,4 +0,0 @@
<changelist name="Uncommitted_changes_before_Checkout_at_04-12-2023_02_50_pm_[Changes]" date="1701681655205" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_04-12-2023_02_50_pm_[Changes]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 04-12-2023 02:50 pm [Changes]" />
</changelist>

92
README.md Normal file
View File

@@ -0,0 +1,92 @@
# HPOS-Registration-App
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.com/sminnovations/hpos-registration-app.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.com/sminnovations/hpos-registration-app/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

View File

@@ -42,9 +42,9 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
@@ -58,24 +58,24 @@ 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.7.0'
implementation 'com.google.android.gms:play-services-auth:20.6.0'
// 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.2"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.2"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.46"
kapt "com.google.dagger:hilt-android-compiler:2.46"
kapt "androidx.hilt:hilt-compiler:1.1.0"
kapt "androidx.hilt:hilt-compiler:1.0.0"
// Navigation Component
implementation "androidx.navigation:navigation-fragment-ktx:2.7.5"
implementation "androidx.navigation:navigation-ui-ktx:2.7.5"
implementation "androidx.navigation:navigation-fragment-ktx:2.7.0"
implementation "androidx.navigation:navigation-ui-ktx:2.7.0"
// Retrofit + GSON
implementation "com.squareup.retrofit2:retrofit:2.9.0"
@@ -85,20 +85,19 @@ dependencies {
implementation 'com.jakewharton.timber:timber:4.7.1'
// Activity KTX for viewModels()
implementation "androidx.activity:activity-ktx:1.8.1"
implementation "androidx.activity:activity-ktx:1.7.2"
//image
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
//Room
implementation "androidx.room:room-ktx:2.6.0"
implementation "androidx.room:room-runtime:2.6.0"
kapt ("androidx.room:room-compiler:2.6.0")
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")
// Barcode scanner
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.preference:preference-ktx:1.2.1'
}

View File

@@ -9,7 +9,6 @@ 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) :
@@ -28,8 +27,8 @@ class UserListOnlineAdapter(options: FirestoreRecyclerOptions<UserData>, private
@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 = "Name: ${model.name}"
userId.text = "User ID: ${model._id}"
Glide.with(view).load(model.userImageURL).into(userImage)
}
}

View File

@@ -1,30 +0,0 @@
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"
}
}

View File

@@ -1,9 +1,7 @@
package com.example.hposregistration.ui.activities
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.hposregistration.data.LanguageManager
import dagger.hilt.android.AndroidEntryPoint
import `in`.sminnovations.hposregistration.databinding.ActivityMainBinding
@@ -11,12 +9,6 @@ import `in`.sminnovations.hposregistration.databinding.ActivityMainBinding
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)

View File

@@ -1,69 +0,0 @@
package com.example.hposregistration.ui.fragments
import android.content.Context
import android.content.pm.PackageManager
import android.os.Bundle
import android.preference.ListPreference
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
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"
}
}
}

View File

@@ -47,10 +47,10 @@ class LoginFragment : Fragment() {
performLogin(loginId, password)
} else {
if (loginId.isBlank()) {
binding.loginId.error = getString(R.string.enter_proper_login_id)
binding.loginId.error = R.string.enter_proper_login_id.toString()
}
if (password.isBlank()) {
binding.password.error = getString(R.string.enter_proper_password)
binding.password.error = R.string.enter_proper_password.toString()
}
}
}

View File

@@ -18,14 +18,11 @@ 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.firebase.firestore.Query
import com.google.firebase.firestore.ktx.firestore
import com.google.firebase.ktx.Firebase
import dagger.hilt.android.AndroidEntryPoint
import `in`.sminnovations.hposregistration.R
import `in`.sminnovations.hposregistration.databinding.FragmentUserListBinding
import java.text.SimpleDateFormat
import java.util.Date
@AndroidEntryPoint
class UserListFragment : BaseFragment() {
@@ -83,10 +80,6 @@ class UserListFragment : BaseFragment() {
showUploadDialog(requireContext())
}
binding.btnsettings.setOnClickListener{
findNavController().navigate(R.id.action_userListFragment_to_languageSettingsFragment)
}
viewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
deteleIncompleteRegistration(userDataList)
}
@@ -98,14 +91,14 @@ class UserListFragment : BaseFragment() {
builder.setMessage(R.string.do_log_out)
// Positive button
builder.setPositiveButton(R.string.yes) { dialog, _ ->
builder.setPositiveButton("Yes") { dialog, _ ->
saveUserId()
findNavController().navigate(R.id.action_userListFragment_to_loginFragment)
dialog.dismiss()
}
// Negative button
builder.setNegativeButton(R.string.no) { dialog, _ ->
builder.setNegativeButton("No") { dialog, _ ->
dialog.dismiss()
}
@@ -167,17 +160,7 @@ 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()

View File

@@ -144,7 +144,7 @@ class AbhaRegistrationFragment : BaseFragment() {
private fun saveUserDataAsPerAbhaId() {
with(binding) {
tvScanMessage.visibility = View.VISIBLE
tvScanMessage.text = getString(R.string.enter_aadhar_manually)
tvScanMessage.text = R.string.enter_aadhar_manually.toString()
etAbhaId.setText(userData.abhaId)
etName.setText(userData.name)
}
@@ -156,7 +156,7 @@ class AbhaRegistrationFragment : BaseFragment() {
private fun saveUserDataAsPerAadharId() {
with(binding) {
tvScanMessage.text =
getString(R.string.scanned_aadhar_id)
R.string.scanned_aadhar_id.toString()
etName.setText(userData.name)
}
Toast.makeText(
@@ -169,19 +169,19 @@ class AbhaRegistrationFragment : BaseFragment() {
): Boolean {
with(binding) {
if (!checkAbhaIDNumber(abhaId)) {
etAbhaId.error = getString(R.string.invalid_abha_id)
etAbhaId.error = R.string.invalid_abha_id.toString()
return false
}
if (!checkAadharIDNumber(aadharId)) {
aadharID.error = getString(R.string.invalid_aadhar_id)
aadharID.error = R.string.invalid_aadhar_id.toString()
return false
}
if (!checkUserName(userName)) {
etName.error = getString(R.string.name_field_error)
etName.error = R.string.name_field_error.toString()
return false
}
if (!checkCenterName(centerName)) {
etCenterName.error = getString(R.string.center_name_error)
etCenterName.error = R.string.center_name_error.toString()
return false
}
}

View File

@@ -179,7 +179,7 @@ class UserDetailsRegistrationFragment : Fragment() {
viewModel.insert(userData)
navigateToCaptureUserImageFragment()
} else {
showToast(getString(R.string.enter_details_properly))
showToast(R.string.enter_details_properly.toString())
}
}
}
@@ -194,7 +194,7 @@ class UserDetailsRegistrationFragment : Fragment() {
with(binding) {
val yob = etYob.text.toString()
if (yob.isEmpty() || yob.toInt() <= 1900 || yob.toInt() > 2023) {
etYob.error = getString(R.string.enter_valid_birth_year)
etYob.error = R.string.enter_valid_birth_year.toString()
return false
} else {
userData.birthYear = yob
@@ -211,7 +211,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val genderother= binding.etOthergender.text.toString()
userData.gender = genderother
if (genderother.isEmpty()) {
etOthergender.error = getString(R.string.fill_field)
etOthergender.error = R.string.fill_field.toString()
return false
}
}
@@ -225,7 +225,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val mobile = etMobile.text.toString()
if (mobile.isEmpty() || mobile.length != 10) {
etMobile.error = getString(R.string.valid_mobile_number)
etMobile.error = R.string.valid_mobile_number.toString()
return false
} else {
userData.phoneNumber = mobile
@@ -233,7 +233,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val careOf = etCareof.text.toString()
if (careOf.isEmpty()) {
etCareof.error = getString(R.string.enter_father_husband_name)
etCareof.error = R.string.enter_father_husband_name.toString()
return false
} else {
userData.careOf = careOf
@@ -241,7 +241,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val maritalStatus = etIsMarried.text.toString()
if (maritalStatus.isEmpty()) {
etIsMarried.error = getString(R.string.enter_marital_status)
etIsMarried.error = R.string.enter_marital_status.toString()
return false
} else {
userData.maritalStatus = maritalStatus
@@ -250,7 +250,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val category = etCategory.text.toString()
val other = etOther.text.toString()
if (category.isEmpty()) {
etCategory.error = getString(R.string.enter_category)
etCategory.error = R.string.enter_category.toString()
return false
} else if (category == "OTHER" && tilOther.isVisible) {
userData.category = other
@@ -261,7 +261,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val caste = etCaste.text.toString()
val othercaste = etOthercaste.text.toString()
if (caste.isEmpty()) {
etCaste.error = getString(R.string.enter_caste)
etCaste.error = R.string.enter_caste.toString()
return false
} else if (caste == "OTHER" && tilOthercaste.isVisible) {
userData.caste = othercaste
@@ -277,7 +277,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val house = etHouse.text.toString()
if (house.isEmpty()) {
etHouse.error = getString(R.string.enter_house_address)
etHouse.error = R.string.enter_house_address.toString()
return false
} else {
userData.house = house
@@ -285,7 +285,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val city = etCity.text.toString()
if (city.isEmpty()) {
etCity.error = getString(R.string.enter_city)
etCity.error = R.string.enter_city.toString()
return false
} else {
userData.city = city
@@ -293,7 +293,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val district = etDistrict.text.toString()
if (district.isEmpty()) {
etDistrict.error = getString(R.string.enter_district)
etDistrict.error = R.string.enter_district.toString()
return false
} else {
userData.district = district
@@ -301,7 +301,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val state = etState.text.toString()
if (state.isEmpty()) {
etState.error = getString(R.string.enter_state)
etState.error = R.string.enter_state.toString()
return false
} else {
userData.state = state
@@ -309,7 +309,7 @@ class UserDetailsRegistrationFragment : Fragment() {
val pincode = etPincode.text.toString()
if (pincode.isEmpty() || pincode.length != 6) {
etPincode.error = getString(R.string.enter_pincode)
etPincode.error = R.string.enter_pincode.toString()
return false
} else {
userData.pinCode = pincode
@@ -322,7 +322,7 @@ class UserDetailsRegistrationFragment : Fragment() {
if (yes1history.isChecked) {
val familyHistory = etFamilyHistory.text.toString()
if (familyHistory.isEmpty()) {
etFamilyHistory.error = getString(R.string.enter_family_history)
etFamilyHistory.error = R.string.enter_family_history.toString()
return false
}

View File

@@ -1,5 +0,0 @@
<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>

View File

@@ -1,13 +0,0 @@
<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>

View File

@@ -16,14 +16,6 @@
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"
@@ -34,20 +26,6 @@
app:layout_constraintStart_toStartOf="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
android:id="@+id/noList"
style="@style/title1"

View File

@@ -31,9 +31,6 @@
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"
@@ -96,16 +93,4 @@
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>

View File

@@ -128,16 +128,7 @@
<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>

View File

@@ -132,15 +132,8 @@
<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>

View File

@@ -7,8 +7,7 @@
<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>
@@ -110,7 +109,6 @@
<string name="valid_mobile_number">Please enter a valid 10-digit mobile number</string>
<string name="enter_name">Please enter your name</string>
<string name="enter_marital_status">Please enter your marital status</string>
<string name="empty_registrations">No registrations are available for display</string>
<string name="enter_category">Please enter your category</string>
<string name="enter_caste">Please enter your caste</string>
<string name="enter_house_address">Please enter your house address</string>
@@ -127,17 +125,12 @@
<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="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>