From 541c2cecf59fb5775227ffa4993ab9cffaa05c18 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 6 Feb 2020 19:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bookshelf => book/group}/GroupManageDialog.kt | 10 ++++++++-- .../app/ui/book/{info => group}/GroupSelectDialog.kt | 7 +++++-- .../io/legado/app/ui/book/info/BookInfoActivity.kt | 1 + .../legado/app/ui/main/bookshelf/BookshelfFragment.kt | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) rename app/src/main/java/io/legado/app/ui/{main/bookshelf => book/group}/GroupManageDialog.kt (96%) rename app/src/main/java/io/legado/app/ui/book/{info => group}/GroupSelectDialog.kt (98%) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt similarity index 96% rename from app/src/main/java/io/legado/app/ui/main/bookshelf/GroupManageDialog.kt rename to app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt index 1022f4ed9..af3723e11 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt @@ -1,4 +1,4 @@ -package io.legado.app.ui.main.bookshelf +package io.legado.app.ui.book.group import android.annotation.SuppressLint import android.content.Context @@ -25,6 +25,7 @@ import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.customView import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.yesButton +import io.legado.app.ui.main.bookshelf.BookshelfViewModel import io.legado.app.utils.applyTint import io.legado.app.utils.getViewModel import io.legado.app.utils.requestInputMethod @@ -77,7 +78,12 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { recycler_view.adapter = adapter App.db.bookGroupDao().liveDataAll().observe(viewLifecycleOwner, Observer { val diffResult = - DiffUtil.calculateDiff(GroupDiffCallBack(adapter.getItems(), it)) + DiffUtil.calculateDiff( + GroupDiffCallBack( + adapter.getItems(), + it + ) + ) adapter.setItems(it, false) diffResult.dispatchUpdatesTo(adapter) }) diff --git a/app/src/main/java/io/legado/app/ui/book/info/GroupSelectDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt similarity index 98% rename from app/src/main/java/io/legado/app/ui/book/info/GroupSelectDialog.kt rename to app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt index 517f9dc9d..6dbdbd17b 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/GroupSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt @@ -1,4 +1,4 @@ -package io.legado.app.ui.book.info +package io.legado.app.ui.book.group import android.annotation.SuppressLint import android.content.Context @@ -44,7 +44,10 @@ class GroupSelectDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { fun show(manager: FragmentManager) { val fragment = GroupSelectDialog() - fragment.show(manager, tag) + fragment.show( + manager, + tag + ) } } diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 6b0e5433f..cf86b2f04 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -21,6 +21,7 @@ import io.legado.app.help.BlurTransformation import io.legado.app.help.ImageLoader import io.legado.app.help.IntentDataHelp import io.legado.app.ui.audio.AudioPlayActivity +import io.legado.app.ui.book.group.GroupSelectDialog import io.legado.app.ui.book.info.edit.BookInfoEditActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index e3c68dcaa..c51bd46e2 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -22,6 +22,7 @@ import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.view.ATEAutoCompleteTextView import io.legado.app.ui.book.arrange.ArrangeBookActivity +import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.download.DownloadActivity import io.legado.app.ui.importbook.ImportBookActivity