如何让浮动动作按钮变成全屏形式

How to make floating action button transform into full screen form

在我的应用程序中,我有一个 FAB,我想用它来创建自定义事件。我想要实现的动画是 material 设计指南中 "Full Screen" 下标记的动画 https://material.io/guidelines/components/buttons-floating-action-button.html#buttons-floating-action-button-transitions

有谁知道我怎样才能做到这一点?

您正在寻找 'CircularReveal' 动画。您可以使用 built-in 一种易于使用的方法,例如 ViewAnimationUtils.createCircularReveal() but this will require a min-SDK of 21. If you need the animation on older versions of Android, there are several libraries

关于使用CircularReveal,只要按照文档或在线查找教程即可。通常,您将设置一个初始圆(大小和坐标)和一个结束圆(大小和坐标),当动画被触发时,它会将小圆动画化为大圆。