Merge pull request #2998 from Bnyro/master

Fix history showing up when clearing search query
This commit is contained in:
Bnyro 2023-02-08 10:11:06 +01:00 committed by GitHub
commit c37d95b7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -41,6 +41,7 @@ import java.io.File
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.SocketTimeoutException import java.net.SocketTimeoutException
import java.net.URL import java.net.URL
import java.util.concurrent.Executors
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@ -54,7 +55,6 @@ import okio.BufferedSink
import okio.buffer import okio.buffer
import okio.sink import okio.sink
import okio.source import okio.source
import java.util.concurrent.Executors
/** /**
* Download service with custom implementation of downloading using [HttpURLConnection]. * Download service with custom implementation of downloading using [HttpURLConnection].

View File

@ -268,7 +268,6 @@ class MainActivity : BaseActivity() {
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean { override fun onQueryTextSubmit(query: String?): Boolean {
navController.navigate(R.id.searchResultFragment, bundleOf("query" to query)) navController.navigate(R.id.searchResultFragment, bundleOf("query" to query))
searchViewModel.setQuery("")
searchView.clearFocus() searchView.clearFocus()
return true return true
} }
@ -318,10 +317,8 @@ class MainActivity : BaseActivity() {
override fun onMenuItemActionCollapse(item: MenuItem): Boolean { override fun onMenuItemActionCollapse(item: MenuItem): Boolean {
if (binding.mainMotionLayout.progress == 0F) { if (binding.mainMotionLayout.progress == 0F) {
try { runCatching {
minimizePlayer() minimizePlayer()
} catch (e: Exception) {
// current fragment isn't the player fragment
} }
} }
// Handover back press to `BackPressedDispatcher` // Handover back press to `BackPressedDispatcher`