Show dialog before removing quick search
This commit is contained in:
1 parent
4e8d41b145
commit
7b655c6260
3 files changed
+15
-7
No files matched your search
@@ -1406,13 +1406,19 @@ class GalleryListScene : SearchBarScene(), OnDragHandlerListener, SearchLayout.H
|
||||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
|
||||
val position = viewHolder.bindingAdapterPosition
|
||||
val quickSearch = mQuickSearchList[position]
|
||||
lifecycleScope.launchIO {
|
||||
EhDB.deleteQuickSearch(quickSearch)
|
||||
mQuickSearchList.removeAt(position)
|
||||
withUIContext {
|
||||
mAdapter.notifyItemRemoved(position)
|
||||
}
|
||||
}
|
||||
BaseDialogBuilder(context!!)
|
||||
.setMessage(getString(R.string.delete_quick_search, quickSearch.name))
|
||||
.setPositiveButton(R.string.delete) { _, _ ->
|
||||
lifecycleScope.launchIO {
|
||||
EhDB.deleteQuickSearch(quickSearch)
|
||||
mQuickSearchList.removeAt(position)
|
||||
withUIContext {
|
||||
mAdapter.notifyItemRemoved(position)
|
||||
}
|
||||
}
|
||||
}.setNegativeButton(android.R.string.cancel) { _, _ ->
|
||||
mAdapter.notifyItemChanged(position)
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user