From 794e99e5c2804b4d9c6749415536c2a0cadcc969 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 6 Dec 2019 23:09:51 +0100 Subject: [PATCH] implement placeholder clicks at the Select Contact screen --- .../contacts/pro/activities/InsertOrEditContactActivity.kt | 2 +- .../contacts/pro/fragments/ContactsFragment.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt index f5f8d9e9..25578c9f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt @@ -289,7 +289,7 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener { } } - private fun showFilterDialog() { + fun showFilterDialog() { FilterContactSourcesDialog(this) { contacts_fragment?.forceListRedraw = true refreshContacts(CONTACTS_TAB_MASK or FAVORITES_TAB_MASK) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt index 17a1b53c..73816813 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/ContactsFragment.kt @@ -4,6 +4,7 @@ import android.content.Context import android.content.Intent import android.util.AttributeSet import com.simplemobiletools.contacts.pro.activities.EditContactActivity +import com.simplemobiletools.contacts.pro.activities.InsertOrEditContactActivity import com.simplemobiletools.contacts.pro.activities.MainActivity class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) { @@ -14,6 +15,10 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag } override fun placeholderClicked() { - (activity as? MainActivity)?.showFilterDialog() + if (activity is MainActivity) { + (activity as MainActivity).showFilterDialog() + } else if (activity is InsertOrEditContactActivity) { + (activity as InsertOrEditContactActivity).showFilterDialog() + } } }