pull/32/head
kunfei 5 years ago
parent 6c9c08d342
commit ff3af56226
  1. 7
      app/src/main/java/io/legado/app/ui/booksource/BookSourceActivity.kt
  2. 18
      app/src/main/res/menu/book_source.xml
  3. 2
      app/src/main/res/menu/source_edit.xml

@ -64,13 +64,13 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.action_add_book_source -> { R.id.menu_add_book_source -> {
this.startActivity<SourceEditActivity>() this.startActivity<SourceEditActivity>()
} }
R.id.action_import_book_source_qr -> { R.id.menu_import_book_source_qr -> {
this.startActivityForResult<QrCodeActivity>(qrRequestCode) this.startActivityForResult<QrCodeActivity>(qrRequestCode)
} }
R.id.action_select_all -> { R.id.menu_select_all -> {
launch(IO) { launch(IO) {
val isEnableList = val isEnableList =
App.db.bookSourceDao().searchIsEnable("%${search_view.query}%") App.db.bookSourceDao().searchIsEnable("%${search_view.query}%")
@ -81,6 +81,7 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
} }
} }
} }
} }
if (item.groupId == R.id.source_group) { if (item.groupId == R.id.source_group) {
search_view.setQuery(item.title, true) search_view.setQuery(item.title, true)

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<item <item
android:id="@+id/action_select_all" android:id="@+id/menu_select_all"
android:icon="@drawable/ic_select_all" android:icon="@drawable/ic_select_all"
android:title="@string/select_all" android:title="@string/select_all"
app:showAsAction="always" app:showAsAction="always"
@ -57,49 +57,49 @@
</item> </item>
<item <item
android:id="@+id/action_add_book_source" android:id="@+id/menu_add_book_source"
android:icon="@drawable/ic_add" android:icon="@drawable/ic_add"
android:title="@string/add_book_source" android:title="@string/add_book_source"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_import_book_source_local" android:id="@+id/menu_import_book_source_local"
android:icon="@drawable/ic_import" android:icon="@drawable/ic_import"
android:title="@string/import_book_source_local" android:title="@string/import_book_source_local"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_import_book_source_onLine" android:id="@+id/menu_import_book_source_onLine"
android:icon="@drawable/ic_import" android:icon="@drawable/ic_import"
android:title="@string/import_book_source_on_line" android:title="@string/import_book_source_on_line"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_import_book_source_qr" android:id="@+id/menu_import_book_source_qr"
android:icon="@drawable/ic_import" android:icon="@drawable/ic_import"
android:title="@string/import_by_qr_code" android:title="@string/import_by_qr_code"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_revert_selection" android:id="@+id/menu_revert_selection"
android:icon="@drawable/ic_swap_outline_24dp" android:icon="@drawable/ic_swap_outline_24dp"
android:title="@string/revert_selection" android:title="@string/revert_selection"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_del_select" android:id="@+id/menu_del_select"
android:icon="@drawable/ic_clear_all" android:icon="@drawable/ic_clear_all"
android:title="@string/del_select" android:title="@string/del_select"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_check_book_source" android:id="@+id/menu_check_book_source"
android:icon="@drawable/ic_check_source" android:icon="@drawable/ic_check_source"
android:title="@string/check_select_source" android:title="@string/check_select_source"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_share_wifi" android:id="@+id/menu_share_wifi"
android:icon="@drawable/ic_share" android:icon="@drawable/ic_share"
android:title="@string/wifi_share" android:title="@string/wifi_share"
app:showAsAction="never" /> app:showAsAction="never" />

@ -40,7 +40,7 @@
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_share_wifi" android:id="@+id/menu_share_wifi"
android:title="@string/wifi_share" android:title="@string/wifi_share"
app:showAsAction="never" /> app:showAsAction="never" />

Loading…
Cancel
Save