mac
2024-07-02 d7ff801372431e64aee8f68ece4b8532cffb2207
app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java
@@ -31,6 +31,7 @@
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;
@@ -308,6 +309,7 @@
                currentFragmentIndex = 0;
                bottomViewChangeOfStyle();
                showFragment();
                HdlCommonLogic.lowerTagType = LowerTagType.home;
                HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.homepage.toString());
            }
        });
@@ -320,6 +322,7 @@
                currentFragmentIndex = 1;
                bottomViewChangeOfStyle();
                showFragment();
                HdlCommonLogic.lowerTagType = LowerTagType.power_station;
                HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.powerstation.toString());
            }
        });
@@ -332,6 +335,7 @@
                currentFragmentIndex = 2;
                bottomViewChangeOfStyle();
                showFragment();
                HdlCommonLogic.lowerTagType = LowerTagType.message;
                HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.message.toString());
            }
        });
@@ -344,6 +348,7 @@
                currentFragmentIndex = 3;
                bottomViewChangeOfStyle();
                showFragment();
                HdlCommonLogic.lowerTagType = LowerTagType.me;
                HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, HomepageTitleTabSwitch.me.toString());
            }
        });
@@ -361,16 +366,19 @@
    }
    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));
@@ -515,6 +523,30 @@
                        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);
                    }
                }
            }