From 910ddf87b2cf88834ac150eb430a17f0aeaee774 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 11 May 2020 14:40:28 +0200 Subject: [PATCH] remove all subsequent numbers from Recents as needed --- .../dialer/adapters/RecentCallsAdapter.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/RecentCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/RecentCallsAdapter.kt index 33d0d4c7..75fa4b60 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/RecentCallsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/RecentCallsAdapter.kt @@ -11,7 +11,6 @@ import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.SimpleContactsHelper -import com.simplemobiletools.commons.helpers.mydebug import com.simplemobiletools.commons.views.MyRecyclerView import com.simplemobiletools.dialer.R import com.simplemobiletools.dialer.activities.SimpleActivity @@ -98,9 +97,13 @@ class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayList + val idsToRemove = ArrayList() + callsToRemove.forEach { + idsToRemove.add(it.id) + it.neighbourIDs.mapTo(idsToRemove, { it }) + } - RecentsHelper(activity).removeRecentCalls(ids) { + RecentsHelper(activity).removeRecentCalls(idsToRemove) { recentCalls.removeAll(callsToRemove) activity.runOnUiThread { if (recentCalls.isEmpty()) {