diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 549a8be9b..8b1a203a4 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -25,8 +25,20 @@ class MainActivity : BaseActivity(), BottomNavigationView.OnNavig } override fun onNavigationItemSelected(item: MenuItem): Boolean { - - + when (item.itemId) { + R.id.menu_bookshelf -> { + view_pager_main.currentItem = 0 + } + R.id.menu_find_book -> { + view_pager_main.currentItem = 1 + } + R.id.menu_book_source -> { + view_pager_main.currentItem = 3 + } + R.id.menu_my_config -> { + view_pager_main.currentItem = 4 + } + } return false } diff --git a/app/src/main/res/menu/activity_main_bnv.xml b/app/src/main/res/menu/activity_main_bnv.xml index 4260d59db..757656941 100644 --- a/app/src/main/res/menu/activity_main_bnv.xml +++ b/app/src/main/res/menu/activity_main_bnv.xml @@ -4,19 +4,19 @@ tools:showIn="bottom_navigation_view">