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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:32:29+00:00 2026-05-31T10:32:29+00:00

I have 3 ImageButtons which are animated when Filling to left, like this: public

  • 0

I have 3 ImageButtons which are animated when Filling to left, like this:

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
{
    ImageButton top;
    ImageButton left;
    ImageButton right;

    top     = meMap.get("top");
    left    = meMap.get("left");
    right   = meMap.get("right");

    goLeft =
            new TranslateAnimation(0, -(top.getLeft() - left.getLeft()), 0, -(top.getTop() - left.getTop()));

    goRight =
            new TranslateAnimation(0, -(left.getLeft() - right.getLeft()), 0, -(left.getTop() - right.getTop()));

    goTopFromRight =
            new TranslateAnimation(0, top.getLeft() - right.getLeft(), 0, top.getTop() - right.getTop());


    goRight.setAnimationListener(this);

    if (velocityX<-500)
    {
        System.out.println("aaaa "+"ScrollLeft");


        goLeft.setDuration(500);   
        goLeft.setFillAfter(true);
        goLeft.setFillAfter(true);
        top.startAnimation(goLeft);

        goRight.setDuration(500);  
        goRight.setFillAfter(true);
        goRight.setFillAfter(true);
        left.startAnimation(goRight);

        goTopFromRight.setDuration(500); 
        goTopFromRight.setFillAfter(true);
        goTopFromRight.setFillAfter(true);
        right.startAnimation(goTopFromRight);

    }

Now, I have an onanimationEnd listener like this:

public void onAnimationEnd(Animation animation) {
    ImageButton top;
    ImageButton left;
    ImageButton right;

    top     = meMap.get("top");
    left    = meMap.get("left");
    right   = meMap.get("right");



    top.clearAnimation();
    left.clearAnimation();
    right.clearAnimation();


    RelativeLayout.LayoutParams layoutLeft = 
                new RelativeLayout.LayoutParams(
                        RelativeLayout.LayoutParams.WRAP_CONTENT,
                        RelativeLayout.LayoutParams.WRAP_CONTENT);

    layoutLeft.addRule(RelativeLayout.ALIGN_BOTTOM,R.id.CenterTextView);
    layoutLeft.addRule(RelativeLayout.LEFT_OF,R.id.CenterTextView);
    top.setLayoutParams(layoutLeft);


    RelativeLayout.LayoutParams layoutRight = 
            new RelativeLayout.LayoutParams(
                    RelativeLayout.LayoutParams.WRAP_CONTENT,
                    RelativeLayout.LayoutParams.WRAP_CONTENT);

    layoutRight.addRule(RelativeLayout.ALIGN_BOTTOM,R.id.CenterTextView);
    layoutRight.addRule(RelativeLayout.RIGHT_OF,R.id.CenterTextView);
    left.setLayoutParams(layoutRight);

    RelativeLayout.LayoutParams layoutTop = 
            new RelativeLayout.LayoutParams(
                    RelativeLayout.LayoutParams.WRAP_CONTENT,
                    RelativeLayout.LayoutParams.WRAP_CONTENT);

    layoutTop.addRule(RelativeLayout.CENTER_VERTICAL,RelativeLayout.TRUE);
    layoutTop.addRule(RelativeLayout.CENTER_HORIZONTAL,RelativeLayout.TRUE);
    right.setLayoutParams(layoutTop);


    meMap.put("top", right);
    meMap.put("left", top);
    meMap.put("right", left);

}

The problem is that when I am doing the animations (except goRight), my icons are Flickering for a litle moment. I don’t know how to resolve this. Please Help.

  • 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-05-31T10:32:30+00:00Added an answer on May 31, 2026 at 10:32 am

    Ana, I think you have already read my answers here

    Android TranslateAnimation resets after animation

    android animation is not finished in onAnimationEnd

    I had also replied to your comment, basically in stead of doing the functionality inside the mAnimation.setAnimationListener method, you need to create custom ImageButtons and put the functionality there

    public Class myImageButton extends ImageButton {
    @Override
        protected void onAnimationEnd() {
            super.onAnimationEnd();
            //Functionality here
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which contains TextViews and ImageButtons organized in various layouts. This
I have a gridview with some imagebuttons, each of which kicks off a report
I have a widget on my home screen with several ImageButtons which have default
Currently I have this.. which works fine <asp:ImageButton ID=ImageButton1 runat=server Width=80 Height=60 ImageUrl='<%# Bind(ImageUrl)
I have this app which was working find and suddenly is crashing caused by
I have a layout which contains 4 horizontal LinearLayouts with 3 ImageButtons inside each
I have a complex button which is made up of some layouts and Imagebuttons
My situation here is that, I have asp Imagebuttons on my web page which
I have a GridView which supports deleting. I'd like to add a pop up
I have a panel on an aspx page which contains an UpdatePanel. This panel

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.