Hello,
I'm trying to do several translations simultaneously on Android.
I have 2 or more buttons on a layout (all the same size), and when i
press one i want the others to move out of the screen.
I've done a test app to try to implement this behaviour.
On it i've set a listener on click of one button to test, something
like:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Button toMove = (Button) findViewById(R.id.button_test2);
Button toMove2 = (Button) findViewById(R.id.button_test3);
AnimationSet set = new AnimationSet(true);
TranslateAnimation anim = new TranslateAnimation(0, -toMove
.getWidth(), 0, 0);
anim.setFillAfter(true);
anim.setDuration(1000);
toMove.setAnimation(anim);
toMove2.setAnimation(anim);
set.addAnimation(anim);
view.startAnimation(set);
}
The thing is that the two buttons start the animation, one slightly
after the other. I've read that it is due to the getDelayForView()
method that returns different delays of each. Is there any way to move
2 or more buttons simultaneously?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en