@Test public void shouldHighLightApprovedAmount() { viewHolder.populate(viewModel, RnRForm.STATUS.SUBMITTED); int bgReqColor = ((ColorDrawable) viewHolder.requestAmount.getBackground()).getColor(); int bgAprColor = ((ColorDrawable) viewHolder.approvedAmount.getBackground()).getColor(); assertThat(bgReqColor, is(RuntimeEnvironment.application.getApplicationContext().getResources().getColor(android.R.color.transparent))); assertThat(bgAprColor, is(RuntimeEnvironment.application.getApplicationContext().getResources().getColor(R.color.color_white))); assertThat(viewHolder.requestAmount.isEnabled(), is(false)); assertThat(viewHolder.approvedAmount.isEnabled(), is(true)); }
public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } RequisitionFormViewHolder(View itemView); }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } RequisitionFormViewHolder(View itemView); void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status); }
RequisitionFormViewHolder extends BaseViewHolder { public void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status) { productCode.setText(entry.getFmn()); productName.setText(entry.getProductName()); initAmount.setText(entry.getInitAmount()); received.setText(entry.getReceived()); issued.setText(entry.getIssued()); theoreticalInventory.setText(entry.getTheoretical()); total.setText(entry.getTotal()); inventory.setText(entry.getInventory()); different.setText(entry.getDifferent()); totalRequest.setText(entry.getAdjustedTotalRequest()); populateAdjustmentTheoreticalIcon(entry); if (LMISApp.getInstance().getFeatureToggleFor(R.bool.feature_training)) { fakePopulateRequestApprovedAmount(entry, status); } else { populateRequestApprovedAmount(entry, status); } } RequisitionFormViewHolder(View itemView); void populate(RequisitionFormItemViewModel entry, RnRForm.STATUS status);  }