mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
24a4db9e7c
commit
052d477c0e
@ -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)
|
||||
}
|
||||
|
||||
}
|
@ -83,8 +83,8 @@ class BookmarkFragment : VMBaseFragment<TocViewModel>(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) {
|
||||
|
Loading…
Reference in New Issue
Block a user