remove unnecessary test of ViewPager position, since the callback will only be enabled if the position is not 0.

This commit is contained in:
Christophe Beyls 2024-05-03 21:08:46 +02:00
parent 05b7358c04
commit 3e8484f928
1 changed files with 1 additions and 3 deletions

View File

@ -196,9 +196,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
private val onBackPressedCallback = object : OnBackPressedCallback(false) {
override fun handleOnBackPressed() {
if (binding.viewPager.currentItem != 0) {
binding.viewPager.currentItem = 0
}
binding.viewPager.currentItem = 0
}
}