| | |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | | import com.hdl.photovoltaic.databinding.ActivityPowerStationsMoveBinding; |
| | | import com.hdl.photovoltaic.enums.ShowErrorMode; |
| | | import com.hdl.photovoltaic.internet.HttpClient; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlResidenceLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.ui.bean.HouseIdBean; |
| | | import com.hdl.photovoltaic.ui.newC.adapter.HouseMoveAdapter; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | | import com.hdl.photovoltaic.widget.refreshlayout.BGARefreshLayout; |
| | | import com.hdl.photovoltaic.widget.refreshlayout.HDLRefreshViewHolder; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.greenrobot.eventbus.ThreadMode; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | this.houseListBeanIDList = new ArrayList<>(); |
| | | this.houseListBeanIDList.addAll(HdlResidenceLogic.getInstance().getHouseIdList()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 下拉刷新的逻辑 |
| | |
| | | //移动电站位置 |
| | | HdlResidenceLogic.getInstance().moveHouseId(houseIdBean.getHomeId()); |
| | | initData();//初始化缓存数据 |
| | | houseMoveAdapter.setList(houseListBeanIDList);//重新刷新列表 |
| | | if (houseMoveAdapter != null) { |
| | | houseMoveAdapter.setList(houseListBeanIDList);//重新刷新列表 |
| | | } |
| | | nullDataUpdateUi(houseListBeanIDList);//检测数据是否为空 |
| | | //通知外面更新位置 |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.REFRESH_HOME_LIST, ConstantManage.REFRESH_HOME_LIST); |
| | |
| | | super.onDestroy(); |
| | | } |
| | | |
| | | /** |
| | | * 收到EventBUs通知 |
| | | * |
| | | * @param eventBus 数据 |
| | | */ |
| | | @Subscribe(threadMode = ThreadMode.MAIN) |
| | | public void onEventMessage(BaseEventBus eventBus) { |
| | | super.onEventMessage(eventBus); |
| | | if (ConstantManage.REFRESH_HOME_LIST.equals(eventBus.getTopic())) { |
| | | if (houseMoveAdapter != null) { |
| | | initData(); |
| | | houseMoveAdapter.setList(houseListBeanIDList); |
| | | } |
| | | nullDataUpdateUi(houseListBeanIDList);//检测数据是否为空 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |