Merge pull request #459 from alexbakker/fix-371

Don't allow drag and drop if the entry list is filtered in any way
This commit is contained in:
Michael Schättgen 2020-06-07 23:33:21 +02:00 committed by GitHub
commit 506adcf81f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,8 +108,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();
@ -117,7 +117,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) {
@ -136,8 +136,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();
@ -145,8 +145,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) {