From 673dd4b692420b38435bdf62a221e8f9c5df02ac Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 21 Jun 2021 14:39:29 +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 --- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/io/legado/app/constant/EventBus.kt | 1 + .../java/io/legado/app/receiver/MediaButtonReceiver.kt | 2 +- .../main/java/io/legado/app/service/AudioPlayService.kt | 3 +-- .../io/legado/app/ui/{ => book}/audio/AudioPlayActivity.kt | 2 +- .../legado/app/ui/{ => book}/audio/AudioPlayViewModel.kt | 2 +- .../java/io/legado/app/ui/book/info/BookInfoActivity.kt | 2 +- .../legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt | 7 ++++++- .../app/ui/main/bookshelf/style1/books/BooksFragment.kt | 5 ++++- .../app/ui/main/bookshelf/style2/BookshelfFragment2.kt | 5 ++++- app/src/main/res/layout/activity_audio_play.xml | 2 +- 11 files changed, 22 insertions(+), 11 deletions(-) rename app/src/main/java/io/legado/app/ui/{ => book}/audio/AudioPlayActivity.kt (99%) rename app/src/main/java/io/legado/app/ui/{ => book}/audio/AudioPlayViewModel.kt (99%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c87caef2e..4cae9d17d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -169,7 +169,7 @@ android:launchMode="singleTask" /> (EventBus.UP_BOOK) { booksAdapter.notification(it) } + observeEvent(EventBus.BOOKSHELF_REFRESH) { + booksAdapter.notifyDataSetChanged() + } } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt index 1676710eb..7fd83f6f0 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt @@ -22,7 +22,7 @@ import io.legado.app.help.AppConfig import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.primaryTextColor -import io.legado.app.ui.audio.AudioPlayActivity +import io.legado.app.ui.book.audio.AudioPlayActivity import io.legado.app.ui.book.info.BookInfoActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.search.SearchActivity @@ -231,5 +231,8 @@ class BookshelfFragment2 : BaseBookshelfFragment(R.layout.fragment_bookshelf1), observeEvent(EventBus.UP_BOOK) { booksAdapter.notification(it) } + observeEvent(EventBus.BOOKSHELF_REFRESH) { + booksAdapter.notifyDataSetChanged() + } } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_audio_play.xml b/app/src/main/res/layout/activity_audio_play.xml index 235b20cb4..20c64aba6 100644 --- a/app/src/main/res/layout/activity_audio_play.xml +++ b/app/src/main/res/layout/activity_audio_play.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/background" - tools:context=".ui.audio.AudioPlayActivity"> + tools:context=".ui.book.audio.AudioPlayActivity">