pull/32/head
kunfei 5 years ago
parent e516824b32
commit 15050e80e3
  1. 3
      app/src/main/java/io/legado/app/help/BookHelp.kt
  2. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt
  3. 3
      app/src/main/res/layout/item_bookshelf_list.xml

@ -85,4 +85,7 @@ object BookHelp {
?: "" ?: ""
} }
fun getDurChapterIndexByChapterName() {
}
} }

@ -12,6 +12,7 @@ import io.legado.app.data.entities.Book
import io.legado.app.help.ImageLoader import io.legado.app.help.ImageLoader
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.getCompatColor 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_bookshelf_list.view.*
import kotlinx.android.synthetic.main.item_relace_rule.view.tv_name import kotlinx.android.synthetic.main.item_relace_rule.view.tv_name
import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onClick
@ -81,9 +82,12 @@ class BookshelfAdapter : PagedListAdapter<Book, BookshelfAdapter.MyViewHolder>(D
} }
callBack?.let { callBack?.let {
if (book.origin != BookType.local && it.isUpdate(book.bookUrl)) { if (book.origin != BookType.local && it.isUpdate(book.bookUrl)) {
bv_unread.invisible()
rl_loading.show() rl_loading.show()
} else { } else {
rl_loading.hide() rl_loading.hide()
bv_unread.setBadgeCount(book.getUnreadChapterNum())
bv_unread.setHighlight(book.lastCheckCount > 0)
} }
} ?: rl_loading.hide() } ?: rl_loading.hide()
} }

@ -27,8 +27,9 @@
android:id="@+id/fl_has_new" android:id="@+id/fl_has_new"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_name"> app:layout_constraintTop_toTopOf="parent">
<io.legado.app.ui.widget.BadgeView <io.legado.app.ui.widget.BadgeView
android:id="@+id/bv_unread" android:id="@+id/bv_unread"

Loading…
Cancel
Save