| | |
| | | import android.content.pm.PackageManager; |
| | | import android.hardware.camera2.CameraManager; |
| | | import android.os.Bundle; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 电站列表界面 |
| | | * (住宅)电站列表-界面 |
| | | */ |
| | | public class HouseListFragment extends CustomBaseFragment { |
| | | |
| | |
| | | @Override |
| | | public void onRefresh() { |
| | | updateUIData(true); |
| | | Log.d("HouseListFragment", "下拉刷新"); |
| | | HdlLogLogic.print("HouseListFragment", "下拉刷新"); |
| | | } |
| | | }); |
| | | houseInfoAdapter.setNoOnclickListener(new HouseInfoAdapter.OnclickListener() { |
| | |
| | | //点击住宅详情 |
| | | HdlLogLogic.print("点击住宅详情===" + new Gson().toJson(houseIdBean)); |
| | | HdlResidenceLogic.getInstance().switchHouse(houseIdBean); |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS + "?homeId=" + houseIdBean.getHomeId(); |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS + "?homeId=" + houseIdBean.getHomeId()+"&homeName="+houseIdBean.getHomeName(); |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void initView() { |
| | | viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.my_power_station_我的电站); |
| | | viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.my_power_station); |
| | | viewBinding.toolbarTopFragmentHouseListRl.topMoreIv.setVisibility(View.VISIBLE); |
| | | viewBinding.toolbarTopFragmentHouseListRl.topMoreIv.setImageResource(R.drawable.add); |
| | | LinearLayoutManager linearLayout = new LinearLayoutManager(_mActivity); |
| | | houseInfoAdapter = new HouseInfoAdapter(this.houseListBeanIDList); |
| | | houseInfoAdapter = new HouseInfoAdapter(this.houseListBeanIDList,_mActivity); |
| | | viewBinding.fragmentHouseSrlListRc.setLayoutManager(linearLayout); |
| | | viewBinding.fragmentHouseSrlListRc.setAdapter(houseInfoAdapter); |
| | | |
| | |
| | | MqttRecvClient.getInstance().removeAllTopic(); |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) { |
| | | //进去住宅详情读取逆变器列表成功后通知 |
| | | //进去住宅详情uni读取逆变器列表成功后通知 |
| | | for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList().size(); i++) { |
| | | //String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList().get(i).getGatewayId(); |
| | | //字符串是自己按规则拼接的,里面注册主题时会解析字符串,只拿getGatewayId()值; |