@Test public void shouldNotClearInputWhenRotate() { viewHolder.populate(viewModel, stockCard); MovementReasonManager.MovementReason positiveReason = new MovementReasonManager.MovementReason(MovementReasonManager.MovementType.POSITIVE_ADJUST, "POSITIVE_1", "positive adjustment description"); viewModel.setDraft(true); viewModel.setReason(positiveReason); viewHolder.etPositiveAdjustment.setText("10"); viewHolder.populate(viewModel, stockCard); assertThat(viewHolder.etPositiveAdjustment.getText().toString(), is("10")); }
public void populate(final StockMovementViewModel model, StockCard stockCard) { removeTextChangeListeners(model, stockCard.calculateSOHFromLots()); disableLine(); hideUnderline(); 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()); txSignature.setText(model.getSignature()); if (model.getReason() != null) { txReason.setText(model.getReason().getDescription()); } else { txReason.setText(StringUtils.EMPTY); } setItemViewTextColor(model); if (model.isDraft()) { setInitialDraftStyle(model); } else { itemView.setBackgroundColor(Color.TRANSPARENT); } addClickListeners(model, getPreviousMovementDate(stockCard)); addTextChangedListeners(model, stockCard.calculateSOHFromLots()); }
StockMovementViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model, StockCard stockCard) { removeTextChangeListeners(model, stockCard.calculateSOHFromLots()); disableLine(); hideUnderline(); 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()); txSignature.setText(model.getSignature()); if (model.getReason() != null) { txReason.setText(model.getReason().getDescription()); } else { txReason.setText(StringUtils.EMPTY); } setItemViewTextColor(model); if (model.isDraft()) { setInitialDraftStyle(model); } else { itemView.setBackgroundColor(Color.TRANSPARENT); } addClickListeners(model, getPreviousMovementDate(stockCard)); addTextChangedListeners(model, stockCard.calculateSOHFromLots()); } }
StockMovementViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model, StockCard stockCard) { removeTextChangeListeners(model, stockCard.calculateSOHFromLots()); disableLine(); hideUnderline(); 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()); txSignature.setText(model.getSignature()); if (model.getReason() != null) { txReason.setText(model.getReason().getDescription()); } else { txReason.setText(StringUtils.EMPTY); } setItemViewTextColor(model); if (model.isDraft()) { setInitialDraftStyle(model); } else { itemView.setBackgroundColor(Color.TRANSPARENT); } addClickListeners(model, getPreviousMovementDate(stockCard)); addTextChangedListeners(model, stockCard.calculateSOHFromLots()); } StockMovementViewHolder(View itemView); }
StockMovementViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model, StockCard stockCard) { removeTextChangeListeners(model, stockCard.calculateSOHFromLots()); disableLine(); hideUnderline(); 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()); txSignature.setText(model.getSignature()); if (model.getReason() != null) { txReason.setText(model.getReason().getDescription()); } else { txReason.setText(StringUtils.EMPTY); } setItemViewTextColor(model); if (model.isDraft()) { setInitialDraftStyle(model); } else { itemView.setBackgroundColor(Color.TRANSPARENT); } addClickListeners(model, getPreviousMovementDate(stockCard)); addTextChangedListeners(model, stockCard.calculateSOHFromLots()); } StockMovementViewHolder(View itemView); void populate(final StockMovementViewModel model, StockCard stockCard); void highLightAndShowBottomBtn(); }
StockMovementViewHolder extends BaseViewHolder { public void populate(final StockMovementViewModel model, StockCard stockCard) { removeTextChangeListeners(model, stockCard.calculateSOHFromLots()); disableLine(); hideUnderline(); 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()); txSignature.setText(model.getSignature()); if (model.getReason() != null) { txReason.setText(model.getReason().getDescription()); } else { txReason.setText(StringUtils.EMPTY); } setItemViewTextColor(model); if (model.isDraft()) { setInitialDraftStyle(model); } else { itemView.setBackgroundColor(Color.TRANSPARENT); } addClickListeners(model, getPreviousMovementDate(stockCard)); addTextChangedListeners(model, stockCard.calculateSOHFromLots()); } StockMovementViewHolder(View itemView); void populate(final StockMovementViewModel model, StockCard stockCard); void highLightAndShowBottomBtn();  }