From 56e2d4f67befbe1adc982be1876c3bd3b34e2c5f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 31 Jul 2022 18:42:12 +0200 Subject: [PATCH] close search at pressing Back --- .../filemanager/pro/activities/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt index 12ffd470..c9707920 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt @@ -642,7 +642,9 @@ class MainActivity : SimpleActivity() { return } - if (getCurrentFragment()!!.breadcrumbs.getItemCount() <= 1) { + if (isSearchOpen && mSearchMenuItem != null) { + mSearchMenuItem!!.collapseActionView() + } else if (getCurrentFragment()!!.breadcrumbs.getItemCount() <= 1) { if (!wasBackJustPressed && config.pressBackTwice) { wasBackJustPressed = true toast(R.string.press_back_again)