I'm trying to chain two View Animations of the same type, in this case alpha. Initially, I want my View to fade-out while translating left, then after this has completed the View should fade back in at the center of the screen.
I can get the animation to slide and fade to the left without issue, however, when I attempt to add a fade-in animation afterwards, no animation occurs, the alpha just abruptly changes to 0.2. I have tried playing with fillAfter
and fillBefore
but these don't seem to make a difference. I understand that View Animation has no impact on the actual properties of the View. Here is my code so far:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillBefore="false"
android:fillEnabled="true"
android:shareInterpolator="false">
<translate
android:duration="450"
android:fromXDelta="0%p"
android:toXDelta="-100%p" />
<alpha
android:duration="450"
android:fromAlpha="1.0"
android:toAlpha="0.2" />
<alpha
android:duration="450"
android:fromAlpha="0.2"
android:toAlpha="1.0"
android:startOffset="450" />
</set>
I know I could probably achieve the desired effect using Animation Listeners, however, an XML only solution would be more elegant in my opinion.