private void setProductInfo(View v, ProductWrapper pWrapper) { TextView productName = (TextView) v.findViewById(R.id.productName); TextView productCount = (TextView) v.findViewById(R.id.productCount); productName.setText(pWrapper.getName(lngIndex)); if (pWrapper.getInStock() <= 0) { productCount.setText(AppRootActivity.words.get(Const.NOT_IN_STOCK)); } else { productCount.setText( AppRootActivity.words.get(Const.IN_STOCK) + " " + pWrapper.getInStock() + " " + pWrapper.getUnit()); } TextView pDesc = (TextView) v.findViewById(R.id.pDescription); TextView pLocation = (TextView) v.findViewById(R.id.pLocation); TextView pProducer = (TextView) v.findViewById(R.id.pProducer); pDesc.setText( AppRootActivity.words.get(Const.DESCRIPTION) + " " + pWrapper.getDescription(lngIndex)); pLocation.setText( AppRootActivity.words.get(Const.LOCATION) + " " + pWrapper.getLocationName(lngIndex)); pProducer.setText( AppRootActivity.words.get(Const.PRODUCER) + " " + pWrapper.getProducerName(lngIndex)); }
private void setProductPrice(View view, ProductWrapper pWrapper) { TextView productPrice = (TextView) view.findViewById(R.id.productPrice); productPrice.setText(pWrapper.getPricePerUnit() + " " + pWrapper.getCurrency(lngIndex)); TextView per = (TextView) view.findViewById(R.id.per); per.setText("per " + pWrapper.getUnit()); }