gpt4 book ai didi

android - Android 的功能发现动画

转载 作者:IT王子 更新时间:2023-10-29 00:09:51 25 4
gpt4 key购买 nike

自 5 月起,Google 更新了其网站上的 Material Design 指南。我在一个名为 Feature discovery 的新部分中看到了一个有趣而酷的设计模式。 .

我想实现 the animation for 'discovering' the Navigation Drawer button . Google Fit 上次更新中也有类似的动画,用于抽屉式导航和 float 操作按钮。

通常,对于 Android 动画,Google 提供了一个很棒的 UI 指南,但我们没有任何进一步的信息来为我们自己的应用程序开发它。

您知道是否有带有 Android 库的原生解决方案来实现此类动画?如果是,它是否适用于 Android 5.0 (API 21) 以下 - 它可以高于 Android 4.1+?

编辑:我做了一个 Github 项目来实现相同的动画。你可以在这里找到它:https://github.com/Guimareshh/Feature-discovery-animations

谢谢!

最佳答案

您需要制作自定义动画,否则您可以使用Ripple Effect + Reveal并将其设置为抽屉导航图标,

Circular Reveal Animation

void enterReveal() {
// previously invisible view
final View myView = findViewById(R.id.my_view);

// get the center for the clipping circle
int cx = myView.getMeasuredWidth() / 2;
int cy = myView.getMeasuredHeight() / 2;

// get the final radius for the clipping circle
int finalRadius = Math.max(myView.getWidth(), myView.getHeight()) / 2;

// create the animator for this view (the start radius is zero)
Animator anim =
ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);

// make the view visible and start the animation
myView.setVisibility(View.VISIBLE);
anim.start();
}

关于android - Android 的功能发现动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37466174/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com