From afb62b49b79a31ab62a548f9cef672dfc9bae16f Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 09 四月 2025 09:04:38 +0800
Subject: [PATCH] 2025年04月09日09:04:34

---
 app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java b/app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java
index 7e4d36b..8eee042 100644
--- a/app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java
+++ b/app/src/main/java/com/hdl/photovoltaic/base/BaseFragment.java
@@ -3,11 +3,9 @@
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.WindowManager;
 import android.widget.FrameLayout;
 
 import androidx.annotation.NonNull;
@@ -20,8 +18,12 @@
 import com.hdl.photovoltaic.listener.BaseView;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
 import com.hdl.photovoltaic.widget.LoadingDialog;
+import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
+
 
 import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
 
 import java.util.Locale;
 
@@ -47,7 +49,7 @@
             view = inflater.inflate((int) getContentView(), container, false);
         } else if (getContentView() instanceof View) {
             view = (View) getContentView();
-            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+            ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
             view.setLayoutParams(layoutParams);
         } else {
             view = null;
@@ -59,6 +61,7 @@
     @Override
     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
+        view.setClickable(true);
         view.postDelayed(new Runnable() {
             @Override
             public void run() {
@@ -91,7 +94,8 @@
 
     protected void onLazyInitView(Bundle savedInstanceState) {
         onBindView(savedInstanceState);
-//        registerEventBus();
+        //娉ㄥ唽EventBus
+        registerEventBus();
     }
 
 
@@ -102,7 +106,8 @@
         isFirst = true;
         //闅愯棌Loading
         hideLoading();
-//        unregisterEventBus();
+        //娉ㄩ攢EventBus
+        unregisterEventBus();
     }
 
 
@@ -118,10 +123,15 @@
         }
     }
 
-//    @Subscribe(threadMode = ThreadMode.MAIN)
-//    public void onEventMessage(BaseEvent event) {
-//
-//    }
+    /**
+     * 鏀跺埌EventBUs閫氱煡
+     *
+     * @param eventBus 鏁版嵁
+     */
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    public void onEventMessage(BaseEventBus eventBus) {
+
+    }
 
     /**
      * 鏄剧ずView
@@ -165,7 +175,7 @@
      */
     protected LoadingDialog getLoadingDialog() {
         if (loadingDialog == null && _mActivity != null) {
-            loadingDialog = new LoadingDialog(_mActivity, R.style.Custom_AlertDialog);
+            loadingDialog = new LoadingDialog(_mActivity, R.style.Custom_Dialog);
         }
         return loadingDialog;
     }
@@ -174,6 +184,7 @@
      * 寮�濮婰oading
      */
     protected void showLoading() {
+        getLoadingDialog().setText("");
         getLoadingDialog().start();
     }
 

--
Gitblit v1.8.0