mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-03 15:11:42 +01:00
Remove note about call links if there are no call links selected.
This commit is contained in:
committed by
Cody Henthorne
parent
a8fb5f2598
commit
163ece75b2
@@ -219,9 +219,16 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
|
|||||||
|
|
||||||
private fun handleDeleteSelectedRows() {
|
private fun handleDeleteSelectedRows() {
|
||||||
val count = callLogActionMode.getCount()
|
val count = callLogActionMode.getCount()
|
||||||
|
val selectionState = viewModel.selectionStateSnapshot
|
||||||
|
val hasCallLinks = selectionState.isExclusionary() || selectionState.selected().any { it is CallLogRow.Id.CallLink }
|
||||||
|
|
||||||
MaterialAlertDialogBuilder(requireContext())
|
MaterialAlertDialogBuilder(requireContext())
|
||||||
.setTitle(resources.getQuantityString(R.plurals.CallLogFragment__delete_d_calls, count, count))
|
.setTitle(resources.getQuantityString(R.plurals.CallLogFragment__delete_d_calls, count, count))
|
||||||
.setMessage(getString(R.string.CallLogFragment__call_links_youve_created))
|
.apply {
|
||||||
|
if (hasCallLinks) {
|
||||||
|
setMessage(getString(R.string.CallLogFragment__call_links_youve_created))
|
||||||
|
}
|
||||||
|
}
|
||||||
.setPositiveButton(R.string.CallLogFragment__delete) { _, _ ->
|
.setPositiveButton(R.string.CallLogFragment__delete) { _, _ ->
|
||||||
performDeletion(count, viewModel.stageSelectionDeletion())
|
performDeletion(count, viewModel.stageSelectionDeletion())
|
||||||
callLogActionMode.end()
|
callLogActionMode.end()
|
||||||
@@ -380,7 +387,11 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
|
|||||||
override fun deleteCall(call: CallLogRow) {
|
override fun deleteCall(call: CallLogRow) {
|
||||||
MaterialAlertDialogBuilder(requireContext())
|
MaterialAlertDialogBuilder(requireContext())
|
||||||
.setTitle(resources.getQuantityString(R.plurals.CallLogFragment__delete_d_calls, 1, 1))
|
.setTitle(resources.getQuantityString(R.plurals.CallLogFragment__delete_d_calls, 1, 1))
|
||||||
.setMessage(getString(R.string.CallLogFragment__call_links_youve_created))
|
.apply {
|
||||||
|
if (call is CallLogRow.CallLink) {
|
||||||
|
setMessage(getString(R.string.CallLogFragment__call_links_youve_created))
|
||||||
|
}
|
||||||
|
}
|
||||||
.setPositiveButton(R.string.CallLogFragment__delete) { _, _ ->
|
.setPositiveButton(R.string.CallLogFragment__delete) { _, _ ->
|
||||||
performDeletion(1, viewModel.stageCallDeletion(call))
|
performDeletion(1, viewModel.stageCallDeletion(call))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user