标签: animatorset

为Android应用程序创建3D动画

嘿家伙我需要根据屏幕上用户滑动的速度创建3D翻转/旋转动画,我能够使用ObjectAnimator及其相关属性创建此动画,但我需要建议如何在android中创建3D动画以上.我还需要执行一些部分旋转的动画

虽然对于android我们可以使用OPENGL但是对于一个简单的动画OPENGL太重了,因为我们没有设计真正的游戏我已经引用了以下链接

https://2cupsoftech.wordpress.com/2012/09/18/3d-flip-between-two-view-or-viewgroup-on-android/

http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html

3d animation android objectanimator animatorset

7
推荐指数
1
解决办法
242
查看次数

重新启动AnimatedVectorDrawableCompat的AnimatorSet

这是我需要实现的效果AnimatedVectorDrawableCompat

vector_drawable_anim.xml

<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
                 android:drawable="@drawable/vector_drawable">
    <target
        android:name="star"
        android:animation="@animator/star_anim"/>
</animated-vector>
Run Code Online (Sandbox Code Playgroud)

vector_drawable.xml

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="500px"
        android:height="500px"
        android:viewportHeight="500"
        android:viewportWidth="500">
    <group
        android:name="star_group"
        android:scaleX="5.0"
        android:scaleY="5.0">
        <path
            android:name="star"
            android:pathData="M 50.0,90.0 L 82.9193546357,27.2774101308 L 12.5993502926,35.8158045183 Z"
            android:strokeColor="@color/colorAccent"
            android:strokeWidth="1"/>
    </group>
</vector>
Run Code Online (Sandbox Code Playgroud)

star_anim.xml

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:ordering="sequentially">

    <objectAnimator
        android:duration="1000"
        android:propertyName="trimPathStart"
        android:valueFrom="1"
        android:valueTo="0"/>

    <objectAnimator
        android:duration="1000"
        android:propertyName="trimPathEnd"
        android:valueFrom="1"
        android:valueTo="0"/>

</set>
Run Code Online (Sandbox Code Playgroud)

但是AnimatorSet不能设置repeatMode

如果我设置objectAnimatorrepeatMode,第二个objectAnimator将不显示。

我该怎么办?

android android-animation android-vectordrawable animatorset

5
推荐指数
1
解决办法
1428
查看次数

如何在AnimatorSet playSequentially()中的动画之间添加延迟?

我正在使用AnimatorSet playSequentially方法,如下所示:

AnimatorSet set = new AnimatorSet();
ObjectAnimator in = ObjectAnimator.ofFloat(splash, "alpha", 0f, 1f);
in.setDuration(2500);
in.setInterpolator(new AccelerateInterpolator());
ObjectAnimator out = ObjectAnimator.ofFloat(splash, "alpha", 1f, 0f);
out.setDuration(2500);
out.setInterpolator(new AccelerateInterpolator());

set.playSequentially(in,out);
Run Code Online (Sandbox Code Playgroud)

我想在动画1和2之间添加延迟,如下所示:

set.playSequentially(in,1000,out);
Run Code Online (Sandbox Code Playgroud)

使用playSequentially方法可以在动画之间添加延迟吗?

谢谢.

animation android android-animation objectanimator animatorset

1
推荐指数
1
解决办法
2006
查看次数