| | |
| | | public DeviceUtils(String deviceId){ |
| | | this.deviceId=deviceId; |
| | | } |
| | | private List<DeviceDetailListData.ResponseData.DeviceListBean> datas = new ArrayList<>(); |
| | | private static List<DeviceDetailListData.ResponseData.DeviceListBean> datas = new ArrayList<>(); |
| | | |
| | | private void getDeviceList() { |
| | | DeviceSubAccountListService deviceSubAccountListService = ClassInstanceManager.newInstance().getDeviceSubAccountListService(); |
| | |
| | | } |
| | | |
| | | public void play() { |
| | | if (datas.size() == 0) { |
| | | getDeviceList(); |
| | | } else { |
| | | for (DeviceDetailListData.ResponseData.DeviceListBean deviceListBean : datas) { |
| | | if (deviceListBean.deviceId.equals(deviceId)) { |
| | | if (!deviceListBean.status.equals("online")) { |
| | | return; |
| | | } |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable(MethodConst.ParamConst.deviceDetail, deviceListBean); |
| | | Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class); |
| | | intent.putExtras(bundle); |
| | | HdlToLcUtils.getInstance().getActivity().startActivity(intent); |
| | | for (DeviceDetailListData.ResponseData.DeviceListBean deviceListBean : datas) { |
| | | if (deviceListBean.deviceId.equals(deviceId)) { |
| | | if (!deviceListBean.status.equals("online")) { |
| | | return; |
| | | } |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable(MethodConst.ParamConst.deviceDetail, deviceListBean); |
| | | Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class); |
| | | intent.putExtras(bundle); |
| | | HdlToLcUtils.getInstance().getActivity().startActivity(intent); |
| | | |
| | | return; |
| | | } |
| | | } |
| | | getDeviceList(); |
| | | } |
| | | @Override |
| | | public void DeviceList(DeviceDetailListData.Response responseData) { |
| | |
| | | |
| | | datas.addAll(responseData.data.deviceList); |
| | | |
| | | play(); |
| | | for (DeviceDetailListData.ResponseData.DeviceListBean deviceListBean : datas) { |
| | | if (deviceListBean.deviceId.equals(deviceId)) { |
| | | if (!deviceListBean.status.equals("online")) { |
| | | return; |
| | | } |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable(MethodConst.ParamConst.deviceDetail, deviceListBean); |
| | | Intent intent = new Intent(HdlToLcUtils.getInstance().getActivity(), DeviceOnlineMediaPlayActivity.class); |
| | | intent.putExtras(bundle); |
| | | HdlToLcUtils.getInstance().getActivity().startActivity(intent); |
| | | |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void onError(Throwable throwable) { |