From ce16f0a1b74840e66219da4a694a295dbfb9e1b5 Mon Sep 17 00:00:00 2001 From: GKF Date: Mon, 3 Jun 2019 16:10:19 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/main/MainActivity.kt | 16 ++++++++++++++-- app/src/main/res/menu/activity_main_bnv.xml | 8 ++++---- 2 files changed, 18 insertions(+), 6 deletions(-) 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">