Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TranslationConfig 无法设置为反转动画 #511

Open
kolyneh opened this issue Jun 19, 2024 · 0 comments
Open

TranslationConfig 无法设置为反转动画 #511

kolyneh opened this issue Jun 19, 2024 · 0 comments

Comments

@kolyneh
Copy link

kolyneh commented Jun 19, 2024

  • 系统版本(必须)/ System version (required):any
  • 库版本(必须)/ Library version (required):3.2.1
  • 问题代码/截图(可选)/ Problem code or screenshot (optional):
  • 报错信息(可选)/ Error reporting information (optional):

问题描述/重现步骤请写在这里
Please write the description here.

似乎 TranslationConfig 没有处理 buildAnimatorbuildAnimationisRevert 参数,以至于我没办法简单复用 AnimationHelper 来创建显示和隐藏动画, 例如我要用以下代码设置动画:

val animation = AnimationHelper.asAnimation()
            .withAlpha(AlphaConfig().from(0).to(1))
            .withScale(ScaleConfig().scale(0f, 1f))
            .withTranslation(TranslationConfig().from(Direction.BOTTOM).to(Direction.TOP))
popup.setShowAnimator(animation.toShow())
popup.setDismissAnimation(animation.toDismiss())
popup.showPopupWindow(anchor)

这样设置以后,Alpha 和 Scale 可以按照预期在显示和隐藏时反转动画,而 Translation 动画一直都是自下而上。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant