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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:36:45+00:00 2026-06-01T19:36:45+00:00

I have a button (placed in a linearlayout) with animation. After the animation is

  • 0

I have a button (placed in a linearlayout) with animation. After the animation is completed (simple translateAnimation) I want that animated button to be enabled. I realized that using an animation only has an effect for the button drawable, so the clickable “place” stays at the original position.

layout= (LinearLayout) findViewById (R.id.newitemtext);
 layout.setBackgroundResource(R.drawable.white_box);
btn = (Button) findViewById (R.id.btn);
 moveLefttoRight = new TranslateAnimation(0,0 , 0, 200);
            moveLefttoRight.setDuration(1000);
            moveLefttoRight.setFillAfter(true); 


            animbutton.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    layout.startAnimation(moveLefttoRight);
                    layout.setEnabled(true);


                }
            });

btn.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    Log.i("TAG", "CCIK");


                }


});

The btn button is in the LinearLayout layout. How could I set the position after the animation? I tried to use setPadding but with no success.
Thanks in advance!

  • 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-01T19:36:47+00:00Added an answer on June 1, 2026 at 7:36 pm

    Use View.setLayoutParams(), to update a Views params – note that it depends on what kind of layout the view is inside as to how the params can be updated. For example, if your view is in a LinearLayout, then you will only be able to adjust params that relate to a LinearLayout (gravity, weight, width, height, etc.) so you would not be able to adjust the absolute X/Y coords. You may want to switch to something like a RelativeLayout to try and move the view to the final destination based on the location of other views.

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

Sidebar

Related Questions

I have an animated gif placed on the button. It's animating ok (most of
I have a image button placed for each row of a datagrid? using item
I have button, which fires an event, that deletes a record from the database.
I have a button that I would like to disable when the form submits
I have a button on an ASP.Net page that will call Response.Redirect back to
I have a scroll view and a button placed over it , When i
I have 4 ImageButton in a linearlayout placed equally distanced. For now I am
I can't create layout in which I will have <LinearLayout> <TextView/> <ExpandableListView/> <Button/> </LinearLayout>
I have a button which is not working when placed below two panels. If
I have a Scrollview as a parent view, within that i have placed some

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.