| | |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.ActivityMyPowerStationBinding; |
| | | import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; |
| | | import com.hdl.photovoltaic.enums.LowerTagType; |
| | | import com.hdl.photovoltaic.enums.NetworkType; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatusType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | |
| | | currentFragmentIndex = 0; |
| | | bottomViewChangeOfStyle(); |
| | | showFragment(); |
| | | HdlCommonLogic.lowerTagType = LowerTagType.home; |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.homepage.toString()); |
| | | } |
| | | }); |
| | |
| | | currentFragmentIndex = 1; |
| | | bottomViewChangeOfStyle(); |
| | | showFragment(); |
| | | HdlCommonLogic.lowerTagType = LowerTagType.power_station; |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.powerstation.toString()); |
| | | } |
| | | }); |
| | |
| | | currentFragmentIndex = 2; |
| | | bottomViewChangeOfStyle(); |
| | | showFragment(); |
| | | HdlCommonLogic.lowerTagType = LowerTagType.message; |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.message.toString()); |
| | | } |
| | | }); |
| | |
| | | currentFragmentIndex = 3; |
| | | bottomViewChangeOfStyle(); |
| | | showFragment(); |
| | | HdlCommonLogic.lowerTagType = LowerTagType.me; |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.me.toString()); |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | private void initView() { |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setText(R.string.power_shome_page); |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setText(R.string.summarize); |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setText(R.string.power_station); |
| | | viewBinding.myMessageBottomIl2.titleTv.setText(R.string.message); |
| | | viewBinding.myMessageBottomIl2.titleTv.setText(R.string.alarm); |
| | | viewBinding.myMeBottomIl3.titleTv.setText(R.string.power_station_me); |
| | | this.bottomViewChangeOfStyle(); |
| | | } |
| | | |
| | | /** |
| | | * 底部模块样式改变 |
| | | */ |
| | | private void bottomViewChangeOfStyle() { |
| | | if (this.currentFragmentIndex == 0) { |
| | | //首页界面 |
| | | //概览界面 |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.home_page_selected)); |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setTextColor(getColor(R.color.text_E6000000)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.power_station_unselected)); |
| | |
| | | uniCallBackBaseBean.setData(linkResponse.getData()); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true); |
| | | } else if (linkResponse.getTopic().endsWith("/app/thing/event/appHomeRemoveRefresh/up")) { |
| | | String[] topicArray = linkResponse.getTopic().split("/"); |
| | | //住宅删除通知 |
| | | HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean(); |
| | | uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_home_remove_refresh); |
| | | uniCallBackBaseBean.setData(topicArray[1]); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true); |
| | | } else if (linkResponse.getTopic().endsWith("/app/thing/event/appHomeDebugRefresh/up")) { |
| | | String[] topicArray = linkResponse.getTopic().split("/"); |
| | | //住宅二次调试(授权状态)刷新通知 |
| | | HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean(); |
| | | uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_home_debug_refresh); |
| | | uniCallBackBaseBean.setData(topicArray[1]); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true); |
| | | } else if (linkResponse.getTopic().endsWith("/app/thing/event/appHomeDeliverRefresh/up")) { |
| | | String[] topicArray = linkResponse.getTopic().split("/"); |
| | | //住宅交付状态变更刷新通知 |
| | | HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean(); |
| | | uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_home_delivery_refresh); |
| | | uniCallBackBaseBean.setData(topicArray[1]); |
| | | HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean); |
| | | HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true); |
| | | } |
| | | } |
| | | } |