浏览代码

0.0.49.beta19
- 尝试修复 #387 #388 bug

0.0.49.beta18
- 尝试修复 #370 bug

0.0.49.beta17
- 修复<=API29的部分设备上存在的非安全区不回调的问题;
- 合并 #377 的 PR
- 其他问题修复

0.0.49.beta14 ready
- 修复 PopNotification 存在的显示位置错误问题;
- 修复 InputDialog 点击背景无法关闭的问题;
- 修复 FullScreenDialog 滑动错位问题;
- 修复 OnBindView 回调 view 不为 customView 的问题;

0.0.49.beta13
- FullScreenDialog 增加 maskColor 设置;
- 修复 IOS 主题下 MessageDialog 使用 build() 构建模式时无法设置背景颜色的问题;
- 修复 CustomDialog 设置 FullScreen 属性无效的问题;

0.0.49.beta12 ready
- 尝试修正 padding属性设置错误的bug(via @Matcha-xiaobin #356);
- 修复了 PopTip 在频繁弹出时某些已经显示的 PopTip 可能存在的导致异常显示在屏幕顶部的问题;
- BottomDialog 增加 setScrollableWhenContentLargeThanVisibleRange(boolean) 允许将自定义布局添加到对话框本身存在的 ScrollView 外,请注意此方法将会使自定义布局添加到 Title Text、Content(Message Text)之间;

0.0.49.beta11
- 修复部分已知问题;

0.0.49.beta10
- 完善 OnBindView 内部逻辑,当dialog和view相同时不重复执行onBind事件;
- WaitDialog新增onShow(DialogXRunnable)和onDismiss(DialogXRunnable);
- 尝试修复可能存在的问题;

0.0.49.beta9
- 菜单布局结构优化;

0.0.49.beta8
- 对话框内的 dialogView 引用进行了处理,以及 PopTip 的 baseView,减少在低版本安卓系统上出现内存泄漏的可能性
- FullScreenDialog 新增了方法 hideActivityContentView(boolean) 用于设置是否在显示 FullScreenDialog 时不对 activity 的界面内容进行渲染,这将提升一定的性能,此方法只可以在使用 build 方法构建且在执行show方法之前使用,但这将引发一些问题,例如输入法弹出时 FullScreenDialog 无法上浮等;
- 其他问题修复;

0.0.49.beta6
- 对 BottomMenu 的 setOkButton、setCancelButton、setOtherButton 提供了单独的 OnBottomMenuButtonClickListener 参数接口,可直接提供 BottomMenu 参数的 onClick 回调事件;
- BottomDialog/BottomMenu 新增 set/get OkTextInfo 和 OtherTextInfo 方法;
- 修复 DialogXBaseRelativeLayout 可能存在的嵌套循环调用 requestFocus() 方法的问题;
- 修复关于 WaitDialog 设置背景颜色不生效的问题;

0.0.49.beta5 ready
- ActivityScreenShotImageView 增加静态方法 useHardwareRenderingMode,开启可使用硬件加速渲染模式;
- 修复部分系统下 ActivityScreenShotImageView 在执行回收时触发的“Software rendering doesn't support hardware bitmaps.”异常;
- 其他问题修复;

0.0.49.beta4 ready
- 修复部分系统下 BlurRelativeLayout 或 BlurRelativeLayout 在执行回收时触发的“Calling RS with no Context active.”异常;
- ActivityScreenShotImageView 截图方案更新;

0.0.49.beta4 ready
- 修复在部分设备上由 DialogXBaseRelativeLayout 引发的 StackOverflowError,此问题猜测跟特定版本系统固件存在问题有关;

0.0.49.beta3
- 修复 ActivityScreenShotImageView 可能引发的“Software rendering doesn’t support hardware bitmaps” 异常;
- 修复 BottomDialog/FullScreenDialog 的滑动事件在内部存在 ScrollController 时,若触摸位置处于 ScrollController 布局外无法滑动对话框的问题;

0.0.49.beta2
- InputInfo新增方法:`getInputFilters()`、`setInputFilters(InputFilter[] inputFilters)`、`addInputFilter(InputFilter inputFilter)` 和 `removeInputFilter(InputFilter inputFilter)`(issues:332);
- 尝试性修复 DialogFragment 模式实现下的 WaitDialog 内存泄漏问题(issues:334);
- 修复关于DialogFragmentImpl引发的空指针问题此问题(issues:335);

0.0.49.beta1
- 修复 BlurRelativeLayout 和 BlurLinearLayout 在 iOS 主题下使用 DialogFragment 模式时存在的渲染宽度和高度 <=0 导致的异常(issues:324);
- 修复 IOS 主题下可能存在的 `RSInvalidStateException: Calling RS with no Context active` 异常问题(issues:327);
- 修复可能存在的高频启关对话框过程中,因UI未完成构建被关闭引发的空指针异常(issues:331);

Kongzue 1 年之前
父节点
当前提交
e679808bde

+ 4 - 6
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -301,11 +301,7 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
             if (customViewHeight == 0 || isMatchParentHeightCustomView()) {
                 customViewHeight = ((int) boxRoot.getSafeHeight());
             }
-            if (getMaxHeight() != 0) {
-                enterY = Math.min(getMaxHeight() - boxRoot.getUnsafePlace().bottom, customViewHeight);
-            } else {
-                enterY = customViewHeight;
-            }
+            enterY = customViewHeight;
         }
 
         @Override
@@ -438,8 +434,10 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
                 int thisVal = (int) animation.getAnimatedValue();
                 bkg.setY(thisVal);
 
+                log("anim: " +thisVal);
+
                 makeEnterY();
-                float newBkgEnterAimY = boxRoot.getSafeHeight() - enterY - boxRoot.getUnsafePlace().bottom - boxRoot.getUnsafePlace().top;
+                float newBkgEnterAimY = boxRoot.getSafeHeight() - enterY;
                 if (newBkgEnterAimY < 0) newBkgEnterAimY = 0;
                 if (newBkgEnterAimY != bkgEnterAimY) {
                     bkgEnterAimY = newBkgEnterAimY;

+ 3 - 0
DialogX/src/main/java/com/kongzue/dialogx/impl/DialogFragmentImpl.java

@@ -37,6 +37,9 @@ import java.lang.ref.WeakReference;
  */
 public class DialogFragmentImpl extends DialogFragment {
 
+    public DialogFragmentImpl() {
+    }
+
     private View dialogView;
     private BaseDialog baseDialog;
 

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

@@ -128,10 +128,10 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
                         }
                     }
                     if (systemBarInsets != null) {
-                        unsafePlace.left = systemBarInsets.left;
-                        unsafePlace.top = systemBarInsets.top;
-                        unsafePlace.right = systemBarInsets.right;
-                        unsafePlace.bottom = systemBarInsets.bottom;
+                        unsafePlace.left = Math.max( systemBarInsets.left,start);
+                        unsafePlace.top = Math.max(systemBarInsets.top,top);
+                        unsafePlace.right = Math.max(systemBarInsets.right,end);
+                        unsafePlace.bottom = Math.max(systemBarInsets.bottom,bottom);
                     } else {
                         unsafePlace.left = start;
                         unsafePlace.top = top;
@@ -165,7 +165,7 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
     }
 
     public void setUnsafePadding(@Px int start, @Px int top, @Px int end, @Px int bottom) {
-        log("KONGZUE DEBUG DIALOGX: getParentDialog()=" + getParentDialog() + " t=" + top + " b=" + bottom);
+        log("KONGZUE DEBUG DIALOGX: setUnsafePadding=" + getParentDialog() + " t=" + top + " b=" + bottom);
         if (getParentDialog() instanceof DialogXBaseBottomDialog) {
             log("  KONGZUE DEBUG DIALOGX: isDialogXBaseBottomDialog");
             ViewGroup bkgView = findViewById(R.id.bkg);

+ 39 - 39
DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java

@@ -27,7 +27,7 @@ import static android.view.View.MeasureSpec.EXACTLY;
  * @createTime: 2019/9/24 17:34
  */
 public class MaxRelativeLayout extends RelativeLayout {
-    
+
     private int maxWidth;
     private int maxHeight;
     private int minWidth;
@@ -35,24 +35,24 @@ public class MaxRelativeLayout extends RelativeLayout {
     private boolean lockWidth;
     private boolean interceptTouch = true;
     private View contentView;
-    
+
     public MaxRelativeLayout(Context context) {
         super(context);
         init(context, null);
     }
-    
+
     public MaxRelativeLayout(Context context, AttributeSet attrs) {
         super(context, attrs);
         init(context, attrs);
     }
-    
+
     public MaxRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
         init(context, attrs);
     }
-    
+
     private float startAnimValue = 0, endAnimValue = 0;
-    
+
     private void init(Context context, AttributeSet attrs) {
         if (attrs != null) {
             TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DialogXMaxLayout);
@@ -62,12 +62,12 @@ public class MaxRelativeLayout extends RelativeLayout {
             minHeight = a.getDimensionPixelSize(R.styleable.DialogXMaxLayout_minLayoutHeight, 0);
             lockWidth = a.getBoolean(R.styleable.DialogXMaxLayout_lockWidth, false);
             interceptTouch = a.getBoolean(R.styleable.DialogXMaxLayout_interceptTouch, true);
-            
+
             a.recycle();
         }
         minWidth = minWidth == 0 ? getMinimumWidth() : minWidth;
         minHeight = minHeight == 0 ? getMinimumHeight() : minHeight;
-        
+
         if (!isInEditMode()) {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                 animate().setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@@ -81,14 +81,14 @@ public class MaxRelativeLayout extends RelativeLayout {
             }
         }
     }
-    
+
     private ScrollView childScrollView;
-    
+
     public MaxRelativeLayout setMaxHeight(int maxHeight) {
         if (maxHeight > 0) this.maxHeight = maxHeight;
         return this;
     }
-    
+
     public MaxRelativeLayout setMaxWidth(int maxWidth) {
         if (maxWidth > 0) this.maxWidth = maxWidth;
         return this;
@@ -104,15 +104,15 @@ public class MaxRelativeLayout extends RelativeLayout {
     }
 
     private int preWidth = -1;
-    
+
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         int heightMode = MeasureSpec.getMode(heightMeasureSpec);
         int widthMode = MeasureSpec.getMode(widthMeasureSpec);
-        
+
         int heightSize = MeasureSpec.getSize(heightMeasureSpec);
         int widthSize = MeasureSpec.getSize(widthMeasureSpec);
-        
+
         if (preWidth == -1 && widthSize != 0) {
             preWidth = widthSize;
         }
@@ -120,10 +120,10 @@ public class MaxRelativeLayout extends RelativeLayout {
             maxWidth = Math.min(maxWidth, Math.min(widthSize, preWidth));
         }
         if (heightSize > maxHeight && maxHeight != 0) {
-            heightSize = maxHeight;
+            heightSize = maxHeight + getPaddingBottom() + getPaddingTop();
         }
         if (widthSize > maxWidth && maxWidth != 0) {
-            widthSize = maxWidth;
+            widthSize = maxWidth + getPaddingLeft() + getPaddingRight();
         }
         View blurView = findViewWithTag("blurView");
         View contentView = this.contentView == null ? findViewWithoutTag("blurView") : this.contentView;
@@ -132,7 +132,7 @@ public class MaxRelativeLayout extends RelativeLayout {
             int heightTemp = contentView.getMeasuredHeight() == 0 ? getMeasuredHeight() : contentView.getMeasuredHeight();
             if (widthTemp < minWidth) widthTemp = minWidth;
             if (heightTemp < minHeight) heightTemp = minHeight;
-            
+
             LayoutParams lp = (LayoutParams) blurView.getLayoutParams();
             lp.addRule(RelativeLayout.CENTER_IN_PARENT);
             lp.width = widthTemp;
@@ -146,14 +146,14 @@ public class MaxRelativeLayout extends RelativeLayout {
                 blurView.setLayoutParams(lp);
             }
         }
-        
+
         int maxHeightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, heightMode);
         int maxWidthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, widthMode);
         super.onMeasure(maxWidthMeasureSpec, maxHeightMeasureSpec);
-        
+
         childScrollView = findViewById(R.id.scrollView);
     }
-    
+
     private View findViewWithoutTag(String tag) {
         for (int i = 0; i < getChildCount(); i++) {
             if (!tag.equals(getChildAt(i).getTag())) {
@@ -162,7 +162,7 @@ public class MaxRelativeLayout extends RelativeLayout {
         }
         return null;
     }
-    
+
     @Deprecated
     public boolean isChildScrollViewCanScroll() {
         if (childScrollView == null) return false;
@@ -176,31 +176,31 @@ public class MaxRelativeLayout extends RelativeLayout {
         }
         return false;
     }
-    
+
     public int dip2px(float dpValue) {
         final float scale = getResources().getDisplayMetrics().density;
         return (int) (dpValue * scale + 0.5f);
     }
-    
+
     public boolean isLockWidth() {
         return lockWidth;
     }
-    
+
     public MaxRelativeLayout setLockWidth(boolean lockWidth) {
         this.lockWidth = lockWidth;
         return this;
     }
-    
+
     private OnYChanged onYChangedListener;
-    
+
     int navBarHeight;
     Paint navBarPaint;
-    
+
     public void setNavBarHeight(int height) {
         navBarHeight = height;
         invalidate();
     }
-    
+
     @Override
     protected void onDraw(Canvas canvas) {
         super.onDraw(canvas);
@@ -212,44 +212,44 @@ public class MaxRelativeLayout extends RelativeLayout {
             canvas.drawRect(0, getHeight() - navBarHeight, getWidth(), getHeight(), navBarPaint);
         }
     }
-    
+
     public void setContentView(View contentView) {
         this.contentView = contentView;
     }
-    
+
     public interface OnYChanged {
         void y(float y);
     }
-    
+
     @Override
     public void setY(float y) {
         super.setY(y);
     }
-    
+
     public OnYChanged getOnYChanged() {
         return onYChangedListener;
     }
-    
+
     public MaxRelativeLayout setOnYChanged(OnYChanged onYChanged) {
         this.onYChangedListener = onYChanged;
         return this;
     }
-    
+
     @Override
     public void setTranslationY(float translationY) {
         super.setTranslationY(translationY);
         if (onYChangedListener != null) onYChangedListener.y(translationY);
     }
-    
+
     private OnTouchListener onTouchListener;
-    
+
     @Override
     public void setOnTouchListener(OnTouchListener l) {
         onTouchListener = l;
     }
-    
+
     boolean reInterceptTouch;
-    
+
     @Override
     public boolean dispatchTouchEvent(MotionEvent ev) {
         if (onTouchListener != null) {
@@ -257,7 +257,7 @@ public class MaxRelativeLayout extends RelativeLayout {
         }
         return super.dispatchTouchEvent(ev);
     }
-    
+
     @Override
     public boolean onInterceptTouchEvent(MotionEvent ev) {
         return reInterceptTouch;

+ 1 - 1
gradle.properties

@@ -19,7 +19,7 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.49.beta18
+BUILD_VERSION=0.0.49.beta19
 BUILD_VERSION_INT=48
 DIALOGX_STYLE_VERSION=5
 android.nonTransitiveRClass=true