diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java b/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java index 67feb6bb..ed3cc8c2 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java @@ -48,11 +48,11 @@ public class NotesListViewItemTouchHelper extends ItemTouchHelper { } /** - * Disable swipe on sections + * Disable swipe on sections and if grid view is enabled * * @param recyclerView RecyclerView * @param viewHolder RecyclerView.ViewHoler - * @return 0 if section, otherwise super() + * @return 0 if viewHolder is section or grid view is enabled, otherwise super() */ @Override public int getSwipeDirs(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) { diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewGridHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewGridHolder.java index a0a773ec..13cf735a 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewGridHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewGridHolder.java @@ -23,7 +23,7 @@ public class NoteViewGridHolder extends NoteViewHolder { } public void showSwipe(boolean left) { - + throw new UnsupportedOperationException(NoteViewGridHolder.class.getSimpleName() + " does not support swiping"); } public void bind(@NonNull DBNote note, boolean showCategory, int mainColor, int textColor, @Nullable CharSequence searchQuery) { @@ -38,6 +38,6 @@ public class NoteViewGridHolder extends NoteViewHolder { } public View getNoteSwipeable() { - return null; + throw new UnsupportedOperationException(NoteViewGridHolder.class.getSimpleName() + " does not support swiping"); } } \ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolderWithoutExcerpt.java b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolderWithoutExcerpt.java index 78a74a5f..c7c61bd6 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolderWithoutExcerpt.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolderWithoutExcerpt.java @@ -18,7 +18,6 @@ public class NoteViewHolderWithoutExcerpt extends NoteViewHolder { this.binding = binding; } - public void showSwipe(boolean left) { binding.noteFavoriteLeft.setVisibility(left ? View.VISIBLE : View.INVISIBLE); binding.noteDeleteRight.setVisibility(left ? View.INVISIBLE : View.VISIBLE);