CSV FILE CREATED- for complete offline mode-Fixed Issues
This commit is contained in:
@@ -9,7 +9,7 @@ import androidx.room.migration.Migration
|
|||||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||||
import com.example.hposregistration.data.user.UserData
|
import com.example.hposregistration.data.user.UserData
|
||||||
|
|
||||||
@Database(entities = [UserData::class], version = 3, exportSchema = false)
|
@Database(entities = [UserData::class], version = 4, exportSchema = false)
|
||||||
abstract class MyDatabase : RoomDatabase() {
|
abstract class MyDatabase : RoomDatabase() {
|
||||||
|
|
||||||
abstract fun userDao(): UserDao
|
abstract fun userDao(): UserDao
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class LocalFileDataSource {
|
|||||||
"_id",
|
"_id",
|
||||||
"name",
|
"name",
|
||||||
"bloodGroup",
|
"bloodGroup",
|
||||||
"birthYear", // Include other fields from the data class
|
"birthYear",
|
||||||
"state",
|
"state",
|
||||||
"abhaId",
|
"abhaId",
|
||||||
"userImageURL",
|
"userImageURL",
|
||||||
@@ -74,7 +74,7 @@ class LocalFileDataSource {
|
|||||||
data._id,
|
data._id,
|
||||||
data.name,
|
data.name,
|
||||||
data.bloodGroup,
|
data.bloodGroup,
|
||||||
data.birthYear ?: "", // Replace with the actual birthYear field
|
data.birthYear,
|
||||||
data.state,
|
data.state,
|
||||||
data.abhaId,
|
data.abhaId,
|
||||||
data.userImageURL,
|
data.userImageURL,
|
||||||
|
|||||||
@@ -86,8 +86,26 @@ class UserListFragment : BaseFragment() {
|
|||||||
showUploadDialog(requireContext())
|
showUploadDialog(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnSaveLocal.setOnClickListener {
|
viewModel.allUserData.observe(viewLifecycleOwner) { userData ->
|
||||||
showDownloadDialog(requireContext())
|
|
||||||
|
val btnSaveLocalVisibility =
|
||||||
|
if (userData.isNotEmpty()) View.VISIBLE else View.GONE
|
||||||
|
|
||||||
|
binding.btnSaveLocal.visibility = btnSaveLocalVisibility
|
||||||
|
|
||||||
|
binding.btnSaveLocal.setOnClickListener {
|
||||||
|
if (btnSaveLocalVisibility == View.VISIBLE) {
|
||||||
|
// Execute the action when the button is visible (testStatus is true for at least one user)
|
||||||
|
showDownloadDialog(requireContext())
|
||||||
|
} else {
|
||||||
|
// Handle the case when the button is not visible
|
||||||
|
Toast.makeText(
|
||||||
|
requireContext(),
|
||||||
|
"No test details stored locally",
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnsettings.setOnClickListener{
|
binding.btnsettings.setOnClickListener{
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:src="@drawable/downloads"
|
android:src="@drawable/downloads"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/rv_order"
|
app:layout_constraintBottom_toBottomOf="@+id/rv_order"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,9 @@
|
|||||||
<string name="enter_father_husband_name">पिता / पति का नाम दर्ज करें</string>
|
<string name="enter_father_husband_name">पिता / पति का नाम दर्ज करें</string>
|
||||||
<string name="do_log_out">क्या आप ऐप्लिकेशन से लॉग आउट करना चाहते हैं?</string>
|
<string name="do_log_out">क्या आप ऐप्लिकेशन से लॉग आउट करना चाहते हैं?</string>
|
||||||
<string name="log_out">लॉग आउट</string>
|
<string name="log_out">लॉग आउट</string>
|
||||||
|
<string name="local">साक्षात्कार विवरण स्थानीय रूप से सहेजे गए हैं</string>
|
||||||
|
|
||||||
<string name="no_data_available">स्थानीय डेटाबेस में कोई डेटा उपलब्ध नहीं है</string>
|
<string name="no_data_available">स्थानीय डेटाबेस में कोई डेटा उपलब्ध नहीं है</string>
|
||||||
<string name="test_details_stored_locally">टेस्ट विवरण स्थानीय रूप से संग्रहित हैं</string>
|
|
||||||
<string name="upload_db_registration">डीबी पंजीकरण अपलोड करें</string>
|
<string name="upload_db_registration">डीबी पंजीकरण अपलोड करें</string>
|
||||||
<string name="upload_local_db_to_cloud">क्या आप स्थानीय डीबी को क्लाउड पर अपलोड करना चाहते हैं?</string>
|
<string name="upload_local_db_to_cloud">क्या आप स्थानीय डीबी को क्लाउड पर अपलोड करना चाहते हैं?</string>
|
||||||
<string name="upload">अपलोड</string>
|
<string name="upload">अपलोड</string>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<string name="retry">ಮರುಪ್ರಯಾಸ</string>
|
<string name="retry">ಮರುಪ್ರಯಾಸ</string>
|
||||||
<string name="failed_to_connect">ಸಂಪರ್ಕ ಸಾಧಿಸಲಾಗಿಲ್ಲ</string>
|
<string name="failed_to_connect">ಸಂಪರ್ಕ ಸಾಧಿಸಲಾಗಿಲ್ಲ</string>
|
||||||
<string name="cancel">ರದ್ದು ಮಾಡಿ</string>
|
<string name="cancel">ರದ್ದು ಮಾಡಿ</string>
|
||||||
|
<string name="local">ಟೆಸ್ಟ್ ವಿವರಗಳನ್ನು ಸ್ಥಳೀಯವಾಗಿ ಉಳಿಸಲಾಗಿದೆ</string>
|
||||||
|
|
||||||
|
|
||||||
//Registration Screens
|
//Registration Screens
|
||||||
@@ -119,6 +120,7 @@
|
|||||||
<string name="enter_father_husband_name">ದಯವಿಟ್ಟು ನಿಮ್ಮ ತಂದೆ / ಗಂಡನ ಹೆಸರನ್ನು ನಮೂದಿಸಿ</string>
|
<string name="enter_father_husband_name">ದಯವಿಟ್ಟು ನಿಮ್ಮ ತಂದೆ / ಗಂಡನ ಹೆಸರನ್ನು ನಮೂದಿಸಿ</string>
|
||||||
<string name="do_log_out">ನೀವು ಅಪ್ಲಿಕೇಶನ್ ನಿಂದ ಲಾಗೌಟ್ ಮಾಡಲು ಇಚ್ಛಿಸುತ್ತೀರಾ?</string>
|
<string name="do_log_out">ನೀವು ಅಪ್ಲಿಕೇಶನ್ ನಿಂದ ಲಾಗೌಟ್ ಮಾಡಲು ಇಚ್ಛಿಸುತ್ತೀರಾ?</string>
|
||||||
<string name="log_out">ಲಾಗೌಟ್</string>
|
<string name="log_out">ಲಾಗೌಟ್</string>
|
||||||
|
<string name="no_data_available">ಸ್ಥಾನಿಕ ಡೇಟಾಬೇಸ್ನಲ್ಲಿ ಯಾವುದೇ ಡೇಟಾ ಲಭ್ಯವಿಲ್ಲ</string>
|
||||||
|
|
||||||
<string name="upload_db_registration">ಡಿಬಿ ನೋಂದಾಯಿಸುವ ಕೊರಕು</string>
|
<string name="upload_db_registration">ಡಿಬಿ ನೋಂದಾಯಿಸುವ ಕೊರಕು</string>
|
||||||
<string name="upload_local_db_to_cloud">ನೀವು ಲೋಕಲ್ ಡಿಬಿ ನೋಂದಾಯಿಸನ್ನು ಮೇಘಮಾರ್ಗಕ್ಕೆ ಅಪ್ಲೋಡ್ ಮಾಡಲು ಇಚ್ಛಿಸುವಿರಾ?</string>
|
<string name="upload_local_db_to_cloud">ನೀವು ಲೋಕಲ್ ಡಿಬಿ ನೋಂದಾಯಿಸನ್ನು ಮೇಘಮಾರ್ಗಕ್ಕೆ ಅಪ್ಲೋಡ್ ಮಾಡಲು ಇಚ್ಛಿಸುವಿರಾ?</string>
|
||||||
|
|||||||
@@ -105,6 +105,8 @@
|
|||||||
<string name="registration_success">Registration Done Successfully</string>
|
<string name="registration_success">Registration Done Successfully</string>
|
||||||
<string name="internt_not_local">Internet not available, test details stored locally</string>
|
<string name="internt_not_local">Internet not available, test details stored locally</string>
|
||||||
<string name="local">test details stored locally</string>
|
<string name="local">test details stored locally</string>
|
||||||
|
<string name="no_data_available">No data available in the local database</string>
|
||||||
|
|
||||||
<string name="enter_details_properly">Please enter all the details properly</string>
|
<string name="enter_details_properly">Please enter all the details properly</string>
|
||||||
<string name="enter_valid_birth_year">Please enter a valid birth year between 1900 and 2023</string>
|
<string name="enter_valid_birth_year">Please enter a valid birth year between 1900 and 2023</string>
|
||||||
<string name="fill_field">Please fill the field</string>
|
<string name="fill_field">Please fill the field</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user