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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:09:21+00:00 2026-06-15T14:09:21+00:00

I am trying to add Animation for ListView I am using getView()to draw some

  • 0

I am trying to add Animation for ListView I am using getView()to draw some views in list. all works fine.

public View getView(int position, View convertView, ViewGroup parent) { }

I am trying to add animation when user click on list cell then all list cells should slide left and new data should come from right at same time, means cell data is moving towards left and same time new data coming from right side.

I Have implemented following code in OnItemClickListener

@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
    Animation slideOutAnimation=AnimationUtils.loadAnimation(this, R.anim.slide_out);
    slideOutAnimation.setDuration(900);

    Animation slideInAnimation=AnimationUtils.loadAnimation(this, R.anim.slide_in);
    slideInAnimation.setDuration(500);

    listView.startAnimation(slideOutAnimation);

    new Handler().postDelayed(new Runnable() {

    @Override
    public void run() {
        data = newData();
        listView.startAnimation(slideInAnimation);
        myAdapterClass.notifyDataSetChanged();
    }
    }, slideOutAnimation.getDuration());
}
};

above code is working but not getting desire output I am getting one empty view while changing Animation.

Left Sliding Animation Starts— Empty View—-Right Sliding Animation Starts

Not getting why Empty view (shows empty screen for while) is coming, I have played with Animation time and handler but no luck.

How to remove that empty view ? how to achieve this output ?

Left Sliding Animation Starts(Data moving)( Same time data coming from Right) Right Sliding Animation Starts

  • 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-15T14:09:22+00:00Added an answer on June 15, 2026 at 2:09 pm

    I am trying to add animation when user click on list cell then all
    list cells should slide left and new data should come from right at
    same time, means cell data is moving towards left and same time new
    data coming from right side.

    Your code works as intended but it will not do what you want simply because you use a single ListView widget which you first animate sliding left and then animate sliding right after the first animation ends.

    Try to use a ViewFlipper containing two ListViews(one will be the visible one the other will be the one that comes with new data). You’ll set your animations on the ViewFlipper(in and out animations) and then on a list item click you’ll do:

    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
          data = newData();
          //set the data for the second list, which currently isn't visible 
          secondListViewAdapter.notifyDataSetChanged();
          viewFlipper().showNext(); //show the next list with animation
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying add subview with animation effect using the code which work fine
I'm trying to add an animation to my ListView so text will fade into
Trying to add init parameter names to a list in init(ServletConfig) method. public void
I am trying to add delay while adding view to mainview but views spear
Im trying to add an animation of a monkey using a NSMutablAarray of UIImageViews.
I have a custom view, extending LinearLayout and im trying to add some custom
I have an html table that I am trying to add some animation to
I'm trying to add an animation to my TabActivty. For example, when the user
I'm trying to add a swipe animation to an element. I've tried initializing jqTouch
I am trying to add a bounce effect to my animation but am having

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.