close search on tab change
This commit is contained in:
parent
6077c5aa66
commit
075d2e57f0
1 changed files with 5 additions and 2 deletions
|
@ -181,7 +181,11 @@ class MainActivity : SimpleActivity() {
|
|||
viewpager.adapter = ViewPagerAdapter(this)
|
||||
viewpager.offscreenPageLimit = 3
|
||||
viewpager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
|
||||
override fun onPageScrollStateChanged(state: Int) {}
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
if (isSearchOpen) {
|
||||
searchMenuItem?.collapseActionView()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
||||
|
||||
|
@ -190,7 +194,6 @@ class MainActivity : SimpleActivity() {
|
|||
getAllFragments().forEach {
|
||||
it?.finishActMode()
|
||||
}
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue