Added some IDE hint annotations

This commit is contained in:
Stefan Niedermann 2020-06-11 11:14:57 +02:00
parent 0cfcb31f7d
commit 6da8a01b4d
5 changed files with 6 additions and 2 deletions

View file

@ -139,7 +139,7 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i
return !selected.contains(position) && selected.add(position);
}
public void clearSelection(RecyclerView recyclerView) {
public void clearSelection(@NonNull RecyclerView recyclerView) {
for (Integer i : getSelected()) {
RecyclerView.ViewHolder viewHolder = recyclerView.findViewHolderForAdapterPosition(i);
if (viewHolder != null) {

View file

@ -37,7 +37,8 @@ public class NoteViewGridHolder extends NoteViewHolder {
binding.noteExcerpt.setVisibility(TextUtils.isEmpty(note.getExcerpt()) ? GONE : VISIBLE);
}
@Nullable
public View getNoteSwipeable() {
throw new UnsupportedOperationException(NoteViewGridHolder.class.getSimpleName() + " does not support swiping");
return null;
}
}

View file

@ -114,5 +114,6 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder {
public abstract void showSwipe(boolean left);
@Nullable
public abstract View getNoteSwipeable();
}

View file

@ -37,6 +37,7 @@ public class NoteViewHolderWithExcerpt extends NoteViewHolder {
bindSearchableContent(context, binding.noteExcerpt, searchQuery, note.getExcerpt(), mainColor);
}
@NonNull
public View getNoteSwipeable() {
return binding.noteSwipeable;
}

View file

@ -34,6 +34,7 @@ public class NoteViewHolderWithoutExcerpt extends NoteViewHolder {
bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), mainColor);
}
@NonNull
public View getNoteSwipeable() {
return binding.noteSwipeable;
}