| | |
| | | |
| | | |
| | | import android.Manifest; |
| | | import android.content.DialogInterface; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | |
| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | setNotificationBarBackgroundColor(CustomColor.white); |
| | | setStatusBarTextColor(); |
| | | setStatusBarTranslucent(); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF333738)); |
| | | //初始化数据 |
| | | initData(); |
| | | //初始化 |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | viewBinding.addPowerStationTv.setOnClickListener(new View.OnClickListener() { |
| | |
| | | } |
| | | |
| | | private void initView() { |
| | | viewBinding.toolbarTopRl.getRoot().setBackgroundColor(getColor(R.color.text_FFECECEC)); |
| | | viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE); |
| | | viewBinding.toolbarTopRl.topLeftIv.setImageResource(R.drawable.back_c); |
| | | viewBinding.toolbarTopRl.topTitleTv.setText(R.string.power_station_selection); |
| | | viewBinding.toolbarTopRl.topMoreBtn.setVisibility(View.VISIBLE); |
| | | viewBinding.toolbarTopRl.topMoreIv.setImageResource(R.drawable.editor_house); |
| | |
| | | dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { |
| | | @Override |
| | | public void Confirm() { |
| | | HdlResidenceLogic.getInstance().switchHouse(houseIdBean); |
| | | HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true); |
| | | dialog.dismiss(); |
| | | JsonObject jsonObject = new JsonObject(); |
| | | jsonObject.addProperty("homeId", houseIdBean.getHomeId()); |
| | |
| | | dialog.dismiss(); |
| | | } |
| | | }); |
| | | |
| | | dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { |
| | | @Override |
| | | public void onDismiss(DialogInterface dialog) { |
| | | //取消之后还原之前状态 |
| | | for (int i = 0; i < houseListBeanIDList.size(); i++) { |
| | | HouseIdBean houseIdBean = houseListBeanIDList.get(i); |
| | | houseIdBean.setState_select(false); |
| | | if (UserConfigManage.getInstance().getHomeId().equals(houseIdBean.getHomeId())) { |
| | | houseIdBean.setState_select(true); |
| | | } |
| | | } |
| | | houseListAdapter.notifyDataSetChanged(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |