فهرست منبع

0.0.46.beta16

kongzue 2 سال پیش
والد
کامیت
4c90a22b6d

+ 16 - 3
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -1,5 +1,7 @@
 package com.kongzue.dialogx.dialogs;
 
+import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
+
 import android.animation.ObjectAnimator;
 import android.animation.ValueAnimator;
 import android.app.Activity;
@@ -9,6 +11,7 @@ import android.graphics.drawable.GradientDrawable;
 import android.os.Handler;
 import android.os.Looper;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.ViewOutlineProvider;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.RelativeLayout;
@@ -164,7 +167,7 @@ public class FullScreenDialog extends BaseDialog {
                 public void onShow() {
                     isShow = true;
                     preShow = false;
-    
+                    
                     lifecycle.setCurrentState(Lifecycle.State.CREATED);
                     onDialogShow();
                     
@@ -190,7 +193,7 @@ public class FullScreenDialog extends BaseDialog {
                         if (onBackPressedListener.onBackPressed(me)) {
                             dismiss();
                         }
-                    }else{
+                    } else {
                         if (isCancelable()) {
                             dismiss();
                         }
@@ -381,7 +384,7 @@ public class FullScreenDialog extends BaseDialog {
                     @Override
                     public void doShowAnim(FullScreenDialog dialog, ObjectRunnable<Float> animProgress) {
                         int customViewHeight = boxCustom.getHeight();
-                        if (customViewHeight == 0) {
+                        if (customViewHeight == 0 || isMatchParentHeightCustomView()) {
                             //实测在 Android 10 中,离屏情况下 View可能无法得到正确高度(恒 0),此时直接按照全屏高度处理
                             //其他版本 Android 未发现此问题
                             showEnterAnim((int) boxRoot.getSafeHeight());
@@ -390,6 +393,16 @@ public class FullScreenDialog extends BaseDialog {
                         }
                     }
                     
+                    private boolean isMatchParentHeightCustomView() {
+                        if (onBindView != null && onBindView.getCustomView() != null) {
+                            ViewGroup.LayoutParams lp = onBindView.getCustomView().getLayoutParams();
+                            if (lp != null) {
+                                return lp.height == MATCH_PARENT;
+                            }
+                        }
+                        return false;
+                    }
+                    
                     @Override
                     public void doExitAnim(FullScreenDialog dialog, ObjectRunnable<Float> animProgress) {
                         long exitAnimDurationTemp = 300;

BIN
app/release/app-release.apk


+ 1 - 1
app/release/output-metadata.json

@@ -11,7 +11,7 @@
       "type": "SINGLE",
       "filters": [],
       "versionCode": 45,
-      "versionName": "0.0.46.beta8",
+      "versionName": "0.0.46.beta15",
       "outputFile": "app-release.apk"
     }
   ]

+ 1 - 1
gradle.properties

@@ -19,5 +19,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.46.beta15
+BUILD_VERSION=0.0.46.beta16
 BUILD_VERSION_INT=45