@Test public void shouldSortByProductCodeAndCategory() throws Exception { ArrayList<RnrFormItem> list = new ArrayList<>(); list.add(getRnrFormItem(1L, "product", "08S17", MEDICINE_TYPE_SOLUTION)); list.add(getRnrFormItem(3L, "product3", "08S22Z", MEDICINE_TYPE_ADULT)); list.add(getRnrFormItem(2L, "product2", "08S32Z", MEDICINE_TYPE_CHILDREN)); list.add(getRnrFormItem(4L, "product4", "08S39Z", MEDICINE_TYPE_ADULT)); mmiaRnrFormProductList.initView(list, false); ViewGroup leftViewGroup = mmiaRnrFormProductList.findViewById(R.id.rnr_from_list_product_name); assertThat(getCodeFromTextView(leftViewGroup, 0, 0, 1), is(list.get(1).getProduct().getCode())); assertThat(getPrimaryNameTextView(leftViewGroup, 0, 1, 1), is(list.get(1).getProduct().getPrimaryName())); assertThat(getCodeFromTextView(leftViewGroup, 1, 0, 1), is(list.get(3).getProduct().getCode())); assertThat(getPrimaryNameTextView(leftViewGroup, 1, 1, 1), is(list.get(3).getProduct().getPrimaryName())); assertThat(getCodeFromTextView(leftViewGroup, 4, 0, 1), is(list.get(2).getProduct().getCode())); assertThat(getPrimaryNameTextView(leftViewGroup, 4, 1, 1), is(list.get(2).getProduct().getPrimaryName())); assertThat(getCodeFromTextView(leftViewGroup, 6, 0, 1), is(list.get(0).getProduct().getCode())); assertThat(getPrimaryNameTextView(leftViewGroup, 6, 1, 1), is(list.get(0).getProduct().getPrimaryName())); }
public void initView(List<RnrFormItem> list, boolean shouldOldData) { this.dataWithOldFormat = shouldOldData; addHeaderView(); addItemView(list); }
MMIARnrFormProductList extends LinearLayout { public void initView(List<RnrFormItem> list, boolean shouldOldData) { this.dataWithOldFormat = shouldOldData; addHeaderView(); addItemView(list); } }
MMIARnrFormProductList extends LinearLayout { public void initView(List<RnrFormItem> list, boolean shouldOldData) { this.dataWithOldFormat = shouldOldData; addHeaderView(); addItemView(list); } MMIARnrFormProductList(Context context);  MMIARnrFormProductList(Context context, AttributeSet attrs); }
MMIARnrFormProductList extends LinearLayout { public void initView(List<RnrFormItem> list, boolean shouldOldData) { this.dataWithOldFormat = shouldOldData; addHeaderView(); addItemView(list); } MMIARnrFormProductList(Context context);  MMIARnrFormProductList(Context context, AttributeSet attrs); void onConfigurationChanged(Configuration newConfig); void initView(List<RnrFormItem> list, boolean shouldOldData); void fillOtherTypeItem(); boolean isCompleted(); View addLeftHeaderView(); ViewGroup addRightHeaderView(); }
MMIARnrFormProductList extends LinearLayout { public void initView(List<RnrFormItem> list, boolean shouldOldData) { this.dataWithOldFormat = shouldOldData; addHeaderView(); addItemView(list); } MMIARnrFormProductList(Context context);  MMIARnrFormProductList(Context context, AttributeSet attrs); void onConfigurationChanged(Configuration newConfig); void initView(List<RnrFormItem> list, boolean shouldOldData); void fillOtherTypeItem(); boolean isCompleted(); View addLeftHeaderView(); ViewGroup addRightHeaderView(); public List<RnrFormItem> itemFormList; }