| | |
| | | long beginTime; |
| | | long endTime; |
| | | |
| | | RechargeListModel rechargeListModel; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | |
| | | |
| | | private void setData() { |
| | | |
| | | RechargeListModel rechargeListModel = new RechargeListModel(this); |
| | | rechargeListModel.getRechargeList().observe(this, myList -> { |
| | | rechargeListModel = new RechargeListModel(this); |
| | | rechargeListModel.getAllRechargeList().observe(this, myList -> { |
| | | rechargeList.clear(); |
| | | rechargeList.addAll(myList); |
| | | adapter.notifyDataSetChanged(); |
| | | getTotal(); |
| | | }); |
| | | adapter = new RechargeAdapter(this, rechargeList); |
| | | rechargeListBinding.rechargeList.setAdapter(adapter); |
| | |
| | | TipUtil.show(RechargeListActivity.this, "结束时间不能晚于开始时间"); |
| | | } else { |
| | | endTime = endTime + (1000 * 60 * 60 * 24) - 1; |
| | | List<RechargeBean> userList = baseDao.rechargeDao().findByTime(beginTime, endTime); |
| | | rechargeList.clear(); |
| | | rechargeList.addAll(userList); |
| | | adapter.notifyDataSetChanged(); |
| | | getTotal(); |
| | | |
| | | rechargeListModel.getRechargeList(beginTime, endTime).observe(RechargeListActivity.this, list -> { |
| | | if (rechargeList != null) { |
| | | rechargeList.clear(); |
| | | rechargeList.addAll(list); |
| | | adapter.notifyDataSetChanged(); |
| | | getTotal(); |
| | | } else { |
| | | TipUtil.show(RechargeListActivity.this, "未查询到数据!"); |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | } |