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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:54:16+00:00 2026-06-03T03:54:16+00:00

I am using linear layout to get the message with image from .net server.

  • 0

I am using linear layout to get the message with image from .net server.

when the new message is come the position of the layout is increased and the new message is added to the top of the layout one by one.

the problem is when the new message will come,the new message is added to layout suddenly.

I want to apply animation to the layout and make my app like when the new message is come the message is added to the layout slowly. means the previous messages move down slowly and new message is added top of the layout.

  • 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-03T03:54:17+00:00Added an answer on June 3, 2026 at 3:54 am

    Use android:animateLayoutChanges on the LinearLayout that shall hold the data. This will trigger an animation when adding new content. It starts by moving the old data down making room for more content. Then follows a second step where the new data will fade into the free space.

    Example code

    main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/baseLL"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    >
    
        <!-- button used to add data -->
        <Button
            android:layout_width="192dip"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Add Content"
            android:onClick="onAddContentClick" />
    
        <!-- button used to remove data -->
        <Button
            android:layout_width="192dip"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Remove Content"
            android:onClick="onRemoveContentClick" />
    
        <!-- data will be added to this LinearLayout at run time -->
        <LinearLayout
            android:id="@+id/dataLL"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:animateLayoutChanges="true"
        >
    
        </LinearLayout>
    
    </LinearLayout>
    

    basicanimation.java

    package com.test.animation.basic;
    
    import android.app.Activity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.LinearLayout;
    import android.widget.LinearLayout.LayoutParams;
    import android.widget.TextView;
    
    public class BasicAnimationActivity extends Activity {
    
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
        }
    
        public void onAddContentClick(View v) {
            LinearLayout dataLL = (LinearLayout) findViewById(R.id.dataLL);
            int dataCount = dataLL.getChildCount();
            TextView newDataTV = generateData(dataCount);
            dataLL.addView(newDataTV, 0);
        }
    
        public void onRemoveContentClick(View v) {
            LinearLayout dataLL = (LinearLayout) findViewById(R.id.dataLL);
            if (dataLL.getChildCount() > 0) {
                dataLL.removeViewAt(0);
            }
        }
    
        private TextView generateData(int dataCount) {
            TextView TV = new TextView(this);
            TV.setText("Data " + dataCount);
            TV.setLayoutParams(new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,
                    android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
            return TV;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run a simple linear regression (using rpy2 from Python) and
I am implementing an application displaying images and messages obtained from .net server. For
I am trying to add TableLayout to the LinearLayout from resourse(xml) using programmable way.
My current implementation of an Hash Table is using Linear Probing and now I
Classification and regression trees by Breiman et al mentioned about using linear combination of
I've been using eigen3 linear algebra library in c++ for a while, and I've
I am using xmaxima to solve two simultaneous non-linear equations using the 'solve' command.The
I am training linear regression model using a data-set which has real valued labels
Using R, I would like to plot a linear relationship between two variables, but
I Have activity that get some data from the internet, and shows it to

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.