do not filter out any Favorites when we are showing all contact sources

This commit is contained in:
tibbi 2017-12-30 21:23:47 +01:00
parent a52dfa4d8e
commit 812e7896c5
2 changed files with 4 additions and 2 deletions

View File

@ -140,7 +140,6 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
private fun setupTabColors() {
val lastUsedPage = config.lastUsedViewPagerPage
viewpager.currentItem = lastUsedPage
main_tabs_holder.apply {
background = ColorDrawable(config.backgroundColor)
setSelectedTabIndicatorColor(getAdjustedPrimaryColor())
@ -160,6 +159,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
favorites_fragment?.finishActMode()
invalidateOptionsMenu()
}
viewpager.currentItem = config.lastUsedViewPagerPage
main_tabs_holder.onTabSelectionChanged(
tabUnselectedAction = {

View File

@ -25,7 +25,9 @@ class AddFavoritesDialog(val activity: SimpleActivity, val callback: () -> Unit)
allContacts.sort()
val contactSources = config.displayContactSources
allContacts = allContacts.filter { contactSources.contains(it.source) } as ArrayList<Contact>
if (!activity.config.showAllContacts()) {
allContacts = allContacts.filter { contactSources.contains(it.source) } as ArrayList<Contact>
}
view.add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites)
activity.runOnUiThread {