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 8774799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:39:29+00:00 2026-06-13T18:39:29+00:00

I have a ListView . Initially, the ListView contains some data. When the user

  • 0

I have a ListView. Initially, the ListView contains some data. When the user clicks on an item, another layout will be dynamically added to that item so it’s height will be increased.

Right now, when the item’s height is increased, it shows the modified item instantly. However, what I want is for this to be animated so it increases the item’s height gradually.

  • 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-13T18:39:30+00:00Added an answer on June 13, 2026 at 6:39 pm

    I think I was looking for the same as was asked, I was looking for a way to animate the expanding of the listview item as some new content is shown (I was just changing the visibility on some views from GONE to VISIBLE). I had used the answer by mirroredAbstraction to help me apply a translate animation (I didn’t want a rotate animation):

    <translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:fromYDelta="0"
    android:toYDelta="-100%p"
    android:duration="500"   
    />
    

    to each of the views. It create a nice effect, but looking closely, the listview item was actually suddenly expanding to the entire size that would be needed, then the animation dropped the views into place. But what I wanted was the effect of the listview item growing down as the views come into visibility.

    I found exactly what I was looking for here:
    expanding-listview-items

    The blogger has a link to his github sample, here:
    ExpandAnimationExample

    If you find these sites gone, please inform me and I will make my copy available.

    he put a negative margin on the content to come into visibility as well as setting visibility to GONE:

    android:layout_marginBottom="-50dip"
    

    and wrote an animation manipulating the bottom margin:

    public class ExpandAnimation extends Animation {
    ...
        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            super.applyTransformation(interpolatedTime, t);
    
            if (interpolatedTime < 1.0f) {
    
                // Calculating the new bottom margin, and setting it
                mViewLayoutParams.bottomMargin = mMarginStart
                        + (int) ((mMarginEnd - mMarginStart) * interpolatedTime);
    
                // Invalidating the layout, making us seeing the changes we made
                mAnimatedView.requestLayout();
            }
            ...
        }
    }
    

    and it looks very nice. I found his answer to this SO (possible duplicate?) question:

    Adding animation to a ListView in order to expand/collapse content

    Also, please let me know if you know another way to do the same thing.

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

Sidebar

Related Questions

I have a button ,listview and another button.Initially listview have property gone so that
I have ListView that uses a GridView to display several columns of data. Two
I have dynamic listview on my android client app that receive data from remote
I have a ListView where each item has a checkbox. Initially there are no
I have listview control.There is an option to remove selected items.After the user removes
I have listview having customized some textview and one imageview. When I long click
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have ListView which is saving all data to database. For adding i have
I have a ListView and each item have a TextView. I would like add
I have a list that will filter in input in an EditText field and

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.