在安卓中用手指滚动的速度对对象进行动画处理



我正在尝试创建一个包含ImageView对象的动画,其中对象会根据触摸运动改变其位置。

例如:参考此链接:https://www.behance.net/gallery/32233691/ELEVATE-Onboarding

我可以创建翻译动画,但是它们有一个必须由我更改的时间设置。

  1. 如何设置有关触摸运动的此计时。

我尝试过的事情:1. 我正在尝试使用共享过渡元素的安卓视图页面。代码可在此网址上找到:https://medium.com/@BashaChris/the-android-viewpager-has-become-a-fairly-popular-component-among-android-apps-its-simple-6bca403b16d4

您可以通过导入以下包来执行此操作

import com.github.florent37.viewanimator.ViewAnimator;

然后添加以下代码。

ViewAnimator
             .animate(YourImageView,text)
             .rotation(360)
             .scale(0,1)
             .start();

您可以使用自定义动画

最新更新