• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set animation's properties through activity class in Android 4.2.2

 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my my_right_in.xml animation file

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<translate
android:duration="1000"
android:startOffset="8000"
android:fromXDelta="100%p"
android:fromYDelta="0%"
android:toXDelta="50%p"
android:toYDelta="0%"
android:repeatCount="0" />

</set>

I tried to give it in activity class before animation is started as follows:

int startOffsetOfRightIn = 8000;
int durationOfRightIn = 1000;


right_in.setStartOffset(startOffsetOfRightIn);
right_in.setDuration(durationOfRightIn);

But with the newly added code, it doesn't work properly as earlier. Both are same. Then why does it give difference?
 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
remove android:duration="1000" and startOffset from xml. Then it will work!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic