Ich versuche, ein AnimatedVectorDrawable zum Ausblenden und zur gleichen Zeit zu übersetzen. Ich machte eine ObjectAnimator
Ressource:Ausblenden und Übersetzen VectorDrawable mit ObjectAnimator
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:propertyName="translationX"
android:duration="@+string/animtime"
android:valueFrom="0"
android:valueTo="150"
android:valueType="floatType"/>
<objectAnimator
android:propertyName="alpha"
android:duration="@+string/animtime"
android:valueFrom="255"
android:valueTo="0"
android:valueType="intType"/>
Dann ein VectorDrawable
mit den ObjectAnimation
gezielt:
<target
android:name="disgust"
android:animation="@anim/fadetransout" />
Die VectorDrawable
ist ein <group>
in einer VectorDrawable
Ressourcendatei.
Aber wenn ich die Animation starte, passiert nichts. Was mache ich falsch?
Ich fand dies in der Stack-Trace:
Method setTranslationX() with type float not found on target class class android.graphics.drawable.VectorDrawable$VGroup
Method setAlpha() with type int not found on target class class android.graphics.drawable.VectorDrawable$VGroup
Hat es etwas damit zu tun haben?
Wenn das nicht möglich ist, gibt es eine andere Möglichkeit, meine VectorDrawable
zu verblassen und zu übersetzen?
Vielen Dank.
nette erklärung .. vielen dank. – Sayem