java - Animate View and keep visible after animation -
i have 2 indicators, each need invisible start. want them visible after animating in, how do this? right animate in disappear, here code:
indicator.setvisibility(view.invisible); indicator2.setvisibility(view.invisible); animation fadeinanimation = animationutils.loadanimation(getactivity(), r.anim.fade_in_view); indicator.startanimation(fadeinanimation); indicator2.startanimation(fadeinanimation);
my xml is:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromalpha="0.0" android:toalpha="1.0" android:interpolator="@android:anim/accelerate_interpolator" android:duration="1500" android:repeatcount="0" /> </set>
try doing this: fadeinanimation.setfillafter(true)
or
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromalpha="0.0" android:toalpha="1.0" android:interpolator="@android:anim/accelerate_interpolator" android:duration="1500" android:repeatcount="0" android:fillafter="true"/> </set>
Comments
Post a Comment