diff --git a/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt b/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt index 43a6ac72d..84d0c011f 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/BookmarkAdapter.kt @@ -34,7 +34,7 @@ class BookmarkAdapter(context: Context, val callback: Callback) : } binding.root.onLongClick { 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 { fun onClick(bookmark: Bookmark) - fun onLongClick(bookmark: Bookmark) + fun onLongClick(bookmark: Bookmark, pos: Int) } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/toc/BookmarkFragment.kt b/app/src/main/java/io/legado/app/ui/book/toc/BookmarkFragment.kt index 0e6925d6b..b0ec07f3b 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/BookmarkFragment.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/BookmarkFragment.kt @@ -83,8 +83,8 @@ class BookmarkFragment : VMBaseFragment(R.layout.fragment_bookmark } } - override fun onLongClick(bookmark: Bookmark) { - showDialogFragment(BookmarkDialog(bookmark)) + override fun onLongClick(bookmark: Bookmark, pos: Int) { + showDialogFragment(BookmarkDialog(bookmark, pos)) } override fun upBookmark(pos: Int, bookmark: Bookmark) {