|
@@ -16,6 +16,7 @@ import com.kx.liedouYX.R;
|
16
|
16
|
import com.kx.liedouYX.entity.StockBean;
|
17
|
17
|
import com.kx.liedouYX.utils.RecycleViewUtils;
|
18
|
18
|
|
|
19
|
+import java.util.ArrayList;
|
19
|
20
|
import java.util.List;
|
20
|
21
|
|
21
|
22
|
import butterknife.BindView;
|
|
@@ -48,18 +49,20 @@ public class RecordDateAdapter extends RecyclerView.Adapter<RecordDateAdapter.My
|
48
|
49
|
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
49
|
50
|
RecycleViewUtils.setListRecycleGood(context, holder.recordList);
|
50
|
51
|
List<StockBean> stockBeans = data.get(position);
|
|
52
|
+ List<StockBean> newStockBeans = new ArrayList<>();
|
51
|
53
|
for (StockBean stockBean : stockBeans) {
|
52
|
|
- if (TextUtils.isEmpty(stockBean.getGoods_id())) {
|
53
|
|
-// stockBeans.remove(stockBean);
|
54
|
|
- LogUtil.e("失效的商品:" + stockBean.toString());
|
|
54
|
+ if (!TextUtils.isEmpty(stockBean.getGoods_id())) {
|
|
55
|
+ newStockBeans.add(stockBean);
|
55
|
56
|
}
|
56
|
57
|
}
|
57
|
|
- holder.recordDate.setText(stockBeans.get(0).getAdd_time());
|
58
|
|
- LinearLayoutManager manager = new LinearLayoutManager(context);
|
59
|
|
- manager.setOrientation(RecyclerView.VERTICAL);
|
60
|
|
- RecordListAdapter adapter = new RecordListAdapter(context, stockBeans);
|
61
|
|
- holder.recordList.setLayoutManager(manager);
|
62
|
|
- holder.recordList.setAdapter(adapter);
|
|
58
|
+ if (newStockBeans.size() > 0) {
|
|
59
|
+ holder.recordDate.setText(newStockBeans.get(0).getAdd_time());
|
|
60
|
+ LinearLayoutManager manager = new LinearLayoutManager(context);
|
|
61
|
+ manager.setOrientation(RecyclerView.VERTICAL);
|
|
62
|
+ RecordListAdapter adapter = new RecordListAdapter(context, newStockBeans);
|
|
63
|
+ holder.recordList.setLayoutManager(manager);
|
|
64
|
+ holder.recordList.setAdapter(adapter);
|
|
65
|
+ }
|
63
|
66
|
}
|
64
|
67
|
|
65
|
68
|
@Override
|