pull/1705/head
kunfei 3 years ago
parent 24a4db9e7c
commit 052d477c0e
  1. 4
      app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/toc/BookmarkFragment.kt

@ -34,7 +34,7 @@ class BookmarkAdapter(context: Context, val callback: Callback) :
} }
binding.root.onLongClick { binding.root.onLongClick {
getItem(holder.layoutPosition)?.let { bookmark -> getItem(holder.layoutPosition)?.let { bookmark ->
callback.onLongClick(bookmark) callback.onLongClick(bookmark, holder.layoutPosition)
} }
} }
@ -42,7 +42,7 @@ class BookmarkAdapter(context: Context, val callback: Callback) :
interface Callback { interface Callback {
fun onClick(bookmark: Bookmark) fun onClick(bookmark: Bookmark)
fun onLongClick(bookmark: Bookmark) fun onLongClick(bookmark: Bookmark, pos: Int)
} }
} }

@ -83,8 +83,8 @@ class BookmarkFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_bookmark
} }
} }
override fun onLongClick(bookmark: Bookmark) { override fun onLongClick(bookmark: Bookmark, pos: Int) {
showDialogFragment(BookmarkDialog(bookmark)) showDialogFragment(BookmarkDialog(bookmark, pos))
} }
override fun upBookmark(pos: Int, bookmark: Bookmark) { override fun upBookmark(pos: Int, bookmark: Bookmark) {

Loading…
Cancel
Save