From eeeca08910557ecc2a9f8901088c525585831193 Mon Sep 17 00:00:00 2001 From: Sajal Raj Gautam Date: Wed, 24 May 2023 11:30:56 +0530 Subject: [PATCH] Disable search closing when user press back while playing video Issue #1965: * Search for something * Play the video * Clicking back btn would close the search also Fix: Disable auto close of search in onMenuItemActionCollapse method call. Search will close when search fragment is removed. Known Issues: Search will still close when player fragment is closed. --- .../java/com/github/libretube/ui/activities/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 9e2114994..e308b1814 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -354,7 +354,9 @@ class MainActivity : BaseActivity() { this@MainActivity.onBackPressedDispatcher.onBackPressed() } - return true + // Suppress collapsing of search view here. + // It will close when search fragment will close, so its safe to return false here + return false } }) return super.onCreateOptionsMenu(menu)