fix the backpress behavior

This commit is contained in:
Bnyro 2022-09-22 18:34:13 +02:00
parent b541cae3de
commit 5ec053b3b1
3 changed files with 1 additions and 19 deletions

View File

@ -279,22 +279,6 @@ class MainActivity : BaseActivity() {
return true
}
})
searchItem.setOnActionExpandListener(
object : MenuItem.OnActionExpandListener {
override fun onMenuItemActionExpand(p0: MenuItem): Boolean {
return true
}
override fun onMenuItemActionCollapse(p0: MenuItem): Boolean {
val currentFragmentId = navController.currentDestination?.id
if (currentFragmentId == R.id.searchFragment || currentFragmentId == R.id.searchResultFragment) {
navController.popBackStack()
}
return true
}
}
)
return super.onCreateOptionsMenu(menu)
}

View File

@ -18,7 +18,7 @@ class SettingsActivity : BaseActivity() {
setContentView(binding.root)
binding.backImageButton.setOnClickListener {
onBackPressed()
onBackPressedDispatcher.onBackPressed()
}
if (savedInstanceState == null) {

View File

@ -107,8 +107,6 @@
android:id="@+id/channel_recView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:nestedScrollingEnabled="false" />
</RelativeLayout>