Fix history showing up when clearing search query

This commit is contained in:
Bnyro 2023-02-08 10:10:46 +01:00
parent 793ad8e731
commit 5992b0c567
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`