@Test public void whenButtonsModeIsUsed_shouldViewAndItsElementsBeLongClickableToSupportRemovingAnswers() { List<SelectChoice> items = getTestChoices(); setUpFormEntryPrompt(items, ""); SelectItemClickListener listener = mock(SelectItemClickListener.class); SelectMultipleListAdapter adapter = new SelectMultipleListAdapter(new ArrayList<>(), listener, activityController.get(), items, formEntryPrompt, null, null, 0, 1, false); recyclerView.initRecyclerView(adapter, false); AudioVideoImageTextLabel view = (AudioVideoImageTextLabel) getChoiceView(0); File file = mock(File.class); when(file.exists()).thenReturn(true); view.setImage(file); view.setVideo(file); AudioHelper audioHelper = mock(AudioHelper.class); MutableLiveData<Boolean> isPlaying = new MutableLiveData<>(false); when(audioHelper.setAudio(any(AudioButton.class), any())).thenReturn(isPlaying); view.setAudio("file: assertThat(view.isLongClickable(), is(true)); assertThat(view.getImageView().isLongClickable(), is(true)); assertThat(view.getVideoButton().isLongClickable(), is(true)); assertThat(view.getAudioButton().isLongClickable(), is(true)); assertThat(view.getLabelTextView().isLongClickable(), is(true)); }
public void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex) { if (isFlex) { enableFlexboxLayout(); } else { enableGridLayout(adapter.getNumColumns()); } setAdapter(adapter); adjustRecyclerViewSize(); }
ChoicesRecyclerView extends RecyclerView { public void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex) { if (isFlex) { enableFlexboxLayout(); } else { enableGridLayout(adapter.getNumColumns()); } setAdapter(adapter); adjustRecyclerViewSize(); } }
ChoicesRecyclerView extends RecyclerView { public void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex) { if (isFlex) { enableFlexboxLayout(); } else { enableGridLayout(adapter.getNumColumns()); } setAdapter(adapter); adjustRecyclerViewSize(); } ChoicesRecyclerView(@NonNull Context context);  ChoicesRecyclerView(Context context, AttributeSet attrs); }
ChoicesRecyclerView extends RecyclerView { public void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex) { if (isFlex) { enableFlexboxLayout(); } else { enableGridLayout(adapter.getNumColumns()); } setAdapter(adapter); adjustRecyclerViewSize(); } ChoicesRecyclerView(@NonNull Context context);  ChoicesRecyclerView(Context context, AttributeSet attrs); void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex); }
ChoicesRecyclerView extends RecyclerView { public void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex) { if (isFlex) { enableFlexboxLayout(); } else { enableGridLayout(adapter.getNumColumns()); } setAdapter(adapter); adjustRecyclerViewSize(); } ChoicesRecyclerView(@NonNull Context context);  ChoicesRecyclerView(Context context, AttributeSet attrs); void initRecyclerView(AbstractSelectListAdapter adapter, boolean isFlex);  }