1
0
Эх сурвалжийг харах

0.0.50.beta34
- Lifecycle.State.DESTROYED 时机调整到销毁 dialogImpl 之前;
- CustomDialog 中监听 baseView 位置变化的 OnDrawListener 修改为 OnPreDrawListener 以解决部分系统存在的兼容性问题;
- BaseDialog 新增 callDialogDismiss() 用于调用对应对话框实例的 dismiss()
- 新增 bindDismissWithLifecycleOwner(LifecycleOwner) 用于绑定具备特定生命周期的组件,当组件关闭时自动关闭对话框;
- PopTip 增加了限制最大可显示数量设置,例如限制只能显示最多四个提示 `PopTip.maxShowCount = 4;`;
- PopTip 增加了让位位移动画控制拦截器 PopMoveDisplacementInterceptor,可通过 `PopTip.moveDisplacementInterceptor` 进行设置;
- PopNotification 增加了限制最大可显示数量设置,例如限制只能显示最多四个提示 `PopNotification.maxShowCount = 4;`;
- PopNotification 增加了让位位移动画控制拦截器 PopMoveDisplacementInterceptor,可通过 `PopNotification.moveDisplacementInterceptor` 进行设置;
- PopMenu、BottomMenu、MessageMenu 增加了菜单分割线设置:`.setItemDivider(ItemDivider)`,其中ItemDivider 提供了 left(左边距(dp))、right(右边距(dp))、color(颜色)设置项,可通过对应的 set 方法进行设置,颜色设置中支持指定亮暗色模式(参数 light)单独设置不同的颜色;

Kongzue 1 долоо хоног өмнө
parent
commit
8ef76f0fea

+ 4 - 72
app/src/main/java/com/kongzue/dialogxdemo/activity/MainActivity.java

@@ -1257,81 +1257,13 @@ public class MainActivity extends BaseActivity {
             }
         });
 
-        PopTip.maxShowCount = 4;        //限制最大可显示数量
-
-        DialogX.globalStyle = new MaterialStyle() {
-            @Override
-            public PopTipSettings popTipSettings() {
-                return new PopTipSettings() {
-                    @Override
-                    public int layout(boolean light) {
-                        return R.layout.layout_dialogx_poptip_snackbar;
-                    }
-
-                    @Override
-                    public ALIGN align() {
-                        return ALIGN.BOTTOM;
-                    }
-
-                    @Override
-                    public int enterAnimResId(boolean light) {
-                        return com.kongzue.dialogx.R.anim.anim_dialogx_default_enter;
-                    }
-
-                    @Override
-                    public int exitAnimResId(boolean light) {
-                        return com.kongzue.dialogx.R.anim.anim_dialogx_default_exit;
-                    }
-                };
-            }
-        };
-
-        //重置位移动画位置
-        PopTip.moveDisplacementInterceptor = new PopMoveDisplacementInterceptor<PopTip>() {
-            @Override
-            public float resetAnimY(int index, PopTip dialog, float fromY, float toY, int dialogHeight, int allTipSize, boolean moveBack) {
-                if (moveBack) {
-                    return fromY - dialogHeight * 0.5f + 0.15f * (allTipSize - index - 1) * dialogHeight;
-                }else{
-                    return fromY + dialogHeight * 0.5f - 0.15f * (allTipSize - index - 1) * dialogHeight;
-                }
-            }
-
-            float zoomRatio = 0.03f;
-
-            @Override
-            public boolean animUpdater(int index, PopTip dialog, View dialogBody, float fromY, float toY, float progress, ValueAnimator animation, int allTipSize, boolean moveBack) {
-                if (moveBack){
-                    float originalScale = 1f - zoomRatio * (allTipSize - index - 1);
-                    float targetScale = originalScale * (1f - zoomRatio * progress);
-                    if (targetScale>1)targetScale=1;
-                    dialogBody.setScaleX(targetScale);
-                    dialogBody.setScaleY(targetScale);
-                    dialogBody.setAlpha(targetScale);
-                }else{
-                    float originalScale = 1f - zoomRatio * (allTipSize - index - 1);
-                    float currentScale = originalScale * (1f - zoomRatio * 1);
-                    float targetScale = currentScale + (originalScale - currentScale) * progress;
-
-                    if (index==0){
-                        log("originalScale=" + originalScale + " ("+index + "/" + allTipSize + ")"  + " targetScale="+targetScale + " progress="+progress);
-                    }
-
-                    if (targetScale > 1) targetScale = 1;
-                    dialogBody.setScaleX(targetScale);
-                    dialogBody.setScaleY(targetScale);
-                    dialogBody.setAlpha(targetScale);
-                }
-                return false;
-            }
-        };
-
         btnPoptip.setOnClickListener(new View.OnClickListener() {
             int index;
+
             @Override
             public void onClick(View v) {
                 index++;
-                PopTip.show("任务 " + index + " 已完成处理","撤销").setEnterAnimDuration(500).iconSuccess().noAutoDismiss();
+                PopTip.show("任务 " + index + " 已完成处理", "撤销").setEnterAnimDuration(500).iconSuccess().noAutoDismiss();
             }
         });
 
@@ -1464,7 +1396,7 @@ public class MainActivity extends BaseActivity {
                 }).setScrollableWhenContentLargeThanVisibleRange(false).show();
             }
         });
-        PopNotification.maxShowCount=3;
+
         btnPopnotification.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -1490,7 +1422,7 @@ public class MainActivity extends BaseActivity {
                         toast("点击回复按钮");
                         return false;
                     }
-                }).showLong();
+                }).noAutoDismiss();
             }
         });
 

+ 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.50.beta33
+BUILD_VERSION=0.0.50.beta34
 BUILD_VERSION_INT=50
 DIALOGX_STYLE_VERSION=5
 android.nonTransitiveRClass=true