Sfoglia il codice sorgente

Merge pull request #358 from Matcha-xiaobin/master

修复fullscreendialog不能被推起的问题;
Kongzue 1 anno fa
parent
commit
af409ff081

+ 10 - 4
DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java

@@ -14,7 +14,6 @@ import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
-import android.view.ViewParent;
 import android.view.ViewTreeObserver;
 import android.view.WindowInsets;
 import android.view.inputmethod.InputMethodManager;
@@ -118,6 +117,10 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
                 unsafePlace.right = end;
                 unsafePlace.bottom = bottom;
 
+                if (onSafeInsetsChangeListener != null) {
+                    onSafeInsetsChangeListener.onChange(unsafePlace);
+                }
+
                 //做下判断,如果是底部对话框,则把paddingBottom设为0,改为推起子控件
                 MaxRelativeLayout bkgView = findViewById(R.id.bkg);
                 if (bkgView != null && bkgView.getLayoutParams() instanceof LayoutParams) {
@@ -298,7 +301,8 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
     boolean useWindowInsetsAnimation = false;
 
 
-    private void initDynamicSafeAreaListener() {}
+    private void initDynamicSafeAreaListener() {
+    }
 
     @RequiresApi(api = Build.VERSION_CODES.KITKAT_WATCH)
     private void initDynamicSafeAreaListenerOld() {
@@ -337,7 +341,8 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
         }
     }
 
-    private void getWindowInsetsByDisplayMetrics() {}
+    private void getWindowInsetsByDisplayMetrics() {
+    }
 
     private void getWindowInsetsByDisplayMetricsOld() {
         if (getParentDialog() == null || getParentDialog().getOwnActivity() == null) return;
@@ -439,7 +444,8 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
 
     protected Rect unsafePlace = new Rect();
 
-    private void paddingView(int left, int top, int right, int bottom) {}
+    private void paddingView(int left, int top, int right, int bottom) {
+    }
 
     private void paddingViewOld(int left, int top, int right, int bottom) {
         unsafePlace = new Rect(left, top, right, bottom);