Bladeren bron

0.0.45.beta10

kongzue 2 jaren geleden
bovenliggende
commit
a72022d799
2 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 2 1
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopMenu.java
  2. 1 1
      gradle.properties

+ 2 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopMenu.java

@@ -400,6 +400,7 @@ public class PopMenu extends BaseDialog {
                             protected void applyTransformation(float interpolatedTime, Transformation t) {
                                 int aimHeight = interpolatedTime == 1 ? ViewGroup.LayoutParams.WRAP_CONTENT : (int) (targetHeight * interpolatedTime);
                                 boxBody.getLayoutParams().height = aimHeight;
+                                boxBody.getLayoutParams().width = getWidth() == -1 ? baseView.getWidth() : getWidth();
                                 if ((boxBody.getY() + aimHeight) > boxRoot.getSafeHeight()) {
                                     boxBody.setY(boxRoot.getSafeHeight() - aimHeight);
                                 }
@@ -466,7 +467,7 @@ public class PopMenu extends BaseDialog {
                         //无绑定按钮的情况下
                         RelativeLayout.LayoutParams rLp = (RelativeLayout.LayoutParams) boxBody.getLayoutParams();
                         rLp.addRule(RelativeLayout.CENTER_IN_PARENT);
-                        rLp.width = RelativeLayout.LayoutParams.MATCH_PARENT;
+                        rLp.width = getWidth() == -1 ? RelativeLayout.LayoutParams.MATCH_PARENT : getWidth();
                         rLp.leftMargin = dip2px(50);
                         rLp.rightMargin = dip2px(50);
                         boxBody.setLayoutParams(rLp);

+ 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.45.beta9
+BUILD_VERSION=0.0.45.beta10
 BUILD_VERSION_INT=44