さて、私はこの言葉で新しい人です。ボタンを押すと他のボタンのアニメーションが発生し、膨張も発生するため、膨張を遅らせようとしています。
ただし、インフレートがすぐに発生するため、アニメーションを表示できません。そのため、最初にアニメーションを表示し、次にインフレートに含まれる情報を表示できるように、インフレートを2000ミリ秒のように遅らせたいと思います。
アニメーションと膨張を呼び出すために同じボタンを使用しています。
これが私のコードです:
case R.id.btnsalud:
//This is the code for animations
//This is the loader for all the animations that is used for the button
{final Animation animBounceForSalud = AnimationUtils.loadAnimation(this, R.anim.bounce);
final Animation animBounceForSalud1 = AnimationUtils.loadAnimation(this, R.anim.bounce1);
//This object is the objects (buttons) whom is applied the animation
final Button animSalud = (Button)findViewById(R.id.btnobra);
final Button animSalud1 = (Button)findViewById(R.id.btnprotesta);
//This object (button) is the one which applies the animation to the other buttons
Button btnBounceSalud = (Button)findViewById(R.id.btnsalud);
animSalud.startAnimation(animBounceForSalud);
animSalud1.startAnimation(animBounceForSalud1);
animSalud.setVisibility(500);
animSalud1.setVisibility(500);}
//This is the code for inflate
//Check if the Layout already exists
LinearLayout hiddenLayout1 = (LinearLayout)findViewById(R.id.hiddenLayout);
if((hiddenLayout1 == null)){
//Right here is where you can defined in which layout is going to
//inflate the hidden layout
LinearLayout myLayout = (LinearLayout)findViewById(R.id.inflateposition0);
View hiddenInfo = getLayoutInflater().inflate(R.layout.salud, myLayout, false);
myLayout.addView(hiddenInfo);
}
break;
どんな答えも高く評価されます:D