| | |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.ActivityPowerStationsListBinding; |
| | | import com.hdl.photovoltaic.enums.Languages; |
| | | import com.hdl.photovoltaic.enums.ShowErrorMode; |
| | | import com.hdl.photovoltaic.internet.HttpClient; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | |
| | | import com.hdl.photovoltaic.ui.device.ScanActivity; |
| | | import com.hdl.photovoltaic.ui.newC.adapter.HouseListAdapter; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | | import com.hdl.photovoltaic.utils.AppManagerUtils; |
| | | import com.hdl.photovoltaic.utils.PermissionUtils; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.DelayedConfirmationCancelDialog; |
| | |
| | | viewBinding.addPowerStationTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | // 未授权 如果应用程序没有所需的权限,则显示解释说明 |
| | | PermissionExplanationDialog.getInstance().showPortConflictPdDialog(_mActivity, getString(R.string.camera_storage_instructions), getString(R.string.camera_storage_purpose)); |
| | | PermissionUtils.requestPermissionsResultCallback(_mActivity, Manifest.permission.CAMERA, new PermissionUtils.PermissionState() { |
| | |
| | | hideLoading(); |
| | | } |
| | | if (list != null && !list.isEmpty()) { |
| | | if (!comparableList(houseListBeanIDList, list)) { |
| | | //更新缓存 |
| | | HdlResidenceLogic.getInstance().setHouseIdList(list, true); |
| | | if (houseListAdapter != null) { |
| | | //重新获取列表数据 |
| | | initData(); |
| | | refreshDetails(""); |
| | | //更新电站选中状态 |
| | | setSelectState(); |
| | | //更新列表数据 |
| | | houseListAdapter.setList(houseListBeanIDList); |
| | | } |
| | | |
| | | |
| | | // if (!comparableList(houseListBeanIDList, list)) { |
| | | //更新缓存 |
| | | HdlResidenceLogic.getInstance().setHouseIdList(list, true); |
| | | if (houseListAdapter != null) { |
| | | //重新获取列表数据 |
| | | initData(); |
| | | refreshDetails(""); |
| | | //更新电站选中状态 |
| | | setSelectState(); |
| | | //更新列表数据 |
| | | houseListAdapter.setList(houseListBeanIDList); |
| | | } |
| | | // } |
| | | } |
| | | nullDataUpdateUi(list); |
| | | } |
| | |
| | | * @param houseIdBean 选中数据 |
| | | */ |
| | | private void houseSelectionDialog(HouseIdBean houseIdBean) { |
| | | String placeholder = UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.ar) ? "s%" : "%s"; |
| | | ConfirmationCancelDialog dialog = new ConfirmationCancelDialog(this); |
| | | dialog.setTitle(getString(R.string.loading_title_tip)); |
| | | dialog.setContent(getString(R.string.switch_power_station).replace("%s", "\"" + houseIdBean.getHomeName() + "\"")); |
| | | dialog.setContent(getString(R.string.switch_power_station).replace(placeholder, "\"" + houseIdBean.getHomeName() + "\"")); |
| | | dialog.show(); |
| | | dialog.isHideTitle(true); |
| | | dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { |