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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:01:27+00:00 2026-06-12T09:01:27+00:00

I have a parent ListView shown with items based on a custom layout. When

  • 0

I have a parent ListView shown with items based on a custom layout. When a user clicks on any item then I need to add a child ListView to that item and should display the overall item of the parent ListView with expanding animation. [All data need to be added dynamically]
Any suggestions….

  • 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-12T09:01:28+00:00Added an answer on June 12, 2026 at 9:01 am

    Simple you can add your item in a layout (via xml or code) and show(hide) with animation. Here is example from Udinic. It had listview item expand with animation and require API level only 4+.
    This example’s so simple. You only define your item in linearlayout called toolbar

    ExpandAnimationExample

    in onItemClick event use ExpanAnimation

    /**
    * This animation class is animating the expanding and reducing the size of a view.
    * The animation toggles between the Expand and Reduce, depending on the current state of the view
    * @author Udinic
    *
    */
    public class ExpandAnimation extends Animation {
        private View mAnimatedView;
        private LayoutParams mViewLayoutParams;
        private int mMarginStart, mMarginEnd;
        private boolean mIsVisibleAfter = false;
        private boolean mWasEndedAlready = false;
    
        /**
    * Initialize the animation
    * @param view The layout we want to animate
    * @param duration The duration of the animation, in ms
    */
        public ExpandAnimation(View view, int duration) {
    
            setDuration(duration);
            mAnimatedView = view;
            mViewLayoutParams = (LayoutParams) view.getLayoutParams();
    
            // decide to show or hide the view
            mIsVisibleAfter = (view.getVisibility() == View.VISIBLE);
    
            mMarginStart = mViewLayoutParams.bottomMargin;
            mMarginEnd = (mMarginStart == 0 ? (0- view.getHeight()) : 0);
    
            view.setVisibility(View.VISIBLE);
        }
    
        @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();
    
            // Making sure we didn't run the ending before (it happens!)
            } else if (!mWasEndedAlready) {
                mViewLayoutParams.bottomMargin = mMarginEnd;
                mAnimatedView.requestLayout();
    
                if (mIsVisibleAfter) {
                    mAnimatedView.setVisibility(View.GONE);
                }
                mWasEndedAlready = true;
            }
        }
    }
    

    Detail usage is in project.

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

Sidebar

Related Questions

I have 2 custom ListView Created as item layout + ArrayAdapter + My own
I have a listview with custom array adapter, the view allows the user to
I have a ListView which can contain any number of items. When it uses
I have a listview, with around 200 items, I have implemented a custom ArrayAdapter
I have a ListView that will allow the user to long-press an item to
I've a ListView that can have 0 custom items inside (like My Downloads). Is
I have an ASP.NET 2.0 ListView control (aka:parent) and configured inside this ListView I
If you have Parent has_many :children Child Is there any reason a foreign key
I have a custom CursorAdapter that is taking items from a database and displaying
I have a click event hooked up to my listview as shown. int[] GenusListIDs

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.