0

I want to translate my fragment away from the screen i.e. from middle to left and then hide in the left. Isn't this the right code? This wouldn't work. Please tell where i am going wrong.

<?xml version="1.0" encoding="utf-8"?>
<set
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/accelerate_interpolator">
     <translate
           android:fromXDelta="0%p"
           android:toXDelta="-100%p"
           android:duration="500">
     </translate>
</set>
Feona
  • 295
  • 2
  • 6
  • 18

2 Answers2

0

It Depend on you current position of your Frament, to animate fragment show hide, see this post: Android Fragments and animation

Community
  • 1
  • 1
Anis BEN NSIR
  • 2,555
  • 20
  • 29
0

You have to use an objectAnimator Animation

VinceFR
  • 2,551
  • 1
  • 21
  • 27