feat: Cut and Copy from search

This commit is contained in:
J-Jamet committed 2023-08-05 17:29:32 +02:00
1 parent 8ce9757b7c
commit c078bd05e2
2 files changed
+5 -8

No files matched your search

@@ -242,7 +242,6 @@ class GroupActivity : DatabaseLockActivity(),
}
private fun removeSearch() {
finishNodeAction()
mSearchState = null
intent.removeExtra(AUTO_SEARCH_KEY)
if (Intent.ACTION_SEARCH == intent.action) {
@@ -1040,8 +1039,8 @@ class GroupActivity : DatabaseLockActivity(),
nodes: List<Node>
): Boolean {
actionNodeMode?.invalidate()
// Nothing here fragment calls onPasteMenuClick internally
removeSearch()
loadGroup()
return true
}
@@ -1050,8 +1049,8 @@ class GroupActivity : DatabaseLockActivity(),
nodes: List<Node>
): Boolean {
actionNodeMode?.invalidate()
// Nothing here fragment calls onPasteMenuClick internally
removeSearch()
loadGroup()
return true
}
@@ -346,14 +346,12 @@ class GroupFragment : DatabaseFragment(), SortDialogFragment.SortSelectionListen
}
// Move
if (database.isReadOnly
|| isASearchResult) {
if (database.isReadOnly) {
menu?.removeItem(R.id.menu_move)
}
// Copy (not allowed for group)
if (database.isReadOnly
|| isASearchResult
|| nodes.any { it.type == Type.GROUP }) {
menu?.removeItem(R.id.menu_copy)
}