修复书签bug

pull/981/head
gedoor 4 years ago
parent bdd75cc157
commit 621be37d19
  1. 9
      app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/toc/BookmarkFragment.kt

@ -27,14 +27,17 @@ class BookmarkAdapter(context: Context, val callback: Callback) :
}
override fun registerListener(holder: ItemViewHolder, binding: ItemBookmarkBinding) {
getItem(holder.layoutPosition)?.let { bookmark ->
binding.root.setOnClickListener {
binding.root.setOnClickListener {
getItem(holder.layoutPosition)?.let { bookmark ->
callback.onClick(bookmark)
}
binding.root.onLongClick {
}
binding.root.onLongClick {
getItem(holder.layoutPosition)?.let { bookmark ->
callback.onLongClick(bookmark)
}
}
}
interface Callback {

@ -1,6 +1,5 @@
package io.legado.app.ui.book.toc
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.os.Bundle
@ -74,7 +73,6 @@ class BookmarkFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_
activity?.finish()
}
@SuppressLint("InflateParams")
override fun onLongClick(bookmark: Bookmark) {
requireContext().alert(R.string.bookmark) {
setMessage(bookmark.chapterName)

Loading…
Cancel
Save