@Test public void whenChoicesFiltered_shouldProperValuesBeReturnedInSelectMultiNoButtonsMode() { List<SelectChoice> items = getTestChoices(); setUpFormEntryPrompt(items, "no-buttons"); SelectMultipleListAdapter adapter = new SelectMultipleListAdapter(new ArrayList<>(), null, activityController.get(), items, formEntryPrompt, null, null, 0, 1, true); recyclerView.initRecyclerView(adapter, false); assertVisibleItemsInNoButtonsMode("AAA", "BBB"); adapter.getFilter().filter("b"); assertVisibleItemsInNoButtonsMode("BBB"); adapter.getFilter().filter("bc"); assertVisibleItemsInNoButtonsMode(); adapter.getFilter().filter("b"); assertVisibleItemsInNoButtonsMode("BBB"); adapter.getFilter().filter(""); assertVisibleItemsInNoButtonsMode("AAA", "BBB"); }
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);  }