XML Animation List Duration not working

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 4K views
whitehorsey
Messages
188
Reaction score
0
I am creating a border for an image view using xml. This is what I have:

<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >

<item android:duration="200">
<shape
android:shape="rectangle" >
<stroke
android:width="5dp"
android:color="#FF0000" />
<solid android:color="#000099" />
</shape>
</item>
</animation-list>

The border shows up but it stays with the imageview and does not disappear. I want it to disappear after 2 seconds. What is wrong?
 
Last edited by a moderator:
Physics news on Phys.org
A problem is that you are specifying 200 instead of 2000 msec.
I have never programmed an android, but just as a guess, do you need additional items in your animation list?
Are you expecting the box to disappear once your list is complete?
 
.Scott said:
A problem is that you are specifying 200 instead of 2000 msec.
I have never programmed an android, but just as a guess, do you need additional items in your animation list?
Are you expecting the box to disappear once your list is complete?
Unless the code isn't using the standard of milliseconds. Maybe it's waiting 200 seconds (3 1/2 minutes) to go away.