I have an activity whose layout only contains a VideoView. Here is the xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<VideoView
android:id="@+id/videoplayer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
>
</VideoView>
I am trying to apply this animation to the VideoView after it stops playing:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%" android:toYDelta="-100%" android:duration="500"/>
<scale
android:fromXScale="1.0"
android:toXScale="0"
android:fromYScale="1.0"
android:toYScale="0"
android:duration="500"
android:pivotX="50%"
android:pivotY="0%"
/>
</set>
This works perfectly as it is shown. But if I switch from LinearLayout to RelativeLayout in the layout then the animation no longer works and the video just freezes on the last frame that is shown before it stops.
Why would the type of root layout in my activity cause an animation not to function properly?
EDIT: To add to the weirdness if I add this TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" ">
</TextView>
To the RelativeLayout below the VideoView then the animation will work. However if I take the space out of the android:text element of this then it is back to not working. o.O
EDIT: I've awarded the bounty to Beowulf Bjornson for the nice tip of using the newer animation framework.
But I am still very interested if anyone ever figures out what is going on with the old style animations in this situation I'd be more than happy to throw some more points up for it.