Browse Source

0.0.37.beta8

kongzue 4 years ago
parent
commit
a292d7c896

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

@@ -385,26 +385,41 @@ public class BottomDialog extends BaseDialog {
             boxRoot.post(new Runnable() {
                 @Override
                 public void run() {
-                    bkg.setY(boxRoot.getHeight());
-                    bkg.post(new Runnable() {
-                        @Override
-                        public void run() {
-                            
-                            bkg.setY(bkgEnterAimY);
-    
-                            Animation enterAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_dialogx_bottom_enter);
-                            long enterAnimDurationTemp = enterAnim.getDuration();
-                            if (overrideEnterDuration >= 0) {
-                                enterAnimDurationTemp = overrideEnterDuration;
-                            }
-                            if (enterAnimDuration >= 0) {
-                                enterAnimDurationTemp = enterAnimDuration;
+                    if (style.overrideBottomDialogRes()!=null && style.overrideBottomDialogRes().touchSlide()){
+                        bkg.setY(boxRoot.getHeight());
+                        bkg.post(new Runnable() {
+                            @Override
+                            public void run() {
+                                bkg.setY(bkgEnterAimY);
+            
+                                Animation enterAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_dialogx_bottom_enter);
+                                long enterAnimDurationTemp = enterAnim.getDuration();
+                                if (overrideEnterDuration >= 0) {
+                                    enterAnimDurationTemp = overrideEnterDuration;
+                                }
+                                if (enterAnimDuration >= 0) {
+                                    enterAnimDurationTemp = enterAnimDuration;
+                                }
+                                enterAnim.setDuration(enterAnimDurationTemp);
+                                enterAnim.setInterpolator(new DecelerateInterpolator(2f));
+                                bkg.startAnimation(enterAnim);
                             }
-                            enterAnim.setDuration(enterAnimDurationTemp);
-                            enterAnim.setInterpolator(new DecelerateInterpolator(2f));
-                            bkg.startAnimation(enterAnim);
+                        });
+                    }else{
+                        Animation enterAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_dialogx_bottom_enter);
+                        long enterAnimDurationTemp = enterAnim.getDuration();
+                        if (overrideEnterDuration >= 0) {
+                            enterAnimDurationTemp = overrideEnterDuration;
                         }
-                    });
+                        if (enterAnimDuration >= 0) {
+                            enterAnimDurationTemp = enterAnimDuration;
+                        }
+                        enterAnim.setDuration(enterAnimDurationTemp);
+                        enterAnim.setInterpolator(new DecelerateInterpolator(2f));
+                        bkg.startAnimation(enterAnim);
+    
+                        bkg.setY(bkgEnterAimY);
+                    }
                     
                     boxRoot.animate()
                             .setDuration(300)

+ 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.37.beta7
+BUILD_VERSION=0.0.37.beta8
 BUILD_VERSION_INT=36