mac
2023-12-29 27d994f4375f604ba7f49a5ba600882884d73126
app/src/main/java/com/hdl/photovoltaic/ui/message/MessageFragment.java
@@ -67,6 +67,7 @@
                currentIndex = 0;
                initView();
                showFragment();
                postEventBus(MessageFunctionTabSwitch.nascent);
            }
        });
@@ -77,6 +78,7 @@
                currentIndex = 1;
                initView();
                showFragment();
                postEventBus(MessageFunctionTabSwitch.recover);
            }
        });
@@ -88,6 +90,7 @@
                currentIndex = 2;
                initView();
                showFragment();
                postEventBus(MessageFunctionTabSwitch.all);
            }
        });
    }
@@ -116,6 +119,7 @@
            viewBinding.line2V.setVisibility(View.GONE);
            viewBinding.line3V.setVisibility(View.VISIBLE);
        }
    }
    private void initData() {
@@ -130,7 +134,8 @@
        BaseEventBus baseEventBus = new BaseEventBus();
        baseEventBus.setTopic(ConstantManage.message_function_tab_switch);
        baseEventBus.setType(tabSwitch.toString());
        EventBus.getDefault().post(baseEventBus);
        //发送粘性事件(如果不发粘性事件会遇到一个没有加载出来的碎片接收不到信息)
        EventBus.getDefault().postSticky(baseEventBus);
    }
@@ -183,13 +188,6 @@
        //把当前显示的fragment记录下来
        currentFragment = fragmentList.get(currentIndex);
        if (this.currentIndex == 0) {
            postEventBus(MessageFunctionTabSwitch.nascent);
        } else if (this.currentIndex == 1) {
            postEventBus(MessageFunctionTabSwitch.recover);
        } else if (this.currentIndex == 2) {
            postEventBus(MessageFunctionTabSwitch.all);
        }
    }