diff --git a/app/src/main/java/org/permanent/permanent/ui/bulkEditMetadata/compose/EditMetadataScreen.kt b/app/src/main/java/org/permanent/permanent/ui/bulkEditMetadata/compose/EditMetadataScreen.kt index 6c4b9100..7614ae25 100644 --- a/app/src/main/java/org/permanent/permanent/ui/bulkEditMetadata/compose/EditMetadataScreen.kt +++ b/app/src/main/java/org/permanent/permanent/ui/bulkEditMetadata/compose/EditMetadataScreen.kt @@ -122,7 +122,10 @@ fun EditMetadataScreen( lightGreyColor, someFilesHaveDescription, redColor, - smallTextSize + smallTextSize, + onTextChange = { + inputDescription = it + } ) Divider(modifier = Modifier.padding(vertical = 16.dp)) @@ -282,9 +285,9 @@ private fun DescriptionView( lightGreyColor: Color, someFilesHaveDescription: Boolean?, redColor: Color, - smallTextSize: TextUnit + smallTextSize: TextUnit, + onTextChange: (String) -> Unit ) { - var description = inputDescription Row( verticalAlignment = Alignment.Top, horizontalArrangement = Arrangement.spacedBy(16.dp) ) { @@ -304,10 +307,8 @@ private fun DescriptionView( Spacer(modifier = Modifier.height(10.dp)) TextField( - value = description, - onValueChange = { value -> - description = value - }, + value = inputDescription, + onValueChange = onTextChange, label = { Text(text = stringResource(id = R.string.edit_files_metadata_description_hint)) }, singleLine = true, modifier = Modifier diff --git a/app/src/main/java/org/permanent/permanent/viewmodels/EditMetadataViewModel.kt b/app/src/main/java/org/permanent/permanent/viewmodels/EditMetadataViewModel.kt index 4862dce4..d8081cc4 100644 --- a/app/src/main/java/org/permanent/permanent/viewmodels/EditMetadataViewModel.kt +++ b/app/src/main/java/org/permanent/permanent/viewmodels/EditMetadataViewModel.kt @@ -26,7 +26,6 @@ class EditMetadataViewModel(application: Application) : ObservableAndroidViewMod private val tagsOfSelectedRecords = MutableLiveData>(mutableStateListOf()) private var commonTags: MutableList = mutableListOf() - private var initialDescription: String = "" private var commonDescription: String = "" private var showWarningSomeFilesHaveDescription = MutableLiveData(false) val showError = MutableLiveData() @@ -96,6 +95,7 @@ class EditMetadataViewModel(application: Application) : ObservableAndroidViewMod } private fun checkForCommonDescription() { + var initialDescription = "" for (record in records) { val recordDescription = record.fileData?.description if (!recordDescription.isNullOrBlank()) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8de8d90c..5a944707 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -723,12 +723,12 @@ Add Location Various locations New location - Are you sure you want set a new location for selected items? + Are you sure you want to set a new date & time for the selected items? Add date and time Add date Various dates and times New Date & Time - Are you sure you want set a new date & time for selected items? + Are you sure you want to set a new date & time for the selected items? Set date and time