feat: 调价跳转 Activity 测试按钮

pull/1894/head
谢意帆 3 years ago
parent d24eef36fe
commit 4ecaa4e2bf
  1. 4
      app/src/main/AndroidManifest.xml
  2. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt
  3. 6
      app/src/main/res/menu/main_bookshelf.xml

@ -280,6 +280,10 @@
<activity <activity
android:name=".ui.book.local.ImportBookActivity" android:name=".ui.book.local.ImportBookActivity"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
<!-- 添加远程 -->
<activity
android:name=".ui.book.remote.RemoteBookActivity"
android:launchMode="singleTop" />
<!-- 发现界面 --> <!-- 发现界面 -->
<activity <activity
android:name=".ui.book.explore.ExploreShowActivity" android:name=".ui.book.explore.ExploreShowActivity"

@ -1,6 +1,7 @@
package io.legado.app.ui.main.bookshelf package io.legado.app.ui.main.bookshelf
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Intent
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
@ -23,6 +24,7 @@ import io.legado.app.ui.book.cache.CacheActivity
import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.group.GroupManageDialog
import io.legado.app.ui.book.local.ImportBookActivity import io.legado.app.ui.book.local.ImportBookActivity
import io.legado.app.ui.book.manage.BookshelfManageActivity import io.legado.app.ui.book.manage.BookshelfManageActivity
import io.legado.app.ui.book.remote.RemoteBookActivity
import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.search.SearchActivity
import io.legado.app.ui.document.HandleFileContract import io.legado.app.ui.document.HandleFileContract
import io.legado.app.ui.main.MainViewModel import io.legado.app.ui.main.MainViewModel
@ -74,6 +76,8 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
override fun onCompatOptionsItemSelected(item: MenuItem) { override fun onCompatOptionsItemSelected(item: MenuItem) {
super.onCompatOptionsItemSelected(item) super.onCompatOptionsItemSelected(item)
when (item.itemId) { when (item.itemId) {
// 查看远程书籍
R.id.menu_remote -> startActivity<RemoteBookActivity>()
R.id.menu_search -> startActivity<SearchActivity>() R.id.menu_search -> startActivity<SearchActivity>()
R.id.menu_update_toc -> activityViewModel.upToc(books) R.id.menu_update_toc -> activityViewModel.upToc(books)
R.id.menu_bookshelf_layout -> configBookshelf() R.id.menu_bookshelf_layout -> configBookshelf()

@ -10,6 +10,12 @@
android:title="@string/search" android:title="@string/search"
app:showAsAction="always" /> app:showAsAction="always" />
<item
android:id="@+id/menu_remote"
android:icon="@drawable/ic_add"
android:title="远程书籍"
app:showAsAction="always" />
<item <item
android:id="@+id/menu_update_toc" android:id="@+id/menu_update_toc"
android:icon="@drawable/ic_refresh_black_24dp" android:icon="@drawable/ic_refresh_black_24dp"

Loading…
Cancel
Save