I have an activity that only has a VideoView in the layout. 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 a VideoView after it stops:
<?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 great as shown. But if I switch from LinearLayout to RelativeLayout in the layout, the animation will no longer work, and the video just freezes in the last frame that appears before it stops.
Why does the type of root layout in my activity make the animation work incorrectly?
EDIT: add to weirdness if I add this TextView
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" "> </TextView>
In the RelativeLayout below the VideoView, the animation will work. However, if I select a space from android: a text element, then it does not work again. oo
EDIT: I awarded Bounty Beowulf Bjornson for good advice on using the new animation environment.
But Iām still very interested if someone ever finds out what happens with the old-style animation in this situation, I would be more than happy to give a few more points for this.
Foamyguy
source share