Skip to content

Commit

Permalink
Merge pull request #304 from PermanentOrg/bugfix/edit-metadata-confir…
Browse files Browse the repository at this point in the history
…mation-titles

Fix description and change texts
  • Loading branch information
flaviuvsp authored Oct 3, 2024
2 parents 86ef4da + aee12ee commit 82c7673
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ fun EditMetadataScreen(
lightGreyColor,
someFilesHaveDescription,
redColor,
smallTextSize
smallTextSize,
onTextChange = {
inputDescription = it
}
)

Divider(modifier = Modifier.padding(vertical = 16.dp))
Expand Down Expand Up @@ -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)
) {
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class EditMetadataViewModel(application: Application) : ObservableAndroidViewMod
private val tagsOfSelectedRecords =
MutableLiveData<SnapshotStateList<Tag>>(mutableStateListOf())
private var commonTags: MutableList<Tag> = mutableListOf()
private var initialDescription: String = ""
private var commonDescription: String = ""
private var showWarningSomeFilesHaveDescription = MutableLiveData(false)
val showError = MutableLiveData<String>()
Expand Down Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -723,12 +723,12 @@
<string name="add_location">Add Location</string>
<string name="various_locations">Various locations</string>
<string name="location_confirmation_title">New location</string>
<string name="location_confirmation_substring">Are you sure you want set a new location for selected items?</string>
<string name="location_confirmation_substring">Are you sure you want to set a new date &amp; time for the selected items?</string>
<string name="add_date_time">Add date and time</string>
<string name="add_date">Add date</string>
<string name="various_date_times">Various dates and times</string>
<string name="date_confirmation_title">New Date &amp; Time</string>
<string name="date_confirmation_substring">Are you sure you want set a new date &amp; time for selected items?</string>
<string name="date_confirmation_substring">Are you sure you want to set a new date &amp; time for the selected items?</string>
<string name="set_date_and_time">Set date and time</string>


Expand Down

0 comments on commit 82c7673

Please sign in to comment.