mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Merge branch 'libre-tube:master' into master
This commit is contained in:
commit
46b29f3813
@ -165,8 +165,6 @@ class MainActivity : BaseActivity() {
|
|||||||
// new way of handling back presses
|
// new way of handling back presses
|
||||||
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
|
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
|
||||||
override fun handleOnBackPressed() {
|
override fun handleOnBackPressed() {
|
||||||
navController.popBackStack(R.id.searchFragment, false)
|
|
||||||
|
|
||||||
if (binding.mainMotionLayout.progress == 0F) {
|
if (binding.mainMotionLayout.progress == 0F) {
|
||||||
try {
|
try {
|
||||||
minimizePlayer()
|
minimizePlayer()
|
||||||
@ -289,6 +287,13 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onQueryTextChange(newText: String?): Boolean {
|
override fun onQueryTextChange(newText: String?): Boolean {
|
||||||
|
// prevent malicious navigation when the search view is getting collapsed
|
||||||
|
if (navController.currentDestination?.id == R.id.searchResultFragment &&
|
||||||
|
(newText == null || newText == "")
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (navController.currentDestination?.id != R.id.searchFragment) {
|
if (navController.currentDestination?.id != R.id.searchFragment) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putString("query", newText)
|
bundle.putString("query", newText)
|
||||||
@ -296,6 +301,7 @@ class MainActivity : BaseActivity() {
|
|||||||
} else {
|
} else {
|
||||||
searchViewModel.setQuery(newText)
|
searchViewModel.setQuery(newText)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user