Quellcode durchsuchen

0.0.47.beta20 update

kongzue vor 2 Jahren
Ursprung
Commit
535b56ca3f

+ 5 - 2
DialogX/src/main/java/com/kongzue/dialogx/impl/DialogFragmentImpl.java

@@ -81,13 +81,16 @@ public class DialogFragmentImpl extends DialogFragment {
                 for (BaseDialog dialog : BaseDialog.getRunningDialogList()) {
                     if (dialog.getOwnActivity() == activity && dialog != baseDialog) {
                         if (!(dialog instanceof NoTouchInterface)) {
-                            Log.e(">>>", "onTouch: "+dialog );
                             dialog.getDialogView().dispatchTouchEvent(event);
                             return true;
                         }
                     }
                 }
-                return activity.dispatchTouchEvent(event);
+                if (baseDialog instanceof NoTouchInterface) {
+                    return activity.dispatchTouchEvent(event);
+                }else{
+                    return true;
+                }
             }
         });
         dialogWindow.setAttributes(lp);

+ 1 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/WindowUtil.java

@@ -80,6 +80,7 @@ public class WindowUtil {
                 FLAG_TRANSLUCENT_NAVIGATION |
                 FLAG_LAYOUT_IN_SCREEN
         ;
+        layoutParams.softInputMode = SOFT_INPUT_ADJUST_RESIZE;
         if (!touchEnable) {
             dialogView.setOnTouchListener(new View.OnTouchListener() {
                 @Override

+ 7 - 3
DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java

@@ -12,6 +12,7 @@ import android.graphics.drawable.Drawable;
 import android.os.Build;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
+import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
@@ -102,7 +103,7 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
 
     @Override
     protected boolean fitSystemWindows(Rect insets) {
-        if (DialogX.useActivityLayoutTranslationNavigationBar || parentDialog.getDialogImplMode() != DialogX.IMPL_MODE.VIEW) {
+        if (!useWindowInsetsAnimation && (DialogX.useActivityLayoutTranslationNavigationBar || parentDialog.getDialogImplMode() != DialogX.IMPL_MODE.VIEW)) {
             paddingView(insets.left, insets.top, insets.right, insets.bottom);
         }
         return super.fitSystemWindows(insets);
@@ -111,7 +112,7 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
     @Override
     public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            if (DialogX.useActivityLayoutTranslationNavigationBar || parentDialog.getDialogImplMode() != DialogX.IMPL_MODE.VIEW) {
+            if (!useWindowInsetsAnimation && (DialogX.useActivityLayoutTranslationNavigationBar || parentDialog.getDialogImplMode() != DialogX.IMPL_MODE.VIEW)) {
                 paddingView(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom());
             }
         }
@@ -176,8 +177,8 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
                             paddingView(windowInsets);
                         }
                     });
-                    initDynamicSafeAreaListener();
                     paddingWindowInsetsByDefault();
+                    initDynamicSafeAreaListener();
                 } else {
                     decorView.getViewTreeObserver().addOnGlobalLayoutListener(decorViewLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
                         @Override
@@ -209,10 +210,13 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
         return list;
     }
 
+    boolean useWindowInsetsAnimation = false;
+
     @RequiresApi(api = Build.VERSION_CODES.KITKAT_WATCH)
     private void initDynamicSafeAreaListener() {
         View decorView = (View) getParent();
         if (decorView != null) {
+            useWindowInsetsAnimation = true;
             ViewCompat.setWindowInsetsAnimationCallback(decorView, new WindowInsetsAnimationCompat.Callback(WindowInsetsAnimationCompat.Callback.DISPATCH_MODE_CONTINUE_ON_SUBTREE) {
 
                 @NonNull

+ 1 - 1
gradle.properties

@@ -19,6 +19,6 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.47.beta19
+BUILD_VERSION=0.0.47.beta20
 BUILD_VERSION_INT=46
 DIALOGX_STYLE_VERSION=5