|
|
|
@ -24,6 +24,7 @@ import kotlinx.coroutines.withContext |
|
|
|
|
|
|
|
|
|
class BookmarkFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_bookmark), |
|
|
|
|
BookmarkAdapter.Callback, |
|
|
|
|
BookmarkDialog.Callback, |
|
|
|
|
TocViewModel.BookmarkCallBack { |
|
|
|
|
override val viewModel by activityViewModels<TocViewModel>() |
|
|
|
|
private val binding by viewBinding(FragmentBookmarkBinding::bind) |
|
|
|
@ -85,4 +86,12 @@ class BookmarkFragment : VMBaseFragment<TocViewModel>(R.layout.fragment_bookmark |
|
|
|
|
override fun onLongClick(bookmark: Bookmark) { |
|
|
|
|
showDialogFragment(BookmarkDialog(bookmark)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun upBookmark(pos: Int, bookmark: Bookmark) { |
|
|
|
|
adapter.setItem(pos, bookmark) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun deleteBookmark(pos: Int) { |
|
|
|
|
adapter.removeItem(pos) |
|
|
|
|
} |
|
|
|
|
} |