Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen clicking on the view the animation kicks back
    primarykey
    data
    text
    <p><strong>(This topic is not about .setfillafter(true)).</strong></p> <p>I got a little trouble with the animations of android and i hope someone can help me with this one.</p> <p>I created a Linearlayout and a listview.</p> <p><em>The listView is placed in a relative layout because i had to set the translationY of an other linearLayout in the same relative layout but i keep that other linearlayout excluded from the question.</em></p> <p>When someone <code>clicks or taps</code> on the linearlayout (that will act like a button) the listview will animate a little bit downwards with the following lines:</p> <pre><code>animation_Fold = new TranslateAnimation(0, 0, 0, 150); createNewAnimationListener(); //to monitor when the animation ends and starts. animation_Fold.setDuration(300); animation_Fold.setFillAfter(true); listview_Contacts.startAnimation(animation_Fold); </code></pre> <p>As you can see i create the animation, and it will move 150(pixels?) downwards.</p> <p>Now there is some more code to animate the listview back to its original position but i think this is irrelevant to this question. (it's practically the same but then fromYDelta and toYDelta will be reversed.)</p> <p>When i click on the listview (does not matter where i click) after it has been animated, it wil kick back to its original position. But i used <code>.setFillAfter(true)</code>, so why is this happening to me? Because i just want the listview to hold its new given position. (the position of the animation)</p> <p>I hope someone can help me with this to finish my animation because i got stuck at this one.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload