Merge pull request #706 from qwertyfinger/fix/contact-not-showing-after-add
Fix contacts not refreshing when search bar is open
This commit is contained in:
commit
4ec963d3f8
1 changed files with 7 additions and 1 deletions
|
@ -52,6 +52,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
|
||||
private var isSearchOpen = false
|
||||
private var searchMenuItem: MenuItem? = null
|
||||
private var searchQuery = ""
|
||||
private var werePermissionsHandled = false
|
||||
private var isFirstResume = true
|
||||
private var isGettingContacts = false
|
||||
|
@ -229,6 +230,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
|
||||
override fun onQueryTextChange(newText: String): Boolean {
|
||||
if (isSearchOpen) {
|
||||
searchQuery = newText
|
||||
getCurrentFragment()?.onSearchQueryChanged(newText)
|
||||
}
|
||||
return true
|
||||
|
@ -540,7 +542,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
}
|
||||
|
||||
override fun refreshContacts(refreshTabsMask: Int) {
|
||||
if (isDestroyed || isFinishing || isGettingContacts || isSearchOpen) {
|
||||
if (isDestroyed || isFinishing || isGettingContacts) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -572,6 +574,10 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
}
|
||||
groups_fragment?.refreshContacts(contacts)
|
||||
}
|
||||
|
||||
if (isSearchOpen) {
|
||||
getCurrentFragment()?.onSearchQueryChanged(searchQuery)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue