From 992dcd651ba49b81b21cc9205603882e7dccad08 Mon Sep 17 00:00:00 2001 From: Alexander Bakker Date: Sun, 7 Jun 2020 17:18:19 +0200 Subject: [PATCH] Don't allow drag and drop if the entry list is filtered in any way --- .../com/beemdevelopment/aegis/ui/views/EntryListView.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java index b22653e0..1ca7fd71 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java @@ -126,8 +126,8 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener { } public void setGroupFilter(String group, boolean apply) { - _touchCallback.setIsLongPressDragEnabled(group == null); _adapter.setGroupFilter(group, apply); + _touchCallback.setIsLongPressDragEnabled(_adapter.isDragAndDropAllowed()); if (apply) { runEntriesAnimation(); @@ -135,7 +135,7 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener { } public void setIsLongPressDragEnabled(boolean enabled) { - _touchCallback.setIsLongPressDragEnabled(enabled); + _touchCallback.setIsLongPressDragEnabled(enabled && _adapter.isDragAndDropAllowed()); } public void setIsCopyOnTapEnabled(boolean enabled) { @@ -154,8 +154,8 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener { } public void setSortCategory(SortCategory sortCategory, boolean apply) { - _touchCallback.setIsLongPressDragEnabled(sortCategory == SortCategory.CUSTOM); _adapter.setSortCategory(sortCategory, apply); + _touchCallback.setIsLongPressDragEnabled(_adapter.isDragAndDropAllowed()); if (apply) { runEntriesAnimation(); @@ -163,8 +163,8 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener { } public void setSearchFilter(String search) { - _touchCallback.setIsLongPressDragEnabled(search == null); _adapter.setSearchFilter(search); + _touchCallback.setIsLongPressDragEnabled(_adapter.isDragAndDropAllowed()); } public void setViewMode(ViewMode mode) {