Browse Source

0.0.41.beta15

kongzue 3 years ago
parent
commit
5129d68c38
32 changed files with 158 additions and 378 deletions
  1. 4 0
      .idea/misc.xml
  2. 1 1
      DialogX/build.gradle
  3. 33 5
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java
  4. 3 1
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java
  5. 3 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java
  6. 33 14
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java
  7. 28 14
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java
  8. 3 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java
  9. 2 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java
  10. 3 50
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnBindView.java
  11. 0 4
      DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java
  12. 8 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/ActivityScreenShotImageView.java
  13. 11 1
      DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java
  14. 0 1
      DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml
  15. 0 1
      DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml
  16. 1 2
      DialogX/src/main/res/layout/layout_dialogx_fullscreen.xml
  17. 1 2
      DialogX/src/main/res/layout/layout_dialogx_fullscreen_dark.xml
  18. 0 50
      DialogXIOSStyle/build.gradle
  19. 2 2
      DialogXIOSStyle/src/main/res/layout/layout_dialogx_bottom_ios.xml
  20. 2 2
      DialogXIOSStyle/src/main/res/layout/layout_dialogx_bottom_ios_dark.xml
  21. 1 1
      DialogXInterface/build.gradle
  22. 0 50
      DialogXKongzueStyle/build.gradle
  23. 2 2
      DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue.xml
  24. 2 2
      DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue_dark.xml
  25. 0 50
      DialogXMIUIStyle/build.gradle
  26. 2 2
      DialogXMIUIStyle/src/main/res/layout/layout_dialogx_bottom_miui.xml
  27. 2 2
      DialogXMIUIStyle/src/main/res/layout/layout_dialogx_bottom_miui_dark.xml
  28. BIN
      app/release/app-release.apk
  29. 1 1
      app/release/output-metadata.json
  30. 9 15
      app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java
  31. 1 1
      gradle.properties
  32. 0 102
      publish-mavencentral.gradle

+ 4 - 0
.idea/misc.xml

@@ -4,6 +4,9 @@
     <option name="filePathToZoomLevelMap">
       <map>
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml" value="0.36944444444444446" />
+        <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml" value="0.5411458333333333" />
+        <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_fullscreen.xml" value="0.5411458333333333" />
+        <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_fullscreen_dark.xml" value="0.5411458333333333" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/drawable/ios_edit_box_bkg.xml" value="0.425" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/drawable/rect_ios_edit_box_bkg_focus.xml" value="0.425" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/layout/activity_app_compat_test.xml" value="0.5328205128205128" />
@@ -13,6 +16,7 @@
         <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/layout/layout_custom_scrollview.xml" value="0.5411458333333333" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/layout/layout_custom_view.xml" value="0.5328205128205128" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/layout/layout_full_login.xml" value="0.3824074074074074" />
+        <entry key="..\:/WorkSpace/Android/DialogXDemo/app/src/main/res/layout/layout_full_webview.xml" value="0.5411458333333333" />
       </map>
     </option>
   </component>

+ 1 - 1
DialogX/build.gradle

@@ -30,7 +30,7 @@ artifacts {
     archives sourcesJar
 }
 dependencies {
-    implementation 'androidx.appcompat:appcompat:1.2.0+'
+    compileOnly 'androidx.appcompat:appcompat:1.2.0+'
     compileOnly files('libs\\androidx-rs.jar')
     api files('libs\\DialogXInterface.jar')
 }

+ 33 - 5
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -2,6 +2,7 @@ package com.kongzue.dialogx.dialogs;
 
 import android.animation.Animator;
 import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
 import android.app.Activity;
 import android.content.res.Configuration;
 import android.os.Handler;
@@ -40,8 +41,6 @@ import com.kongzue.dialogx.util.views.BlurView;
 import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
 import com.kongzue.dialogx.util.views.MaxRelativeLayout;
 
-import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK;
-
 /**
  * @author: Kongzue
  * @github: https://github.com/kongzue/
@@ -338,6 +337,9 @@ public class BottomDialog extends BaseDialog {
                 public void onDismiss() {
                     isShow = false;
                     getDialogLifecycleCallback().onDismiss(me);
+                    dialogImpl = null;
+                    bottomDialogTouchEventInterceptor = null;
+                    System.gc();
                 }
             });
             
@@ -420,7 +422,6 @@ public class BottomDialog extends BaseDialog {
                      * 其他情况不适用,请参考 onContentViewLayoutChangeListener 的代码实现。
                      */
                     if (style.overrideBottomDialogRes() == null || !style.overrideBottomDialogRes().touchSlide()) {
-                        //bkg.setY(getRootFrameLayout().getMeasuredHeight());
                         Animation enterAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_dialogx_bottom_enter);
                         enterAnimDurationTemp = enterAnim.getDuration();
                         if (overrideEnterDuration >= 0) {
@@ -435,6 +436,17 @@ public class BottomDialog extends BaseDialog {
                         bkg.setY(bkgEnterAimY);
                         bkg.startAnimation(enterAnim);
                     }
+                    
+                    ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
+                    bkgAlpha.setDuration(enterAnimDurationTemp);
+                    bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                        @Override
+                        public void onAnimationUpdate(ValueAnimator animation) {
+                            float value = (float) animation.getAnimatedValue();
+                            boxRoot.setBkgAlpha(value);
+                        }
+                    });
+                    bkgAlpha.start();
                 }
             });
         }
@@ -467,6 +479,7 @@ public class BottomDialog extends BaseDialog {
                             }
                             ObjectAnimator keepBottomAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), bkgEnterAimY);
                             keepBottomAnim.setDuration(enterAnimDurationTemp);
+                            keepBottomAnim.setAutoCancel(true);
                             keepBottomAnim.setInterpolator(new DecelerateInterpolator(2f));
                             keepBottomAnim.start();
                         } else {
@@ -484,6 +497,7 @@ public class BottomDialog extends BaseDialog {
                                         enterAnimDurationTemp = enterAnimDuration;
                                     }
                                     enterAnim.setDuration(enterAnimDurationTemp);
+                                    enterAnim.setAutoCancel(true);
                                     enterAnim.setInterpolator(new DecelerateInterpolator(2f));
                                     enterAnim.start();
                                 }
@@ -576,10 +590,10 @@ public class BottomDialog extends BaseDialog {
             if (v != null) v.setEnabled(false);
             if (getContext() == null) return;
             
-            if (boxContent != null)
+            if (boxContent != null) {
                 boxContent.getViewTreeObserver().removeOnGlobalLayoutListener(onContentViewLayoutChangeListener);
+            }
             
-            ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), boxBkg.getHeight());
             long exitAnimDurationTemp = 300;
             if (overrideExitDuration >= 0) {
                 exitAnimDurationTemp = overrideExitDuration;
@@ -587,9 +601,22 @@ public class BottomDialog extends BaseDialog {
             if (exitAnimDuration >= 0) {
                 exitAnimDurationTemp = exitAnimDuration;
             }
+            
+            ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), boxBkg.getHeight());
             exitAnim.setDuration(exitAnimDurationTemp);
             exitAnim.start();
             
+            ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1f, 0f);
+            bkgAlpha.setDuration(exitAnimDurationTemp);
+            bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                @Override
+                public void onAnimationUpdate(ValueAnimator animation) {
+                    float value = (float) animation.getAnimatedValue();
+                    boxRoot.setBkgAlpha(value);
+                }
+            });
+            bkgAlpha.start();
+            
             new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                 @Override
                 public void run() {
@@ -620,6 +647,7 @@ public class BottomDialog extends BaseDialog {
     }
     
     public void refreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {

+ 3 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java

@@ -597,6 +597,7 @@ public class BottomMenu extends BottomDialog {
     
     @Override
     public void refreshUI() {
+        if (!isShow) return;
         if (listView != null) {
             if (menuListAdapter == null) {
                 menuListAdapter = new NormalMenuArrayAdapter(me, getContext(), menuList);
@@ -614,7 +615,8 @@ public class BottomMenu extends BottomDialog {
         super.refreshUI();
     }
     
-    public void preRefreshUI(){
+    public void preRefreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {

+ 3 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java

@@ -138,6 +138,8 @@ public class CustomDialog extends BaseDialog {
                 public void onDismiss() {
                     isShow = false;
                     getDialogLifecycleCallback().onDismiss(me);
+                    dialogImpl = null;
+                    System.gc();
                 }
             });
             
@@ -320,6 +322,7 @@ public class CustomDialog extends BaseDialog {
     }
     
     public void refreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {

+ 33 - 14
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -2,6 +2,7 @@ package com.kongzue.dialogx.dialogs;
 
 import android.animation.Animator;
 import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
 import android.app.Activity;
 import android.content.res.Configuration;
 import android.graphics.Rect;
@@ -146,6 +147,9 @@ public class FullScreenDialog extends BaseDialog {
                 public void onDismiss() {
                     isShow = false;
                     getDialogLifecycleCallback().onDismiss(me);
+                    fullScreenDialogTouchEventInterceptor = null;
+                    dialogImpl = null;
+                    System.gc();
                 }
             });
             
@@ -172,6 +176,7 @@ public class FullScreenDialog extends BaseDialog {
             if (enterAnimDuration >= 0) {
                 enterAnimDurationTemp = enterAnimDuration;
             }
+            boxRoot.setBkgAlpha(0f);
             
             bkg.setY(boxRoot.getHeight());
             boxRoot.post(new Runnable() {
@@ -179,16 +184,23 @@ public class FullScreenDialog extends BaseDialog {
                 public void run() {
                     bkgEnterAimY = boxRoot.getSafeHeight() - boxCustom.getHeight();
                     if (bkgEnterAimY < 0) bkgEnterAimY = 0;
-                    boxRoot.animate()
-                            .setDuration(enterAnimDurationTemp)
-                            .alpha(1f)
-                            .setInterpolator(new DecelerateInterpolator())
-                            .setListener(null);
                     
-                    ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", boxRoot.getHeight(), bkgEnterAimY);
-                    exitAnim.setDuration(enterAnimDurationTemp);
-                    exitAnim.start();
+                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", boxRoot.getHeight(), bkgEnterAimY);
+                    enterAnim.setDuration(enterAnimDurationTemp);
+                    enterAnim.setInterpolator(new DecelerateInterpolator());
+                    enterAnim.start();
                     bkg.setVisibility(View.VISIBLE);
+                    
+                    ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
+                    bkgAlpha.setDuration(enterAnimDurationTemp);
+                    bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                        @Override
+                        public void onAnimationUpdate(ValueAnimator animation) {
+                            float value = (float) animation.getAnimatedValue();
+                            boxRoot.setBkgAlpha(value);
+                        }
+                    });
+                    bkgAlpha.start();
                 }
             });
             
@@ -236,12 +248,7 @@ public class FullScreenDialog extends BaseDialog {
             }
             
             if (onBindView != null) {
-                onBindView.setPrivateRunnable(new Runnable() {
-                    @Override
-                    public void run() {
-                        onBindView.bindParent(boxCustom, me);
-                    }
-                });
+                onBindView.bindParent(boxCustom, me);
             }
             
             if (hideZoomBackground) {
@@ -272,6 +279,17 @@ public class FullScreenDialog extends BaseDialog {
             exitAnim.setDuration(exitAnimDurationTemp);
             exitAnim.start();
             
+            ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1f, 0f);
+            bkgAlpha.setDuration(exitAnimDurationTemp);
+            bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                @Override
+                public void onAnimationUpdate(ValueAnimator animation) {
+                    float value = (float) animation.getAnimatedValue();
+                    boxRoot.setBkgAlpha(value);
+                }
+            });
+            bkgAlpha.start();
+            
             new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                 @Override
                 public void run() {
@@ -305,6 +323,7 @@ public class FullScreenDialog extends BaseDialog {
     }
     
     public void refreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {

+ 28 - 14
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -1,5 +1,6 @@
 package com.kongzue.dialogx.dialogs;
 
+import android.animation.ValueAnimator;
 import android.app.Activity;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -230,6 +231,7 @@ public class MessageDialog extends BaseDialog {
     }
     
     public void refreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {
@@ -290,12 +292,12 @@ public class MessageDialog extends BaseDialog {
             
             txtDialogTip.setMovementMethod(LinkMovementMethod.getInstance());
             
+            boxRoot.setBkgAlpha(0f);
             boxRoot.setParentDialog(me);
             boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
                 @Override
                 public void onShow() {
                     isShow = true;
-                    boxRoot.setAlpha(0f);
                     int enterAnimResId = style.enterAnimResId() == 0 ? R.anim.anim_dialogx_default_enter : style.enterAnimResId();
                     if (overrideEnterAnimRes != 0) {
                         enterAnimResId = overrideEnterAnimRes;
@@ -315,11 +317,16 @@ public class MessageDialog extends BaseDialog {
                     enterAnim.setInterpolator(new DecelerateInterpolator());
                     bkg.startAnimation(enterAnim);
                     
-                    boxRoot.animate()
-                            .setDuration(enterAnimDurationTemp)
-                            .alpha(1f)
-                            .setInterpolator(new DecelerateInterpolator())
-                            .setListener(null);
+                    ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
+                    bkgAlpha.setDuration(enterAnimDurationTemp);
+                    bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                        @Override
+                        public void onAnimationUpdate(ValueAnimator animation) {
+                            float value = (float) animation.getAnimatedValue();
+                            boxRoot.setBkgAlpha(value);
+                        }
+                    });
+                    bkgAlpha.start();
                     
                     getDialogLifecycleCallback().onShow(me);
                     
@@ -346,7 +353,7 @@ public class MessageDialog extends BaseDialog {
                                 if (txtInput == null) return;
                                 txtInput.requestFocus();
                                 txtInput.setFocusableInTouchMode(true);
-                                imeShow(txtInput,true);
+                                imeShow(txtInput, true);
                                 txtInput.setSelection(txtInput.getText().length());
                                 if (inputInfo != null && inputInfo.isSelectAllText()) {
                                     txtInput.selectAll();
@@ -366,6 +373,8 @@ public class MessageDialog extends BaseDialog {
                 public void onDismiss() {
                     isShow = false;
                     getDialogLifecycleCallback().onDismiss(me);
+                    dialogView = null;
+                    System.gc();
                 }
             });
             
@@ -386,7 +395,7 @@ public class MessageDialog extends BaseDialog {
                 @Override
                 public void onClick(View v) {
                     if (txtInput != null) {
-                        imeShow(txtInput,false);
+                        imeShow(txtInput, false);
                     }
                     if (okButtonClickListener != null) {
                         if (okButtonClickListener instanceof OnInputDialogButtonClickListener) {
@@ -408,7 +417,7 @@ public class MessageDialog extends BaseDialog {
                 @Override
                 public void onClick(View v) {
                     if (txtInput != null) {
-                        imeShow(txtInput,false);
+                        imeShow(txtInput, false);
                     }
                     if (cancelButtonClickListener != null) {
                         if (cancelButtonClickListener instanceof OnInputDialogButtonClickListener) {
@@ -430,7 +439,7 @@ public class MessageDialog extends BaseDialog {
                 @Override
                 public void onClick(View v) {
                     if (txtInput != null) {
-                        imeShow(txtInput,false);
+                        imeShow(txtInput, false);
                     }
                     if (otherButtonClickListener != null) {
                         if (otherButtonClickListener instanceof OnInputDialogButtonClickListener) {
@@ -669,10 +678,15 @@ public class MessageDialog extends BaseDialog {
             exitAnim.setDuration(exitAnimDurationTemp);
             bkg.startAnimation(exitAnim);
             
-            boxRoot.animate()
-                    .alpha(0f)
-                    .setInterpolator(new AccelerateInterpolator())
-                    .setDuration(exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
+            ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1f, 0f);
+            bkgAlpha.setDuration(exitAnimDurationTemp);
+            bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                @Override
+                public void onAnimationUpdate(ValueAnimator animation) {
+                    float value = (float) animation.getAnimatedValue();
+                    boxRoot.setBkgAlpha(value);
+                }
+            });
             
             new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                 @Override

+ 3 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java

@@ -450,6 +450,8 @@ public class PopTip extends BaseDialog {
                     if (popTipList != null) popTipList.remove(PopTip.this);
                     isShow = false;
                     getDialogLifecycleCallback().onDismiss(me);
+                    dialogImpl = null;
+                    System.gc();
                 }
             });
             
@@ -638,6 +640,7 @@ public class PopTip extends BaseDialog {
     }
     
     public void refreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {

+ 2 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java

@@ -351,6 +351,7 @@ public class WaitDialog extends BaseDialog {
                     dialogView = null;
                     me.clear();
                     me = null;
+                    System.gc();
                 }
             });
             
@@ -537,6 +538,7 @@ public class WaitDialog extends BaseDialog {
     }
     
     public void refreshUI() {
+        if (!isShow) return;
         runOnMain(new Runnable() {
             @Override
             public void run() {

+ 3 - 50
DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnBindView.java

@@ -1,6 +1,5 @@
 package com.kongzue.dialogx.interfaces;
 
-import android.os.Looper;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -9,6 +8,7 @@ import android.widget.RelativeLayout;
 import com.kongzue.dialogx.DialogX;
 
 import static com.kongzue.dialogx.DialogX.ERROR_INIT_TIPS;
+import static com.kongzue.dialogx.interfaces.BaseDialog.log;
 
 /**
  * @author: Kongzue
@@ -21,45 +21,14 @@ public abstract class OnBindView<D> {
     
     int layoutResId;
     View customView;
-    Runnable privateRunnable;
     
-    public OnBindView(int resId) {
-        createView(resId, false);
-    }
-    
-    public OnBindView(int resId, boolean async) {
-        if (async) {
-            new Thread() {
-                @Override
-                public void run() {
-                    createView(resId, true);
-                }
-            }.start();
-        } else {
-            createView(resId, false);
-        }
-    }
-    
-    public void createView(int resId, boolean async) {
+    public OnBindView(int layoutResId) {
         if (BaseDialog.getContext() == null) {
             DialogX.error(ERROR_INIT_TIPS);
             return;
         }
-        layoutResId = resId;
+        this.layoutResId = layoutResId;
         customView = LayoutInflater.from(BaseDialog.getContext()).inflate(layoutResId, new RelativeLayout(BaseDialog.getContext()), false);
-    
-        runSuccessRunnable(async, createViewSuccessRunnable());
-        runSuccessRunnable(async, privateRunnable);
-    }
-    
-    private void runSuccessRunnable(boolean async, Runnable runnable) {
-        if (runnable != null) {
-            if (async) {
-                BaseDialog.runOnMain(runnable);
-            } else {
-                runnable.run();
-            }
-        }
     }
     
     public OnBindView(View customView) {
@@ -126,20 +95,4 @@ public abstract class OnBindView<D> {
         onBind((D) dialog, getCustomView());
         return this;
     }
-    
-    public Runnable createViewSuccessRunnable() {
-        return null;
-    }
-    
-    /**
-     * @hide 内部方法,请勿使用
-     */
-    public OnBindView<D> setPrivateRunnable(Runnable privateRunnable) {
-        if (customView != null) {
-            runSuccessRunnable(false, privateRunnable);
-        } else {
-            this.privateRunnable = privateRunnable;
-        }
-        return this;
-    }
 }

+ 0 - 4
DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java

@@ -75,11 +75,7 @@ public class BottomDialogTouchEventInterceptor {
                         case MotionEvent.ACTION_MOVE:
                             if (isBkgTouched) {
                                 float aimY = impl.bkg.getY() + event.getY() - bkgTouchDownY;
-                                //Log.e(">>>", "isCanScroll: "+impl.scrollView.isCanScroll() );
                                 if (impl.scrollView.isCanScroll()) {
-//                                    Log.e(">>>", "impl.bkg.getY(): "+impl.bkg.getY());
-//                                    Log.e(">>>", "deltaY(): "+(event.getY() - bkgTouchDownY));
-                                    Log.e(">>>", "impl.scrollView.getScrollDistance(): "+impl.scrollView.getScrollDistance());
                                     if (aimY > 0) {
                                         if (impl.scrollView.getScrollDistance() == 0) {
                                             if (impl.scrollView instanceof ScrollController) {

+ 8 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/ActivityScreenShotImageView.java

@@ -3,6 +3,7 @@ package com.kongzue.dialogx.util.views;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
+import android.graphics.Color;
 import android.graphics.Path;
 import android.os.Build;
 import android.util.AttributeSet;
@@ -64,6 +65,9 @@ public class ActivityScreenShotImageView extends AppCompatImageView {
     @Override
     protected void onDraw(Canvas canvas) {
         if (width >= mRadius && height > mRadius) {
+            if (isScreenshotSuccess){
+                canvas.drawColor(Color.BLACK);
+            }
             Path path = new Path();
             path.moveTo(mRadius, 0);
             path.lineTo(width - mRadius, 0);
@@ -116,12 +120,16 @@ public class ActivityScreenShotImageView extends AppCompatImageView {
     }
     
     private boolean inited = false;
+    private boolean isScreenshotSuccess;
     
     private void drawViewImage(View view) {
         view.destroyDrawingCache();
         view.setDrawingCacheEnabled(true);
         view.buildDrawingCache();
         Bitmap bmp = view.getDrawingCache();
+        if (bmp!=null){
+            isScreenshotSuccess=true;
+        }
         setImageBitmap(bmp);
     }
 }

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

@@ -170,9 +170,16 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
     
     @Override
     public boolean performClick() {
+        if (!isEnabled()) return false;
         return super.performClick();
     }
     
+    @Override
+    public boolean callOnClick() {
+        if (!isEnabled()) return false;
+        return super.callOnClick();
+    }
+    
     public DialogXBaseRelativeLayout setOnLifecycleCallBack(OnLifecycleCallBack onLifecycleCallBack) {
         this.onLifecycleCallBack = onLifecycleCallBack;
         return this;
@@ -244,5 +251,8 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
         getParentDialog().onUIModeChange(newConfig);
     }
     
-    
+    public DialogXBaseRelativeLayout setBkgAlpha(float alpha) {
+        if (getBackground() != null) getBackground().setAlpha((int) (alpha * 255));
+        return this;
+    }
 }

+ 0 - 1
DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml

@@ -55,7 +55,6 @@
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:overScrollMode="never"
-                    android:scrollbarSize="7dp"
                     android:scrollbars="vertical">
 
                     <LinearLayout

+ 0 - 1
DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml

@@ -55,7 +55,6 @@
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:overScrollMode="never"
-                    android:scrollbarSize="7dp"
                     android:scrollbars="vertical">
 
                     <LinearLayout

+ 1 - 2
DialogX/src/main/res/layout/layout_dialogx_fullscreen.xml

@@ -2,8 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:background="@color/black">
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <com.kongzue.dialogx.util.views.ActivityScreenShotImageView
         android:id="@+id/img_zoom_activity"

+ 1 - 2
DialogX/src/main/res/layout/layout_dialogx_fullscreen_dark.xml

@@ -2,8 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:background="@color/black">
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <com.kongzue.dialogx.util.views.ActivityScreenShotImageView
         android:id="@+id/img_zoom_activity"

+ 0 - 50
DialogXIOSStyle/build.gradle

@@ -1,8 +1,5 @@
 apply plugin: 'com.android.library'
 
-def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
-def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
-
 group = "com.kongzue.dialogx.style.ios"
 version = BUILD_VERSION
 
@@ -21,37 +18,6 @@ android {
         }
     }
 }
-
-//install {
-//    repositories.mavenInstaller {
-//        // This generates POM.xml with proper parameters
-//        pom {
-//            project {
-//                packaging 'aar'
-//                name 'dialogXiOSStyle'
-//                url siteUrl
-//                licenses {
-//                    license {
-//                        name 'The Apache Software License, Version 2.0'
-//                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-//                    }
-//                }
-//                developers {
-//                    developer {
-//                        id 'myzchh'//设置自己ID
-//                        name 'myzchh'//设置自己名字
-//                        email 'myzcxhh@live.cn'//设置自己邮箱
-//                    }
-//                }
-//                scm {
-//                    connection gitUrl
-//                    developerConnection gitUrl
-//                    url siteUrl
-//                }
-//            }
-//        }
-//    }
-//}
 task sourcesJar(type: Jar) {
     from android.sourceSets.main.java.srcDirs
     classifier = 'sources'
@@ -60,22 +26,6 @@ task sourcesJar(type: Jar) {
 artifacts {
     archives sourcesJar
 }
-
-//Properties properties = new Properties()
-//properties.load(project.rootProject.file('local.properties').newDataInputStream())
-//bintray {
-//    user = properties.getProperty("bintray.user")
-//    key = properties.getProperty("bintray.apikey")
-//    configurations = ['archives']
-//    pkg {
-//        repo = "maven"
-//        name = "dialogXiOSStyle" //项目在JCenter的名字
-//        websiteUrl = siteUrl
-//        vcsUrl = gitUrl
-//        licenses = ["Apache-2.0"]
-//        publish = true
-//    }
-//}
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
     compileOnly project(path: ':DialogX')

+ 2 - 2
DialogXIOSStyle/src/main/res/layout/layout_dialogx_bottom_ios.xml

@@ -56,7 +56,7 @@
                             android:textSize="12dp"
                             android:textStyle="bold" />
 
-                        <ScrollView
+                        <com.kongzue.dialogx.util.views.BottomDialogScrollView
                             android:id="@+id/scrollView"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
@@ -103,7 +103,7 @@
 
                             </LinearLayout>
 
-                        </ScrollView>
+                        </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
                     </LinearLayout>
 

+ 2 - 2
DialogXIOSStyle/src/main/res/layout/layout_dialogx_bottom_ios_dark.xml

@@ -56,7 +56,7 @@
                             android:textSize="12dp"
                             android:textStyle="bold" />
 
-                        <ScrollView
+                        <com.kongzue.dialogx.util.views.BottomDialogScrollView
                             android:id="@+id/scrollView"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
@@ -103,7 +103,7 @@
 
                             </LinearLayout>
 
-                        </ScrollView>
+                        </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
                     </LinearLayout>
 

+ 1 - 1
DialogXInterface/build.gradle

@@ -2,7 +2,7 @@ apply plugin: 'java-library'
 
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
-    implementation files('libs\\android.jar')
+    compileOnly files('libs\\android.jar')
 }
 
 sourceCompatibility = "1.7"

+ 0 - 50
DialogXKongzueStyle/build.gradle

@@ -1,8 +1,5 @@
 apply plugin: 'com.android.library'
 
-def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
-def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
-
 group = "com.kongzue.dialogx.style.kongzue"
 version = BUILD_VERSION
 
@@ -21,37 +18,6 @@ android {
         }
     }
 }
-
-//install {
-//    repositories.mavenInstaller {
-//        // This generates POM.xml with proper parameters
-//        pom {
-//            project {
-//                packaging 'aar'
-//                name 'dialogXKongzueStyle'
-//                url siteUrl
-//                licenses {
-//                    license {
-//                        name 'The Apache Software License, Version 2.0'
-//                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-//                    }
-//                }
-//                developers {
-//                    developer {
-//                        id 'myzchh'//设置自己ID
-//                        name 'myzchh'//设置自己名字
-//                        email 'myzcxhh@live.cn'//设置自己邮箱
-//                    }
-//                }
-//                scm {
-//                    connection gitUrl
-//                    developerConnection gitUrl
-//                    url siteUrl
-//                }
-//            }
-//        }
-//    }
-//}
 task sourcesJar(type: Jar) {
     from android.sourceSets.main.java.srcDirs
     classifier = 'sources'
@@ -60,22 +26,6 @@ task sourcesJar(type: Jar) {
 artifacts {
     archives sourcesJar
 }
-
-//Properties properties = new Properties()
-//properties.load(project.rootProject.file('local.properties').newDataInputStream())
-//bintray {
-//    user = properties.getProperty("bintray.user")
-//    key = properties.getProperty("bintray.apikey")
-//    configurations = ['archives']
-//    pkg {
-//        repo = "maven"
-//        name = "dialogXKongzueStyle" //项目在JCenter的名字
-//        websiteUrl = siteUrl
-//        vcsUrl = gitUrl
-//        licenses = ["Apache-2.0"]
-//        publish = true
-//    }
-//}
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
     compileOnly project(path: ':DialogX')

+ 2 - 2
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue.xml

@@ -40,7 +40,7 @@
                     android:textColor="@color/black"
                     android:textSize="18dp" />
 
-                <ScrollView
+                <com.kongzue.dialogx.util.views.BottomDialogScrollView
                     android:id="@+id/scrollView"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
@@ -86,7 +86,7 @@
 
                     </LinearLayout>
 
-                </ScrollView>
+                </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
                 <LinearLayout
                     android:layout_width="match_parent"

+ 2 - 2
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue_dark.xml

@@ -40,7 +40,7 @@
                     android:textColor="@color/white"
                     android:textSize="18dp" />
 
-                <ScrollView
+                <com.kongzue.dialogx.util.views.BottomDialogScrollView
                     android:id="@+id/scrollView"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
@@ -86,7 +86,7 @@
 
                     </LinearLayout>
 
-                </ScrollView>
+                </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
                 <LinearLayout
                     android:layout_width="match_parent"

+ 0 - 50
DialogXMIUIStyle/build.gradle

@@ -1,8 +1,5 @@
 apply plugin: 'com.android.library'
 
-def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
-def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
-
 group = "com.kongzue.dialogx.style.miui"
 version = BUILD_VERSION
 
@@ -12,7 +9,6 @@ android {
     defaultConfig {
         minSdkVersion 21
         targetSdkVersion 30
-
     }
 
     buildTypes {
@@ -22,37 +18,6 @@ android {
         }
     }
 }
-
-//install {
-//    repositories.mavenInstaller {
-//        // This generates POM.xml with proper parameters
-//        pom {
-//            project {
-//                packaging 'aar'
-//                name 'dialogXMIUIStyle'
-//                url siteUrl
-//                licenses {
-//                    license {
-//                        name 'The Apache Software License, Version 2.0'
-//                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-//                    }
-//                }
-//                developers {
-//                    developer {
-//                        id 'myzchh'//设置自己ID
-//                        name 'myzchh'//设置自己名字
-//                        email 'myzcxhh@live.cn'//设置自己邮箱
-//                    }
-//                }
-//                scm {
-//                    connection gitUrl
-//                    developerConnection gitUrl
-//                    url siteUrl
-//                }
-//            }
-//        }
-//    }
-//}
 task sourcesJar(type: Jar) {
     from android.sourceSets.main.java.srcDirs
     classifier = 'sources'
@@ -62,21 +27,6 @@ artifacts {
     archives sourcesJar
 }
 
-//Properties properties = new Properties()
-//properties.load(project.rootProject.file('local.properties').newDataInputStream())
-//bintray {
-//    user = properties.getProperty("bintray.user")
-//    key = properties.getProperty("bintray.apikey")
-//    configurations = ['archives']
-//    pkg {
-//        repo = "maven"
-//        name = "dialogXMIUIStyle" //项目在JCenter的名字
-//        websiteUrl = siteUrl
-//        vcsUrl = gitUrl
-//        licenses = ["Apache-2.0"]
-//        publish = true
-//    }
-//}
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
     compileOnly project(path: ':DialogX')

+ 2 - 2
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_bottom_miui.xml

@@ -41,7 +41,7 @@
                     android:textColor="@color/black"
                     android:textSize="18dp" />
 
-                <ScrollView
+                <com.kongzue.dialogx.util.views.BottomDialogScrollView
                     android:id="@+id/scrollView"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
@@ -84,7 +84,7 @@
 
                     </LinearLayout>
 
-                </ScrollView>
+                </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
                 <TextView
                     android:layout_width="match_parent"

+ 2 - 2
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_bottom_miui_dark.xml

@@ -41,7 +41,7 @@
                     android:textColor="@color/dialogxMIUITextDark"
                     android:textSize="18dp" />
 
-                <ScrollView
+                <com.kongzue.dialogx.util.views.BottomDialogScrollView
                     android:id="@+id/scrollView"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
@@ -84,7 +84,7 @@
 
                     </LinearLayout>
 
-                </ScrollView>
+                </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
                 <TextView
                     android:layout_width="match_parent"

BIN
app/release/app-release.apk


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

@@ -11,7 +11,7 @@
       "type": "SINGLE",
       "filters": [],
       "versionCode": 40,
-      "versionName": "0.0.41.beta5",
+      "versionName": "0.0.41.beta14",
       "outputFile": "app-release.apk"
     }
   ]

+ 9 - 15
app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java

@@ -7,6 +7,7 @@ import android.content.res.Configuration;
 import android.graphics.Color;
 import android.net.Uri;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.inputmethod.InputMethodManager;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
@@ -475,7 +476,8 @@ public class MainActivity extends BaseActivity {
                         @Override
                         public void run() {
                             super.run();
-                            BottomMenu.show(new String[]{"添加", "查看", "编辑", "删除", "分享", "评论", "下载", "收藏", "赞!", "不喜欢", "所属专辑", "复制链接", "类似推荐", "添加", "查看", "编辑", "删除", "分享", "评论", "下载", "收藏", "赞!", "不喜欢", "所属专辑", "复制链接", "类似推荐"})
+                            BottomMenu.build()
+                                    .setMenuList(new String[]{"添加", "查看", "编辑", "删除", "分享", "评论", "下载", "收藏", "赞!", "不喜欢", "所属专辑", "复制链接", "类似推荐", "添加", "查看", "编辑", "删除", "分享", "评论", "下载", "收藏", "赞!", "不喜欢", "所属专辑", "复制链接", "类似推荐"})
                                     .setOnIconChangeCallBack(new OnIconChangeCallBack(true) {
                                         @Override
                                         public int getIcon(BottomMenu bottomMenu, int index, String menuText) {
@@ -516,7 +518,8 @@ public class MainActivity extends BaseActivity {
                                             PopTip.show(text);
                                             return false;
                                         }
-                                    });
+                                    })
+                                    .show();
                         }
                     }.start();
                 } else {
@@ -624,7 +627,7 @@ public class MainActivity extends BaseActivity {
             
             @Override
             public void onClick(View v) {
-                onBindView = new OnBindView<FullScreenDialog>(R.layout.layout_full_login, true) {
+                onBindView = new OnBindView<FullScreenDialog>(R.layout.layout_full_login) {
                     @Override
                     public void onBind(FullScreenDialog dialog, View v) {
                         btnCancel = v.findViewById(R.id.btn_cancel);
@@ -636,17 +639,8 @@ public class MainActivity extends BaseActivity {
                         
                         initFullScreenLoginDemo(dialog);
                     }
-                    
-                    @Override
-                    public Runnable createViewSuccessRunnable() {
-                        return new Runnable() {
-                            @Override
-                            public void run() {
-                                FullScreenDialog.show(onBindView);
-                            }
-                        };
-                    }
                 };
+                FullScreenDialog.show(onBindView);
             }
         });
         
@@ -694,7 +688,7 @@ public class MainActivity extends BaseActivity {
                             }
                         });
                         
-                        webView.loadUrl("https://github.com/kongzue/DialogV3/");
+                        webView.loadUrl("https://www.kongzue.com/");
                     }
                 });
             }
@@ -794,7 +788,7 @@ public class MainActivity extends BaseActivity {
                         .setSelection(selectMenuIndexArray);
             }
         });
-    
+        
         btnBottomCustomRecycleView.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {

+ 1 - 1
gradle.properties

@@ -18,5 +18,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.41.beta14
+BUILD_VERSION=0.0.41.beta15
 BUILD_VERSION_INT=40

+ 0 - 102
publish-mavencentral.gradle

@@ -1,102 +0,0 @@
-apply plugin: 'maven-publish'
-apply plugin: 'signing'
-
-task androidSourcesJar(type: Jar) {
-    classifier = 'sources'
-    from android.sourceSets.main.java.source
-}
-
-ext["signing.keyId"] = ''
-ext["signing.password"] = ''
-ext["signing.secretKeyRingFile"] = ''
-ext["ossrhUsername"] = ''
-ext["ossrhPassword"] = ''
-
-File secretPropsFile = project.rootProject.file('local.properties')
-if (secretPropsFile.exists()) {
-    println "Found secret props file, loading props"
-    Properties p = new Properties()
-    p.load(new FileInputStream(secretPropsFile))
-    p.each { name, value ->
-        ext[name] = value
-    }
-} else {
-    println "No props file, loading env vars"
-}
-publishing {
-    publications {
-        release(MavenPublication) {
-            // The coordinates of the library, being set from variables that
-            // we'll set up in a moment
-            groupId PUBLISH_GROUP_ID
-            artifactId PUBLISH_ARTIFACT_ID
-            version PUBLISH_VERSION
-
-            // Two artifacts, the `aar` and the sources
-            artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
-            artifact androidSourcesJar
-
-            // Self-explanatory metadata for the most part
-            pom {
-                name = PUBLISH_ARTIFACT_ID
-                description = 'Kongzue DialogX Open Source Project'
-                // If your project has a dedicated site, use its URL here
-                url = 'https://github.com/kongzue/DialogX'
-                licenses {
-                    license {
-                        name = 'The Apache License, Version 2.0'
-                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
-                    }
-                }
-                developers {
-                    developer {
-                        id = 'kongzue'
-                        name = 'kongzue'
-                        email = 'myzcxhh@live.cn'
-                    }
-                }
-                // Version control info, if you're using GitHub, follow the format as seen here
-                scm {
-                    connection = 'scm:git:github.com/kongzue/DialogX.git'
-                    developerConnection = 'scm:git:ssh://github.com/kongzue/DialogX.git'
-                    url = 'https://github.com/kongzue/DialogX/tree/master'
-                }
-                // A slightly hacky fix so that your POM will include any transitive dependencies
-                // that your library builds upon
-                withXml {
-                    def dependenciesNode = asNode().appendNode('dependencies')
-
-                    project.configurations.implementation.allDependencies.each {
-                        def dependencyNode = dependenciesNode.appendNode('dependency')
-                        dependencyNode.appendNode('groupId', it.group)
-                        dependencyNode.appendNode('artifactId', it.name)
-                        dependencyNode.appendNode('version', it.version)
-                    }
-                }
-            }
-        }
-    }
-    repositories {
-        // The repository to publish to, Sonatype/MavenCentral
-        maven {
-            // This is an arbitrary name, you may also use "mavencentral" or
-            // any other name that's descriptive for you
-            name = "DialogX"
-
-            def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
-            def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
-            // You only need this if you want to publish snapshots, otherwise just set the URL
-            // to the release repo directly
-            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
-
-            // The username and password we've fetched earlier
-            credentials {
-                username ossrhUsername
-                password ossrhPassword
-            }
-        }
-    }
-}
-signing {
-    sign publishing.publications
-}