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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:19:26+00:00 2026-05-15T07:19:26+00:00

public void MoveMyButton (int x) //where the button suppose to move to { TranslateAnimation

  • 0
public void MoveMyButton (int x) //where the button suppose to move to
{
TranslateAnimation anim=new TranslateAnimation(this.getLeft() ,x, this.getTop() ,20));
anim.setFillAfter(true);
anim.setDuration(1000);
this.setAnimation(anim);
anim.start();
}
  • button’s x at start is 1.
  • I call the method to move it to 100, and it goes from 1 to 100
  • I call it to go to 200, and it goes from 1 to 200, instead of 100 to 200

Is there any way to make the animation to save the location of the button as it animates it?
Thanks

_____________________________UPDATE__________________________________
Please correct me if i am wrong.
An animation set is to combine multiple animations, so move from position 1 to position 2
and then from position 2 to position 3.
The problem is that my animations are not predictable. My application is a multiplayer game which 10 players play together.
Every time a player gets a turn the timer button should move toward that player. then when another player gets a turn the button suppose to move from the previous player to the new player.
So I have to show animations when i receive messages from the server. example:
– Move the button from current position to player 1
– Move the button from player 1 to player 3
– Move the button from player 3 to player 9
– ……….. etc

As you can see i can’t predict where the button is suppose to go.
I hope i explained well enough (The youtube link i posted above is exactly what i am trying to achieve)
Any new suggestions?

Thanks for the replies

  • 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-15T07:19:27+00:00Added an answer on May 15, 2026 at 7:19 am

    If I’m understanding correctly, I think you need to move the button to the intermediate location before invoking the animation a second time.

    Update: Or you could use an AnimationSet which contains two TranslateAnimations within it to get the job done.

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

Sidebar

Related Questions

public void test() { List<int> list = new List<int>(); list.Add(1); list.Add(2); list.Add(3); for (int
public void createpass() { //set up dialog final Dialog dialog = new Dialog(App.this); dialog.setContentView(R.layout.createpass);
public void Draw(SpriteBatch theSpriteBatch) { Random rand = new Random(); for(int y = 0;
public void responsePost(Editable editable) { TableLayout chatbox = (TableLayout)findViewById(R.id.chatbox); TableRow tr1 = new TableRow(this);
public void display(Date date) { for (int i = 0; i < this.position; i++)
public void onBackPressed() { Intent setIntent = new Intent(this,xxxxx.class); startActivity(setIntent); return; } I call
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button OpenPDF = (Button) findViewById(R.id.button); OpenPDF.setOnClickListener(new View.OnClickListener()
public void sort() { datelist = new List<DateTime>(rdate); //timedates intlist = new List <Int>(rint);
public void turnRight() { int direction=getDirection(); if (direction==3) direction=0; else direction++; this.setDirection(direction); So I
public void Save() { XmlSerializer Serializer = new XmlSerializer(typeof(DatabaseInformation)); /* A first chance exception

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.