kongzue 4 سال پیش
والد
کامیت
00c9d1d8dd

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

@@ -6,6 +6,8 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
 import android.view.animation.AccelerateInterpolator;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -269,15 +271,15 @@ public class BottomDialog extends BaseDialog {
                         if (bottomDialogMaxHeight <= 1) {
                             bkgEnterAimY = boxBkg.getHeight() - bkg.getHeight() * bottomDialogMaxHeight;
                         } else {
-                            bkgEnterAimY = boxBkg.getHeight() - bottomDialogMaxHeight;
+                            bkgEnterAimY = boxBkg.getHeight() - bottomDialogMaxHeight - boxBkg.getPaddingBottom();
                         }
                     } else {
-                        bkgEnterAimY = boxBkg.getHeight() - bkg.getHeight();
+                        bkgEnterAimY = boxBkg.getHeight() - bkg.getHeight() - boxBkg.getPaddingBottom();
                     }
-                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", boxBkg.getHeight(), bkgEnterAimY);
+                    Animation enterAnim = AnimationUtils.loadAnimation(getContext(), R.anim.anim_dialogx_bottom_enter);
                     enterAnim.setInterpolator(new DecelerateInterpolator(2f));
                     enterAnim.setDuration(500);
-                    enterAnim.start();
+                    bkg.startAnimation(enterAnim);
                     boxRoot.animate().setDuration(enterAnim.getDuration()).alpha(1f).setInterpolator(new DecelerateInterpolator()).setDuration(100).setListener(null);
                 }
             });

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

@@ -154,14 +154,15 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
     }
     
     public abstract static class OnLifecycleCallBack {
-        public void onShow() { }
+        public void onShow() {
+        }
         
         public abstract void onDismiss();
     }
     
     private void paddingView(int left, int top, int right, int bottom) {
         MaxRelativeLayout bkgView = findViewById(R.id.bkg);
-        if (bkgView != null &&  bkgView.getLayoutParams() instanceof LayoutParams) {
+        if (bkgView != null && bkgView.getLayoutParams() instanceof LayoutParams) {
             LayoutParams bkgLp = (LayoutParams) bkgView.getLayoutParams();
             if (bkgLp.getRules()[ALIGN_PARENT_BOTTOM] == RelativeLayout.TRUE) {
                 bkgView.setPadding(0, 0, 0, bottom);