| | |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.FragmentHouseListBinding; |
| | | import com.hdl.photovoltaic.base.CustomBaseFragment; |
| | | import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; |
| | | import com.hdl.photovoltaic.enums.ShowErrorMode; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | |
| | | viewBinding.fragmentHouseSrlListRc.setAdapter(houseInfoAdapter); |
| | | |
| | | |
| | | this.nullDataUpdateUi(houseListBeanIDList); |
| | | |
| | | |
| | | } |
| | | |
| | | private void initData() { |
| | |
| | | |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_EDIT.equals(eventBus.getType())) { |
| | | //todo 现在默认刷新全部 |
| | | //uin编辑住宅通知 |
| | | String homeId = HdlUniLogic.getInstance().getKeyValue("homeId", eventBus.getData()); |
| | | String home_name = HdlUniLogic.getInstance().getKeyValue("powerStationName", eventBus.getData()); |
| | | if (TextUtils.isEmpty(homeId) || TextUtils.isEmpty(home_name)) { |
| | | return; |
| | | } |
| | | int index = -1; |
| | | for (int i = 0; i < houseListBeanIDList.size(); i++) { |
| | | HouseIdBean houseIdBean = houseListBeanIDList.get(i); |
| | | if (houseIdBean.getHomeId().equals(homeId)) { |
| | | index = i; |
| | | houseIdBean.setHomeName(home_name); |
| | | break; |
| | | } |
| | | } |
| | | if (index > -1) { |
| | | if (houseInfoAdapter != null) { |
| | | //更新单个数据 |
| | | houseInfoAdapter.notifyItemChanged(index); |
| | | } |
| | | } |
| | | // String homeId = HdlUniLogic.getInstance().getKeyValue("homeId", eventBus.getData()); |
| | | // String home_name = HdlUniLogic.getInstance().getKeyValue("powerStationName", eventBus.getData()); |
| | | // if (TextUtils.isEmpty(homeId) || TextUtils.isEmpty(home_name)) { |
| | | // return; |
| | | // } |
| | | // int index = -1; |
| | | // for (int i = 0; i < houseListBeanIDList.size(); i++) { |
| | | // HouseIdBean houseIdBean = houseListBeanIDList.get(i); |
| | | // if (houseIdBean.getHomeId().equals(homeId)) { |
| | | // index = i; |
| | | // houseIdBean.setHomeName(home_name); |
| | | // break; |
| | | // } |
| | | // } |
| | | // if (index > -1) { |
| | | // if (houseInfoAdapter != null) { |
| | | // //更新单个数据 |
| | | // houseInfoAdapter.notifyItemChanged(index); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | if (MqttRecvClient.getInstance() != null) { |
| | | MqttRecvClient.getInstance().removeAllTopic(); |
| | | } |
| | | updateUIData(false); |
| | | |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) { |
| | | //进去住宅详情uni读取逆变器列表成功后通知 |
| | | for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList().size(); i++) { |
| | |
| | | } |
| | | } else if (eventBus.getTopic().equals(ConstantManage.homepage_title_tab_switch)) { |
| | | //接收外部点击事件 |
| | | if (eventBus.getType().equals(HdlCommonLogic.HomepageTitleTabSwitch.powerstation.toString())) { |
| | | if (eventBus.getType().equals(HomepageTitleTabSwitch.powerstation.toString())) { |
| | | HdlLogLogic.print("正在点击【电站】"); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | nullDataUpdateUi(list); |
| | | } |
| | | }, _mActivity, ShowErrorMode.YES); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 没有电站列表的样式 |
| | | */ |
| | | private void nullDataUpdateUi(List<HouseIdBean> list) { |
| | | if (list != null && list.size() > 0) { |
| | | viewBinding.nullListTv.setVisibility(View.GONE); |
| | | } else { |
| | | viewBinding.nullListTv.setVisibility(View.VISIBLE); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |