I am trying to use animation to make a layout appear on screen. The idea is that layout will start with height of 0 and grow to 100%.
I have real troubles with this and
Ok, I figured it out.
Animation XML layout
Layout XML file
and my Activity class
public class MyActivity extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void animate(View view){
LinearLayout dialog = (LinearLayout)findViewById(R.id.dialog);
dialog.setVisibility(LinearLayout.VISIBLE);
Animation animation = AnimationUtils.loadAnimation(this, R.anim.anim);
animation.setDuration(500);
dialog.setAnimation(animation);
dialog.animate();
animation.start();
}
}