From 15050e80e34e641570faa050b4f726e7201c2184 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 28 Aug 2019 08:41:07 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/BookHelp.kt | 3 +++ .../java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt | 4 ++++ app/src/main/res/layout/item_bookshelf_list.xml | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index ab0f5ab95..83d8de8e5 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -85,4 +85,7 @@ object BookHelp { ?: "" } + fun getDurChapterIndexByChapterName() { + + } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt index 341de51ff..90024b32c 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt @@ -12,6 +12,7 @@ import io.legado.app.data.entities.Book import io.legado.app.help.ImageLoader import io.legado.app.lib.theme.ThemeStore import io.legado.app.utils.getCompatColor +import io.legado.app.utils.invisible import kotlinx.android.synthetic.main.item_bookshelf_list.view.* import kotlinx.android.synthetic.main.item_relace_rule.view.tv_name import org.jetbrains.anko.sdk27.listeners.onClick @@ -81,9 +82,12 @@ class BookshelfAdapter : PagedListAdapter(D } callBack?.let { if (book.origin != BookType.local && it.isUpdate(book.bookUrl)) { + bv_unread.invisible() rl_loading.show() } else { rl_loading.hide() + bv_unread.setBadgeCount(book.getUnreadChapterNum()) + bv_unread.setHighlight(book.lastCheckCount > 0) } } ?: rl_loading.hide() } diff --git a/app/src/main/res/layout/item_bookshelf_list.xml b/app/src/main/res/layout/item_bookshelf_list.xml index 72376cda3..03fd1afc1 100644 --- a/app/src/main/res/layout/item_bookshelf_list.xml +++ b/app/src/main/res/layout/item_bookshelf_list.xml @@ -27,8 +27,9 @@ android:id="@+id/fl_has_new" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_margin="8dp" app:layout_constraintRight_toRightOf="parent" - app:layout_constraintTop_toTopOf="@id/tv_name"> + app:layout_constraintTop_toTopOf="parent">