diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/MainActivity.kt index 5bf4fc27..6f176332 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/activities/MainActivity.kt @@ -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() } })