@Test public void shouldInitialViewHolder() throws ParseException { InventoryViewModel viewModel = new InventoryViewModelBuilder(product) .setChecked(false) .setType("Embalagem") .build(); viewHolder.populate(viewModel, queryKeyWord, mockedListener); assertThat(viewHolder.productName.getText().toString()).isEqualTo("Lamivudina 150mg [08S40]"); assertThat(viewHolder.productUnit.getText().toString()).isEqualTo("Embalagem"); assertThat(viewHolder.tvHistoryAction.getVisibility()).isEqualTo(View.GONE); }
public void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener) { this.viewModel = inventoryViewModel; setUpLotListView(); resetCheckBox(); setUpCheckBox(); checkBox.setChecked(viewModel.isChecked()); productName.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyledName())); productUnit.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyleType())); initHistoryView(listener); }
InitialInventoryViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener) { this.viewModel = inventoryViewModel; setUpLotListView(); resetCheckBox(); setUpCheckBox(); checkBox.setChecked(viewModel.isChecked()); productName.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyledName())); productUnit.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyleType())); initHistoryView(listener); } }
InitialInventoryViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener) { this.viewModel = inventoryViewModel; setUpLotListView(); resetCheckBox(); setUpCheckBox(); checkBox.setChecked(viewModel.isChecked()); productName.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyledName())); productUnit.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyleType())); initHistoryView(listener); } InitialInventoryViewHolder(View itemView); }
InitialInventoryViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener) { this.viewModel = inventoryViewModel; setUpLotListView(); resetCheckBox(); setUpCheckBox(); checkBox.setChecked(viewModel.isChecked()); productName.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyledName())); productUnit.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyleType())); initHistoryView(listener); } InitialInventoryViewHolder(View itemView); void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener); void setUpLotListView(); void showAddNewLotPanel(int visible); }
InitialInventoryViewHolder extends BaseViewHolder { public void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener) { this.viewModel = inventoryViewModel; setUpLotListView(); resetCheckBox(); setUpCheckBox(); checkBox.setChecked(viewModel.isChecked()); productName.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyledName())); productUnit.setText(TextStyleUtil.getHighlightQueryKeyWord(queryKeyWord, viewModel.getStyleType())); initHistoryView(listener); } InitialInventoryViewHolder(View itemView); void populate(final InventoryViewModel inventoryViewModel, String queryKeyWord, ViewHistoryListener listener); void setUpLotListView(); void showAddNewLotPanel(int visible);  }