remove pull to refresh layout from the search results

This commit is contained in:
tibbi
2019-06-26 11:18:48 +02:00
parent 6ee3f04d8f
commit 10f903129d
2 changed files with 62 additions and 56 deletions

View File

@ -39,6 +39,9 @@ class SearchActivity : SimpleActivity() {
override fun onQueryTextSubmit(query: String) = false
override fun onQueryTextChange(newText: String): Boolean {
if (mIsSearchOpen) {
textChanged(newText)
}
return true
}
})
@ -46,14 +49,23 @@ class SearchActivity : SimpleActivity() {
MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, object : MenuItemCompat.OnActionExpandListener {
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
mIsSearchOpen = true
return true
}
// this triggers on device rotation too, avoid doing anything
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
if (mIsSearchOpen) {
mIsSearchOpen = false
textChanged("")
}
return true
}
})
mSearchMenuItem?.expandActionView()
}
private fun textChanged(text: String) {
}
}