调整菜单顺序

pull/517/head
gedoor 4 years ago
parent 95bf1d8330
commit cdc538c498
  1. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 48
      app/src/main/res/menu/read_book.xml

@ -160,7 +160,8 @@ class ReadBookActivity : ReadBookBaseActivity(),
for (i in 0 until menu.size) { for (i in 0 until menu.size) {
val item = menu[i] val item = menu[i]
when (item.groupId) { when (item.groupId) {
R.id.menu_group_on_line -> item.isVisible = onLine R.id.menu_group_on_line,
R.id.menu_group_on_line_ns -> item.isVisible = onLine
R.id.menu_group_local -> item.isVisible = !onLine R.id.menu_group_local -> item.isVisible = !onLine
R.id.menu_group_text -> item.isVisible = book.isLocalTxt() R.id.menu_group_text -> item.isVisible = book.isLocalTxt()
R.id.menu_group_login -> R.id.menu_group_login ->

@ -1,14 +1,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context=".ui.main.MainActivity"> tools:context=".ui.main.MainActivity"
tools:ignore="AlwaysShowAction">
<item
android:id="@+id/menu_add_bookmark"
android:icon="@drawable/ic_bookmark"
android:title="@string/bookmark_add"
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
<group android:id="@+id/menu_group_on_line"> <group android:id="@+id/menu_group_on_line">
<item <item
@ -25,22 +19,10 @@
<item <item
android:id="@+id/menu_download" android:id="@+id/menu_download"
android:icon="@drawable/ic_download_line"
android:title="@string/offline_cache" android:title="@string/offline_cache"
app:showAsAction="never" /> app:showAsAction="always" />
<item
android:id="@+id/menu_disable_book_source"
android:title="@string/disable_book_source"
app:showAsAction="never" />
</group>
<group android:id="@+id/menu_group_login">
<item
android:id="@+id/menu_login"
android:visible="false"
android:title="@string/login"
app:showAsAction="never" />
</group> </group>
<group android:id="@+id/menu_group_text"> <group android:id="@+id/menu_group_text">
@ -62,6 +44,28 @@
</group> </group>
<item
android:id="@+id/menu_add_bookmark"
android:title="@string/bookmark_add"
app:showAsAction="never" />
<group android:id="@+id/menu_group_login">
<item
android:id="@+id/menu_login"
android:visible="false"
android:title="@string/login"
app:showAsAction="never" />
</group>
<group android:id="@+id/menu_group_on_line_ns">
<item
android:id="@+id/menu_disable_book_source"
android:title="@string/disable_book_source"
app:showAsAction="never" />
</group>
<item <item
android:id="@+id/menu_copy_text" android:id="@+id/menu_copy_text"
android:title="@string/copy_text" android:title="@string/copy_text"

Loading…
Cancel
Save