Update documentation

This commit is contained in:
Stefan Niedermann 2020-06-10 18:12:59 +02:00
parent e8b4a75778
commit f823e48c7c
3 changed files with 4 additions and 5 deletions

View file

@ -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) {

View file

@ -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");
}
}

View file

@ -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);