Merge branch 'Label_structure_changes_in_exporting_csv_and_images' into 'Export_registration_data_to_CSV_and_Save_IMAGE_LOCALLY'
lablel format changes added, when data stored locally See merge request sminnovations/hpos-registration-app!3
This commit is contained in:
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId "in.sminnovations.hposregistration"
|
applicationId "in.sminnovations.hposregistration"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 12
|
versionCode 13
|
||||||
versionName "1.0.12"
|
versionName "1.0.13"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class LocalFileDataSource {
|
|||||||
"userImageURL"
|
"userImageURL"
|
||||||
)
|
)
|
||||||
csvWriter.writeNext(header)
|
csvWriter.writeNext(header)
|
||||||
val imagesFolder = File(getExternalStorageDirectory(), "Images${getCurrentDateTime()}")
|
val imagesFolder = File(getExternalStorageDirectory(), "images${getCurrentDateTime()}")
|
||||||
// val imagesFolder = File(getExternalStorageDirectory(), "Images")
|
// val imagesFolder = File(getExternalStorageDirectory(), "Images")
|
||||||
if (!imagesFolder.exists()) {
|
if (!imagesFolder.exists()) {
|
||||||
if (!imagesFolder.mkdirs()) {
|
if (!imagesFolder.mkdirs()) {
|
||||||
@@ -149,7 +149,7 @@ class LocalFileDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getExternalStorageDirectory(): File {
|
private fun getExternalStorageDirectory(): File {
|
||||||
val folder = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "HposRegister")
|
val folder = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "HposRegistration")
|
||||||
|
|
||||||
if (!folder.exists()) {
|
if (!folder.exists()) {
|
||||||
folder.mkdirs()
|
folder.mkdirs()
|
||||||
@@ -158,7 +158,7 @@ class LocalFileDataSource {
|
|||||||
return folder
|
return folder
|
||||||
}
|
}
|
||||||
private fun getCurrentDateTime(): String {
|
private fun getCurrentDateTime(): String {
|
||||||
val dateFormat = SimpleDateFormat("dd-MM-yy", Locale.getDefault())
|
val dateFormat = SimpleDateFormat("dd_MM_yy", Locale.getDefault())
|
||||||
val currentDateTime = Date()
|
val currentDateTime = Date()
|
||||||
return dateFormat.format(currentDateTime)
|
return dateFormat.format(currentDateTime)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ class RegistrationViewModel @Inject constructor(
|
|||||||
|
|
||||||
fun createCSV(userData: List<UserData>, context: Context) =
|
fun createCSV(userData: List<UserData>, context: Context) =
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
val fileName = "HPOS${getCurrentDate()}.csv"
|
val fileName = "hpos${getCurrentDate()}.csv"
|
||||||
if (localFileDataSource.exportDataToCSV(fileName, userData,context)) {
|
if (localFileDataSource.exportDataToCSV(fileName, userData)) {
|
||||||
userData.forEach { data ->
|
userData.forEach { data ->
|
||||||
data.localFlag = true
|
data.localFlag = true
|
||||||
mainRepository.updateCSVFieldById(
|
mainRepository.updateCSVFieldById(
|
||||||
@@ -97,15 +97,8 @@ class RegistrationViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getCurrentDateTime(): String {
|
|
||||||
val dateFormat = SimpleDateFormat("dd-MM-yy", Locale.getDefault())
|
|
||||||
val currentDateTime = Date()
|
|
||||||
return dateFormat.format(currentDateTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun getCurrentDate(): String {
|
private fun getCurrentDate(): String {
|
||||||
val dateFormat = SimpleDateFormat("dd-MM-yy", Locale.getDefault())
|
val dateFormat = SimpleDateFormat("dd_MM_yy", Locale.getDefault())
|
||||||
val currentDate = Date()
|
val currentDate = Date()
|
||||||
return dateFormat.format(currentDate)
|
return dateFormat.format(currentDate)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,8 +148,8 @@
|
|||||||
<string name="scanned_abha_id">You have scanned the Abha ID</string>
|
<string name="scanned_abha_id">You have scanned the Abha ID</string>
|
||||||
<string name="scanned_aadharid">You have scanned the Aadhar ID</string>
|
<string name="scanned_aadharid">You have scanned the Aadhar ID</string>
|
||||||
<string name="downloadcsv">Download CSV</string>
|
<string name="downloadcsv">Download CSV</string>
|
||||||
<string name="download_db_registration_title">Download DB Tests</string>
|
<string name="download_db_registration_title">Download DB Registartion Data</string>
|
||||||
<string name="download_db_registration_message">Do you want to download the local DB tests in CSV format?</string>
|
<string name="download_db_registration_message">Do you want to download the local DB Registrations in CSV format?</string>
|
||||||
<string name="upload_success_message">Upload done successfully</string>
|
<string name="upload_success_message">Upload done successfully</string>
|
||||||
<string-array name="category">
|
<string-array name="category">
|
||||||
<item>NT-A</item>
|
<item>NT-A</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user