A list's Clear keeps its own wording (#140)
This commit is contained in:
1 parent
a361eae158
commit
8335ede8f7
1 file changed
+7
-3
@@ -439,6 +439,7 @@ fun TaskListScreen(
|
||||
count = content.clearableCompleted().size,
|
||||
onConfirm = viewModel::clearCompleted,
|
||||
onDismiss = { confirmClear = false },
|
||||
singleList = filter is TaskFilter.OfList,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1411,13 +1412,16 @@ private fun CollapsibleSectionHeader(
|
||||
}
|
||||
}
|
||||
|
||||
/** Asks before Clear deletes the [count] completed tasks of a Completed section. */
|
||||
/**
|
||||
* Asks before Clear deletes the [count] completed tasks of a Completed section;
|
||||
* [singleList] says they are a list's, else the ones shown.
|
||||
*/
|
||||
@Composable
|
||||
internal fun ClearCompletedDialog(count: Int, onConfirm: () -> Unit, onDismiss: () -> Unit) {
|
||||
internal fun ClearCompletedDialog(count: Int, onConfirm: () -> Unit, onDismiss: () -> Unit, singleList: Boolean = false) {
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text(stringResource(R.string.clear_completed_title)) },
|
||||
text = { Text(pluralStringResource(R.plurals.clear_completed_shown_body, count, count)) },
|
||||
text = { Text(pluralStringResource(if (singleList) R.plurals.clear_completed_body else R.plurals.clear_completed_shown_body, count, count)) },
|
||||
confirmButton = {
|
||||
TextButton(onClick = { onDismiss(); onConfirm() }) {
|
||||
Text(stringResource(R.string.clear_completed_confirm))
|
||||
|
||||
Reference in new issue
Block a user