@Test public void shouldSetPositiveInventoryAdjustmentFontColorToRed() { viewModel.setReason(new MovementReason(MovementReasonManager.MovementType.POSITIVE_ADJUST, MovementReasonManager.INVENTORY_POSITIVE, "")); viewHolder.populate(viewModel); int redColor = RuntimeEnvironment.application.getResources().getColor(R.color.color_red); assertEquals(redColor, viewHolder.txMovementDate.getCurrentTextColor()); assertEquals(redColor, viewHolder.txReason.getCurrentTextColor()); assertEquals(redColor, viewHolder.etDocumentNo.getCurrentTextColor()); assertEquals(redColor, viewHolder.etReceived.getCurrentTextColor()); assertEquals(redColor, viewHolder.etPositiveAdjustment.getCurrentTextColor()); assertEquals(redColor, viewHolder.etNegativeAdjustment.getCurrentTextColor()); assertEquals(redColor, viewHolder.txStockExistence.getCurrentTextColor()); }
public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } StockMovementItemHistoryViewHolder(View itemView); }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } StockMovementItemHistoryViewHolder(View itemView); void populate(final StockMovementViewModel model); }
StockMovementItemHistoryViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model) { txMovementDate.setText(model.getMovementDate()); etDocumentNo.setText(model.getDocumentNo()); etReceived.setText(model.getReceived()); etNegativeAdjustment.setText(model.getNegativeAdjustment()); etPositiveAdjustment.setText(model.getPositiveAdjustment()); etIssued.setText(model.getIssued()); etRequested.setText(model.getRequested()); txStockExistence.setText(model.getStockExistence()); txReason.setText(model.getReason().getDescription()); txSignature.setText(model.getSignature()); setItemViewTextColor(model); } StockMovementItemHistoryViewHolder(View itemView); void populate(final StockMovementViewModel model);  }