@Override public void onResume() { super.onResume(); Log.d(TAG1, "===>> onResume"); mSendAdapter.notifyDataSetChanged(); mReceiveAdapter.notifyDataSetChanged(); }
/** 换货申请提交成功后还原界面,并重新下载换货数据 */ private void init() { et_apply_message.setText(""); et_apply_message.setHint("请填写换货说明"); exchangeReceiveGoodBeans.clear(); exchangeReceiveGoodsMap.clear(); exChangeSendGoodBeans.clear(); exChangeSendGoodsMap.clear(); mSendAdapter.notifyDataSetChanged(); mReceiveAdapter.notifyDataSetChanged(); setReceiveTotalPriceText(); setSendTotalPriceText(); loadCanSendGoods(); }
/** * 添加换回的商品 * * @param list :要添加的huan回商品列表 */ private void addReceiveGoods(List<RefundGoodBean> list) { Log.d(TAG1, "addReceiveGoods,list size = " + list.size()); exchangeReceiveGoodBeans.addAll(list); for (int i = 0; i < list.size(); i++) { RefundGoodBean goodBean = list.get(i); for (int j = 0; j < goodBean.goodSizeBeans.size(); j++) { Log.d(TAG1, "goodBean.goodSizeBeans size = " + goodBean.goodSizeBeans.size()); RefundGoodSizeBean sizeBean = goodBean.goodSizeBeans.get(j); if (!exchangeReceiveGoodsMap.containsKey(sizeBean.getUniqueKey())) { exchangeReceiveGoodsMap.put(sizeBean.getUniqueKey(), sizeBean); } } } mReceiveAdapter.setList(exchangeReceiveGoodBeans); }
/** * 添加退回的商品 * * @param list :要添加的退回商品列表 */ private void addSendGoods(List<RefundGoodBean> list) { exChangeSendGoodBeans.clear(); exChangeSendGoodBeans.addAll(list); for (int i = exChangeSendGoodBeans.size() - 1; i >= 0; i--) { RefundGoodBean goodBean = exChangeSendGoodBeans.get(i); boolean isRemoveGood = true; // 是否删除不包含货品的商品对象 for (int j = goodBean.goodSizeBeans.size() - 1; j >= 0; j--) { RefundGoodSizeBean sizeBean = goodBean.goodSizeBeans.get(j); Log.d(TAG1, "sizeBean.quanlity = " + sizeBean.quantity); if (sizeBean.quantity.trim().equals("0")) { goodBean.goodSizeBeans.remove(sizeBean); continue; } isRemoveGood = false; if (!exChangeSendGoodsMap.containsKey(sizeBean.getUniqueKey())) { exChangeSendGoodsMap.put(sizeBean.getUniqueKey(), sizeBean); } } if (isRemoveGood) { exChangeSendGoodBeans.remove(goodBean); } } mSendAdapter.setList(exChangeSendGoodBeans); }
private void setView() { ifShowContentView(); mSendAdapter.notifyDataSetChanged(); mReceiveAdapter.notifyDataSetChanged(); factory_name.setText(factoryName); }