implement placeholder clicks at the Select Contact screen

This commit is contained in:
tibbi 2019-12-06 23:09:51 +01:00
parent 16ca90b219
commit 794e99e5c2
2 changed files with 7 additions and 2 deletions

View File

@ -289,7 +289,7 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener {
} }
} }
private fun showFilterDialog() { fun showFilterDialog() {
FilterContactSourcesDialog(this) { FilterContactSourcesDialog(this) {
contacts_fragment?.forceListRedraw = true contacts_fragment?.forceListRedraw = true
refreshContacts(CONTACTS_TAB_MASK or FAVORITES_TAB_MASK) refreshContacts(CONTACTS_TAB_MASK or FAVORITES_TAB_MASK)

View File

@ -4,6 +4,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.util.AttributeSet import android.util.AttributeSet
import com.simplemobiletools.contacts.pro.activities.EditContactActivity import com.simplemobiletools.contacts.pro.activities.EditContactActivity
import com.simplemobiletools.contacts.pro.activities.InsertOrEditContactActivity
import com.simplemobiletools.contacts.pro.activities.MainActivity import com.simplemobiletools.contacts.pro.activities.MainActivity
class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) { class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) {
@ -14,6 +15,10 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
} }
override fun placeholderClicked() { override fun placeholderClicked() {
(activity as? MainActivity)?.showFilterDialog() if (activity is MainActivity) {
(activity as MainActivity).showFilterDialog()
} else if (activity is InsertOrEditContactActivity) {
(activity as InsertOrEditContactActivity).showFilterDialog()
}
} }
} }