I got an XML layout with ViewFlipper and 2 constraint layout as it's child.
- 1st layout has ImageView
- 2nd layout has VideoView
I'm using this code to change layout:
ViewFlipper flip = (ViewFlipper) findViewById(R.id.flippy);
flip.setInAnimation(this, R.anim.in_to_left);
flip.setOutAnimation(this, R.anim.out_to_left);
flip.showNext();
this is XML for animation (both same, but different x value)
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" android:fillAfter="true">
<translate
android:fromXDelta="100%"
android:toXDelta="0"
android:fromYDelta="0%"
android:toYDelta="0%"
android:duration="1400"
/>
- The problem is whenever flip.showNext() called, 2nd layout video view already in place when animation starts, I tried textView component, it works but not video view.
- Is it possible to make 1st layout alpha solid till animation ends?. Whenever flip.showNext() called, 1st layout imageView become transparent (like 50% alpha) when animating. (i didn't put any alpha setting in XML, using android:src in XML for image source).
Thank You
Edit: Just Realized from this move videoView...using translation animation , that translation unable to animate videoView.