pull/32/head
GKF 6 years ago
parent a06ccdd920
commit ce16f0a1b7
  1. 16
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  2. 8
      app/src/main/res/menu/activity_main_bnv.xml

@ -25,8 +25,20 @@ class MainActivity : BaseActivity<MainViewModel>(), BottomNavigationView.OnNavig
} }
override fun onNavigationItemSelected(item: MenuItem): Boolean { 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 return false
} }

@ -4,19 +4,19 @@
tools:showIn="bottom_navigation_view"> tools:showIn="bottom_navigation_view">
<item <item
android:id="@+id/nav_backup" android:id="@+id/menu_bookshelf"
android:icon="@drawable/ic_menu_camera" android:icon="@drawable/ic_menu_camera"
android:title="书架"/> android:title="书架"/>
<item <item
android:id="@+id/nav_restore" android:id="@+id/menu_find_book"
android:icon="@drawable/ic_menu_gallery" android:icon="@drawable/ic_menu_gallery"
android:title="发现"/> android:title="发现"/>
<item <item
android:id="@+id/nav_import_old" android:id="@+id/menu_book_source"
android:icon="@drawable/ic_menu_slideshow" android:icon="@drawable/ic_menu_slideshow"
android:title="书源"/> android:title="书源"/>
<item <item
android:id="@+id/nav_import_github" android:id="@+id/menu_my_config"
android:icon="@drawable/ic_menu_manage" android:icon="@drawable/ic_menu_manage"
android:title="我的"/> android:title="我的"/>

Loading…
Cancel
Save