CSV FILE CREATED- for complete offline mode-Fixed Issues

This commit is contained in:
Mariya
2023-12-19 17:35:09 +05:30
parent 7c7ed3b314
commit 505bed89a1
7 changed files with 30 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
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 fun userDao(): UserDao

View File

@@ -39,7 +39,7 @@ class LocalFileDataSource {
"_id",
"name",
"bloodGroup",
"birthYear", // Include other fields from the data class
"birthYear",
"state",
"abhaId",
"userImageURL",
@@ -74,7 +74,7 @@ class LocalFileDataSource {
data._id,
data.name,
data.bloodGroup,
data.birthYear ?: "", // Replace with the actual birthYear field
data.birthYear,
data.state,
data.abhaId,
data.userImageURL,

View File

@@ -86,8 +86,26 @@ class UserListFragment : BaseFragment() {
showUploadDialog(requireContext())
}
binding.btnSaveLocal.setOnClickListener {
showDownloadDialog(requireContext())
viewModel.allUserData.observe(viewLifecycleOwner) { userData ->
val btnSaveLocalVisibility =
if (userData.isNotEmpty()) View.VISIBLE else View.GONE
binding.btnSaveLocal.visibility = btnSaveLocalVisibility
binding.btnSaveLocal.setOnClickListener {
if (btnSaveLocalVisibility == View.VISIBLE) {
// Execute the action when the button is visible (testStatus is true for at least one user)
showDownloadDialog(requireContext())
} else {
// Handle the case when the button is not visible
Toast.makeText(
requireContext(),
"No test details stored locally",
Toast.LENGTH_SHORT
).show()
}
}
}
binding.btnsettings.setOnClickListener{

View File

@@ -88,6 +88,7 @@
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:src="@drawable/downloads"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/rv_order"
app:layout_constraintStart_toStartOf="parent" />

View File

@@ -115,8 +115,9 @@
<string name="enter_father_husband_name">पिता / पति का नाम दर्ज करें</string>
<string name="do_log_out">क्या आप ऐप्लिकेशन से लॉग आउट करना चाहते हैं?</string>
<string name="log_out">लॉग आउट</string>
<string name="local">साक्षात्कार विवरण स्थानीय रूप से सहेजे गए हैं</string>
<string name="no_data_available">स्थानीय डेटाबेस में कोई डेटा उपलब्ध नहीं है</string>
<string name="test_details_stored_locally">टेस्ट विवरण स्थानीय रूप से संग्रहित हैं</string>
<string name="upload_db_registration">डीबी पंजीकरण अपलोड करें</string>
<string name="upload_local_db_to_cloud">क्या आप स्थानीय डीबी को क्लाउड पर अपलोड करना चाहते हैं?</string>
<string name="upload">अपलोड</string>

View File

@@ -6,6 +6,7 @@
<string name="retry">ಮರುಪ್ರಯಾಸ</string>
<string name="failed_to_connect">ಸಂಪರ್ಕ ಸಾಧಿಸಲಾಗಿಲ್ಲ</string>
<string name="cancel">ರದ್ದು ಮಾಡಿ</string>
<string name="local">ಟೆಸ್ಟ್ ವಿವರಗಳನ್ನು ಸ್ಥಳೀಯವಾಗಿ ಉಳಿಸಲಾಗಿದೆ</string>
//Registration Screens
@@ -119,6 +120,7 @@
<string name="enter_father_husband_name">ದಯವಿಟ್ಟು ನಿಮ್ಮ ತಂದೆ / ಗಂಡನ ಹೆಸರನ್ನು ನಮೂದಿಸಿ</string>
<string name="do_log_out">ನೀವು ಅಪ್ಲಿಕೇಶನ್ ನಿಂದ ಲಾಗೌಟ್ ಮಾಡಲು ಇಚ್ಛಿಸುತ್ತೀರಾ?</string>
<string name="log_out">ಲಾಗೌಟ್</string>
<string name="no_data_available">ಸ್ಥಾನಿಕ ಡೇಟಾಬೇಸ್‌ನಲ್ಲಿ ಯಾವುದೇ ಡೇಟಾ ಲಭ್ಯವಿಲ್ಲ</string>
<string name="upload_db_registration">ಡಿಬಿ ನೋಂದಾಯಿಸುವ ಕೊರಕು</string>
<string name="upload_local_db_to_cloud">ನೀವು ಲೋಕಲ್ ಡಿಬಿ ನೋಂದಾಯಿಸನ್ನು ಮೇಘಮಾರ್ಗಕ್ಕೆ ಅಪ್ಲೋಡ್ ಮಾಡಲು ಇಚ್ಛಿಸುವಿರಾ?</string>

View File

@@ -105,6 +105,8 @@
<string name="registration_success">Registration Done Successfully</string>
<string name="internt_not_local">Internet not available, 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_valid_birth_year">Please enter a valid birth year between 1900 and 2023</string>
<string name="fill_field">Please fill the field</string>