Skip to content

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

Description

@kolyneh
  • 系统版本(必须)/ 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 动画一直都是自下而上。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions