Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8724669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:52:40+00:00 2026-06-13T07:52:40+00:00

(This topic is not about .setfillafter(true)). I got a little trouble with the animations

  • 0

(This topic is not about .setfillafter(true)).

I got a little trouble with the animations of android and i hope someone can help me with this one.

I created a Linearlayout and a listview.

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.

When someone clicks or taps on the linearlayout (that will act like a button) the listview will animate a little bit downwards with the following lines:

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); 

As you can see i create the animation, and it will move 150(pixels?) downwards.

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.)

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 .setFillAfter(true), so why is this happening to me? Because i just want the listview to hold its new given position. (the position of the animation)

I hope someone can help me with this to finish my animation because i got stuck at this one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:52:41+00:00Added an answer on June 13, 2026 at 7:52 am

    Ok, i feel a little bit weird because you all think i talk to myself and i’d like to answer my own questions. But no, fortunately that is not the case.

    So to the point.

    I solved my own problem but i don’t think this is the way it’s meant to solve.
    As i mentioned in a comment to Amokrane Chentir i found out that when you disable the listview you don’t have to set a physical position.
    This means that when i click on the listview when the animation is done and when the listview is disabled the listview does not respond and will ignore every user input (and listeners.)
    But what can i do with a listview that is disabled, Simply nothing.

    But when the animation is performed once, the listview does not need to interact with the user so disabling is a good thing and one step closer to my solution.
    The only thing i had to solve is enabling the listview at the right moment when the animation is reversed again.
    I did this by disabling the listview and made the RelativeLayout underneath the ListView clickable with a onClickListener.
    The onClickListener listens when the user clicks on the listView, sets the animation in reverse and enables the listview again. Problem Solved.

    This made the listview Invisible to the userinteraction.

    if(isUnfolded)
    {
      listview_Contacts.setClickable(false);
      listview_Contacts.setEnabled(false);
    }
    else
    {
      listview_Contacts.setClickable(true);
      listview_Contacts.setEnabled(true);
    }
    

    The onClickListener that monitors when the relativeLayout is clicked.

    rlvLayout.setOnClickListener(new OnClickListener() 
    {           
    public void onClick(View v) 
        {
          if(isUnfolded)
             toggleFoldAnimation();
    }
    });
    

    Feel free to answer or add comments for a better solution, otherwise i hope this solution helped other people out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there are similar questions about this topic,but somehow I'm not able to
This is my second question about this topic, the original question can be found
First of all this is not a question about how can I use http
In contrast to all the SO posts that talk about this topic, I'm not
I know there's a lot of questions about this topic but I have not
I read lot of about this topic but no solution can be used in
I know this topic is asked before but they were not about jqueryui. Therefore
There is a post on this topic already, but it does not have an
I know this is a recurrent/classical topic but I did not found anything that
This topic can look similar to others but I haven't found any usable answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.