From 6f7f59290e50bea0be1b0e80a0e1f08213d517d1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 16 Oct 2018 12:44:35 +0200 Subject: [PATCH] simplify the way of getting selected item positions --- app/build.gradle | 2 +- .../simplemobiletools/contacts/adapters/ContactsAdapter.kt | 4 ++-- .../com/simplemobiletools/contacts/adapters/GroupsAdapter.kt | 2 +- .../simplemobiletools/contacts/adapters/RecentCallsAdapter.kt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d8467985..489d5d99 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,7 +41,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.0.22' + implementation 'com.simplemobiletools:commons:5.1.0' implementation 'joda-time:joda-time:2.9.9' implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt index 65009d8d..3c3db172 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt @@ -153,7 +153,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList, val } val groupsToRemove = groups.filter { selectedKeys.contains(it.id.toInt()) } as ArrayList - val positions = getSelectedItemPositions(groupsToRemove.map { it.id.toInt() }) + val positions = getSelectedItemPositions() groupsToRemove.forEach { if (it.isPrivateSecretGroup()) { activity.dbHelper.deleteGroup(it.id) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt index 0733628c..44c2c08b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/RecentCallsAdapter.kt @@ -80,7 +80,7 @@ class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayList) recentCalls.removeAll(callsToRemove)